38 #ifndef LagrangianMesh_H
39 #define LagrangianMesh_H
57 class LagrangianInjection;
58 class nonConformalCyclicPolyPatch;
141 origPatchNccPatchesPtr_;
163 mutable uint64_t subMeshIndex_;
177 template<
class Field>
178 inline void checkFieldSize(
const Field& field)
const;
189 void printGroups(
const bool header)
const;
210 void permuteAndResizeFields(
const labelList& permutation);
214 static void permuteList
222 static void permuteListCopy
230 static void permuteListInPlace
237 template<
class Container>
238 void resizeContainer(Container& container)
const;
283 template<
class Type,
template<
class>
class GeoField>
284 void appendSpecifiedField
287 GeoField<Type>& geoField,
293 template<
class Type,
template<
class>
class GeoField>
294 bool appendSpecifiedField
297 const word& fieldName,
303 template<
class Type,
class ... FieldNamesAndFields>
307 const word& fieldName,
309 const FieldNamesAndFields& ... fieldNamesAndFields
320 void injectUnspecifiedFields
328 void injectUnspecifiedFields
336 void birthUnspecifiedFields
388 void constructNonConformal()
const;
391 void constructBehind()
const;
491 template<
class Enumeration>
505 EnumerationRef(
label& i)
510 operator Enumeration()
const
512 return static_cast<Enumeration
>(i_);
517 i_ =
static_cast<label>(
e);
528 label element()
const
534 EnumerationRef group()
536 return EnumerationRef(
second());
540 Enumeration group()
const
542 return static_cast<Enumeration
>(
second());
683 template<
class GeoField>
686 const bool strict =
false
690 template<
class GeoField>
693 const bool strict =
false
778 template<
class Displacement>
782 const Displacement& displacement,
800 template<
class ... FieldNamesAndFields>
808 const FieldNamesAndFields& ... fieldNamesAndFields
812 template<
class ... FieldNamesAndFields>
819 const FieldNamesAndFields& ... fieldNamesAndFields
828 template<
class ... FieldNamesAndFields>
837 const FieldNamesAndFields& ... fieldNamesAndFields
841 template<
class ... FieldNamesAndFields>
849 const FieldNamesAndFields& ... fieldNamesAndFields
860 template<
class ... FieldNamesAndFields>
865 const FieldNamesAndFields& ... fieldNamesAndFields
869 template<
class ... FieldNamesAndFields>
873 const FieldNamesAndFields& ... fieldNamesAndFields
877 void reset(
const bool initial,
const bool final);
897 template<
class Enumeration>
938 const bool write =
true
942 virtual bool write(
const bool write =
true)
const;
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.
A HashTable with keys but without contents.
An STL-conforming hash table.
friend Ostream & operator(Ostream &, const HashTable< regIOobject *, word, string::hash > &)
readOption
Enumeration defining the read options.
word group() const
Return group (extension part of name)
const word & name() const
Return name.
writeOption
Enumeration defining the write options.
streamFormat
Enumeration for the format of data in the stream.
compressionType
Enumeration for the format of data in the stream.
Boundary part of a Lagrangian mesh. Just a list of Lagrangian patches with some added convenience fun...
Base class for Lagrangian source conditions.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Class to define the scope of Lagrangian mesh state changes.
changer(LagrangianMesh &mesh, const LagrangianState state)
Construct for a Lagrangian mesh with a given state.
Class to hold element-group indices, and associate the group.
Class to hold and index into the field references associated with a.
const vector & operator()(const label i) const
The displacement for a given index.
linearDisplacement(const LagrangianSubVectorField &linear)
Construct from a reference to the displacement.
Class to hold and index into the field references associated with a.
Pair< vector > operator()(const label i) const
The displacements for a given index.
parabolicDisplacement(const LagrangianSubVectorField &linear, const LagrangianSubVectorField &quadratic)
Construct from references to the displacements.
Class containing Lagrangian geometry and topology.
LagrangianState state(const label i) const
Return the state for an element of the mesh, or a none state.
LagrangianMesh(const polyMesh &mesh, const word &name, const IOobject::readOption readOption=IOobject::READ_IF_PRESENT, const IOobject::writeOption writeOption=IOobject::AUTO_WRITE)
Construct from a mesh and a name.
LagrangianSubMesh injectionMesh(const label n) const
Return the sub-mesh associated with an injection of a given.
LagrangianSubMesh birthMesh(const label n) const
Return the sub-mesh associated with birthing a given number of.
const objectRegistry & db() const
Return database.
const labelIODynamicField & faceTrii() const
Access the face-tet indices.
const LagrangianSubMesh & subAll() const
Return a sub-mesh for all elements.
label size() const
Get the number of elements.
void crossFaces(const LagrangianInternalScalarDynamicField &fraction)
Cross the faces.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
location
Enumeration for the locations of searched positions.
bool changing() const
Return whether or not the mesh is changing.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
tmp< LagrangianInternalVectorField > position() const
Return the global positions.
uint64_t subMeshIndex() const
Get a sub-mesh index.
static const NamedEnum< permutationAlgorithm, 2 > permutationAlgorithmNames_
Permutation algorithm names.
LagrangianBoundaryMesh BoundaryMesh
Boundary mesh type.
~LagrangianMesh()
Destructor.
ClassName("LagrangianMesh")
Run-time type information.
static permutationAlgorithm permutationAlgorithm_
Permutation algorithm.
static const word stateName
Name of the state field.
virtual void storePosition()
Store the positions for use during mapping.
partitioningAlgorithm
Enumeration of the partitioning algorithm.
void track(const List< LagrangianState > &endState, const Displacement &displacement, const LagrangianSubScalarField &deltaFraction, LagrangianSubScalarSubField &fraction)
Track the positions along the given displacements.
const labelIODynamicField & celli() const
Access the cell indices.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write=true) const
Write using given format, version and compression.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
location locate(const point &position, barycentric &coordinates, label &celli, label &facei, label &faceTrii, const scalar fraction) const
Convert a position into a set of coordinates and a.
static const word coordinatesName
Name of the coordinates field.
virtual void clearPosition()
Clear the positions uses during mapping.
const LagrangianBoundaryMesh & boundary() const
Return reference to boundary mesh.
label nGroups() const
Return the number of groups.
virtual bool write(const bool write=true) const
Write settings from the database.
LagrangianSubMesh subNone() const
Return a sub-mesh for no elements.
LagrangianSubMesh subIncomplete() const
Return a sub-mesh for all incomplete elements.
HashTable< const GeoField * > lookupCurrentFields(const bool strict=false) const
Lookup all current-time fields of the given type.
static const word fractionName
Name of the tracked fraction field.
static const word positionName
Name of the position field.
void reset(const bool initial, const bool final)
Reset the mesh to the old-time conditions.
labelList subMeshGlobalSizes() const
Return the global sizes of all the sub-meshes. A value of -1.
label nStates() const
Return the number of states.
const polyMesh & poly() const
Access the poly mesh.
LagrangianMesh Mesh
Mesh type.
const LagrangianSolution & solution() const
Access the solution controls.
permutationAlgorithm
Enumeration of the permutation algorithm.
void clear()
Clear all geometry out of the Lagrangian mesh.
const LagrangianSchemes & schemes() const
Access the schemes.
void birth(const LagrangianSubMesh &birthMesh, const labelList &parents, const FieldNamesAndFields &... fieldNamesAndFields)
Birth specified elements into the mesh. Fields are expanded.
void inject(const LagrangianSubMesh &injectionMesh, 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.
void operator=(const LagrangianMesh &)=delete
Disallow default bitwise assignment.
label stateToGroupi(const LagrangianState state) const
Convert a state to a group index.
static partitioningAlgorithm partitioningAlgorithm_
Partitioning algorithm.
void remove(const UList< label > &elements)
Remove specified elements from the mesh. Shuffles everything.
label globalSize() const
Get the global number of elements.
static const NamedEnum< partitioningAlgorithm, 2 > partitioningAlgorithmNames_
Partitioning algorithm names.
void partition()
Partition the mesh such that the groups are contiguous in memory.
LagrangianSubMesh sub(const LagrangianGroup group) const
Return a sub-mesh for the given group.
static const word prefix
Instance prefix.
const List< LagrangianState > & states() const
Return the states.
const barycentricIODynamicField & coordinates() const
Access the coordinates.
const labelIODynamicField & facei() const
Access the cell-face indices.
Base class for Lagrangian boundary conditions.
Selector class for Lagrangian schemes.
Selector class for Lagrangian schemes.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An ordered pair of two objects of type <Type> with first() and second() elements.
const label & second() const
Return second.
const label & first() const
Return first.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Centred interpolation interpolation scheme class.
Registry of regIOobjects.
const Time & time() const
Return time.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A processor boundary condition for Lagrangian. Properties are communicated to and from the neighbour ...
Processor Lagrangian patch. This is used for the patches that interface between processors across fac...
A class for managing temporary objects.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
LagrangianState
Lagrangian state enumeration.
LagrangianGroup
Lagrangian group enumeration.