Go to the documentation of this file.
39 void Foam::volPointInterpolation::pushUntransformedData
47 const labelList& meshPoints = cpp.meshPoints();
49 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
52 List<Type> elems(slavesMap.constructSize());
55 elems[i] = pointData[meshPoints[i]];
66 elems[slavePoints[j]] = elems[i];
71 slavesMap.reverseDistribute(elems.size(), elems,
false);
76 pointData[meshPoints[i]] = elems[i];
82 void Foam::volPointInterpolation::addSeparated
84 GeometricField<Type, pointPatchField, pointMesh>& pf
89 Pout<<
"volPointInterpolation::addSeparated" <<
endl;
92 typename GeometricField<Type, pointPatchField, pointMesh>::
93 Internal& pfi = pf.ref();
95 typename GeometricField<Type, pointPatchField, pointMesh>::
96 Boundary& pfbf = pf.boundaryFieldRef();
104 refCast<coupledPointPatchField<Type>>
105 (pfbf[patchi]).initSwapAddSeparated
120 refCast<coupledPointPatchField<Type>>
121 (pfbf[patchi]).swapAddSeparated
140 Pout<<
"volPointInterpolation::interpolateInternalField("
141 <<
"const GeometricField<Type, fvPatchField, volMesh>&, "
142 <<
"GeometricField<Type, pointPatchField, pointMesh>&) : "
143 <<
"interpolating field " << vf.name()
144 <<
" from cells to points " << pf.name() <<
endl;
152 if (!isPatchPoint_[pointi])
161 pf[pointi] += pw[pointCelli]*vf[ppc[pointCelli]];
177 Pout<<
"volPointInterpolation::interpolateDimensionedInternalField("
178 <<
"const DimensionedField<Type, volMesh>&, "
179 <<
"DimensionedField<Type, pointMesh>&) : "
180 <<
"interpolating field " << vf.name() <<
" from cells to points "
181 << pf.name() <<
endl;
200 pf[pointi] = Type(
Zero);
204 label celli = ppc[pointCelli];
205 scalar pw = 1.0/
mag(
points[pointi] - cellCentres[celli]);
207 pf[pointi] += pw*vf[celli];
219 scalar
s = sumW[pointi];
249 !isA<emptyFvPatch>(bm[patchi])
262 const polyPatch& pp = bm[patchi].patch();
266 boundaryVals[bFacei++] =
Zero;
271 return tboundaryVals;
298 label pointi =
mp[i];
300 if (isPatchPoint_[pointi])
303 const scalarList& pWeights = boundaryPointWeights_[i];
305 Type& val = pfi[pointi];
310 if (boundaryIsPatchFace_[
pFaces[j]])
312 val += pWeights[j]*boundaryVals[
pFaces[j]];
325 if (normalisationPtr_)
327 const scalarField& normalisation = normalisationPtr_();
330 pfi[
mp[i]] *= normalisation[i];
338 pushUntransformedData(pfi);
347 const bool overrideFixedValue
350 interpolateBoundaryField(vf, pf);
368 Pout<<
"volPointInterpolation::interpolate("
369 <<
"const GeometricField<Type, fvPatchField, volMesh>&, "
370 <<
"GeometricField<Type, pointPatchField, pointMesh>&) : "
371 <<
"interpolating field " << vf.name() <<
" from cells to points "
372 << pf.name() <<
endl;
375 interpolateInternalField(vf, pf);
378 interpolateBoundaryField(vf, pf,
false);
397 "volPointInterpolate(" + vf.name() +
')',
406 interpolateInternalField(vf, tpf.
ref());
409 interpolateBoundaryField(vf, tpf.
ref(),
true);
445 PointFieldType* pfPtr =
446 db.objectRegistry::template getObjectPtr<PointFieldType>(
name);
448 if (!cache || vf.mesh().changing())
451 if (pfPtr && pfPtr->ownedByRegistry())
484 PointFieldType& pf = *pfPtr;
508 return interpolate(vf,
"volPointInterpolate(" + vf.name() +
')',
false);
542 PointFieldType* pfPtr =
543 db.objectRegistry::template getObjectPtr<PointFieldType>(
name);
545 if (!cache || vf.
mesh().changing())
548 if (pfPtr && pfPtr->ownedByRegistry())
566 interpolateDimensionedInternalField(vf, tpf.ref());
581 PointFieldType& pf = *pfPtr;
590 interpolateDimensionedInternalField(vf, pf);
605 return interpolate(vf,
"volPointInterpolate(" + vf.name() +
')',
false);
int debug
Static debugging option.
List< label > labelList
A List of labels.
virtual const pointField & points() const
Return raw points.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const dimensionedScalar mp
Proton mass.
A class for handling words, derived from Foam::string.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
A List obtained as a section of another List.
static const pointConstraints & New(const pointMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void cachePrintMessage(const char *message, const word &name, const FieldType &vf)
Helper for printing cache message.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
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.
Registry of regIOobjects.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
const Mesh & mesh() const
Return mesh.
const fvMesh & mesh() const
A patch is a list of labels that address the faces in the global face list.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
Mesh data needed to do the Finite Volume discretisation.
Mesh representing a set of points created from polyMesh.
const dimensionSet & dimensions() const
Return dimensions.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
Application of (multi-)patch point constraints.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
List< labelList > labelListList
A List of labelList.
const vectorField & cellCentres() const
static label nRequests()
Get number of outstanding requests.
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
label nInternalFaces() const noexcept
Number of internal faces.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
void interpolateInternalField(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate internal field from volField to pointField.
const labelListList & pointCells() const
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Smooth ATC in cells having a point to a set of patches supplied by type.
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
const globalMeshData & globalData() const
Return parallel info.
void interpolateDimensionedInternalField(const DimensionedField< Type, volMesh > &vf, DimensionedField< Type, pointMesh > &pf) const
Interpolate dimensioned internal field from cells to points.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
Interpolate boundary field without applying constraints/boundary.
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::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].reset(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, &oldCyclicPolyPatch::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]
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A list of faces which address into the list of points.