44 void Foam::volPointInterpolation::calcBoundaryAddressing()
48 Pout<<
"volPointInterpolation::calcBoundaryAddressing() : " 49 <<
"constructing boundary addressing" 60 mesh().nFaces()-
mesh().nInternalFaces(),
61 mesh().nInternalFaces()
68 boundaryIsPatchFace_.setSize(boundary.size());
69 boundaryIsPatchFace_ =
false;
72 isPatchPoint_ =
false;
82 const polyPatch& pp = pbm[
patchi];
86 !isA<emptyPolyPatch>(pp)
87 && !magSf.boundaryField()[
patchi].coupled()
94 boundaryIsPatchFace_[bFacei] =
true;
96 const face&
f = boundary[bFacei++];
100 isPatchPoint_[f[fp]] =
true;
119 forAll(isPatchPoint_, pointi)
121 if (isPatchPoint_[pointi] != oldData[pointi])
123 Pout<<
"volPointInterpolation::calcBoundaryAddressing():" 124 <<
" added dangling mesh point:" << pointi
130 label nPatchFace = 0;
131 forAll(boundaryIsPatchFace_, i)
133 if (boundaryIsPatchFace_[i])
138 label nPatchPoint = 0;
141 if (isPatchPoint_[i])
147 <<
" faces :" << boundary.size() <<
nl 148 <<
" of which on proper patch:" << nPatchFace <<
nl 149 <<
" points:" << boundary.nPoints() <<
nl 150 <<
" of which on proper patch:" << nPatchPoint <<
endl;
155 void Foam::volPointInterpolation::makeInternalWeights(
scalarField& sumWeights)
159 Pout<<
"volPointInterpolation::makeInternalWeights() : " 160 <<
"constructing weighting factors for internal and non-coupled" 161 <<
" points." <<
endl;
169 pointWeights_.
clear();
170 pointWeights_.setSize(points.size());
176 if (!isPatchPoint_[pointi])
178 const labelList& pcp = pointCells[pointi];
186 1.0/
mag(points[pointi] - cellCentres[pcp[pointCelli]]);
188 sumWeights[pointi] += pw[pointCelli];
195 void Foam::volPointInterpolation::makeBoundaryWeights(
scalarField& sumWeights)
199 Pout<<
"volPointInterpolation::makeBoundaryWeights() : " 200 <<
"constructing weighting factors for boundary points." <<
endl;
208 boundaryPointWeights_.clear();
209 boundaryPointWeights_.setSize(boundary.meshPoints().size());
211 forAll(boundary.meshPoints(), i)
213 label pointi = boundary.meshPoints()[i];
215 if (isPatchPoint_[pointi])
217 const labelList& pFaces = boundary.pointFaces()[i];
222 sumWeights[pointi] = 0.0;
226 if (boundaryIsPatchFace_[pFaces[i]])
230 pw[i] = 1.0/
mag(points[pointi] - faceCentres[facei]);
231 sumWeights[pointi] += pw[i];
243 void Foam::volPointInterpolation::makeWeights()
247 Pout<<
"volPointInterpolation::makeWeights() : " 248 <<
"constructing weighting factors" 253 calcBoundaryAddressing();
261 "volPointSumWeights",
271 makeInternalWeights(sumWeights);
275 makeBoundaryWeights(sumWeights);
302 addSeparated(sumWeights);
308 pushUntransformedData(sumWeights);
312 forAll(pointWeights_, pointi)
318 pw[i] /= sumWeights[pointi];
325 forAll(boundary.meshPoints(), i)
327 label pointi = boundary.meshPoints()[i];
333 pw[i] /= sumWeights[pointi];
340 Pout<<
"volPointInterpolation::makeWeights() : " 341 <<
"finished constructing weighting factors" GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
void updateMesh(const mapPolyMesh &)
Update mesh topology using the morph engine.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
Interpolate boundary field without applying constraints/boundary.
label nInternalFaces() const
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
static const pointMesh & New(const polyMesh &mesh)
virtual const pointField & points() const
Return raw points.
List< bool > boolList
Bool container classes.
Application of (multi-)patch point constraints.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
vectorField pointField
pointField is a vectorField.
void clear()
Clear the list, i.e. set size to zero.
~volPointInterpolation()
Destructor.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
List< scalar > scalarList
A List of scalars.
List< label > labelList
A List of labels.
void interpolateInternalField(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate internal field from volField to pointField.
const vectorField & cellCentres() const
Interpolate from cell centres to points (vertices) using inverse distance weighting.
const labelListList & pointCells() const
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
const Mesh & mesh() const
Return mesh.
defineTypeNameAndDebug(combustionModel, 0)
void interpolateDisplacement(const volVectorField &, pointVectorField &) const
Interpolate from volField to pointField.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
Addressing for a faceList slice.
volPointInterpolation(const fvMesh &)
Constructor given fvMesh and pointMesh.
const vectorField & faceCentres() const
void setSize(const label)
Reset size of List.
Template functions to aid in the implementation of demand driven data.
const fileName & instance() const
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
bool movePoints()
Correct weighting factors for moving mesh.