111 return wordHashSet(*fileExtensionConstructorTablePtr_);
117 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
130 return edgeMeshFormatsCore::checkSupport
146 return edgeMeshFormatsCore::checkSupport
167 return canReadType(ext, verbose);
195 if (edStat == EXTERNAL)
199 else if (edStat == INTERNAL)
205 if (nExternal == nPtEds)
209 else if (nInternal == nPtEds)
234 else if (nEdNorms == 2)
236 const vector& n0(norms[edNorms[0]]);
237 const vector& n1(norms[edNorms[1]]);
239 if ((n0 & n1) > cosNormalAngleTol_)
243 else if ((fC0tofC1 & n0) > 0.0)
252 else if (nEdNorms > 2)
277 normalVolumeTypes_(0),
279 normalDirections_(0),
281 featurePointNormals_(0),
282 featurePointEdges_(0),
404 label sFEI = featureEdges[i];
407 const labelList& eFaces = edgeFaces[sFEI];
411 label eFI = eFaces[j];
418 surfBaffleRegions[surf[eFI].region()]
474 label nonFeatureStart,
581 return read(unzipName, unzipName.
ext());
585 return read(name, ext);
606 scalar searchDistSqr,
621 scalar searchDistSqr,
675 info[i] = edgeTrees[i].findNearest
685 info[i].setIndex(info[i].index() + sliceStarts[i]);
693 scalar searchRadiusSqr,
708 label index = elems[elemI];
714 dynPointHit.append(nearHit);
724 const scalar searchRadiusSqr,
746 labelList elems = edgeTrees[i].findSphere
754 label index = elems[elemI];
755 label edgeI = edgeTrees[i].shapes().edgeLabels()[index];
760 label hitIndex = index + sliceStarts[i];
769 dynEdgeHit.append(nearHit);
791 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
792 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
831 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
832 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
875 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
876 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
951 return xferMoveTo<extendedEdgeMesh, extendedEdgeMesh>(*this);
991 reversePointMap[i] = newPointI++;
995 reverseFemPointMap[i] = newPointI++;
999 label newConcaveStart = newPointI;
1002 reversePointMap[i] = newPointI++;
1006 reverseFemPointMap[i] = newPointI++;
1010 label newMixedStart = newPointI;
1013 reversePointMap[i] = newPointI++;
1017 reverseFemPointMap[i] = newPointI++;
1021 label newNonFeatureStart = newPointI;
1024 reversePointMap[i] = newPointI++;
1028 reverseFemPointMap[i] = newPointI++;
1033 newPoints.
rmap(fem.
points(), reverseFemPointMap);
1047 reverseEdgeMap[i] = newEdgeI++;
1051 reverseFemEdgeMap[i] = newEdgeI++;
1055 label newInternalStart = newEdgeI;
1058 reverseEdgeMap[i] = newEdgeI++;
1062 reverseFemEdgeMap[i] = newEdgeI++;
1066 label newFlatStart = newEdgeI;
1069 reverseEdgeMap[i] = newEdgeI++;
1073 reverseFemEdgeMap[i] = newEdgeI++;
1077 label newOpenStart = newEdgeI;
1080 reverseEdgeMap[i] = newEdgeI++;
1084 reverseFemEdgeMap[i] = newEdgeI++;
1088 label newMultipleStart = newEdgeI;
1091 reverseEdgeMap[i] = newEdgeI++;
1095 reverseFemEdgeMap[i] = newEdgeI++;
1102 newEdges[reverseEdgeMap[i]] =
edge 1104 reversePointMap[e[0]],
1105 reversePointMap[e[1]]
1111 newEdges[reverseFemEdgeMap[i]] =
edge 1113 reverseFemPointMap[e[0]],
1114 reverseFemPointMap[e[1]]
1131 newNormals.append(fem.
normals());
1138 UIndirectList<labelList>(newEdgeNormals, reverseFemEdgeMap) =
1140 forAll(reverseFemEdgeMap, i)
1142 label mapI = reverseFemEdgeMap[i];
1159 UIndirectList<labelList>
1161 newFeaturePointNormals,
1164 UIndirectList<labelList>
1166 newFeaturePointNormals,
1171 label mapI = reverseFemPointMap[i];
1172 labelList& fn = newFeaturePointNormals[mapI];
1188 newRegionEdges.append(reverseEdgeMap[
regionEdges()[i]]);
1192 newRegionEdges.append(reverseFemEdgeMap[fem.
regionEdges()[i]]);
1237 label newPointI = 0;
1241 reversePointMap[i] = newPointI++;
1244 label newConcaveStart = newPointI;
1247 reversePointMap[i] = newPointI++;
1263 reverseEdgeMap[i] = newEdgeI++;
1266 label newInternalStart = newEdgeI;
1269 reverseEdgeMap[i] = newEdgeI++;
1280 newEdges[reverseEdgeMap[i]] =
edge 1282 reversePointMap[e[0]],
1283 reversePointMap[e[1]]
1304 newFeaturePointNormals,
1311 newRegionEdges[i] = reverseEdgeMap[
regionEdges()[i]];
1340 Info<<
nl <<
"Writing extendedEdgeMesh components to " << prefix
1345 OBJstream convexFtPtStr(prefix +
"_convexFeaturePts.obj");
1346 Info<<
"Writing convex feature points to " << convexFtPtStr.
name() <<
endl;
1353 OBJstream concaveFtPtStr(prefix +
"_concaveFeaturePts.obj");
1354 Info<<
"Writing concave feature points to " 1362 OBJstream mixedFtPtStr(prefix +
"_mixedFeaturePts.obj");
1363 Info<<
"Writing mixed feature points to " << mixedFtPtStr.
name() <<
endl;
1370 OBJstream mixedFtPtStructureStr(prefix +
"_mixedFeaturePtsStructure.obj");
1371 Info<<
"Writing mixed feature point structure to " 1372 << mixedFtPtStructureStr.
name() <<
endl;
1381 mixedFtPtStructureStr.
write 1389 OBJstream externalStr(prefix +
"_externalEdges.obj");
1390 Info<<
"Writing external edges to " << externalStr.
name() <<
endl;
1398 OBJstream internalStr(prefix +
"_internalEdges.obj");
1399 Info<<
"Writing internal edges to " << internalStr.
name() <<
endl;
1407 OBJstream flatStr(prefix +
"_flatEdges.obj");
1408 Info<<
"Writing flat edges to " << flatStr.
name() <<
endl;
1416 OBJstream openStr(prefix +
"_openEdges.obj");
1417 Info<<
"Writing open edges to " << openStr.
name() <<
endl;
1425 OBJstream multipleStr(prefix +
"_multipleEdges.obj");
1426 Info<<
"Writing multiple edges to " << multipleStr.
name() <<
endl;
1434 OBJstream regionStr(prefix +
"_regionEdges.obj");
1435 Info<<
"Writing region edges to " << regionStr.
name() <<
endl;
1443 OBJstream edgeDirsStr(prefix +
"_edgeDirections.obj");
1444 Info<<
"Writing edge directions to " << edgeDirsStr.
name() <<
endl;
1463 os <<
indent <<
"point classification :" <<
nl;
1465 os <<
indent <<
"convex feature points : " 1469 os <<
indent <<
"concave feature points : " 1473 os <<
indent <<
"mixed feature points : " 1477 os <<
indent <<
"other (non-feature) points : " 1483 os <<
indent <<
"edge classification :" <<
nl;
1485 os <<
indent <<
"external (convex angle) edges : " 1489 os <<
indent <<
"internal (concave angle) edges : " 1493 os <<
indent <<
"flat region edges : " 1497 os <<
indent <<
"open edges : " 1501 os <<
indent <<
"multiply connected edges : " 1523 is.check(
"operator>>(Istream&, sideVolumeType&)");
1535 os << static_cast<label>(vt);
1544 os <<
"// points" <<
nl 1548 <<
"// concaveStart mixedStart nonFeatureStart" <<
nl 1552 <<
"// internalStart flatStart openStart multipleStart" <<
nl 1557 <<
"// normals" <<
nl 1559 <<
"// normal volume types" <<
nl 1561 <<
"// normalDirections" <<
nl 1563 <<
"// edgeNormals" <<
nl 1565 <<
"// featurePointNormals" <<
nl 1567 <<
"// featurePointEdges" <<
nl 1569 <<
"// regionEdges" <<
nl 1574 os.
check(
"Ostream& operator<<(Ostream&, const extendedEdgeMesh&)");
1600 is.
check(
"Istream& operator>>(Istream&, extendedEdgeMesh&)");
virtual void writeStats(Ostream &) const
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
const Point & rawPoint() const
Return point with no checking.
OFstream which keeps track of vertices.
autoPtr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
Simple random number generator.
word ext() const
Return file name extension (part after last .)
cachedRandom rndGen(label(0),-1)
const point & min() const
Minimum describing the bounding box.
HashSet wordHashSet
A HashSet with word keys.
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
label flatStart_
Index of the start of the flat feature edges.
const labelList & featureEdges() const
Return feature edge list.
label size() const
Return the number of elements in the PtrList.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
vector point
Point is a vector.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
sideVolumeType
Normals point to the outside.
const labelList & featurePoints() const
Return feature point list.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
static wordHashSet writeTypes()
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
const List< sideVolumeType > & normalVolumeTypes() const
Return.
const labelListList & edgeFaces() const
Return edge-face addressing.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
label nonFeatureStart() const
Return the index of the start of the non-feature points.
autoPtr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
Ostream & indent(Ostream &os)
Indent stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A simple container for copying or transferring objects of type <T>.
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
Triangulated surface description with patch information.
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
void transfer(extendedEdgeMesh &)
Transfer the contents of the argument and annul the argument.
A class for handling words, derived from string.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const pointField & points() const
Return points.
Standard boundBox + extra functionality for use in octree.
void size(const label)
Override size to be inconsistent with allocated storage.
static void write(const fileName &, const edgeMesh &)
Write to file.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
static autoPtr< extendedEdgeMesh > New(const fileName &, const word &ext)
Select constructed from filename (explicit extension)
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
edgeMesh()
Construct null.
Ostream & operator<<(Ostream &, const edgeMesh &)
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
Holds feature edges/points of surface.
vectorField pointField
pointField is a vectorField.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
label multipleStart() const
Return the index of the start of the multiply-connected feature.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
label internalStart_
Index of the start of the internal feature edges.
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
static edgeStatus classifyEdge(const List< vector > &norms, const labelList &edNorms, const vector &fC0tofC1)
Classify the type of feature edge. Requires face centre 0 to face.
virtual void clear()
Clear all storage.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void clear()
Clear the list, i.e. set size to zero.
const double e
Elementary charge.
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
void setSize(const label)
Reset size of List.
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
Ostream & endl(Ostream &os)
Add newline and flush stream.
extendedEdgeMesh()
Construct null.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
label nonFeatureStart_
Index of the start of the non-feature points.
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
A List with indirect addressing.
linePointRef line(const pointField &) const
Return edge line.
void flipNormals()
Flip normals. All concave become convex, all internal external.
label mixedStart_
Index of the start of the mixed type feature points.
const fileName & name() const
Return the name of the stream.
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
void add(const extendedEdgeMesh &)
Add extendedEdgeMesh. No filtering of duplicates.
virtual Ostream & write(const char)
Write character.
label concaveStart_
Index of the start of the concave feature points.
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
dimensionedScalar cos(const dimensionedScalar &ds)
label openStart() const
Return the index of the start of the open feature edges.
Omanip< int > setw(const int i)
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
const point & max() const
Maximum describing the bounding box.
static const Foam::NamedEnum< pointStatus, 4 > pointStatusNames_
static label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
label nRegionEdges() const
Return number of region edges.
labelListList normalDirections_
Starting directions for the edges.
const triSurface & surface() const
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Istream and Ostream manipulators taking arguments.
static label convexStart_
Index of the start of the convex feature points - static as 0.
Initialise the NamedEnum HashTable from the static list of names.
Xfer< extendedEdgeMesh > xfer()
Transfer contents to the Xfer container.
A list of faces which address into the list of points.
static wordHashSet readTypes()
Holds data for octree to work on an edges subset.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Points connected by edges.
label openStart_
Index of the start of the open feature edges.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
vectorField normals_
Normals of the features, to be referred to by index by both feature.
A class for handling file names.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
A HashTable with keys but without contents.
label internalStart() const
Return the index of the start of the internal feature edges.
bool hit() const
Is there a hit.
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
Istream & operator>>(Istream &, edgeMesh &)
virtual void clear()
Clear all storage.
fileName lessExt() const
Return file name without extension (part before last .)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label mixedStart() const
Return the index of the start of the mixed type feature points.
static label externalStart_
Index of the start of the external feature edges - static as 0.
static const Foam::NamedEnum< sideVolumeType, 4 > sideVolumeTypeNames_
labelList regionEdges_
Feature edges which are on the boundary between regions.
static label nPointTypes
Number of possible point types (i.e. number of slices)
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
A List obtained as a section of another List.
DynamicField< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
label start() const
Return start vertex label.
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
virtual void writeStats(Ostream &os) const
Dump some information.
line< point, const point & > linePointRef
Line using referred points.
Description of feature edges and points.
const labelListList & pointEdges() const
Return edges.
label multipleStart_
Index of the start of the multiply-connected feature edges.
const labelListList & normalDirections() const
label concaveStart() const
Return the index of the start of the concave feature points.
~extendedEdgeMesh()
Destructor.
void sortPointsAndEdges(const Patch &, const labelList &featureEdges, const labelList ®ionFeatureEdges, const labelList &feaurePoints)
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
label flatStart() const
Return the index of the start of the flat feature edges.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
void transfer(edgeMesh &)
Transfer the contents of the argument and annul the argument.
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
Holds (reference to) pointField. Encapsulation of data needed for octree searches. Used for searching for nearest point. No bounding boxes around points. Only overlaps and calcNearest are implemented, rest makes little sense.
static const Foam::NamedEnum< edgeStatus, 6 > edgeStatusNames_
virtual void reset(const Xfer< pointField > &points, const Xfer< edgeList > &edges)
Reset primitive data (points, edges)
defineTypeNameAndDebug(combustionModel, 0)
const edgeList & edges() const
Return edges.