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]]
64 Foam::nonConformalBoundary::boundary(
const labelList& patches)
const 66 DynamicList<label> faces;
69 const polyPatch& pp = mesh_.boundaryMesh()[patches[i]];
71 faces.append(
identity(pp.size()) + pp.start());
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_();
184 ownerOrigBoundary_(
boundary(ownerOrigPatchIDs())),
185 meshPointOwnerOrigBoundaryPointPtr_(nullptr),
186 ownerOrigBoundaryPointMeshPointPtr_(nullptr),
187 ownerOrigBoundaryEdgeMeshEdgePtr_(nullptr),
188 ownerOrigBoundaryEdgesPtr_(nullptr),
189 ownerOrigBoundaryMeshEdgesPtr_(nullptr),
190 patchPointOwnerOrigBoundaryPointsPtr_(mesh.boundaryMesh().size()),
191 patchEdgeOwnerOrigBoundaryEdgesPtr_(mesh.boundaryMesh().size()),
192 ownerOrigBoundaryPointNormalsPtr_(nullptr)
209 ownerOrigBoundaryPointNormalsPtr_.clear();
230 if (isA<nonConformalCoupledPolyPatch>(pp))
233 refCast<const nonConformalCoupledPolyPatch>(pbm[nccPatchi]);
235 if (side == 1 && !nccPp.
owner())
continue;
237 if (side == -1 && !nccPp.
neighbour())
continue;
242 nonCoupledPatchIDs.append((nccPp.*method)());
247 result.
transfer(nonCoupledPatchIDs);
283 if (!ownerOrigBoundaryPointMeshPointPtr_.valid())
285 ownerOrigBoundaryPointMeshPointPtr_.set
291 meshPointOwnerOrigBoundaryPoint();
292 labelList& map = meshPointOwnerOrigBoundaryPointPtr_();
295 label ownerOrigBoundaryPointi = ownerOrigBoundary_.
nPoints();
301 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.
nEdges();
303 ++ ownerOrigBoundaryEdgei
306 const label meshEdgei =
313 const label meshPointi = e[i];
315 if (map[meshPointi] == -1)
317 map[meshPointi] = ownerOrigBoundaryPointi ++;
318 remotePoints.
append(meshPointi);
324 ownerOrigBoundaryPointMeshPointPtr_->append(remotePoints);
327 return ownerOrigBoundaryPointMeshPointPtr_();
334 if (!ownerOrigBoundaryEdgeMeshEdgePtr_.valid())
342 ownerOrigAndProcPatchIDs.
append(patchi);
347 boundary(ownerOrigAndProcPatchIDs)
351 labelList ownerOrigAndProcBoundaryMeshEdges
367 ownerOrigBoundary_.size()
373 ownerOrigAndProcBoundary.
edges(),
381 ownerOrigBoundaryEdgeMeshEdgePtr_.set
385 labelField(ownerOrigAndProcBoundaryMeshEdges, map)
400 ownerOrigAndProcBoundaryMeshEdges,
419 remoteMeshEdges.
append(ownerOrigAndProcBoundaryMeshEdges[i]);
423 ownerOrigBoundaryEdgeMeshEdgePtr_->append(remoteMeshEdges);
426 return ownerOrigBoundaryEdgeMeshEdgePtr_();
433 if (!ownerOrigBoundaryEdgesPtr_.valid())
435 ownerOrigBoundaryEdgesPtr_.set
440 const labelList& map = meshPointOwnerOrigBoundaryPoint();
446 label ownerOrigBoundaryEdgei = ownerOrigBoundary_.
nEdges();
448 ++ ownerOrigBoundaryEdgei
451 const label meshEdgei =
459 ownerOrigBoundaryEdgesPtr_->append(remoteEdges);
462 return ownerOrigBoundaryEdgesPtr_();
469 if (!ownerOrigBoundaryMeshEdgesPtr_.valid())
476 ownerOrigBoundaryMeshEdgesPtr_.set
483 ownerOrigBoundaryMeshEdgesPtr_()[edgei] =
486 pointMeshPoint[edges[edgei].start()],
487 pointMeshPoint[edges[edgei].end()]
492 return ownerOrigBoundaryMeshEdgesPtr_();
502 if (!patchPointOwnerOrigBoundaryPointsPtr_.set(patchi))
506 const faceList patchOwnerOrigBoundaryLocalFaces
510 meshPointOwnerOrigBoundaryPoint(),
511 static_cast<const faceList&>(pp)
521 patchPointOwnerOrigBoundaryPointsPtr_.set
524 new labelList(ownerOrigBoundaryLocalPatch.meshPoints())
527 patchEdgeOwnerOrigBoundaryEdgesPtr_.set
532 ownerOrigBoundaryLocalPatch.meshEdges
534 ownerOrigBoundary_.
edges(),
543 const labelList& ppPointOwnerOrigBoundaryPoints =
544 patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
548 const label ownerOrigBoundaryPointi =
549 ppPointOwnerOrigBoundaryPoints[ppPointi];
554 != ownerOrigBoundary_.
meshPoints()[ownerOrigBoundaryPointi]
558 <<
"Patch point does not match all boundary point" 563 const labelList& ppEdgeOwnerOrigBoundaryEdges =
564 patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
568 const label ownerOrigBoundaryEdgei =
569 ppEdgeOwnerOrigBoundaryEdges[ppEdgei];
574 !=
meshEdge(ownerOrigBoundary_, ownerOrigBoundaryEdgei)
578 <<
"Patch edge does not match all boundary edge" 585 return patchPointOwnerOrigBoundaryPointsPtr_[
patchi];
595 if (!patchEdgeOwnerOrigBoundaryEdgesPtr_.set(patchi))
600 return patchEdgeOwnerOrigBoundaryEdgesPtr_[
patchi];
614 ownerOrigBoundaryPointNormals(),
632 ownerOrigBoundaryPointNormals0(),
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
const labelListList & pointEdges() const
Return point-edge addressing.
label nPoints() const
Return number of points supporting patch faces.
Field< label > labelField
Specialisation of Field<T> for label.
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const labelListList & pointEdges() const
void size(const label)
Override size to be inconsistent with allocated storage.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
bool insert(const Key &key)
Insert a new entry.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
A list of faces which address into the list of points.
A List obtained as a section of another List.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool found(const Key &) const
Return true if hashedEntry is found in table.
void append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
List< label > labelList
A List of labels.
faceListList boundary(nPatches)
label nEdges() const
Return number of edges in patch.
defineTypeNameAndDebug(combustionModel, 0)
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
Addressing for a faceList slice.
label size() const
Return the number of elements in the UPtrList.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
edge meshEdge(const PrimitivePatch< FaceList, PointField > &p, const label edgei)
label end() const
Return end vertex label.
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
A List with indirect addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
static const Vector< scalar > zero
label start() const
Return start vertex label.