MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
maia::lb::LbSrcTermController< nDim, nDist, SysEqn > Class Template Reference

Front-end to control all source terms in a wrapping manner. More...

#include <lbsrctermcontroller.h>

Collaboration diagram for maia::lb::LbSrcTermController< nDim, nDist, SysEqn >:
[legend]

Public Member Functions

 LbSrcTermController (LbSolverDxQy< nDim, nDist, SysEqn > *p_solver)
 
void init ()
 Initialize the source term controller. More...
 
void initSrcTerms ()
 Initialize the source term controller. More...
 
void addSrcTerm (const MString &p_name)
 Add a source term to the controller by its property tag. More...
 
void apply_preCollision ()
 Call the pre collision routines of all source terms. More...
 
void apply_postCollision ()
 Call the post collision routines of all source terms. More...
 
void apply_postPropagation ()
 Call the post collision routines of all source terms. More...
 

Private Attributes

LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
 
MInt m_noSrcTerms {}
 
std::vector< std::unique_ptr< LbSrcTerm< nDim, nDist, SysEqn > > > m_srcTerms
 

Detailed Description

template<MInt nDim, MInt nDist, class SysEqn>
class maia::lb::LbSrcTermController< nDim, nDist, SysEqn >
Author
Miro Gondrum
Date
01.02.2022

Definition at line 106 of file lbsrctermcontroller.h.

Constructor & Destructor Documentation

◆ LbSrcTermController()

template<MInt nDim, MInt nDist, class SysEqn >
maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::LbSrcTermController ( LbSolverDxQy< nDim, nDist, SysEqn > *  p_solver)
inline

Definition at line 108 of file lbsrctermcontroller.h.

108: m_solver(p_solver){};
LbSolverDxQy< nDim, nDist, SysEqn > * m_solver

Member Function Documentation

◆ addSrcTerm()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::addSrcTerm ( const MString p_name)
Author
Miro Gondrum
Date
01.02.2022
Parameters
[in]p_nameThe name of the source term

Definition at line 169 of file lbsrctermcontroller.h.

169 {
170 TRACE();
171 m_srcTerms.emplace_back(LbSrcTermFactory<nDim, nDist, SysEqn>::instance()->create_srcTerm(p_name, m_solver));
172}
std::vector< std::unique_ptr< LbSrcTerm< nDim, nDist, SysEqn > > > m_srcTerms
static LbSrcTermFactory * instance()
Creates a static instance of LbSrcTermFactory.

◆ apply_postCollision()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::apply_postCollision
Author
Miro Gondrum
Date
01.02.2022

Definition at line 191 of file lbsrctermcontroller.h.

191 {
192 TRACE();
193 for(auto& srcTerm : m_srcTerms) {
194 srcTerm->apply_postCollision();
195 }
196}

◆ apply_postPropagation()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::apply_postPropagation
Author
Julian Vorspohl
Date
01.05.2024

Definition at line 203 of file lbsrctermcontroller.h.

203 {
204 TRACE();
205 for(auto& srcTerm : m_srcTerms) {
206 srcTerm->apply_postPropagation();
207 }
208}

◆ apply_preCollision()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::apply_preCollision
Author
Miro Gondrum
Date
01.02.2022

Definition at line 179 of file lbsrctermcontroller.h.

179 {
180 TRACE();
181 for(auto& srcTerm : m_srcTerms) {
182 srcTerm->apply_preCollision();
183 }
184}

◆ init()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::init
Author
Miro Gondrum
Date
01.02.2022

Definition at line 128 of file lbsrctermcontroller.h.

128 {
129 TRACE();
130 std::stringstream ss;
131 ss << "- Init source terms:" << std::endl;
132 m_noSrcTerms = 0;
133 if(Context::propertyExists("lbSrcTerms", m_solver->m_solverId)) {
135 }
136 m_srcTerms.clear();
137 ss << " no source terms =" << m_noSrcTerms << std::endl;
138 ss << " ";
139 if(m_noSrcTerms > 0) {
140 for(MInt i = 0; i < m_noSrcTerms; i++) {
141 const MString srcTermName = Context::getBasicProperty<MString>("lbSrcTerms", AT_, &srcTermName, i);
142 m_srcTerms.emplace_back(LbSrcTermFactory<nDim, nDist, SysEqn>::instance()->create_srcTerm(srcTermName, m_solver));
143 ss << srcTermName << " ";
144 }
145 ss << std::endl;
146 m_log << ss.str();
147 if(m_solver->domainId() == 0) std::cout << ss.str();
148 }
149}
static MInt propertyLength(const MString &name, MInt solverId=m_noSolvers)
Returns the number of elements of a property.
Definition: context.cpp:538
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
Definition: context.cpp:494
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55

◆ initSrcTerms()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::initSrcTerms
Author
Julian Vorspohl
Date
01.05.2024

Definition at line 156 of file lbsrctermcontroller.h.

156 {
157 // Call init routine for each source term instance created
158 for(auto& srcTerm : m_srcTerms) {
159 srcTerm->init();
160 }
161}

Member Data Documentation

◆ m_noSrcTerms

template<MInt nDim, MInt nDist, class SysEqn >
MInt maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::m_noSrcTerms {}
private

Definition at line 119 of file lbsrctermcontroller.h.

◆ m_solver

template<MInt nDim, MInt nDist, class SysEqn >
LbSolverDxQy<nDim, nDist, SysEqn>* maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::m_solver
private

Definition at line 118 of file lbsrctermcontroller.h.

◆ m_srcTerms

template<MInt nDim, MInt nDist, class SysEqn >
std::vector<std::unique_ptr<LbSrcTerm<nDim, nDist, SysEqn> > > maia::lb::LbSrcTermController< nDim, nDist, SysEqn >::m_srcTerms
private

Definition at line 120 of file lbsrctermcontroller.h.


The documentation for this class was generated from the following file: