30 template<
class Type,
template<
class>
class GeoField>
31 void Foam::LagrangianMesh::appendSpecifiedField
33 const LagrangianSubMesh& appendMesh,
34 GeoField<Type>& geoField,
35 const Field<Type>& field
38 geoField.resize(
size());
40 appendMesh.sub(geoField).ref().primitiveFieldRef() = field;
44 template<
class Type,
template<
class>
class GeoField>
45 bool Foam::LagrangianMesh::appendSpecifiedField
47 const LagrangianSubMesh& appendMesh,
48 const word& fieldName,
49 const Field<Type>& field
52 if (foundObject<GeoField<Type>>(fieldName))
54 appendSpecifiedField<Type, GeoField>
57 lookupObjectRef<GeoField<Type>>(fieldName),
70 template<
class Type,
class ... FieldNamesAndFields>
74 const word& fieldName,
76 const FieldNamesAndFields& ... fieldNamesAndFields
80 appendSpecifiedField<Type, LagrangianField>
86 || appendSpecifiedField<Type, LagrangianDynamicField>
92 || appendSpecifiedField<Type, LagrangianInternalField>
98 || appendSpecifiedField<Type, LagrangianInternalDynamicField>
117 <<
TypeName.capitalise() <<
" values were specified for "
118 << fieldName <<
" but a " <<
TypeName <<
" Lagrangian field of "
119 <<
"that name was not found." <<
nl <<
nl
120 <<
"Available " <<
TypeName <<
" Lagrangian fields are:" <<
nl
126 appendSpecifiedFields(appendMesh, fieldNamesAndFields ...)
137 template<
class GeoField>
145 if (iter()->isOldTime())
155 template<
class GeoField>
163 if (iter()->isOldTime())
173 template<
class ... FieldNamesAndFields>
180 const FieldNamesAndFields& ... fieldNamesAndFields
187 appendSpecifiedFields(injectionMesh, fieldNamesAndFields ...);
189 injectUnspecifiedFields(injectionMesh, specifiedFieldNames);
191 return injectionMesh;
195 template<
class ... FieldNamesAndFields>
203 const FieldNamesAndFields& ... fieldNamesAndFields
210 appendSpecifiedFields(injectionMesh, fieldNamesAndFields ...);
212 injectUnspecifiedFields(injection, injectionMesh, specifiedFieldNames);
214 return injectionMesh;
218 template<
class ... FieldNamesAndFields>
222 const FieldNamesAndFields& ... fieldNamesAndFields
228 appendSpecifiedFields(birthMesh, fieldNamesAndFields ...);
230 birthUnspecifiedFields(parents, birthMesh, specifiedFieldNames);
236 template<
class Enumeration>
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Generic GeometricField class.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
An STL-conforming hash table.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Class to hold element-group indices, and associate the group.
LagrangianSubMesh inject(const barycentricField &coordinates, const labelField &celli, const labelField &facei, const labelField &faceTrii, const FieldNamesAndFields &... fieldNamesAndFields)
Inject specified elements into the mesh. This method does not.
label size() const
Get the number of elements.
LagrangianSubMesh birth(const labelList &parents, const FieldNamesAndFields &... fieldNamesAndFields)
Birth specified elements into the mesh. Fields are expanded.
HashTable< const GeoField * > lookupCurrentFields(const bool strict=false) const
Lookup all current-time fields of the given type.
void partition()
Partition the mesh such that the groups are contiguous in memory.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
void append(const T &)
Append an element at the end of the list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Traits class for primitives.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static List< word > fieldNames
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
barycentric coordinates(const polyMesh &mesh, const point &position, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the coordinates given the position and tet topology.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.