Go to the documentation of this file.
46 const point& pt = pts[i];
47 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
65 const edge&
e = edges[edgeLabels[i]];
67 os <<
"l " <<
e.start()+1 <<
' ' <<
e.end()+1 <<
endl;
77 void Foam::edgeSurface::calcPointEdges()
79 pointEdges_.
setSize(points_.size());
85 const edge&
e = edges_[edgeI];
91 forAll(pointEdges_, pointi)
93 pointEdges_[pointi].
setSize(pointNEdges[pointi]);
100 const edge&
e = edges_[edgeI];
103 pEdges0[pointNEdges[
e[0]]++] = edgeI;
106 pEdges1[pointNEdges[
e[1]]++] = edgeI;
117 const bool isFirstSurface,
122 nSurfacePoints_(surf.
nPoints()),
124 nSurfaceEdges_(surf.
nEdges()),
126 faceEdges_(surf.size()),
127 pointEdges_(points_.size())
138 points_[pointi++] = surfPoints[i];
145 points_[pointi++] = cutPoints[i];
163 const edge&
e = surfEdges[edgeI];
169 label freeNewEdgeI = allEdges.size();
171 if (extraVerts.empty())
186 extraVerts[0] + nSurfacePoints_
190 for (label extraI = 1; extraI < extraVerts.size(); extraI++)
196 extraVerts[extraI-1] + nSurfacePoints_,
197 extraVerts[extraI] + nSurfacePoints_
205 extraVerts.last() + nSurfacePoints_,
216 for (label eI = freeNewEdgeI; eI < allEdges.size(); eI++)
218 allParentEdges.
append(edgeI);
222 allFaceEdges[myFaces[myFacei]].append(eI);
228 nSurfaceEdges_ = allEdges.size();
237 const edge&
e = cutEdges[i];
239 allEdges.
append(
edge(
e[0] + nSurfacePoints_,
e[1] + nSurfacePoints_));
249 const label facei = iter.key()[isFirstSurface ? 0 : 1];
252 const label edgeI = iter.val();
255 allFaceEdges[facei].append(edgeI + nSurfaceEdges_);
259 edges_.transfer(allEdges);
260 parentEdges_.transfer(allParentEdges);
262 forAll(allFaceEdges, facei)
264 faceEdges_[facei].transfer(allFaceEdges[facei]);
276 Pout<<
"edgeSurface : Dumping faceEdges to files" <<
endl;
280 const labelList& fEdges = faceEdges_[facei];
282 if (fEdges.size() != 3)
285 Pout<<
"edgeSurface : Dumping faceEdges for face " << facei
286 <<
" to " << faceFName <<
endl;
293 Pout<<
"edgeSurface : Dumping edges to edges.obj" <<
endl;
296 Pout<<
"edgeSurface : Dumping intersectionEdges to"
297 <<
" intersectionEdges.obj" <<
endl;
299 OFstream intEdgesStream(
"intersectionEdges.obj");
300 labelList edgeLabels(edges_.size() - nSurfaceEdges_);
303 for (label edgeI = nSurfaceEdges_; edgeI < edges_.size(); edgeI++)
305 edgeLabels[i++] = edgeI;
323 Pout<<
"Old face consisted of edges:" <<
endl;
325 const labelList& fEdges = faceEdges_[facei];
328 const edge&
e = edges_[fEdges[i]];
330 Pout<<
" " << fEdges[i] <<
' ' <<
e
331 << points_[
e.start()] <<
' ' << points_[
e.end()] <<
endl;
336 const label oldNEdges = edges_.size();
338 edges_.setSize(oldNEdges + additionalEdges.size());
341 label newEdgeI = oldNEdges;
343 forAll(additionalEdges, i)
345 edges_[newEdgeI] = additionalEdges[i];
353 label nFEdges = fEdges.size();
355 fEdges.
setSize(nFEdges + additionalEdges.size());
357 forAll(additionalEdges, i)
359 fEdges[nFEdges++] = oldNEdges + i;
369 const labelList& fEdges = faceEdges_[facei];
371 Pout<<
"New face consists of edges:" <<
endl;
374 const edge&
e = edges_[fEdges[i]];
376 Pout<<
" " << fEdges[i] <<
' ' <<
e
377 << points_[
e.start()] <<
' ' << points_[
e.end()] <<
endl;
int debug
Static debugging option.
List< label > labelList
A List of labels.
const Cmpt & x() const
Access to the vector x component.
const labelListList & edgeFaces() const
Return edge-face addressing.
edgeSurface(const triSurface &surf, const bool isFirstSurface, const surfaceIntersection &inter)
Construct from surface and intersection description.
A class for handling file names.
OFstream that keeps track of vertices.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
static constexpr const zero Zero
Global zero (0)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
label nEdges() const
Number of edges in patch.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelPairLookup & facePairToEdgeId() const
Lookup of pairs of faces to created edges.
void addIntersectionEdges(const label facei, const edgeList &)
Add intersection edges to a face. Used for connecting.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
virtual Ostream & write(const char c)
Write character.
void writeObjEdges(const UList< point > &points, const edgeList &edges, const labelList &edgeLabels, Ostream &os)
const Cmpt & z() const
Access to the vector z component.
#define forAll(list, i)
Loop across all elements in list.
Basic surface-surface intersection description. Constructed from two surfaces it creates a descriptio...
Triangulated surface description with patch information.
void setSize(const label n)
Alias for resize()
const pointField & cutPoints() const
The list of cut points.
label nPoints() const
Number of points supporting patch faces.
OBJstream os(runTime.globalPath()/outputName)
const edgeList & cutEdges() const
The list of created edges.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
Output to file stream, using an OSstream.
static void writeObjPoints(const UList< point > &pts, Ostream &os)
const Cmpt & y() const
Access to the vector y component.
forAllConstIters(mixture.phases(), phase)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
defineTypeNameAndDebug(combustionModel, 0)
const labelListList & edgeCuts(const bool isFirstSurf) const
Access either surf1EdgeCuts (isFirstSurface = true) or.