38 #ifndef LagrangianMesh_H
39 #define LagrangianMesh_H
58 class LagrangianInjection;
59 class nonConformalCyclicPolyPatch;
143 origPatchNccPatchesPtr_;
165 mutable label subMeshIndex_;
179 template<
class Field>
180 inline void checkFieldSize(
const Field& field)
const;
191 void printGroups(
const bool header)
const;
212 void permuteAndResizeFields(
const labelList& permutation);
216 static void permuteList
224 static void permuteListCopy
232 static void permuteListInPlace
239 template<
class Container>
240 void resizeContainer(Container& container)
const;
261 template<
class Type,
template<
class>
class GeoField>
262 void appendSpecifiedField
265 GeoField<Type>& geoField,
271 template<
class Type,
template<
class>
class GeoField>
272 bool appendSpecifiedField
275 const word& fieldName,
281 template<
class Type,
class ... FieldNamesAndFields>
285 const word& fieldName,
287 const FieldNamesAndFields& ... fieldNamesAndFields
298 void injectUnspecifiedFields
306 void injectUnspecifiedFields
314 void birthUnspecifiedFields
366 void constructNonConformal()
const;
369 void constructBehind()
const;
469 template<
class Enumeration>
483 EnumerationRef(
label& i)
488 operator Enumeration()
const
490 return static_cast<Enumeration
>(i_);
495 i_ =
static_cast<label>(
e);
506 label element()
const
512 EnumerationRef group()
514 return EnumerationRef(
second());
518 Enumeration group()
const
520 return static_cast<Enumeration
>(
second());
656 template<
class GeoField>
659 const bool strict =
false
663 template<
class GeoField>
666 const bool strict =
false
722 const scalar fraction
745 template<
class Displacement>
749 const Displacement& displacement,
763 template<
class ... FieldNamesAndFields>
770 const FieldNamesAndFields& ... fieldNamesAndFields
779 template<
class ... FieldNamesAndFields>
787 const FieldNamesAndFields& ... fieldNamesAndFields
794 template<
class ... FieldNamesAndFields>
798 const FieldNamesAndFields& ... fieldNamesAndFields
802 void reset(
const bool initial,
const bool final);
822 template<
class Enumeration>
863 const bool write =
true
867 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.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
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.
const labelIODynamicField & faceTrii() const
Access the face-tet indices.
const LagrangianSubMesh & subAll() const
Return a sub-mesh for all elements.
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.
const polyMesh & mesh() const
Access the mesh.
label size() const
Get the number of elements.
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.
static const NamedEnum< permutationAlgorithm, 2 > permutationAlgorithmNames_
Permutation algorithm names.
LagrangianBoundaryMesh BoundaryMesh
Boundary mesh type.
~LagrangianMesh()
Destructor.
LagrangianSubMesh birth(const labelList &parents, const FieldNamesAndFields &... fieldNamesAndFields)
Birth specified elements into the mesh. Fields are expanded.
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.
tmp< LagrangianVectorInternalField > position() const
Return the global positions.
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.
label subMeshIndex() const
Get a sub-mesh index.
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 operator=(const LagrangianMesh &)=delete
Disallow default bitwise assignment.
void crossFaces(const LagrangianScalarInternalDynamicField &fraction)
Cross the faces.
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.
const objectRegistry & thisDb() const
Return the object registry.
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.
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.