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();
91 const fvBoundaryMesh& bm =
mesh.boundary();
93 auto tboundaryVals = tmp<Field<Type>>
::New(
mesh.nBoundaryFaces());
94 auto& boundaryVals = tboundaryVals.ref();
96 forAll(vf.boundaryField(), patchi)
98 label bFacei = bm[patchi].patch().start() -
mesh.nInternalFaces();
103 && !vf.boundaryField()[patchi].coupled()
109 vf.boundaryField()[patchi].size(),
111 ) = vf.boundaryField()[patchi];
119 boundaryVals[bFacei++] =
Zero;
124 return tboundaryVals;
131 GeometricField<Type, pointPatchField, pointMesh>& pf
136 Pout<<
"volPointInterpolation::addSeparated" <<
endl;
139 auto& pfi = pf.ref();
140 auto& pfbf = pf.boundaryFieldRef();
149 (pfbf[patchi]).initSwapAddSeparated
165 (pfbf[patchi]).swapAddSeparated
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();
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 =
303 val += mod*pWeights[j]*boundaryVals[
pFaces[j]];
331 pushUntransformedData(pfi);
336 pcs.constrain(pf,
false);
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const Mesh & mesh() const noexcept
Return const reference to mesh.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef().
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static FOAM_NO_DANGLING_REFERENCE const pointConstraints & New(const pointMesh &mesh, Args &&... args)
const fvMesh & mesh() const noexcept
const labelList & meshPoints() const
Return labelList of mesh points in patch.
A non-owning sub-view of a List (allocated or unallocated storage).
void size(const label n)
Older name for setAddressableSize.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static void waitRequests()
Wait for all requests to finish.
label size() const noexcept
The number of entries in the list.
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
const mapDistribute & globalCoPointSlavesMap() const
const labelListList & globalCoPointSlaves() const
const indirectPrimitivePatch & coupledPatch() const
Return patch of all coupled faces.
label constructSize() const noexcept
Constructed data size.
Class containing processor-to-processor mapping information.
void reverseDistribute(const label constructSize, List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
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.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
const globalMeshData & globalData() const
Return parallel info (demand-driven).
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).
label nInternalFaces() const noexcept
Number of internal faces.
A class for managing temporary objects.
void pushUntransformedData(List< Type > &) const
Helper: push master point data to collocated points.
bitSet isPatchPoint_
Per mesh(!) point whether is on non-coupled, non-empty patch (on.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
scalarListList boundaryPointWeights_
Per boundary point the weights per pointFaces.
void addSeparated(GeometricField< Type, pointPatchField, pointMesh > &) const
Add separated contributions.
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.
tmp< Field< Type > > flatBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Get boundary field in same order as boundary faces. Field is.
autoPtr< primitivePatch > boundaryPtr_
Boundary addressing.
bitSet boundaryIsPatchFace_
Per boundary face whether is on non-coupled, non-empty patch.
bitSet isSymmetryPoint_
Per mesh(!) point whether is on symmetry plane.
const dimensionedScalar mp
Proton mass.
Namespace for handling debugging switches.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
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.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
static constexpr const zero Zero
Global zero (0).
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
List< scalar > scalarList
List of scalar.
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];} pointMap[start]=pointMap[end]=Foam::min(start, end);} } 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};constexpr 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< DynamicList< face > > pFaces[nBCs]
#define forAll(list, i)
Loop across all elements in list.