chombo-discharge
Public Member Functions | List of all members
CdrFactory< T, S > Class Template Reference

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...
 

Detailed Description

template<class T, class S>
class CdrFactory< T, S >

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.

Member Function Documentation

◆ newLayout()

template<class T , class S >
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.


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