47 void Foam::fv::codedFvModel::readCoeffs()
58 Foam::word Foam::fv::codedFvModel::fieldPrimitiveTypeName()
const
60 #define fieldPrimitiveTypeNameTernary(Type, nullArg) \
61 mesh().foundObject<VolField<Type>>(fieldName_) \
62 ? pTraits<Type>::typeName \
69 void Foam::fv::codedFvModel::prepare
72 const dynamicCodeContext& context
75 const word primitiveTypeName = fieldPrimitiveTypeName();
78 dynCode.setFilterVariable(
"typeName",
name());
79 dynCode.setFilterVariable(
"TemplateType", primitiveTypeName);
80 dynCode.setFilterVariable(
"SourceType", primitiveTypeName +
"Source");
83 dynCode.addCompileFile(
"codedFvModelTemplate.C");
86 dynCode.addCopyFile(
"codedFvModelTemplate.H");
89 dynCode.setFilterVariable(
"verbose",
Foam::name(
bool(debug)));
92 dynCode.setMakeOptions
95 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
96 "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
97 "-I$(LIB_SRC)/sampling/lnInclude \\\n"
98 "-I$(LIB_SRC)/fvModels/general/lnInclude \\\n"
100 +
"\n\nLIB_LIBS = \\\n"
101 +
" -lmeshTools \\\n"
104 +
" -lfiniteVolume \\\n"
110 const Foam::word& Foam::fv::codedFvModel::codeName()
const
116 Foam::string Foam::fv::codedFvModel::description()
const
118 return "fvModel:: " +
name();
122 void Foam::fv::codedFvModel::clearRedirect()
const
124 redirectFvModelPtr_.clear();
140 "codeAddAlphaRhoSup",
160 Foam::fvModel& Foam::fv::codedFvModel::redirectFvModel()
const
162 if (!redirectFvModelPtr_.valid())
164 dictionary constructDict(coeffs());
165 constructDict.set(
"type",
name());
173 return redirectFvModelPtr_();
178 void Foam::fv::codedFvModel::addSupType
180 const VolField<Type>& field,
188 Info<<
"codedFvModel::addSup for source " <<
name() <<
endl;
192 redirectFvModel().addSup(field, eqn);
198 void Foam::fv::codedFvModel::addSupType
201 const VolField<Type>& field,
209 Info<<
"codedFvModel::addSup for source " <<
name() <<
endl;
213 redirectFvModel().addSup(
rho, field, eqn);
219 void Foam::fv::codedFvModel::addSupType
223 const VolField<Type>& field,
231 Info<<
"codedFvModel::addSup for source " <<
name() <<
endl;
235 redirectFvModel().addSup(
alpha,
rho, field, eqn);
245 const word& modelType,
251 fieldName_(
word::null)
278 bool Foam::
fv::codedFvModel::movePoints()
280 return redirectFvModel().movePoints();
286 redirectFvModel().topoChange(map);
292 redirectFvModel().mapMesh(map);
298 redirectFvModel().distribute(map);
Macros for easy insertion into run-time selection tables.
void updateLibrary() const
Update library as required.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
static autoPtr< fvModel > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected fvModel.
const dictionary & coeffs() const
Return dictionary.
virtual bool read(const dictionary &dict)
Read source dictionary.
Constructs on-the-fly fvModel source from user-supplied code.
codedFvModel(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling character strings derived from std::string.
A class for handling words, derived from string.
static const word null
An empty word.
#define fieldPrimitiveTypeNameTernary(Type, nullArg)
A special matrix type and solver, designed for finite volume solutions of scalar equations.
#define IMPLEMENT_FV_MODEL_ADD_FIELD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_FIELD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_RHO_FIELD_SUP(Type, modelType)
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
List< word > wordList
A List of words.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
VolField< scalar > volScalarField
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)