39void 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];
82void Foam::volPointInterpolation::addSeparated
84 GeometricField<Type, pointPatchField, pointMesh>& pf
89 Pout<<
"volPointInterpolation::addSeparated" <<
endl;
93 auto& pfbf = pf.boundaryFieldRef();
101 refCast<coupledPointPatchField<Type>>
102 (pfbf[patchi]).initSwapAddSeparated
117 refCast<coupledPointPatchField<Type>>
118 (pfbf[patchi]).swapAddSeparated
137 Pout<<
"volPointInterpolation::interpolateInternalField("
138 <<
"const GeometricField<Type, fvPatchField, volMesh>&, "
139 <<
"GeometricField<Type, pointPatchField, pointMesh>&) : "
140 <<
"interpolating field " << vf.
name()
141 <<
" from cells to points " << pf.
name() <<
endl;
149 if (!isPatchPoint_[pointi])
158 pf[pointi] += pw[pointCelli]*vf[ppc[pointCelli]];
174 Pout<<
"volPointInterpolation::interpolateDimensionedInternalField("
175 <<
"const DimensionedField<Type, volMesh>&, "
176 <<
"DimensionedField<Type, pointMesh>&) : "
177 <<
"interpolating field " << vf.
name() <<
" from cells to points "
197 pf[pointi] = Type(
Zero);
201 label celli = ppc[pointCelli];
202 scalar pw = 1.0/
mag(
points[pointi] - cellCentres[celli]);
204 pf[pointi] += pw*vf[celli];
216 scalar
s = sumW[pointi];
246 !isA<emptyFvPatch>(bm[patchi])
259 const polyPatch& pp = bm[patchi].patch();
263 boundaryVals[bFacei++] =
Zero;
268 return tboundaryVals;
295 label pointi = mp[i];
297 if (isPatchPoint_[pointi])
300 const scalarList& pWeights = boundaryPointWeights_[i];
302 Type& val = pfi[pointi];
307 if (boundaryIsPatchFace_[
pFaces[j]])
309 val += pWeights[j]*boundaryVals[
pFaces[j]];
322 if (normalisationPtr_)
324 const scalarField& normalisation = normalisationPtr_();
327 pfi[mp[i]] *= normalisation[i];
335 pushUntransformedData(pfi);
344 const bool overrideFixedValue
347 interpolateBoundaryField(vf, pf);
365 Pout<<
"volPointInterpolation::interpolate("
366 <<
"const GeometricField<Type, fvPatchField, volMesh>&, "
367 <<
"GeometricField<Type, pointPatchField, pointMesh>&) : "
368 <<
"interpolating field " << vf.
name() <<
" from cells to points "
372 interpolateInternalField(vf, pf);
375 interpolateBoundaryField(vf, pf,
false);
394 "volPointInterpolate(" + vf.
name() +
')',
403 interpolateInternalField(vf, tpf.
ref());
406 interpolateBoundaryField(vf, tpf.
ref(),
true);
442 PointFieldType* pfPtr =
443 db.objectRegistry::template getObjectPtr<PointFieldType>(
name);
445 if (!cache || vf.
mesh().changing())
448 if (pfPtr && pfPtr->ownedByRegistry())
481 PointFieldType& pf = *pfPtr;
505 return interpolate(vf,
"volPointInterpolate(" + vf.
name() +
')',
false);
539 PointFieldType* pfPtr =
540 db.objectRegistry::template getObjectPtr<PointFieldType>(
name);
542 if (!cache || vf.
mesh().changing())
545 if (pfPtr && pfPtr->ownedByRegistry())
563 interpolateDimensionedInternalField(vf, tpf.ref());
578 PointFieldType& pf = *pfPtr;
587 interpolateDimensionedInternalField(vf, pf);
602 return interpolate(vf,
"volPointInterpolate(" + vf.
name() +
')',
false);
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const fileName & instance() const noexcept
Read access to instance path component.
const fvMesh & mesh() const
A list of faces which address into the list of points.
A List obtained as a section of another List.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
@ nonBlocking
"nonBlocking"
static label nRequests()
Get number of outstanding requests.
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
label size() const noexcept
The number of elements in the list.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Registry of regIOobjects.
Smooth ATC in cells having a point to a set of patches supplied by type.
Application of (multi-)patch point constraints.
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
Mesh representing a set of points created from polyMesh.
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
const globalMeshData & globalData() const
Return parallel info.
virtual const pointField & points() const
Return raw points.
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)
const labelListList & pointCells() const
label nInternalFaces() const noexcept
Number of internal faces.
const vectorField & cellCentres() const
bool interpolate() const noexcept
Same as isPointData()
static void cachePrintMessage(const char *message, const word &name, const FieldType &vf)
Helper for printing cache message.
A class for managing temporary objects.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
Interpolate boundary field without applying constraints/boundary.
void interpolateInternalField(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate internal field from volField to pointField.
void interpolateDimensionedInternalField(const DimensionedField< Type, volMesh > &vf, DimensionedField< Type, pointMesh > &pf) const
Interpolate dimensioned internal field from cells to points.
A class for handling words, derived from Foam::string.
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
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))
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
static constexpr const zero Zero
Global zero (0)
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
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]
#define forAll(list, i)
Loop across all elements in list.