38 template<
class FaceList,
class Po
intField>
41 const PrimitivePatch<FaceList, PointField>&
p,
47 p.meshPoints()[
p.edges()[edgei][0]],
48 p.meshPoints()[
p.edges()[edgei][1]]
68 DynamicList<label> faces;
79 IndirectList<face>(
mesh().faces(), faces),
85 template<
class Type,
class Method>
97 template<
class Type,
class Method>
99 Foam::nonConformalBoundary::typeMethod(
const Method& method)
105 template<
class ... NcPpTypeMethods>
109 NcPpTypeMethods ... typeMethods
117 nonConformalOtherPatchIndices
120 nonCoupledPatchIndices,
126 result.
transfer(nonCoupledPatchIndices);
131 template<
class NcPpType,
class NcPpMethod,
class ... NcPpTypeMethods>
132 void Foam::nonConformalBoundary::nonConformalOtherPatchIndices
137 const TypeMethod<NcPpType, NcPpMethod>& typeMethod,
138 NcPpTypeMethods ... typesAndMethods
147 if (isA<NcPpType>(pp))
149 const NcPpType& ncPp =
150 refCast<const NcPpType>(pbm[nccPatchi]);
152 if (side == 1 && !ncPp.owner())
continue;
154 if (side == -1 && ncPp.owner())
continue;
156 if (origPatchIndexTable.
found(ncPp.origPatchIndex()))
continue;
158 origPatchIndexTable.
insert(ncPp.origPatchIndex());
159 nonCoupledPatchIndices.
append((ncPp.*typeMethod.method)());
163 nonConformalOtherPatchIndices
166 nonCoupledPatchIndices,
173 void Foam::nonConformalBoundary::nonConformalOtherPatchIndices
176 DynamicList<label>& nonCoupledPatchIndices,
183 Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals()
const
185 if (!ownerOrigBoundaryPointNormalsPtr_.valid())
187 const faceList& faces = ownerOrigBoundary_.localFaces();
188 const vectorField faceNormals = ownerOrigBoundary_.faceNormals();
194 forAll(faces[facei], facePointi)
196 pointNormals[faces[facei][facePointi]] += faceNormals[facei];
203 ownerOrigBoundary_.meshPoints(),
209 ownerOrigBoundaryPointNormalsPtr_.set
211 (pointNormals/(
mag(pointNormals) + vSmall)).ptr()
215 return ownerOrigBoundaryPointNormalsPtr_();
220 Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals0()
const
222 if (!ownerOrigBoundaryPointNormals0Ptr_.valid())
224 const faceList& faces = ownerOrigBoundary_.localFaces();
230 forAll(faces[facei], facePointi)
232 pointNormals[faces[facei][facePointi]] +=
233 faces[facei].normal(
mesh().oldPoints());
240 ownerOrigBoundary_.meshPoints(),
246 ownerOrigBoundaryPointNormals0Ptr_.set
248 (pointNormals/(
mag(pointNormals) + vSmall)).ptr()
252 return ownerOrigBoundaryPointNormals0Ptr_();
266 ownerOrigBoundary_(
boundary(ownerOrigPatchIndices())),
267 meshPointOwnerOrigBoundaryPointPtr_(nullptr),
268 ownerOrigBoundaryPointMeshPointPtr_(nullptr),
269 ownerOrigBoundaryEdgeMeshEdgePtr_(nullptr),
270 ownerOrigBoundaryEdgesPtr_(nullptr),
271 ownerOrigBoundaryMeshEdgesPtr_(nullptr),
272 patchPointOwnerOrigBoundaryPointsPtr_(
mesh.boundaryMesh().size()),
273 patchEdgeOwnerOrigBoundaryEdgesPtr_(
mesh.boundaryMesh().size()),
274 ownerOrigBoundaryPointNormalsPtr_(nullptr)
289 ownerOrigBoundary_.clearGeom();
291 ownerOrigBoundaryPointNormalsPtr_.clear();
297 #define TYPE_METHOD(Type, Method) typeMethod<Type>(&Type::Method)
303 nonConformalOtherPatchIndices
315 nonConformalOtherPatchIndices
326 nonConformalOtherPatchIndices
338 nonConformalOtherPatchIndices
352 if (!ownerOrigBoundaryPointMeshPointPtr_.valid())
355 ownerOrigBoundaryPointMeshPointPtr_.set
357 new labelList(ownerOrigBoundary_.meshPoints())
360 meshPointOwnerOrigBoundaryPointPtr_.set
365 labelList& meshPointOwnerOrigBoundaryPoint =
366 meshPointOwnerOrigBoundaryPointPtr_();
368 forAll(ownerOrigBoundary_.meshPoints(), ownerOrigBoundaryPointi)
370 meshPointOwnerOrigBoundaryPoint
371 [ownerOrigBoundary_.meshPoints()[ownerOrigBoundaryPointi]] =
372 ownerOrigBoundaryPointi;
376 label ownerOrigBoundaryPointi = ownerOrigBoundary_.nPoints();
380 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.nEdges();
381 ownerOrigBoundaryEdgei < ownerOrigBoundaryEdgeMeshEdge().size();
382 ++ ownerOrigBoundaryEdgei
385 const label meshEdgei =
386 ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
392 const label meshPointi =
e[i];
394 if (meshPointOwnerOrigBoundaryPoint[meshPointi] == -1)
396 meshPointOwnerOrigBoundaryPoint[meshPointi] =
397 ownerOrigBoundaryPointi ++;
398 remoteMeshPoints.
append(meshPointi);
404 ownerOrigBoundaryPointMeshPointPtr_->append(remoteMeshPoints);
407 return ownerOrigBoundaryPointMeshPointPtr_();
414 if (!ownerOrigBoundaryEdgeMeshEdgePtr_.valid())
417 labelList ownerOrigAndProcPatchIndices = this->ownerOrigPatchIndices();
420 if (isA<processorPolyPatch>(
mesh().boundaryMesh()[
patchi]))
427 boundary(ownerOrigAndProcPatchIndices)
431 labelList ownerOrigAndProcBoundaryMeshEdges
447 ownerOrigBoundary_.
size()
453 ownerOrigAndProcBoundary.
edges(),
461 ownerOrigBoundaryEdgeMeshEdgePtr_.set
465 labelField(ownerOrigAndProcBoundaryMeshEdges, map)
480 ownerOrigAndProcBoundaryMeshEdges,
499 remoteMeshEdges.
append(ownerOrigAndProcBoundaryMeshEdges[i]);
503 ownerOrigBoundaryEdgeMeshEdgePtr_->append(remoteMeshEdges);
506 return ownerOrigBoundaryEdgeMeshEdgePtr_();
513 if (!ownerOrigBoundaryEdgesPtr_.valid())
515 ownerOrigBoundaryEdgesPtr_.set
517 new edgeList(ownerOrigBoundary_.edges())
520 ownerOrigBoundaryPointMeshPoint();
521 const labelList& meshPointOwnerOrigBoundaryPoint =
522 meshPointOwnerOrigBoundaryPointPtr_();
527 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.nEdges();
528 ownerOrigBoundaryEdgei < ownerOrigBoundaryEdgeMeshEdge().size();
529 ++ ownerOrigBoundaryEdgei
532 const label meshEdgei =
533 ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
541 meshPointOwnerOrigBoundaryPoint[
e.start()],
542 meshPointOwnerOrigBoundaryPoint[
e.end()]
547 ownerOrigBoundaryEdgesPtr_->append(remoteEdges);
550 return ownerOrigBoundaryEdgesPtr_();
557 if (!ownerOrigBoundaryMeshEdgesPtr_.valid())
559 const edgeList& edges = ownerOrigBoundaryEdges();
562 ownerOrigBoundaryPointMeshPoint();
564 ownerOrigBoundaryMeshEdgesPtr_.set
571 ownerOrigBoundaryMeshEdgesPtr_()[edgei] =
574 pointMeshPoint[edges[edgei].start()],
575 pointMeshPoint[edges[edgei].end()]
580 return ownerOrigBoundaryMeshEdgesPtr_();
590 if (!patchPointOwnerOrigBoundaryPointsPtr_.set(
patchi))
594 ownerOrigBoundaryPointMeshPoint();
595 const labelList& meshPointOwnerOrigBoundaryPoint =
596 meshPointOwnerOrigBoundaryPointPtr_();
598 const faceList patchOwnerOrigBoundaryLocalFaces
602 meshPointOwnerOrigBoundaryPoint,
610 ownerOrigBoundary_.localPoints()
613 patchPointOwnerOrigBoundaryPointsPtr_.set
619 patchEdgeOwnerOrigBoundaryEdgesPtr_.set
626 ownerOrigBoundary_.edges(),
627 ownerOrigBoundary_.pointEdges()
635 const labelList& ppPointOwnerOrigBoundaryPoints =
636 patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
640 const label ownerOrigBoundaryPointi =
641 ppPointOwnerOrigBoundaryPoints[ppPointi];
646 != ownerOrigBoundary_.meshPoints()[ownerOrigBoundaryPointi]
650 <<
"Patch point does not match all boundary point"
655 const labelList& ppEdgeOwnerOrigBoundaryEdges =
656 patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
660 const label ownerOrigBoundaryEdgei =
661 ppEdgeOwnerOrigBoundaryEdges[ppEdgei];
666 !=
meshEdge(ownerOrigBoundary_, ownerOrigBoundaryEdgei)
670 <<
"Patch edge does not match all boundary edge"
677 return patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
687 if (!patchEdgeOwnerOrigBoundaryEdgesPtr_.set(
patchi))
689 patchPointOwnerOrigBoundaryPoints(
patchi);
692 return patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
706 ownerOrigBoundaryPointNormals(),
707 patchPointOwnerOrigBoundaryPoints(
patchi)
724 ownerOrigBoundaryPointNormals0(),
725 patchPointOwnerOrigBoundaryPoints(
patchi)
#define forAll(list, i)
Loop across all elements in list.
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
const polyMesh & mesh() const
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool insert(const Key &key)
Insert a new entry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
label nEdges() const
Return number of edges in patch.
const labelListList & pointEdges() const
Return point-edge addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
void append(T *)
Append an element at the end of the list.
A List obtained as a section of another List.
A List with indirect addressing.
label size() const
Return the number of elements in the UList.
label size() const
Return the number of elements in the UPtrList.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
A class for managing temporary objects.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
Addressing for a faceList slice.
edge meshEdge(const PrimitivePatch< FaceList, PointField > &p, const label edgei)
defineTypeNameAndDebug(combustionModel, 0)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< label > labelField
Specialisation of Field<T> for label.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
faceListList boundary(nPatches)