36 template<
class FaceList,
class Po
intField>
39 const PrimitivePatch<FaceList, PointField>&
p,
45 p.meshPoints()[
p.edges()[edgei][0]],
46 p.meshPoints()[
p.edges()[edgei][1]]
66 DynamicList<label> faces;
77 IndirectList<face>(
mesh().faces(), faces),
84 Foam::nonConformalBoundary::meshPointOwnerOrigBoundaryPoint()
const
86 if (!meshPointOwnerOrigBoundaryPointPtr_.valid())
88 meshPointOwnerOrigBoundaryPointPtr_.set
93 forAll(ownerOrigBoundary_.meshPoints(), ownerOrigBoundaryPointi)
95 meshPointOwnerOrigBoundaryPointPtr_()
96 [ownerOrigBoundary_.meshPoints()[ownerOrigBoundaryPointi]] =
97 ownerOrigBoundaryPointi;
101 return meshPointOwnerOrigBoundaryPointPtr_();
106 Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals()
const
108 if (!ownerOrigBoundaryPointNormalsPtr_.valid())
110 const faceList& faces = ownerOrigBoundary_.localFaces();
111 const vectorField faceNormals = ownerOrigBoundary_.faceNormals();
117 forAll(faces[facei], facePointi)
119 pointNormals[faces[facei][facePointi]] += faceNormals[facei];
126 ownerOrigBoundary_.meshPoints(),
132 ownerOrigBoundaryPointNormalsPtr_.set
134 (pointNormals/(
mag(pointNormals) + vSmall)).ptr()
138 return ownerOrigBoundaryPointNormalsPtr_();
143 Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals0()
const
145 if (!ownerOrigBoundaryPointNormals0Ptr_.valid())
147 const faceList& faces = ownerOrigBoundary_.localFaces();
153 forAll(faces[facei], facePointi)
155 pointNormals[faces[facei][facePointi]] +=
156 faces[facei].normal(mesh().oldPoints());
163 ownerOrigBoundary_.meshPoints(),
169 ownerOrigBoundaryPointNormals0Ptr_.set
171 (pointNormals/(
mag(pointNormals) + vSmall)).ptr()
175 return ownerOrigBoundaryPointNormals0Ptr_();
189 ownerOrigBoundary_(
boundary(ownerOrigPatchIDs())),
190 meshPointOwnerOrigBoundaryPointPtr_(nullptr),
191 ownerOrigBoundaryPointMeshPointPtr_(nullptr),
192 ownerOrigBoundaryEdgeMeshEdgePtr_(nullptr),
193 ownerOrigBoundaryEdgesPtr_(nullptr),
194 ownerOrigBoundaryMeshEdgesPtr_(nullptr),
195 patchPointOwnerOrigBoundaryPointsPtr_(mesh.boundaryMesh().size()),
196 patchEdgeOwnerOrigBoundaryEdgesPtr_(mesh.boundaryMesh().size()),
197 ownerOrigBoundaryPointNormalsPtr_(nullptr)
212 ownerOrigBoundary_.clearGeom();
214 ownerOrigBoundaryPointNormalsPtr_.clear();
235 if (isA<nonConformalCoupledPolyPatch>(pp))
238 refCast<const nonConformalCoupledPolyPatch>(pbm[nccPatchi]);
240 if (side == 1 && !nccPp.
owner())
continue;
242 if (side == -1 && !nccPp.
neighbour())
continue;
247 nonCoupledPatchIDs.
append((nccPp.*method)());
252 result.
transfer(nonCoupledPatchIDs);
260 return nonConformalNonCoupledPatchIDs(0, method);
267 return nonConformalNonCoupledPatchIDs(0, method);
274 return nonConformalNonCoupledPatchIDs(1, method);
281 return nonConformalNonCoupledPatchIDs(1, method);
288 if (!ownerOrigBoundaryPointMeshPointPtr_.valid())
290 ownerOrigBoundaryPointMeshPointPtr_.set
292 new labelList(ownerOrigBoundary_.meshPoints())
296 meshPointOwnerOrigBoundaryPoint();
297 labelList& map = meshPointOwnerOrigBoundaryPointPtr_();
300 label ownerOrigBoundaryPointi = ownerOrigBoundary_.nPoints();
306 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.nEdges();
307 ownerOrigBoundaryEdgei < ownerOrigBoundaryEdgeMeshEdge().size();
308 ++ ownerOrigBoundaryEdgei
311 const label meshEdgei =
312 ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
314 const edge&
e = mesh().edges()[meshEdgei];
318 const label meshPointi =
e[i];
320 if (map[meshPointi] == -1)
322 map[meshPointi] = ownerOrigBoundaryPointi ++;
323 remotePoints.
append(meshPointi);
329 ownerOrigBoundaryPointMeshPointPtr_->append(remotePoints);
332 return ownerOrigBoundaryPointMeshPointPtr_();
339 if (!ownerOrigBoundaryEdgeMeshEdgePtr_.valid())
342 labelList ownerOrigAndProcPatchIDs = this->ownerOrigPatchIDs();
345 if (isA<processorPolyPatch>(mesh().boundaryMesh()[
patchi]))
356 labelList ownerOrigAndProcBoundaryMeshEdges
372 ownerOrigBoundary_.
size()
378 ownerOrigAndProcBoundary.
edges(),
386 ownerOrigBoundaryEdgeMeshEdgePtr_.set
390 labelField(ownerOrigAndProcBoundaryMeshEdges, map)
405 ownerOrigAndProcBoundaryMeshEdges,
424 remoteMeshEdges.
append(ownerOrigAndProcBoundaryMeshEdges[i]);
428 ownerOrigBoundaryEdgeMeshEdgePtr_->append(remoteMeshEdges);
431 return ownerOrigBoundaryEdgeMeshEdgePtr_();
438 if (!ownerOrigBoundaryEdgesPtr_.valid())
440 ownerOrigBoundaryEdgesPtr_.set
442 new edgeList(ownerOrigBoundary_.edges())
445 const labelList& map = meshPointOwnerOrigBoundaryPoint();
451 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.nEdges();
452 ownerOrigBoundaryEdgei < ownerOrigBoundaryEdgeMeshEdge().size();
453 ++ ownerOrigBoundaryEdgei
456 const label meshEdgei =
457 ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
459 const edge&
e = mesh().edges()[meshEdgei];
464 ownerOrigBoundaryEdgesPtr_->append(remoteEdges);
467 return ownerOrigBoundaryEdgesPtr_();
474 if (!ownerOrigBoundaryMeshEdgesPtr_.valid())
476 const edgeList& edges = ownerOrigBoundaryEdges();
479 ownerOrigBoundaryPointMeshPoint();
481 ownerOrigBoundaryMeshEdgesPtr_.set
488 ownerOrigBoundaryMeshEdgesPtr_()[edgei] =
491 pointMeshPoint[edges[edgei].start()],
492 pointMeshPoint[edges[edgei].end()]
497 return ownerOrigBoundaryMeshEdgesPtr_();
507 if (!patchPointOwnerOrigBoundaryPointsPtr_.set(
patchi))
511 const faceList patchOwnerOrigBoundaryLocalFaces
515 meshPointOwnerOrigBoundaryPoint(),
523 ownerOrigBoundary_.localPoints()
526 patchPointOwnerOrigBoundaryPointsPtr_.set
532 patchEdgeOwnerOrigBoundaryEdgesPtr_.set
539 ownerOrigBoundary_.edges(),
540 ownerOrigBoundary_.pointEdges()
548 const labelList& ppPointOwnerOrigBoundaryPoints =
549 patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
553 const label ownerOrigBoundaryPointi =
554 ppPointOwnerOrigBoundaryPoints[ppPointi];
559 != ownerOrigBoundary_.meshPoints()[ownerOrigBoundaryPointi]
563 <<
"Patch point does not match all boundary point"
568 const labelList& ppEdgeOwnerOrigBoundaryEdges =
569 patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
573 const label ownerOrigBoundaryEdgei =
574 ppEdgeOwnerOrigBoundaryEdges[ppEdgei];
579 !=
meshEdge(ownerOrigBoundary_, ownerOrigBoundaryEdgei)
583 <<
"Patch edge does not match all boundary edge"
590 return patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
600 if (!patchEdgeOwnerOrigBoundaryEdgesPtr_.set(
patchi))
602 patchPointOwnerOrigBoundaryPoints(
patchi);
605 return patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
619 ownerOrigBoundaryPointNormals(),
620 patchPointOwnerOrigBoundaryPoints(
patchi)
637 ownerOrigBoundaryPointNormals0(),
638 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 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.
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)