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::meshPointOwnerOrigBoundaryPoint()
const
185 if (!meshPointOwnerOrigBoundaryPointPtr_.valid())
187 meshPointOwnerOrigBoundaryPointPtr_.set
192 forAll(ownerOrigBoundary_.meshPoints(), ownerOrigBoundaryPointi)
194 meshPointOwnerOrigBoundaryPointPtr_()
195 [ownerOrigBoundary_.meshPoints()[ownerOrigBoundaryPointi]] =
196 ownerOrigBoundaryPointi;
200 return meshPointOwnerOrigBoundaryPointPtr_();
205 Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals()
const
207 if (!ownerOrigBoundaryPointNormalsPtr_.valid())
209 const faceList& faces = ownerOrigBoundary_.localFaces();
210 const vectorField faceNormals = ownerOrigBoundary_.faceNormals();
216 forAll(faces[facei], facePointi)
218 pointNormals[faces[facei][facePointi]] += faceNormals[facei];
225 ownerOrigBoundary_.meshPoints(),
231 ownerOrigBoundaryPointNormalsPtr_.set
233 (pointNormals/(
mag(pointNormals) + vSmall)).ptr()
237 return ownerOrigBoundaryPointNormalsPtr_();
242 Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals0()
const
244 if (!ownerOrigBoundaryPointNormals0Ptr_.valid())
246 const faceList& faces = ownerOrigBoundary_.localFaces();
252 forAll(faces[facei], facePointi)
254 pointNormals[faces[facei][facePointi]] +=
255 faces[facei].normal(mesh().oldPoints());
262 ownerOrigBoundary_.meshPoints(),
268 ownerOrigBoundaryPointNormals0Ptr_.set
270 (pointNormals/(
mag(pointNormals) + vSmall)).ptr()
274 return ownerOrigBoundaryPointNormals0Ptr_();
288 ownerOrigBoundary_(
boundary(ownerOrigPatchIndices())),
289 meshPointOwnerOrigBoundaryPointPtr_(nullptr),
290 ownerOrigBoundaryPointMeshPointPtr_(nullptr),
291 ownerOrigBoundaryEdgeMeshEdgePtr_(nullptr),
292 ownerOrigBoundaryEdgesPtr_(nullptr),
293 ownerOrigBoundaryMeshEdgesPtr_(nullptr),
294 patchPointOwnerOrigBoundaryPointsPtr_(mesh.boundaryMesh().size()),
295 patchEdgeOwnerOrigBoundaryEdgesPtr_(mesh.boundaryMesh().size()),
296 ownerOrigBoundaryPointNormalsPtr_(nullptr)
311 ownerOrigBoundary_.clearGeom();
313 ownerOrigBoundaryPointNormalsPtr_.clear();
319 #define TYPE_METHOD(Type, Method) typeMethod<Type>(&Type::Method)
325 nonConformalOtherPatchIndices
337 nonConformalOtherPatchIndices
348 nonConformalOtherPatchIndices
360 nonConformalOtherPatchIndices
374 if (!ownerOrigBoundaryPointMeshPointPtr_.valid())
376 ownerOrigBoundaryPointMeshPointPtr_.set
378 new labelList(ownerOrigBoundary_.meshPoints())
382 meshPointOwnerOrigBoundaryPoint();
383 labelList& map = meshPointOwnerOrigBoundaryPointPtr_();
386 label ownerOrigBoundaryPointi = ownerOrigBoundary_.nPoints();
392 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.nEdges();
393 ownerOrigBoundaryEdgei < ownerOrigBoundaryEdgeMeshEdge().size();
394 ++ ownerOrigBoundaryEdgei
397 const label meshEdgei =
398 ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
400 const edge&
e = mesh().edges()[meshEdgei];
404 const label meshPointi =
e[i];
406 if (map[meshPointi] == -1)
408 map[meshPointi] = ownerOrigBoundaryPointi ++;
409 remotePoints.
append(meshPointi);
415 ownerOrigBoundaryPointMeshPointPtr_->append(remotePoints);
418 return ownerOrigBoundaryPointMeshPointPtr_();
425 if (!ownerOrigBoundaryEdgeMeshEdgePtr_.valid())
428 labelList ownerOrigAndProcPatchIndices = this->ownerOrigPatchIndices();
431 if (isA<processorPolyPatch>(mesh().boundaryMesh()[
patchi]))
438 boundary(ownerOrigAndProcPatchIndices)
442 labelList ownerOrigAndProcBoundaryMeshEdges
458 ownerOrigBoundary_.
size()
464 ownerOrigAndProcBoundary.
edges(),
472 ownerOrigBoundaryEdgeMeshEdgePtr_.set
476 labelField(ownerOrigAndProcBoundaryMeshEdges, map)
491 ownerOrigAndProcBoundaryMeshEdges,
510 remoteMeshEdges.
append(ownerOrigAndProcBoundaryMeshEdges[i]);
514 ownerOrigBoundaryEdgeMeshEdgePtr_->append(remoteMeshEdges);
517 return ownerOrigBoundaryEdgeMeshEdgePtr_();
524 if (!ownerOrigBoundaryEdgesPtr_.valid())
526 ownerOrigBoundaryEdgesPtr_.set
528 new edgeList(ownerOrigBoundary_.edges())
531 const labelList& map = meshPointOwnerOrigBoundaryPoint();
537 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.nEdges();
538 ownerOrigBoundaryEdgei < ownerOrigBoundaryEdgeMeshEdge().size();
539 ++ ownerOrigBoundaryEdgei
542 const label meshEdgei =
543 ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
545 const edge&
e = mesh().edges()[meshEdgei];
550 ownerOrigBoundaryEdgesPtr_->append(remoteEdges);
553 return ownerOrigBoundaryEdgesPtr_();
560 if (!ownerOrigBoundaryMeshEdgesPtr_.valid())
562 const edgeList& edges = ownerOrigBoundaryEdges();
565 ownerOrigBoundaryPointMeshPoint();
567 ownerOrigBoundaryMeshEdgesPtr_.set
574 ownerOrigBoundaryMeshEdgesPtr_()[edgei] =
577 pointMeshPoint[edges[edgei].start()],
578 pointMeshPoint[edges[edgei].end()]
583 return ownerOrigBoundaryMeshEdgesPtr_();
593 if (!patchPointOwnerOrigBoundaryPointsPtr_.set(
patchi))
597 const faceList patchOwnerOrigBoundaryLocalFaces
601 meshPointOwnerOrigBoundaryPoint(),
609 ownerOrigBoundary_.localPoints()
612 patchPointOwnerOrigBoundaryPointsPtr_.set
618 patchEdgeOwnerOrigBoundaryEdgesPtr_.set
625 ownerOrigBoundary_.edges(),
626 ownerOrigBoundary_.pointEdges()
634 const labelList& ppPointOwnerOrigBoundaryPoints =
635 patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
639 const label ownerOrigBoundaryPointi =
640 ppPointOwnerOrigBoundaryPoints[ppPointi];
645 != ownerOrigBoundary_.meshPoints()[ownerOrigBoundaryPointi]
649 <<
"Patch point does not match all boundary point"
654 const labelList& ppEdgeOwnerOrigBoundaryEdges =
655 patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
659 const label ownerOrigBoundaryEdgei =
660 ppEdgeOwnerOrigBoundaryEdges[ppEdgei];
665 !=
meshEdge(ownerOrigBoundary_, ownerOrigBoundaryEdgei)
669 <<
"Patch edge does not match all boundary edge"
676 return patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
686 if (!patchEdgeOwnerOrigBoundaryEdgesPtr_.set(
patchi))
688 patchPointOwnerOrigBoundaryPoints(
patchi);
691 return patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
705 ownerOrigBoundaryPointNormals(),
706 patchPointOwnerOrigBoundaryPoints(
patchi)
723 ownerOrigBoundaryPointNormals0(),
724 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 polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
A class for managing temporary objects.
#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.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
Addressing for a faceList slice.
edge meshEdge(const PrimitivePatch< FaceList, PointField > &p, const label edgei)
dimensioned< scalar > mag(const dimensioned< Type > &)
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)