Go to the documentation of this file.
31 #include "triSurface.H"
39 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
56 const edge&
e = edges[i];
58 os <<
"l " <<
e.start()+1 <<
' ' <<
e.end()+1 <<
endl;
72 scalar minLen = GREAT;
99 const label edgeI = eLabels[eI];
101 if (surf.
edges()[edgeI] == faceEdge)
108 <<
"Problem:: Cannot find edge with vertices " << faceEdge
109 <<
" in face " << faceI
123 bool hasDuplicate =
false;
125 label prevVertI = -1;
129 label newVertI = map[elems[elemI]];
131 if (newVertI == prevVertI)
137 prevVertI = newVertI;
148 elems[elemI++] = map[oldElems[0]];
150 for (
label vertI = 1; vertI < oldElems.size(); vertI++)
153 label newVertI = map[oldElems[vertI]];
155 if (newVertI != elems.last())
157 elems[elemI++] = newVertI;
174 elems[elemI] = map[elems[elemI]];
198 const edge&
e = edges[edgeI];
202 (
e.start() !=
e.end())
203 && (uniqueEdges.
find(
e) == uniqueEdges.end())
209 map[edgeI] = newEdgeI;
211 newEdges[newEdgeI++] =
e;
239 label elem = elems[elemI];
241 if (uniqueElems.
find(elem) == uniqueElems.end())
246 map[elemI] = newElemI;
248 newElems[newElemI++] = elem;
272 forAll(cutPoints(), cutPointI)
274 writeOBJ(cutPoints()[cutPointI], os);
277 forAll(edgeCutVerts, edgeI)
279 const labelList& extraVerts = edgeCutVerts[edgeI];
281 if (extraVerts.
size())
286 os <<
"l " <<
e.start()+1 <<
' '
289 for (
label i = 1; i < extraVerts.
size(); i++)
291 os <<
"l " << extraVerts[i-1] + surf.
nPoints() + 1 <<
' '
295 os <<
"l " << extraVerts.last() + surf.
nPoints() + 1
296 <<
' ' <<
e.end()+1 <<
endl;
305 const scalar startTol,
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)
static labelList filterLabels(const labelList &elems, labelList &map)
Remove all duplicate elements.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
static label classify(const scalar startTol, const scalar endTol, const point &p, const edge &e, const pointField &points)
Detect if point close to edge of end. Returns -1: not close.
static void removeDuplicates(const labelList &map, labelList &labels)
Remove duplicates from ordered dynamic list. Returns map from old.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static edgeList filterEdges(const edgeList &, labelList &map)
static void writeOBJ(const point &pt, Ostream &os)
Write point in obj format.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeIntersectedEdges(const triSurface &surf, const labelListList &edgeCutVerts, Ostream &os) const
Debugging: Dump intersected edges to stream.
const labelListList & faceEdges() const
Return face-edge addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
A HashTable with keys but without contents.
static label getEdge(const triSurface &surf, const label faceI, const label fp)
Get edge label of edge between face vertices fp and fp+1.
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.
Triangulated surface description with patch information.
const labelListList & pointEdges() const
Return point-edge addressing.
static void inlineRemap(const labelList &map, labelList &elems)
Apply map to elements of a labelList.
label nPoints() const
Return number of points supporting patch faces.
errorManip< error > abort(error &err)
const double e
Elementary charge.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool insert(const Key &key)
Insert a new entry.
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
static scalar minEdgeLen(const triSurface &surf, const label pointI)
Get minimum length of all edges connected to point.
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,...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)