chombo-discharge
|
Factory class for CdrLayout. T is (usually) CdrSolver and S is the implementation class (e.g., CdrCTU). More...
#include <CD_CdrLayout.H>
Public Member Functions | |
CdrFactory () | |
Default constructor (does nothing) | |
~CdrFactory () | |
Default constructor (does nothing) | |
RefCountedPtr< CdrLayout< T > > | newLayout (const Vector< RefCountedPtr< CdrSpecies >> &a_species) const |
Factory method, create a new CdrLayout. More... | |
Factory class for CdrLayout. T is (usually) CdrSolver and S is the implementation class (e.g., CdrCTU).
Factory class is very simple; since we don't want to template CdrLayout further we use a factory to instantiate solvers of any CdrSolver inherited class, and then return a layout with the casted classes. That's about it. This is useful because it allows the factory to act as a "casting-point" for switching between various solver implementation.
RefCountedPtr< CdrLayout< T > > CdrFactory< T, S >::newLayout | ( | const Vector< RefCountedPtr< CdrSpecies >> & | a_species | ) | const |
Factory method, create a new CdrLayout.
This creates a collection of CdrSolvers. Run-time errors will occur if the template S is not a derived class of T.