43 void Foam::edgeSurface::writeOBJ
52 const point& pt = points[pointi];
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
76 const point& pt = points[pointi];
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,
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;
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;
label nPoints() const
Return number of points supporting patch faces.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Basic surface-surface intersection description. Constructed from two surfaces it creates a descriptio...
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
const labelListList & edgeCuts(const bool) const
Access either surf1EdgeCuts (isFirstSurface = true) or.
edgeSurface(const triSurface &surf, const bool isFirstSurface, const surfaceIntersection &inter)
Construct from surface and intersection description.
const edgeList & cutEdges() const
vectorField pointField
pointField is a vectorField.
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...
void transfer(const FixedList< T, Size > &)
Copy (not transfer) the argument contents.
void append(const T &)
Append an element at the end of the list.
const labelPairLookup & facePairToEdge() const
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
List< label > labelList
A List of labels.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void addIntersectionEdges(const label facei, const edgeList &)
Add intersection edges to a face. Used for connecting.
label nEdges() const
Return number of edges in patch.
defineTypeNameAndDebug(combustionModel, 0)
const pointField & cutPoints() const
word name(const complex &)
Return a string representation of a complex.
void setSize(const label)
Reset size of List.
vector point
Point is a vector.
label end() const
Return end vertex label.
prefixOSstream Pout(cout, "Pout")
T & last()
Return the last element of the list.
Triangulated surface description with patch information.
label start() const
Return start vertex label.