MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
DgBoundaryConditionFactory< nDim, SysEqn > Class Template Reference

Class to handle creation of boundary condition objects. More...

#include <dgcartesianboundaryconditionfactory.h>

Collaboration diagram for DgBoundaryConditionFactory< nDim, SysEqn >:
[legend]

Public Types

using IdType = MInt
 
using ReturnType = std::unique_ptr< DgBoundaryCondition< nDim, SysEqn > >
 
using SolverType = DgCartesianSolver< nDim, SysEqn >
 
using ProductCreator = std::function< ReturnType(SolverType &, IdType)>
 

Public Member Functions

 DgBoundaryConditionFactory (SolverType &solver)
 Constructor only saves solver reference to member variable. More...
 
template<class T >
MBool add (const IdType id, maia::dg::bc::Type< T >)
 Add new type to factory. More...
 
ReturnType create (const IdType id)
 Create type from identifier. More...
 

Private Attributes

SolverTypem_solver
 
MFactory< DgBoundaryCondition< nDim, SysEqn >, IdType, ReturnType, ProductCreator, SolverType &, IdTypem_factory
 

Detailed Description

template<MInt nDim, class SysEqn>
class DgBoundaryConditionFactory< nDim, SysEqn >
Author
Michael Schlottke (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2014-04-05
Template Parameters
nDimSee DgCartesianSolver for definition.
SysEqnSee DgCartesianSolver for definition.

This is a class following the factory pattern as described in Alexandrescu (2001).

References: Andrei Alexandrescu (2001): Modern C++ Design.

Definition at line 48 of file dgcartesianboundaryconditionfactory.h.

Member Typedef Documentation

◆ IdType

template<MInt nDim, class SysEqn >
using DgBoundaryConditionFactory< nDim, SysEqn >::IdType = MInt

Definition at line 50 of file dgcartesianboundaryconditionfactory.h.

◆ ProductCreator

template<MInt nDim, class SysEqn >
using DgBoundaryConditionFactory< nDim, SysEqn >::ProductCreator = std::function<ReturnType(SolverType&, IdType)>

Definition at line 53 of file dgcartesianboundaryconditionfactory.h.

◆ ReturnType

template<MInt nDim, class SysEqn >
using DgBoundaryConditionFactory< nDim, SysEqn >::ReturnType = std::unique_ptr<DgBoundaryCondition<nDim, SysEqn> >

Definition at line 51 of file dgcartesianboundaryconditionfactory.h.

◆ SolverType

template<MInt nDim, class SysEqn >
using DgBoundaryConditionFactory< nDim, SysEqn >::SolverType = DgCartesianSolver<nDim, SysEqn>

Definition at line 52 of file dgcartesianboundaryconditionfactory.h.

Constructor & Destructor Documentation

◆ DgBoundaryConditionFactory()

template<MInt nDim, class SysEqn >
DgBoundaryConditionFactory< nDim, SysEqn >::DgBoundaryConditionFactory ( SolverType solver)
inlineexplicit

Member Function Documentation

◆ add()

template<MInt nDim, class SysEqn >
template<class T >
MBool DgBoundaryConditionFactory< nDim, SysEqn >::add ( const IdType  id,
maia::dg::bc::Type< T >   
)
inline

Definition at line 61 of file dgcartesianboundaryconditionfactory.h.

61 {
62 return m_factory.add(id, [](SolverType& solver, IdType bcId) { return ReturnType(new T(solver, bcId)); });
63 }
MFactory< DgBoundaryCondition< nDim, SysEqn >, IdType, ReturnType, ProductCreator, SolverType &, IdType > m_factory
std::unique_ptr< DgBoundaryCondition< nDim, SysEqn > > ReturnType
SolverType
Definition: enums.h:22

◆ create()

template<MInt nDim, class SysEqn >
ReturnType DgBoundaryConditionFactory< nDim, SysEqn >::create ( const IdType  id)
inline

Definition at line 66 of file dgcartesianboundaryconditionfactory.h.

66{ return m_factory.create(id, m_solver, id); }

Member Data Documentation

◆ m_factory

template<MInt nDim, class SysEqn >
MFactory<DgBoundaryCondition<nDim, SysEqn>, IdType, ReturnType, ProductCreator, SolverType&, IdType> DgBoundaryConditionFactory< nDim, SysEqn >::m_factory
private

Definition at line 70 of file dgcartesianboundaryconditionfactory.h.

◆ m_solver

template<MInt nDim, class SysEqn >
SolverType& DgBoundaryConditionFactory< nDim, SysEqn >::m_solver
private

Definition at line 69 of file dgcartesianboundaryconditionfactory.h.


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