57 elems[i] = pointData[meshPoints[i]];
68 elems[slavePoints[j]] = elems[i];
78 pointData[meshPoints[i]] = elems[i];
87 const GeometricField<Type, fvPatchField, volMesh>& vf
90 const fvMesh&
mesh = vf.mesh();
94 auto& boundaryVals = tboundaryVals.ref();
96 forAll(vf.boundaryField(), patchi)
102 !isA<emptyFvPatch>(bm[patchi])
103 && !vf.boundaryField()[patchi].coupled()
109 vf.boundaryField()[patchi].size(),
111 ) = vf.boundaryField()[patchi];
115 const polyPatch&
pp = bm[patchi].patch();
119 boundaryVals[bFacei++] =
Zero;
124 return tboundaryVals;
136 Pout<<
"volPointInterpolation::addSeparated" <<
endl;
139 auto& pfi = pf.
ref();
148 refCast<coupledPointPatchField<Type>>
149 (pfbf[patchi]).initSwapAddSeparated
164 refCast<coupledPointPatchField<Type>>
165 (pfbf[patchi]).swapAddSeparated
178 const GeometricField<Type, pointPatchField, pointMesh>& pf,
183 const Field<Type>& pfi = pf.primitiveField();
186 const fvMesh& Mesh =
mesh();
187 const fvBoundaryMesh& bm = Mesh.boundary();
189 auto tboundaryVals = tmp<Field<Type>>
::New(Mesh.nBoundaryFaces(),
Zero);
190 auto& boundaryVals = tboundaryVals.ref();
200 label pointi =
mp[i];
202 if (isPatchPoint_[pointi])
205 const scalarList& pWeights = boundaryPointWeights_[i];
206 const Type& val = pfi[pointi];
215 scalar mod(isSymmetryPoint_[pointi] ? 0.5 : 1);
219 if (boundaryIsPatchFace_[
pFaces[j]])
221 boundaryVals[
pFaces[j]] += mod*pWeights[j]*val;
230 label bFacei = bm[patchi].patch().start() - Mesh.nInternalFaces();
231 if (!isA<emptyFvPatch>(bm[patchi]) && !vf[patchi].
coupled())
248 const GeometricField<Type, fvPatchField, volMesh>& vf,
249 GeometricField<Type, pointPatchField, pointMesh>& pf
254 Field<Type>& pfi = pf.primitiveFieldRef();
257 tmp<Field<Type>> tboundaryVals(flatBoundaryField(vf));
258 const Field<Type>& boundaryVals = tboundaryVals();
268 label pointi =
mp[i];
270 if (isPatchPoint_[pointi])
273 const scalarList& pWeights = boundaryPointWeights_[i];
275 Type& val = pfi[pointi];
280 if (boundaryIsPatchFace_[
pFaces[j]])
283 if (isSymmetryPoint_[pointi])
285 const label globalFaceI =
287 const label facePatchID =
292 isA<symmetryPolyPatch>(
pp)
293 || isA<symmetryPlanePolyPatch>(
pp)
303 val += mod*pWeights[j]*boundaryVals[
pFaces[j]];
331 pushUntransformedData(pfi);
List< scalar > scalarList
List of scalar.
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const mapDistribute & globalCoPointSlavesMap() const
static const pointConstraints & New(const pointMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
label constructSize() const noexcept
Constructed data size.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
static void waitRequests()
Wait for all requests to finish.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
A list of faces which address into the list of points.
void addSeparated(GeometricField< Type, pointPatchField, pointMesh > &) const
Add separated contributions.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
const fvMesh & mesh() const noexcept
Reference to the mesh.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
label nInternalFaces() const noexcept
Number of internal faces.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
void reverseDistribute(const label constructSize, List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
int debug
Static debugging option.
void pushUntransformedData(List< Type > &) const
Helper: push master point data to collocated points.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing 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]
const indirectPrimitivePatch & coupledPatch() const
Return patch of all coupled faces.
Class containing processor-to-processor mapping information.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
tmp< Field< Type > > flatBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Get boundary field in same order as boundary faces. Field is.
List< label > labelList
A List of labels.
A class for managing temporary objects.
void interpolateSensitivitiesField(const GeometricField< Type, pointPatchField, pointMesh > &pf, typename GeometricField< Type, fvPatchField, volMesh >::Boundary &vf, const labelHashSet &patchIDs) const
Interpolate sensitivties from points to faces.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
const dimensionedScalar mp
Proton mass.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const labelListList & globalCoPointSlaves() const
static constexpr const zero Zero
Global zero (0)