38 template<
class T,
class ListType>
47 template<
class T,
class NotT,
class ListType>
59 template<
class T,
class ListType>
65 if (lst[iOld] != value)
67 lst[iNew] = lst[iOld];
74 template<
class ListType>
78 const typename ListType::value_type& defaultValue,
83 ListType newLst(size, defaultValue);
87 if (oldToNew[elemI] >= 0)
89 newLst[oldToNew[elemI]] = lst[elemI];
101 template<
class SrcPatchType,
class TgtPatchType>
104 const SrcPatchType& srcPatch,
105 const TgtPatchType& tgtPatch,
113 template<
class SrcPatchType,
class TgtPatchType>
116 const SrcPatchType& srcPatch,
118 const TgtPatchType& tgtPatch,
127 << this->
srcPatch_.size() <<
" source faces and "
172 triEngine.triangulate
177 srcTriSrcFaces.
resize(srcTris.
size(), srcFacei);
182 const face tgtFacePoints = this->
tgtPatch_[tgtFacei].reverseFace();
185 triEngine.triangulate
190 tgtTriTgtFaces.
resize(tgtTris.
size(), tgtFacei);
193 for (
label i = 0; i <
n; ++ i)
195 tgtTris[tgtTris.
size() -
n + i] =
196 tgtTris[tgtTris.
size() -
n + i].reverseFace();
197 tgtTriTgtEdges[tgtTris.
size() -
n + i] =
204 this->srcPatch_.points()
209 this->tgtPatch_.points()
224 srcTriPatchPointSrcPatchPoints =
232 tgtTriPatchPointTgtPatchPoints =
240 forAll(srcTriPatch, srcTrii)
242 forAll(srcTriPatch[srcTrii], srcTriEdgei)
244 const label srcTriPatchEdgei =
245 srcTriPatch.
faceEdges()[srcTrii][srcTriEdgei];
246 const label srcPatchEdgei = srcTriSrcEdges[srcTrii][srcTriEdgei];
247 srcTriPatchEdgeSrcPatchEdges[srcTriPatchEdgei] = srcPatchEdgei;
250 forAll(tgtTriPatch, tgtTrii)
252 forAll(tgtTriPatch[tgtTrii], tgtTriEdgei)
254 const label tgtTriPatchEdgei =
255 tgtTriPatch.
faceEdges()[tgtTrii][tgtTriEdgei];
256 const label tgtPatchEdgei = tgtTriTgtEdges[tgtTrii][tgtTriEdgei];
257 tgtTriPatchEdgeTgtPatchEdges[tgtTriPatchEdgei] = tgtPatchEdgei;
265 vectorField(srcPointNormals, srcTriPatchPointSrcPatchPoints),
280 srcTriPatchPointSrcPatchPoints,
288 tgtTriPatchPointTgtPatchPoints,
302 srcTriPatchEdgeSrcPatchEdges,
311 tgtTriPatchEdgeTgtPatchEdges,
327 auto setFaceDiagonalPoints = []
337 const labelList& triis = edgeTris[edgei];
339 if (triis.
size() != 2)
344 const label facei0 = triFaces[triis[0]];
345 const label facei1 = triFaces[triis[1]];
347 if (facei0 != facei1)
352 const label facei = facei0;
356 label edgePointi = 1;
357 edgePointi < edgePoints[edgei].
size() - 1;
361 const label pointi = edgePoints[edgei][edgePointi];
363 pointFaces[pointi] = facei;
367 setFaceDiagonalPoints
374 setFaceDiagonalPoints
394 if (tpiFaceCombined[tpiFacei])
continue;
397 const label srcFacei =
401 const label tgtFacei =
409 srcFacei != -1 && tgtFacei != -1
419 [&](
const label tpiEdgei,
const label tpiFacei)
426 ? srcTriSrcFaces[tpiSrcFacei] == srcFacei
431 ? tgtTriTgtFaces[tpiTgtFacei] == tgtFacei
442 tpiFaceCombined[tpiFacei] =
true;
460 const label tpiEdgeFacei =
461 tpiEdgeFaces[tpiEdgei][0] == -1
464 const label tpiFacei = tpiEdgeFaces[tpiEdgei][tpiEdgeFacei];
465 const label tpiFaceEdgei =
466 findIndex(tpiFaceEdges[tpiFacei], tpiEdgei);
469 tpi.
faces()[tpiFacei].faceEdge(tpiFaceEdgei).start();
483 ++ pointNFaces[
f[fPointi]];
495 pointNFaces[pointj] > 2
497 pointNFaces[pointj] > 0
509 oldPointNewPoints[pointj] = pointi;
553 template<
class SrcPatchType,
class TgtPatchType>
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void resize(const label)
Alter the addressed list size.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Patch intersection based on polygonal faces. This triangulates the supplied patches and passes them t...
FacePatchIntersection(const SrcPatchType &srcPatch, const TgtPatchType &tgtPatch, const scalar snapTol)
Construct from a source and a target patch.
virtual word type() const
virtual ~FacePatchIntersection()
Destructor.
void size(const label)
Override size to be inconsistent with allocated storage.
Base class for patch intersections. Provides storage and access to the intersection points and faces ...
const SrcPatchType & srcPatch() const
The source patch.
const SrcPatchType & srcPatch_
Reference to the source patch.
const TgtPatchType & tgtPatch() const
The target patch.
const TgtPatchType & tgtPatch_
Reference to the target patch.
A list of faces which address into the list of points.
label nEdges() const
Return number of edges in patch.
label nPoints() const
Return number of points supporting patch faces.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const labelListList & edgeFaces() const
Return edge-face addressing.
const labelListList & faceEdges() const
Return face-edge addressing.
A List obtained as a section of another List.
Patch intersection based on triangular faces. Intersects and combines two triangulated patches increm...
const DynamicList< labelPair > & intersectEdgeFaces() const
...
const DynamicList< labelList > & faceEdges() const
...
const DynamicList< labelPair > & nonIntersectEdgeFaces() const
...
A List with indirect addressing.
Starts timing CPU usage and return elapsed time from start.
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
const DynamicList< label > & pointSrcFaces() const
The intersection points' source faces, or -1 if the point.
DynamicList< label > pointTgtFaces_
The intersection points' target faces, or -1 if the point.
List< DynamicList< label > > tgtFaceFaces_
The target faces' intersection faces.
const DynamicList< label > & pointSrcPoints() const
The intersection points' corresponding source points, or -1.
const DynamicList< label > & faceSrcFaces() const
The intersection faces' corresponding source faces, or -1.
const List< DynamicList< label > > & tgtEdgePoints() const
The target edges' intersection points. Ordered along the edge.
DynamicField< point > points_
The intersection points.
const faceList & faces() const
The intersection faces.
DynamicList< label > pointTgtPoints_
The intersection points' corresponding target points, or -1.
List< DynamicList< label > > tgtEdgePoints_
The target edges' intersection points. Ordered along the edge.
void report(const word &writeSuffix=word::null)
Report properties of the intersection process.
DynamicList< label > pointSrcPoints_
The intersection points' corresponding source points, or -1.
const labelList & srcPointPoints() const
The source points' corresponding intersection points.
const DynamicList< label > & pointSrcEdges() const
The intersection points' source edges, or -1 if the point.
const DynamicList< label > & faceTgtFaces() const
The intersection faces' corresponding target faces, or -1.
const DynamicList< label > & pointTgtFaces() const
The intersection points' target faces, or -1 if the point.
List< DynamicList< label > > srcEdgePoints_
The source edges' intersection points. Ordered along the edge.
labelList srcPointPoints_
The source points' corresponding intersection points.
DynamicList< label > pointSrcFaces_
The intersection points' source faces, or -1 if the point.
DynamicList< label > pointSrcEdges_
The intersection points' source edges, or -1 if the point.
const DynamicList< label > & pointTgtEdges() const
The intersection points' target edges, or -1 if the point.
DynamicList< face > faces_
The intersection faces.
DynamicList< label > faceTgtFaces_
The intersection faces' corresponding target faces, or -1.
const labelList & tgtPointPoints() const
The target points' corresponding intersection points.
const pointField & points() const
The intersection points.
const List< DynamicList< label > > & srcEdgePoints() const
The source edges' intersection points. Ordered along the edge.
const DynamicList< label > & pointTgtPoints() const
The intersection points' corresponding target points, or -1.
labelList tgtPointPoints_
The target points' corresponding intersection points.
List< DynamicList< label > > srcFaceFaces_
The source faces' intersection faces.
DynamicList< label > faceSrcFaces_
The intersection faces' corresponding source faces, or -1.
DynamicList< label > pointTgtEdges_
The intersection points' target edges, or -1 if the point.
Triangulation of three-dimensional polygons.
const UList< FixedList< label, 3 > > & triEdges() const
Get the triangles' edges.
const UList< triFace > & triPoints() const
Get the triangles' points.
Context class. Returned by populate and resets the star when it.
Engine for constructing a star-shaped domain by walking.
const DynamicList< edgeLink > & starEdgeEdges() const
Access the star-edge-edges.
const DynamicList< label > & faceStarFaces() const
Access the face-star-faces.
context populate(const label faceOrEdgei, const bool isFace, CanCross canCross, const UList< FaceEdges > &faceEdges, const UList< labelPair > &edgeFaces, const label maxIterations=labelMax)
Populate the star given a seed face or edge, a function.
void write(const fileName &file, const word &title, const bool binary, const PointField &points, const VertexList &vertices, const LineList &lines, const FaceList &faces, const wordList &fieldNames, const boolList &fieldIsPointValues, const UPtrList< const Field< label >> &fieldLabelValues #define FieldTypeValuesConstArg(Type, nullArg))
Write VTK polygonal data to a file. Takes a PtrList of fields of labels and.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void inplaceRemove(ListType &lst, const T &value)
ListType reverseList(const ListType &list)
Reverse a list. First element becomes last element etc.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
ListType reorder(const label size, const typename ListType::value_type &defaultValue, const labelUList &oldToNew, const ListType &lst)
List< labelList > labelListList
A List of labelList.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< vector > vectorField
Specialisation of Field<T> for vector.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
Ostream & indent(Ostream &os)
Indent stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define forAllStarFaces(star, starFacei, facei)
#define forAllStarEdges(star, i, starEdgei, edgei)