Palabos Dynamics Calling Relationships
In this article, the calling relationship of dynamics would be shown which helps write your own dynamic classes. The dynamics classes are mainly written in /src/basicDynamics/ and /src/complexDynamics/. Here we will take BGKdynamics and MRTdynamics as examples for illustration.
BGKdynamics
- The calling graph:
BGKdynamics::collide()<--dynamicsTemplates::bgk_ma2_collision()<--dynamicsTemplatesImpl::bgk_ma2_collision(). - The declaration and implementation of functions in class
BGKdynamicsare in src/basicDynamics/isoThermalDynamics.h and ../isoThermalDynamics.hh, respectively. - The structs
dynamicsTemplatesanddynamicsTemplatesImpland the two member functions with the same namebgk_ma2_collision()are written in src/latticeBoltzmann/dynamicsTemplates.h
MRTdynamics
- The calling graph:
MRTdynamics::collide()<--mrtTemplates::mrtCollision()<--mrtTemplatesImpl::mrtCollision(). - The declaration and implementation of functions in class
MRTdynamicsare in src/complexDynamics/mrtDynamics.h and ../mrtDynamics.hh, respectively. - The structs
mrtTemplatesandmrtTemplatesImpland the two member functions with the same namemrtCollision()are written in src/latticeBoltzmann/mrtTemplates.h
Conclusion
- The kernal function is the
XXXdynamics::collide()which implements the collision step. - The
collide()would call different computations from differentTemplateslikedynamicsTemplates,mrtTemplates,momentTemplatesand so on. - The
collide()is implemented oncelllevel. So for non-local dynamics, a superclassclass NonLocalDynamics2D : public CompositeDynamics<T,Descriptor>might be used.
To better understand the calling relations, one could use Doxygen+GraphViz to plot the call graph or get use of the structure or call graph/hierachy function within IDE.