54 pointWeights_(mesh().
points().size()),
60 mesh().nFaces() - mesh().nInternalFaces(),
61 mesh().nInternalFaces()
65 boundaryPointWeights_(boundary_.meshPoints().size()),
66 boundaryPointNbrWeights_(boundary_.meshPoints().size())
70 Pout<<
"volPointInterpolation::volPointInterpolation(const fvMesh&) : "
71 <<
"constructing weighting factors"
102 const label patchFacei =
111 scalar nonCoupledMagSf = 0;
116 !isCoupledPolyPatch[
patches[i]]
117 && !isCoupledFvPatch[
patches[i]]
120 nonCoupledMagSf += fvbm[
patches[i]].magSf()[patchFaces[i]];
124 pointBoundaryFactor[pointi] =
127 pointBoundaryFactor[pointi],
128 nonCoupledMagSf/pbm[
patchi].magFaceAreas()[patchFacei]
144 if (pointBoundaryFactor[pointi] > 1 - rootSmall)
continue;
146 pointWeights_[pointi].
setSize(pointCells[pointi].size());
148 const scalar
f = pointBoundaryFactor[pointi];
150 forAll(pointCells[pointi], pointCelli)
152 const label celli = pointCells[pointi][pointCelli];
154 pointWeights_[pointi][pointCelli] =
170 !isCoupledPolyPatch[
patchi]
171 && isCoupledFvPatch[
patchi]
186 boundaryPointWeights_[bPointi].resize(
pFaces.size());
187 boundaryPointNbrWeights_[bPointi].resize(
pFaces.size());
193 const label patchFacei =
202 boundaryPointWeights_[bPointi][bPointFacei].resize
207 boundaryPointNbrWeights_[bPointi][bPointFacei].resize
216 fvbm[
patches[i]].magSf()[patchFaces[i]]
217 /pbm[
patchi].magFaceAreas()[patchFacei];
219 const scalar
f = pointBoundaryFactor[pointi];
227 !isCoupledPolyPatch[
patches[i]]
228 && isCoupledFvPatch[
patches[i]]
232 boundaryPointNbrWeights_[bPointi][bPointFacei][i] =
239 !isCoupledPolyPatch[
patches[i]]
240 && !isCoupledFvPatch[
patches[i]]
244 boundaryPointWeights_[bPointi][bPointFacei][i] =
256 "volPointSumWeights",
265 forAll(pointWeights_, pointi)
267 forAll(pointWeights_[pointi], i)
269 sumWeights[pointi] += pointWeights_[pointi][i];
277 forAll(boundaryPointWeights_[bPointi], i)
279 forAll(boundaryPointWeights_[bPointi][i], j)
281 sumWeights[pointi] += boundaryPointWeights_[bPointi][i][j];
282 sumWeights[pointi] += boundaryPointNbrWeights_[bPointi][i][j];
297 forAll(pointWeights_, pointi)
299 forAll(pointWeights_[pointi], i)
301 pointWeights_[pointi][i] /= sumWeights[pointi];
309 forAll(boundaryPointWeights_[bPointi], i)
311 forAll(boundaryPointWeights_[bPointi][i], j)
313 boundaryPointWeights_[bPointi][i][j] /= sumWeights[pointi];
314 boundaryPointNbrWeights_[bPointi][i][j] /= sumWeights[pointi];
335 interpolateUnconstrained(vf, pf);
#define forAll(list, i)
Loop across all elements in list.
Graphite solid properties.
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
const fvMesh & mesh() const
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
const Mesh & mesh() const
Return mesh.
Generic GeometricBoundaryField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
void setSize(const label)
Reset size of List.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const labelListList & pointFaces() const
Return point-face addressing.
A List obtained as a section of another List.
label size() const
Return the number of elements in the UPtrList.
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
A face is a list of labels corresponding to mesh vertices.
Mesh data needed to do the Finite Volume discretisation.
const volVectorField & C() const
Return cell centres.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const UCompactListList< label > & polyBFacePatches() const
Return poly-bFace-patch addressing.
const UCompactListList< label > & polyBFacePatchFaces() const
Return poly-bFace-patch-face addressing.
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
const labelList & patchIndices() const
Boundary face patch indices.
const labelList & patchFaceIndices() const
Boundary face patch face indices.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
const labelListList & pointCells() const
Interpolate from cell centres to points (vertices) using inverse distance weighting.
~volPointInterpolation()
Destructor.
volPointInterpolation(const fvMesh &)
Constructor given fvMesh.
void interpolateDisplacement(const volVectorField &, pointVectorField &) const
Interpolate from volField to pointField.
Template functions to aid in the implementation of demand driven data.
const fvPatchList & patches
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
prefixOSstream Pout(cout, "Pout")
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
faceListList boundary(nPatches)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< small) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &mergedCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]