MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
lbsrctermcontroller.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
8#include <sstream>
9#include "UTIL/functions.h"
10#include "lbsyseqn.h"
11
12namespace maia::lb {
13
14template <MInt nDim, MInt nDist, class SysEqn>
17 return &fact;
18}
19
20template <MInt nDim, MInt nDist, class SysEqn>
24 LbSrcTerm<nDim, nDist, SysEqn>* instance = nullptr;
25 auto it = m_function_reg.find(p_name);
26 if(it != m_function_reg.end()) {
27 // call constructor with relevant input args
28 instance = it->second(p_solver);
29 } else {
30 std::stringstream ss;
31 ss << "lbSrcTerms: " << p_name << " is not defined!" << std::endl;
32 ss << "Defined are the following lbSrcTerm for d" << nDim << "q" << nDist << ": " << std::endl;
33 for(const auto& i : m_function_reg) {
34 ss << " " << i.first << std::endl;
35 }
36 TERMM(1, ss.str());
37 }
38 return instance;
39}
40
47} // namespace maia::lb
This class represents all LB models.
Definition: lbsolverdxqy.h:29
Front-end to create source term objects.
LbSrcTerm< nDim, nDist, SysEqn > * create_srcTerm(const MString &p_name, LbSolverDxQy< nDim, nDist, SysEqn > *p_solver)
Create an lb source term object and return a pointer to it.
static LbSrcTermFactory * instance()
Creates a static instance of LbSrcTermFactory.
Abstract class for lb source terms.
Definition: lbsrcterm.h:22