Go to the documentation of this file.
74 class faMeshBoundaryHalo;
75 class faMeshLduAddressing;
85 public MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>,
124 for (
auto& tuples : list)
144 bool valid()
const noexcept
146 return (procNo() >= 0 && patchEdgei() >= 0);
150 label procNo()
const {
return (*
this)[0]; }
151 void procNo(label val) { (*this)[0] = val; }
154 label patchi()
const {
return (*
this)[1]; }
155 void patchi(label val) { (*this)[1] = val; }
159 label patchEdgei()
const {
return (*
this)[2]; }
160 void patchEdgei(label val) { (*this)[2] = val; }
163 label meshFacei()
const {
return (*
this)[3]; }
164 void meshFacei(label val) { (*this)[3] = val; }
167 label realPatchi()
const
169 const label
id = patchi();
170 return (
id < 0 ? -(
id + 1) :
id);
174 void faPatchi(label val)
180 bool is_finiteArea()
const noexcept
182 return (patchi() < 0);
186 bool is_localProc()
const noexcept
217 mutable label nPoints_;
220 mutable label nEdges_;
223 mutable label nInternalEdges_;
226 mutable label nFaces_;
238 mutable std::unique_ptr<uindirectPrimitivePatch> patchPtr_;
241 mutable std::unique_ptr<List<labelPair>> bndConnectPtr_;
250 mutable label curTimeIndex_;
283 mutable std::unique_ptr<vectorField> pointAreaNormalsPtr_;
292 mutable boolList* correctPatchPointNormalsPtr_;
301 mutable std::unique_ptr<faMeshBoundaryHalo> haloMapPtr_;
304 mutable std::unique_ptr<pointField> haloFaceCentresPtr_;
307 mutable std::unique_ptr<vectorField> haloFaceNormalsPtr_;
313 static int origPointAreaMethod_;
316 static const int quadricsFit_;
325 void operator=(
const faMesh&) =
delete;
328 void initPatch()
const;
331 void setPrimitiveMeshData();
338 void calcBoundaryConnections()
const;
342 void setBoundaryConnections
351 void calcLduAddressing()
const;
354 void calcPatchStarts()
const;
360 void calcMagLe()
const;
363 void calcAreaCentres()
const;
366 void calcEdgeCentres()
const;
372 void calcFaceAreaNormals()
const;
375 void calcEdgeAreaNormals()
const;
378 void calcPointAreaNormals_orig(
vectorField& result)
const;
381 void calcPointAreaNormals(
vectorField& result)
const;
384 void calcPointAreaNormalsByQuadricsFit(
vectorField& result)
const;
387 void calcFaceCurvatures()
const;
390 void calcEdgeTransformTensors()
const;
393 void clearGeomNotAreas()
const;
396 void clearHalo()
const;
399 void clearGeom()
const;
402 void clearAddressing()
const;
405 void clearOut()
const;
411 void calcHaloFaceGeometry()
const;
419 const word& patchName,
420 const word& patchType =
""
427 const word& emptyPatchName =
"",
428 const dictionary* defaultPatchDefinition =
nullptr
433 void checkBoundaryEdgeLabelRange(
const labelUList& edgeLabels)
const;
445 checkBoundaryEdgeLabelRange(edgeLabels);
451 result[i] = bndField[edgeLabels[i] - nInternalEdges_];
515 const bool validBoundary =
true
522 const bool validBoundary =
true
552 inline label
comm() const noexcept;
555 inline label&
comm() noexcept;
561 inline label
nPoints() const noexcept;
564 inline label
nEdges() const noexcept;
573 inline label
nFaces() const noexcept;
598 virtual
bool hasDb() const;
645 return (edgeIndex < nInternalEdges_);
764 virtual bool write(
const bool valid =
true)
const;
The class contains the addressing required by the lduMatrix: upper, lower and losort.
List< label > labelList
A List of labels.
const word & name() const
Name function is needed to disambiguate those inherited.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
const edgeVectorField & Le() const
Return edge length vectors.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
virtual void mapOldAreas(const faMeshMapper &mapper) const
Map face areas in time using given map.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
const faceList & faces() const
Return local patch faces.
A class for handling file names.
A field of fields is a PtrList of fields with reference counting.
virtual bool write(const bool valid=true) const
Write mesh.
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
A class for managing temporary objects.
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
static const word prefix
The prefix to local: finite-area.
const polyMesh & operator()() const
Interface to referenced polyMesh (similar to GeoMesh)
const labelList & edgeOwner() const noexcept
Edge owner addressing.
labelList internalPoints() const
Return internal point labels.
List< labelPair > boundaryProcSizes() const
const List< labelPair > & boundaryConnections() const
Various mesh related information for a parallel run.
const vectorField & pointAreaNormals() const
Return point area normals.
virtual ~faMesh()
Destructor.
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
Mesh consisting of general polyhedral cells.
const labelList & patchStarts() const
Return patch starts.
#define forAll(list, i)
Loop across all elements in list.
void stableSort(UList< T > &a)
const faGlobalMeshData & globalData() const
Return parallel info.
const vectorField & haloFaceNormals() const
Face normals of boundary halo neighbours.
Registry of regIOobjects.
label nFaces() const noexcept
Number of patch faces.
Finite area boundary mesh.
const edgeList & edges() const noexcept
Return local patch edges with reordered boundary.
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
Class holds all the necessary information for mapping fields associated with faMesh.
const DimensionedField< scalar, areaMesh > & S0() const
Return old-time face areas.
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
bool operator==(const faMesh &m) const
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
A patch is a list of labels that address the faces in the global face list.
Forwards and collection of common area field types.
const areaVectorField & faceAreaNormals() const
Return face area normals.
const Time & time() const
Return reference to time.
label nEdges() const noexcept
Number of local mesh edges.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label nInternalEdges() const noexcept
Number of internal faces.
Selector class for finite area solution. faMesh is derived from faSolution so that all fields have ac...
label nBoundaryEdges() const noexcept
Number of boundary edges (== nEdges - nInternalEdges)
const edgeScalarField & magLe() const
Return edge length magnitudes.
const faMeshBoundaryHalo & boundaryHaloMap() const
Mapping/swapping for boundary halo neighbours.
const fileName & facesInstance() const
Return the current instance directory for faces.
label nPoints() const noexcept
Number of local mesh points.
bool operator!=(const faMesh &m) const
const polyMesh & mesh() const
Return access to polyMesh.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool moving() const
Is mesh moving.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
const pointField & points() const
Return local patch points.
const labelUList & neighbour() const
Internal face neighbour.
labelList boundaryProcs() const
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
labelList boundaryPoints() const
Return boundary point labels.
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
const labelUList & owner() const
Internal face owner.
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
const word & name() const noexcept
Return name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
lduAddressing wrapper for faMesh
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
const areaScalarField & faceCurvatures() const
Return face curvatures.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
An ordered pair of two objects of type <T> with first() and second() elements.
label comm() const noexcept
Return communicator used for parallel communication.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
A 1D vector of objects of type <T> with a fixed length <N>.
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
void addFaPatches(PtrList< faPatch > &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
bool moving() const noexcept
Is mesh moving.
virtual void mapFields(const faMeshMapper &mapper) const
Map all fields in time using given map.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void updateMesh(const mapPolyMesh &)
Update after topo change.
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
void size(const label n)
Older name for setAddressableSize.
const fileName & pointsInstance() const
Return the current instance directory for points.
Generic GeometricField class.
bool isInternalEdge(const label edgeIndex) const
True if given edge label is internal to the mesh.
TypeName("faMesh")
Runtime type information.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
Forwards for edge field types.
Face to edge interpolation scheme. Included in faMesh.
Database for solution data, solver performance and other reduced data.
faBoundaryMesh BoundaryMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ord...
virtual bool movePoints()
Update after mesh motion.
UPtrList< const lduInterface > lduInterfacePtrsList
List of coupled interface fields to be used in coupling.
const pointField & haloFaceCentres() const
Face centres of boundary halo neighbours.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A list of faces which address into the list of points.
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
lduInterfacePtrsList interfaces() const