60 os <<
"v " <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
63 for (
const label edgei : edgeLabels)
65 const edge&
e = edges[edgei];
67 os <<
"l " <<
e.start()+1 <<
' ' <<
e.end()+1 <<
nl;
77 void Foam::edgeSurface::calcPointEdges()
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,
121 points_(surf.
nPoints() + inter.cutPoints().size()),
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];
153 DynamicList<label> allParentEdges(surf.
nEdges());
154 List<DynamicList<label>> allFaceEdges(surf.
size());
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_);
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)
284 fileName faceFName(
"face_" +
name(facei) +
".obj");
285 Pout<<
"edgeSurface : Dumping faceEdges for face " << facei
286 <<
" to " << faceFName <<
endl;
288 OFstream fStream(faceFName);
293 Pout<<
"edgeSurface : Dumping edges to edges.obj" <<
endl;
294 OBJstream(
"edges.obj").
write(edges_, points_);
296 Pout<<
"edgeSurface : Dumping intersectionEdges to" 297 <<
" intersectionEdges.obj" <<
endl;
299 OFstream intEdgesStream(
"intersectionEdges.obj");
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;
void size(const label n)
Older name for setAddressableSize.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void append(const T &val)
Append an element at the end of the list.
List< edge > edgeList
List of edge.
constexpr char nl
The newline '\n' character (0x0a)
Basic surface-surface intersection description. Constructed from two surfaces it creates a descriptio...
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
edgeSurface(const triSurface &surf, const bool isFirstSurface, const surfaceIntersection &inter)
Construct from surface and intersection description.
const edgeList & cutEdges() const
The list of created edges.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelListList & edgeCuts(const bool isFirstSurf) const
Access either surf1EdgeCuts (isFirstSurface = true) or.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void addIntersectionEdges(const label facei, const edgeList &)
Add intersection edges to a face. Used for connecting.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label nEdges() const
Number of edges in patch.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
const pointField & cutPoints() const
The list of cut points.
const labelPairLookup & facePairToEdgeId() const
Lookup of pairs of faces to created edges.
static void writeObjEdges(const UList< point > &points, const edgeList &edges, const labelUList &edgeLabels, Ostream &os)
List< label > labelList
A List of labels.
Triangulated surface description with patch information.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
forAllConstIters(mixture.phases(), phase)
static constexpr const zero Zero
Global zero (0)