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

#include <lscartesiansolverfactory.h>

Static Public Member Functions

static std::unique_ptr< LsCartesianSolver< nDim > > create (MInt solverId_, const MBool *propertiesGroups, GridProxy &gridProxy_, Geometry< nDim > &geometry_, const MPI_Comm comm)
 Factory method for LsCartesianSolver. More...
 

Private Types

using CartesianSolver = typename maia::CartesianSolver< nDim, LsCartesianSolver< nDim > >
 
using GridProxy = typename CartesianSolver::GridProxy
 

Detailed Description

template<MInt nDim>
class LsCartesianSolverFactory< nDim >

Definition at line 11 of file lscartesiansolverfactory.h.

Member Typedef Documentation

◆ CartesianSolver

template<MInt nDim>
using LsCartesianSolverFactory< nDim >::CartesianSolver = typename maia::CartesianSolver<nDim, LsCartesianSolver<nDim> >
private

Definition at line 12 of file lscartesiansolverfactory.h.

◆ GridProxy

template<MInt nDim>
using LsCartesianSolverFactory< nDim >::GridProxy = typename CartesianSolver::GridProxy
private

Definition at line 13 of file lscartesiansolverfactory.h.

Member Function Documentation

◆ create()

template<MInt nDim>
std::unique_ptr< LsCartesianSolver< nDim > > LsCartesianSolverFactory< nDim >::create ( MInt  solverId_,
const MBool propertiesGroups,
GridProxy gridProxy_,
Geometry< nDim > &  geometry_,
const MPI_Comm  comm 
)
static
Author
Miro Gondrum
Date
26.05.2023
Returns
LsCartesianSolver

Definition at line 13 of file lscartesiansolverfactory.cpp.

14 {
15 MInt solverMethodInt = -1;
16 if(Context::propertyExists("solverMethod", solverId)) {
17 solverMethodInt = string2enum(Context::getSolverProperty<MString>("solverMethod", solverId, AT_));
18 }
19 // TODO labels:LS More relevant input to trigger correct built of desired LS solver version is necessary
20 const MBool isSemiLagrange =
21 (solverMethodInt == MAIA_SEMI_LAGRANGE_LEVELSET || solverMethodInt == MAIA_RUNGE_KUTTA_MB_SEMI_LAGRANGE_LEVELSET
22 || solverMethodInt == MAIA_SEMI_LAGRANGE_LEVELSET_LB);
23 const MBool isFreeAdvection = (solverMethodInt == MAIA_LEVELSET_SURFACE);
24 if(isSemiLagrange) {
25 return std::make_unique<LsCartesianSolverSemiLagrangian<nDim>>(solverId, propertiesGroups, gridProxy, geometry,
26 comm);
27 } else if(isFreeAdvection) {
28 return std::make_unique<LsCartesianSolverFreeAdvection<nDim>>(solverId, propertiesGroups, gridProxy, geometry,
29 comm);
30 } else {
31 return std::make_unique<LsCartesianSolver<nDim>>(solverId, propertiesGroups, gridProxy, geometry, comm);
32 }
33}
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
Definition: context.cpp:494
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
Definition: enums.cpp:20
@ MAIA_SEMI_LAGRANGE_LEVELSET_LB
Definition: enums.h:68
@ MAIA_RUNGE_KUTTA_MB_SEMI_LAGRANGE_LEVELSET
Definition: enums.h:71
@ MAIA_LEVELSET_SURFACE
Definition: enums.h:70
@ MAIA_SEMI_LAGRANGE_LEVELSET
Definition: enums.h:67
int32_t MInt
Definition: maiatypes.h:62
bool MBool
Definition: maiatypes.h:58

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