36 void Foam::volPointInterpolation::pushUntransformedData
44 const labelList& meshPoints = cpp.meshPoints();
46 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
49 List<Type> elems(slavesMap.constructSize());
52 elems[i] = pointData[meshPoints[i]];
63 elems[slavePoints[j]] = elems[i];
68 slavesMap.reverseDistribute(elems.size(), elems,
false);
73 pointData[meshPoints[i]] = elems[i];
79 void Foam::volPointInterpolation::addSeparated
81 GeometricField<Type, pointPatchField, pointMesh>& pf
86 Pout<<
"volPointInterpolation::addSeparated" <<
endl;
89 typename GeometricField<Type, pointPatchField, pointMesh>::
90 Internal& pfi = pf.ref();
92 typename GeometricField<Type, pointPatchField, pointMesh>::
93 Boundary& pfbf = pf.boundaryFieldRef();
97 if (pfbf[
patchi].coupled())
99 refCast<coupledPointPatchField<Type>>
100 (pfbf[
patchi]).initSwapAddSeparated
113 if (pfbf[
patchi].coupled())
115 refCast<coupledPointPatchField<Type>>
116 (pfbf[
patchi]).swapAddSeparated
135 Pout<<
"volPointInterpolation::interpolateInternalField(" 136 <<
"const GeometricField<Type, fvPatchField, volMesh>&, " 137 <<
"GeometricField<Type, pointPatchField, pointMesh>&) : " 138 <<
"interpolating field from cells to points" 145 forAll(pointCells, pointi)
147 if (!isPatchPoint_[pointi])
150 const labelList& ppc = pointCells[pointi];
156 pf[pointi] += pw[pointCelli]*vf[ppc[pointCelli]];
184 !isA<emptyFvPatch>(bm[
patchi])
201 boundaryVals[bFacei++] =
Zero;
206 return tboundaryVals;
230 if (isPatchPoint_[pointi])
233 const scalarList& pWeights = boundaryPointWeights_[i];
235 Type& val = pfi[pointi];
240 if (boundaryIsPatchFace_[pFaces[j]])
242 val += pWeights[j]*boundaryVals[pFaces[j]];
257 pushUntransformedData(pfi);
262 bool havePatchTypes =
false;
268 havePatchTypes =
true;
283 "volPointSumWeights",
303 if (isPatchPoint_[pointi])
305 pswi[pointi] =
sum(boundaryPointWeights_[i]);
313 pushUntransformedData(pswi);
320 if (isPatchPoint_[pointi])
322 pfi[pointi] /= pswi[pointi];
333 const bool overrideFixedValue
354 Pout<<
"volPointInterpolation::interpolate(" 355 <<
"const GeometricField<Type, fvPatchField, volMesh>&, " 356 <<
"GeometricField<Type, pointPatchField, pointMesh>&) : " 357 <<
"interpolating field from cells to points" 383 "volPointInterpolate(" + vf.
name() +
')',
429 if (!cache || vf.
mesh().changing())
432 if (db.objectRegistry::template foundObject<PointFieldType>(name))
435 db.objectRegistry::template lookupObjectRef<PointFieldType>
440 if (pf.ownedByRegistry())
465 if (!db.objectRegistry::template foundObject<PointFieldType>(name))
469 PointFieldType* pfPtr = tpf.
ptr();
476 db.objectRegistry::template lookupObjectRef<PointFieldType>
496 PointFieldType* pfPtr = tpf.
ptr();
514 return interpolate(vf,
"volPointInterpolate(" + vf.
name() +
')',
false);
List< labelList > labelListList
A List of labelList.
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
Interpolate boundary field without applying constraints/boundary.
label nInternalFaces() const
const Boundary & boundaryField() const
Return const-reference to the boundary field.
T & ref() const
Return non-const reference or generate a fatal error.
wordList patchTypes(nPatches)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
const dimensionSet dimless
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
A calculated boundary condition for pointField.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Mesh representing a set of points created from polyMesh.
Application of (multi-)patch point constraints.
const dimensionSet & dimensions() const
Return dimensions.
A list of faces which address into the list of points.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
static const word null
An empty word.
const globalMeshData & globalData() const
Return parallel info.
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.
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]
void store()
Transfer ownership of this object to its registry.
const labelListList & pointFaces() const
Return point-face addressing.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const Mesh & mesh() const
Return mesh.
static pointMesh & New(polyMesh &mesh)
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
const fvMesh & mesh() const
const fileName & instance() const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
T * ptr() const
Return tmp pointer for reuse.
A class for managing temporary objects.
Registry of regIOobjects.
A patch is a list of labels that address the faces in the global face list.
const objectRegistry & db() const
Return the local objectRegistry.
static void cachePrintMessage(const char *message, const word &name, const FieldType &vf)
Helper for printing cache message.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.