43 parallelFvGeometryScheme,
50 void Foam::parallelFvGeometryScheme::adjustGeometry
57 syncedBCentres = SubField<vector>
70 syncedBAreas = SubField<vector>
85 for (
const auto&
pp :
pbm)
87 const auto* ppp = isA<coupledPolyPatch>(
pp);
104 if (ppp && !ppp->owner())
106 SubField<point> patchFc
112 patchFc = SubField<vector>
119 SubField<vector> patchArea
125 patchArea = SubField<vector>
136 void Foam::parallelFvGeometryScheme::adjustGeometry()
145 syncedBCentres = SubField<vector>
148 mesh_.nBoundaryFaces(),
149 mesh_.nInternalFaces()
158 syncedBAreas = SubField<vector>
161 mesh_.nBoundaryFaces(),
162 mesh_.nInternalFaces()
172 const auto&
pbm = mesh_.boundaryMesh();
173 for (
const auto&
pp :
pbm)
175 const auto* ppp = isA<coupledPolyPatch>(
pp);
192 if (ppp && !ppp->owner())
195 const_cast<coupledPolyPatch&
> 200 SubField<point> patchFc
206 patchFc = SubField<vector>
213 SubField<vector> patchArea
219 patchArea = SubField<vector>
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)
309 Foam::parallelFvGeometryScheme::parallelFvGeometryScheme
316 dict_(
dict.subOrEmptyDict(
"geometry"))
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;
368 return geometry().weights();
375 return geometry().deltaCoeffs();
382 return geometry().nonOrthDeltaCoeffs();
389 return geometry().nonOrthCorrectionVectors();
412 adjustGeometry(faceCentres, faceAreas);
const polyBoundaryMesh & pbm
const fvMesh & mesh_
Hold reference to mesh.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
A class for managing references or pointers (no reference counting)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
vectorField pointField
pointField is a vectorField.
virtual tmp< surfaceVectorField > nonOrthCorrectionVectors() const
Return non-orthogonality correction vectors.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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...
label nInternalFaces() const noexcept
Number of internal faces.
virtual tmp< surfaceScalarField > weights() const
Return linear difference weighting factors.
static tmp< fvGeometryScheme > New(const fvMesh &mesh, const dictionary &dict, const word &defaultScheme)
Return new tmp interpolation scheme.
virtual tmp< surfaceScalarField > deltaCoeffs() const
Return cell-centre difference coefficients.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
virtual void movePoints()
Do what is necessary if the mesh has moved.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh for topology changes.
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
virtual tmp< surfaceScalarField > nonOrthDeltaCoeffs() const
Return non-orthogonal cell-centre difference coefficients.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Abstract base class for geometry calculation schemes.
const fvGeometryScheme & geometry() const
Construct underlying fvGeometryScheme.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)