46 void Foam::volPointInterpolation::makeWeights()
50 Pout<<
"volPointInterpolation::makeWeights() : " 51 <<
"constructing weighting factors" 68 mesh().nFaces() -
mesh().nInternalFaces(),
69 mesh().nInternalFaces()
77 pointWeights_.clear();
78 pointWeights_.setSize(points.size());
79 boundaryPointWeights_.clear();
80 boundaryPointWeights_.setSize(boundary.meshPoints().size());
81 boundaryPointNbrWeights_.clear();
82 boundaryPointNbrWeights_.setSize(boundary.meshPoints().size());
85 boolList isCoupledPolyPatch(pbm.size(),
false);
86 boolList isCoupledFvPatch(fvbm.size(),
false);
87 forAll(isCoupledFvPatch, patchi)
96 forAll(boundary.meshPoints(), bPointi)
98 const label pointi = boundary.meshPoints()[bPointi];
100 const labelList& pFaces = boundary.pointFaces()[bPointi];
102 forAll(pFaces, pPointFacei)
105 const label patchi = pbm.patchID()[pFaces[pPointFacei]];
106 const label patchFacei = pbm.patchFaceID()[pFaces[pPointFacei]];
114 scalar nonCoupledMagSf = 0;
119 !isCoupledPolyPatch[patches[i]]
120 && !isCoupledFvPatch[patches[i]]
123 nonCoupledMagSf += fvbm[patches[i]].magSf()[patchFaces[i]];
127 pointBoundaryFactor[pointi] =
130 pointBoundaryFactor[pointi],
131 nonCoupledMagSf/pbm[patchi].magFaceAreas()[patchFacei]
147 if (pointBoundaryFactor[pointi] > 1 - rootSmall)
continue;
149 pointWeights_[pointi].setSize(pointCells[pointi].size());
151 const scalar f = pointBoundaryFactor[pointi];
153 forAll(pointCells[pointi], pointCelli)
155 const label celli = pointCells[pointi][pointCelli];
157 pointWeights_[pointi][pointCelli] =
158 (1 -
f)/
mag(points[pointi] -
mesh().
C()[celli]);
173 !isCoupledPolyPatch[patchi]
174 && isCoupledFvPatch[patchi]
183 forAll(boundary.meshPoints(), bPointi)
185 const label pointi = boundary.meshPoints()[bPointi];
187 const labelList& pFaces = boundary.pointFaces()[bPointi];
189 boundaryPointWeights_[bPointi].
resize(pFaces.size());
190 boundaryPointNbrWeights_[bPointi].resize(pFaces.size());
192 forAll(pFaces, bPointFacei)
195 const label patchi = pbm.patchID()[pFaces[bPointFacei]];
196 const label patchFacei = pbm.patchFaceID()[pFaces[bPointFacei]];
204 boundaryPointWeights_[bPointi][bPointFacei].resize
209 boundaryPointNbrWeights_[bPointi][bPointFacei].resize
218 fvbm[patches[i]].magSf()[patchFaces[i]]
219 /pbm[
patchi].magFaceAreas()[patchFacei];
221 const scalar f = pointBoundaryFactor[pointi];
229 !isCoupledPolyPatch[patches[i]]
230 && isCoupledFvPatch[patches[i]]
233 const point C = CBnf[patches[i]][patchFaces[i]];
234 boundaryPointNbrWeights_[bPointi][bPointFacei][i] =
235 (1 -
f)*a/
mag(points[pointi] - C);
241 !isCoupledPolyPatch[patches[i]]
242 && !isCoupledFvPatch[patches[i]]
245 const point Cf = fvbm[patches[i]].Cf()[patchFaces[i]];
246 boundaryPointWeights_[bPointi][bPointFacei][i] =
247 f*a/
mag(points[pointi] - Cf);
258 "volPointSumWeights",
267 forAll(pointWeights_, pointi)
269 forAll(pointWeights_[pointi], i)
271 sumWeights[pointi] += pointWeights_[pointi][i];
276 forAll(boundary.meshPoints(), bPointi)
278 const label pointi = boundary.meshPoints()[bPointi];
279 forAll(boundaryPointWeights_[bPointi], i)
281 forAll(boundaryPointWeights_[bPointi][i], j)
283 sumWeights[pointi] += boundaryPointWeights_[bPointi][i][j];
284 sumWeights[pointi] += boundaryPointNbrWeights_[bPointi][i][j];
299 forAll(pointWeights_, pointi)
301 forAll(pointWeights_[pointi], i)
303 pointWeights_[pointi][i] /= sumWeights[pointi];
308 forAll(boundary.meshPoints(), bPointi)
310 const label pointi = boundary.meshPoints()[bPointi];
311 forAll(boundaryPointWeights_[bPointi], i)
313 forAll(boundaryPointWeights_[bPointi][i], j)
315 boundaryPointWeights_[bPointi][i][j] /= sumWeights[pointi];
316 boundaryPointNbrWeights_[bPointi][i][j] /= sumWeights[pointi];
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const char *const typeName
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
GeometricBoundaryField< vector, fvPatchField, volMesh > Boundary
Type of the boundary field.
const dimensionSet dimless
void resize(const label)
Alias for setSize(const label)
UList< label > labelUList
virtual const pointField & points() const
Return raw points.
List< bool > boolList
Bool container classes.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
vectorField pointField
pointField is a vectorField.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
~volPointInterpolation()
Destructor.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
List< scalar > scalarList
A List of scalars.
void interpolateUnconstrained(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate from volField to pointField.
virtual void topoChange(const polyTopoChangeMap &)
Update mesh topology using the morph engine.
List< label > labelList
A List of labels.
faceListList boundary(nPatches)
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
Interpolate from cell centres to points (vertices) using inverse distance weighting.
const labelListList & pointCells() const
const Mesh & mesh() const
Return mesh.
defineTypeNameAndDebug(combustionModel, 0)
static pointMesh & New(polyMesh &mesh)
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.
Template functions to aid in the implementation of demand driven data.
const UCompactListList< label > & polyBFacePatchFaces() const
Return poly-bFace-patch-face addressing.
vector point
Point is a vector.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const UCompactListList< label > & polyBFacePatches() const
Return poly-bFace-patch addressing.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
dimensioned< scalar > mag(const dimensioned< Type > &)
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
const volVectorField & C() const
Return cell centres.
Class containing mesh-to-mesh mapping information.
virtual bool movePoints()
Correct weighting factors for moving mesh.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.