50void Foam::parallelFvGeometryScheme::adjustGeometry
52 pointField& faceCentres,
53 vectorField& faceAreas
57 syncedBCentres = SubField<vector>
70 syncedBAreas = SubField<vector>
85 for (
const auto&
pp :
pbm)
104 if (ppp && !ppp->owner())
106 SubField<point> patchFc
112 patchFc = SubField<vector>
119 SubField<vector> patchArea
125 patchArea = SubField<vector>
136void Foam::parallelFvGeometryScheme::adjustGeometry()
148 mesh_.nBoundaryFaces(),
149 mesh_.nInternalFaces()
161 mesh_.nBoundaryFaces(),
162 mesh_.nInternalFaces()
172 const auto&
pbm = mesh_.boundaryMesh();
173 for (
const auto&
pp :
pbm)
192 if (ppp && !ppp->owner())
246 forAll(faceCentres, facei)
248 const auto& oldFc = mesh_.faceCentres()[facei];
249 const auto& newFc = faceCentres[facei];
250 const auto& oldFa = mesh_.faceAreas()[facei];
251 const auto& newFa = faceAreas[facei];
253 if (oldFc != newFc || oldFa != newFa)
257 if (mesh_.isInternalFace(facei))
260 <<
"Different geometry for internal face:" << facei
261 <<
" oldFc:" << oldFc <<
nl
262 <<
" newFc:" << newFc <<
nl
263 <<
" oldFa:" << oldFa <<
nl
264 <<
" newFa:" << newFa <<
nl
271 forAll(cellCentres, celli)
273 const auto& oldCc = mesh_.cellCentres()[celli];
274 const auto& newCc = cellCentres[celli];
275 const auto& oldCv = mesh_.cellVolumes()[celli];
276 const auto& newCv = cellVolumes[celli];
278 if (oldCc != newCc || oldCv != newCv)
290 Info<<
"parallelFvGeometryScheme::movePoints() : "
291 <<
"adjusted geometry of faces:"
299 std::move(faceCentres),
300 std::move(faceAreas),
301 std::move(cellCentres),
302 std::move(cellVolumes)
309Foam::parallelFvGeometryScheme::parallelFvGeometryScheme
328 Pout<<
"parallelFvGeometryScheme::geometry() : "
329 <<
"constructing underlying scheme from " << dict_
336 basicFvGeometryScheme::typeName
339 return geometryPtr_();
347 Pout<<
"parallelFvGeometryScheme::movePoints() : "
348 <<
"recalculating primitiveMesh centres" <<
endl;
382 return geometry().nonOrthDeltaCoeffs();
389 return geometry().nonOrthCorrectionVectors();
412 adjustGeometry(faceCentres, faceAreas);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
SubField is a Field obtained as a section of another Field, without its own allocation....
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base class for geometry calculation schemes.
const fvMesh & mesh_
Hold reference to mesh.
const fvMesh & mesh() const
Return mesh reference.
static tmp< fvGeometryScheme > New(const fvMesh &mesh, const dictionary &dict, const word &defaultScheme)
Return new tmp interpolation scheme.
Mesh data needed to do the Finite Volume discretisation.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Geometry calculation scheme with explicit sync of face-geometry across processor patches.
tmp< fvGeometryScheme > geometryPtr_
Demand-driven construction of underlying scheme.
virtual bool updateGeom(const pointField &points, const refPtr< pointField > &oldPoints, pointField &faceCentres, vectorField &faceAreas, pointField &cellCentres, scalarField &cellVolumes) const
Calculate geometry quantities using mesh topology and provided points. If oldPoints provided only doe...
virtual tmp< surfaceScalarField > nonOrthDeltaCoeffs() const
Return non-orthogonal cell-centre difference coefficients.
const fvGeometryScheme & geometry() const
Construct underlying fvGeometryScheme.
virtual tmp< surfaceVectorField > nonOrthCorrectionVectors() const
Return non-orthogonality correction vectors.
dictionary dict_
Dictionary for underlying scheme.
virtual void movePoints()
Do what is necessary if the mesh has moved.
virtual tmp< surfaceScalarField > weights() const
Return linear difference weighting factors.
virtual tmp< surfaceScalarField > deltaCoeffs() const
Return cell-centre difference coefficients.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh for topology changes.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces).
label nInternalFaces() const noexcept
Number of internal faces.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.