Go to the documentation of this file.
27 #include "triSurface.H"
54 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
58 const edge&
e = edges[edgeI];
60 os <<
"l " <<
e.start()+1 <<
' ' <<
e.end()+1 <<
endl;
78 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
82 const edge&
e = edges[edgeLabels[i]];
84 os <<
"l " <<
e.start()+1 <<
' ' <<
e.end()+1 <<
endl;
116 pEdges0[pointNEdges[
e[0]]++] = edgeI;
119 pEdges1[pointNEdges[
e[1]]++] = edgeI;
130 const bool isFirstSurface,
135 nSurfacePoints_(surf.
nPoints()),
137 nSurfaceEdges_(surf.
nEdges()),
139 faceEdges_(surf.
size()),
140 pointEdges_(points_.size())
151 points_[pointI++] = surfPoints[i];
158 points_[pointI++] = cutPoints[i];
176 const edge&
e = surfEdges[edgeI];
182 label freeNewEdgeI = allEdges.size();
184 if (extraVerts.empty())
199 extraVerts[0] + nSurfacePoints_
203 for (
label extraI = 1; extraI < extraVerts.
size(); extraI++)
209 extraVerts[extraI-1] + nSurfacePoints_,
210 extraVerts[extraI] + nSurfacePoints_
218 extraVerts.last() + nSurfacePoints_,
229 for (
label eI = freeNewEdgeI; eI < allEdges.size(); eI++)
231 allParentEdges.
append(edgeI);
235 allFaceEdges[myFaces[myFaceI]].
append(eI);
241 nSurfaceEdges_ = allEdges.size();
250 const edge&
e = cutEdges[i];
252 allEdges.
append(
edge(
e[0] + nSurfacePoints_,
e[1] + nSurfacePoints_));
264 const label edgeI = iter();
281 allFaceEdges[faceI].
append(edgeI + nSurfaceEdges_);
285 edges_.transfer(allEdges);
286 parentEdges_.transfer(allParentEdges);
288 forAll(allFaceEdges, faceI)
290 faceEdges_[faceI].transfer(allFaceEdges[faceI]);
302 Pout<<
"edgeSurface : Dumping faceEdges to files" <<
endl;
306 const labelList& fEdges = faceEdges_[faceI];
308 if (fEdges.
size() != 3)
311 Pout<<
"edgeSurface : Dumping faceEdges for face " << faceI
312 <<
" to " << faceFName <<
endl;
315 writeOBJ(points_, edges_, fEdges, fStream);
319 Pout<<
"edgeSurface : Dumping edges to edges.obj" <<
endl;
323 Pout<<
"edgeSurface : Dumping intersectionEdges to"
324 <<
" intersectionEdges.obj" <<
endl;
325 OFstream intEdgesStream(
"intersectionEdges.obj");
327 labelList edgeLabels(edges_.size() - nSurfaceEdges_);
330 for (
label edgeI = nSurfaceEdges_; edgeI < edges_.size(); edgeI++)
332 edgeLabels[i++] = edgeI;
335 writeOBJ(points_, edges_, edgeLabels, intEdgesStream);
350 Pout<<
"Old face consisted of edges:" <<
endl;
352 const labelList& fEdges = faceEdges_[faceI];
355 const edge&
e = edges_[fEdges[i]];
357 Pout<<
" " << fEdges[i] <<
' ' <<
e
358 << points_[
e.start()] <<
' ' << points_[
e.end()] <<
endl;
363 const label oldNEdges = edges_.size();
365 edges_.setSize(oldNEdges + additionalEdges.
size());
368 label newEdgeI = oldNEdges;
370 forAll(additionalEdges, i)
372 edges_[newEdgeI] = additionalEdges[i];
384 forAll(additionalEdges, i)
386 fEdges[nFEdges++] = oldNEdges + i;
396 const labelList& fEdges = faceEdges_[faceI];
398 Pout<<
"New face consists of edges:" <<
endl;
401 const edge&
e = edges_[fEdges[i]];
403 Pout<<
" " << fEdges[i] <<
' ' <<
e
404 << points_[
e.start()] <<
' ' << points_[
e.end()] <<
endl;
void addIntersectionEdges(const label faceI, const edgeList &)
Add intersection edges to a face. Used for connecting.
const labelPairLookup & facePairToEdge() const
const labelListList & edgeFaces() const
Return edge-face addressing.
labelListList pointEdges_
Constructed from above: pointEdges.
edgeSurface(const triSurface &surf, const bool isFirstSurface, const surfaceIntersection &inter)
Construct from surface and intersection description.
A class for handling file names.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
#define forAll(list, i)
Loop across all elements in list.
void writeOBJ(Ostream &os, label &vertI, const tetPoints &tet)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
const labelListList & edgeCuts(const bool) const
Access either surf1EdgeCuts (isFirstSurface = true) or.
label nEdges() const
Return number of edges in patch.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Ostream & endl(Ostream &os)
Add newline and flush stream.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
Basic surface-surface intersection description. Constructed from two surfaces it creates a descriptio...
Triangulated surface description with patch information.
void append(const T &)
Append an element at the end of the list.
void calcPointEdges()
Calculate pointEdges.
pointField points_
All points (0 .. nSurfacePoints_-1 are points from surface)
const pointField & cutPoints() const
label nPoints() const
Return number of points supporting patch faces.
const double e
Elementary charge.
const edgeList & cutEdges() const
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of List.
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
edgeList edges_
All edges (0 .. nSurfaceEdges_-1 are (possibly split) surface edges)
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
static void writeOBJ(const pointField &, const edgeList &, Ostream &)
Dump edges in obj format.