84class faMeshBoundaryHalo;
85class faMeshLduAddressing;
95 public MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>,
134 for (
auto& tuples : list)
154 bool valid()
const noexcept
156 return (procNo() >= 0 && patchEdgei() >= 0);
160 label procNo()
const {
return (*
this)[0]; }
161 void procNo(label val) { (*this)[0] = val; }
164 label patchi()
const {
return (*
this)[1]; }
165 void patchi(label val) { (*this)[1] = val; }
169 label patchEdgei()
const {
return (*
this)[2]; }
170 void patchEdgei(label val) { (*this)[2] = val; }
173 label meshFacei()
const {
return (*
this)[3]; }
174 void meshFacei(label val) { (*this)[3] = val; }
177 label realPatchi()
const
179 const label
id = patchi();
180 return (
id < 0 ? -(
id + 1) :
id);
184 void faPatchi(label val)
190 bool is_finiteArea()
const noexcept
192 return (patchi() < 0);
196 bool is_localProc()
const noexcept
227 mutable label nPoints_;
230 mutable label nEdges_;
233 mutable label nInternalEdges_;
236 mutable label nFaces_;
248 mutable label curTimeIndex_;
254 mutable std::unique_ptr<uindirectPrimitivePatch> patchPtr_;
257 mutable std::unique_ptr<List<labelPair>> bndConnectPtr_;
296 mutable std::unique_ptr<vectorField> pointAreaNormalsPtr_;
305 mutable boolList* correctPatchPointNormalsPtr_;
314 mutable std::unique_ptr<faMeshBoundaryHalo> haloMapPtr_;
317 mutable std::unique_ptr<pointField> haloFaceCentresPtr_;
320 mutable std::unique_ptr<vectorField> haloFaceNormalsPtr_;
326 static int geometryOrder_;
329 static const int quadricsFit_;
338 void operator=(
const faMesh&) =
delete;
342 void initPatch()
const;
346 void setPrimitiveMeshData();
353 void calcBoundaryConnections()
const;
357 void setBoundaryConnections
366 void calcLduAddressing()
const;
369 void calcPatchStarts()
const;
377 void calcMagLe()
const;
381 void calcAreaCentres()
const;
385 void calcEdgeCentres()
const;
393 void calcFaceAreaNormals()
const;
397 void calcEdgeAreaNormals()
const;
401 void calcPointAreaNormals(
vectorField& result)
const;
404 void calcPointAreaNormalsByQuadricsFit(
vectorField& result)
const;
408 void calcFaceCurvatures()
const;
411 void calcEdgeTransformTensors()
const;
414 void clearGeomNotAreas()
const;
417 void clearHalo()
const;
420 void clearGeom()
const;
423 void clearAddressing()
const;
426 void clearOut()
const;
432 void calcHaloFaceGeometry()
const;
440 const word& patchName,
441 const word& patchType =
""
448 const word& emptyPatchName =
"",
449 const dictionary* defaultPatchDefinition =
nullptr
454 void checkBoundaryEdgeLabelRange(
const labelUList& edgeLabels)
const;
466 checkBoundaryEdgeLabelRange(edgeLabels);
472 result[i] = bndField[edgeLabels[i] - nInternalEdges_];
481 static bool hasSystemFiles(
const polyMesh& pMesh);
484 static bool hasFiles(
const polyMesh& pMesh);
551 const bool doInit =
true
565 return geometryOrder_;
572 int old(geometryOrder_);
573 geometryOrder_ = order;
589 const bool validBoundary =
true
596 const bool validBoundary =
true
600 bool init(
const bool doInit);
681 virtual
bool hasDb() const;
734 return (edgeIndex < nInternalEdges_);
865 virtual bool write(
const bool valid =
true)
const;
Forwards and collection of common area field types.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A field of fields is a PtrList of fields with reference counting.
A 1D vector of objects of type <T> with a fixed length <N>.
FixedList()=default
Default construct.
Generic GeometricField class.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
An ordered pair of two objects of type <T> with first() and second() elements.
A list of faces which address into the list of points.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Database for solution data, solver performance and other reduced data.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Face to edge interpolation scheme. Included in faMesh.
Finite area boundary mesh.
lduInterfacePtrsList interfaces() const
Various mesh related information for a parallel run.
Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ord...
lduAddressing wrapper for faMesh
Class holds all the necessary information for mapping fields associated with faMesh.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
virtual bool movePoints()
Update after mesh motion.
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
labelList internalPoints() const
Return internal point labels.
bool operator==(const faMesh &m) const
static int geometryOrder() noexcept
Return the current geometry treatment (0: primitive, 1: standard)
const fileName & facesInstance() const
Return the current instance directory for faces.
const vectorField & haloFaceNormals() const
Face normals of boundary halo neighbours.
const labelList & patchStarts() const
Return patch starts.
virtual void mapOldAreas(const faMeshMapper &mapper) const
Map face areas in time using given map.
faBoundaryMesh BoundaryMesh
The boundary type associated with the mesh.
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
bool hasInternalEdgeLabels() const noexcept
const Time & time() const
Return reference to time.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
label comm() const noexcept
Return communicator used for parallel communication.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
const pointField & haloFaceCentres() const
Face centres of boundary halo neighbours.
label nEdges() const noexcept
Number of local mesh edges.
static const word prefix
The prefix to local: finite-area.
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
label nBoundaryEdges() const noexcept
Number of boundary edges (== nEdges - nInternalEdges)
const faceList & faces() const
Return local faces.
bool isInternalEdge(const label edgeIndex) const noexcept
True if given edge label is internal to the mesh.
const polyMesh & mesh() const
Return access to polyMesh.
bool init(const bool doInit)
Initialise non-demand-driven data etc.
const edgeScalarField & magLe() const
Return edge length magnitudes.
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
const edgeList::subList internalEdges() const
Sub-list of local internal edges.
const word & name() const
virtual void mapFields(const faMeshMapper &mapper) const
Map all fields in time using given map.
const edgeList & edges() const noexcept
Return local edges with reordered boundary.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
const edgeVectorField & Le() const
Return edge length vectors.
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
const fileName & pointsInstance() const
Return the current instance directory for points.
const labelUList & owner() const
Internal face owner.
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
bool operator!=(const faMesh &m) const
label nInternalEdges() const noexcept
Number of internal faces.
const faGlobalMeshData & globalData() const
Return parallel info.
const DimensionedField< scalar, areaMesh > & S0() const
Return old-time face areas.
const polyMesh & operator()() const
Interface to referenced polyMesh (similar to GeoMesh)
const areaScalarField & faceCurvatures() const
Return face curvatures.
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
label nPoints() const noexcept
Number of local mesh points.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
const labelUList & neighbour() const
Internal face neighbour.
label nFaces() const noexcept
Number of patch faces.
const List< labelPair > & boundaryConnections() const
faMesh Mesh
The mesh type.
labelList boundaryProcs() const
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
static autoPtr< faMesh > TryNew(const polyMesh &pMesh)
Read construction from polyMesh if all files are available.
const pointField & points() const
Return local points.
void addFaPatches(faPatchList &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
void removeFiles() const
Remove all files from mesh instance()
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
const labelList & edgeOwner() const noexcept
Edge owner addressing.
List< labelPair > boundaryProcSizes() const
virtual void updateMesh(const mapPolyMesh &)
Update after topo change.
const vectorField & pointAreaNormals() const
Return point area normals.
virtual ~faMesh()
Destructor.
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
TypeName("faMesh")
Runtime type information.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
const areaVectorField & faceAreaNormals() const
Return face area normals.
const faMeshBoundaryHalo & boundaryHaloMap() const
Mapping/swapping for boundary halo neighbours.
labelList boundaryPoints() const
Return boundary point labels.
bool moving() const
Is mesh moving.
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
Selector class for finite area solution. faMesh is derived from faSolution so that all fields have ac...
A class for handling file names.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
bool moving() const noexcept
Is mesh moving.
A patch is a list of labels that address the faces in the global face list.
int myProcNo() const noexcept
Return processor number.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Forwards for edge field types.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
void sort(UList< T > &list)
Sort the list.
PtrList< faPatch > faPatchList
Store lists of faPatch as a PtrList.
void stableSort(UList< T > &list)
Stable sort the list.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
#define forAll(list, i)
Loop across all elements in list.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.