43 void Foam::edgeSurface::writeOBJ
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;
66 void Foam::edgeSurface::writeOBJ
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;
90 void Foam::edgeSurface::calcPointEdges()
92 pointEdges_.setSize(points_.size());
98 const edge&
e = edges_[edgeI];
104 forAll(pointEdges_, pointi)
106 pointEdges_[pointi].setSize(pointNEdges[pointi]);
113 const edge&
e = edges_[edgeI];
116 pEdges0[pointNEdges[
e[0]]++] = edgeI;
119 pEdges1[pointNEdges[
e[1]]++] = edgeI;
130 const bool isFirstSurface,
134 points_(surf.
nPoints() + inter.cutPoints().size()),
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];
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_);
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;
321 writeOBJ(points_, edges_, eStream);
323 Pout<<
"edgeSurface : Dumping intersectionEdges to"
324 <<
" intersectionEdges.obj" <<
endl;
325 OFstream intEdgesStream(
"intersectionEdges.obj");
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;
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
void setSize(const label)
Reset size of List.
label nEdges() const
Return number of edges in patch.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelListList & edgeFaces() const
Return edge-face addressing.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
T & last()
Return the last element of the list.
Description of surface in form of 'cloud of edges'.
void addIntersectionEdges(const label facei, const edgeList &)
Add intersection edges to a face. Used for connecting.
edgeSurface(const triSurface &surf, const bool isFirstSurface, const surfaceIntersection &inter)
Construct from surface and intersection description.
const edgeList & edges() const
const pointField & points() const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling file names.
Basic surface-surface intersection description. Constructed from two surfaces it creates a descriptio...
const edgeList & cutEdges() const
const labelListList & edgeCuts(const bool) const
Access either surf1EdgeCuts (isFirstSurface = true) or.
const labelPairLookup & facePairToEdge() const
const pointField & cutPoints() const
Triangulated surface description with patch information.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")