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++;
1002 reversePointMap[i] = newPointi++;
1006 reverseFemPointMap[i] = newPointi++;
1013 reversePointMap[i] = newPointi++;
1017 reverseFemPointMap[i] = 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]]);
1241 reversePointMap[i] = 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&)");
label concaveStart() const
Return the index of the start of the concave feature points.
extendedEdgeMesh()
Construct null.
cachedRandom rndGen(label(0),-1)
A simple container for copying or transferring objects of type <T>.
static autoPtr< extendedEdgeMesh > New(const fileName &, const word &ext)
Select constructed from filename (explicit extension)
void transfer(edgeMesh &)
Transfer the contents of the argument and annul the argument.
linePointRef line(const pointField &) const
Return edge line.
A HashTable with keys but without contents.
label nonFeatureStart() const
Return the index of the start of the non-feature points.
#define forAll(list, i)
Loop across all elements in list.
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.
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 wordHashSet readTypes()
Ostream & indent(Ostream &os)
Indent stream.
vectorField normals_
Normals of the features, to be referred to by index by both feature.
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
const double e
Elementary charge.
const point & min() const
Minimum describing the bounding box.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
void sortPointsAndEdges(const Patch &, const labelList &featureEdges, const labelList ®ionFeatureEdges, const labelList &feaurePoints)
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
label mixedStart_
Index of the start of the mixed type feature points.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
Description of feature edges and points.
const Point & rawPoint() const
Return point with no checking.
label openStart_
Index of the start of the open feature edges.
const labelList & featurePoints() const
Return feature point list.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
static const Foam::NamedEnum< sideVolumeType, 4 > sideVolumeTypeNames_
Ostream & endl(Ostream &os)
Add newline and flush stream.
Holds data for octree to work on an edges subset.
const point & max() const
Maximum describing the bounding box.
virtual void clear()
Clear all storage.
static const Foam::NamedEnum< edgeStatus, 6 > edgeStatusNames_
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
label concaveStart_
Index of the start of the concave feature points.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
void add(const extendedEdgeMesh &)
Add extendedEdgeMesh. No filtering of duplicates.
virtual Ostream & write(const char)
Write character.
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
Initialise the NamedEnum HashTable from the static list of names.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
edgeMesh()
Construct null.
label internalStart_
Index of the start of the internal feature edges.
labelListList normalDirections_
Starting directions for the edges.
const pointField & points() const
Return points.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
A list of faces which address into the list of points.
A List obtained as a section of another List.
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
vectorField pointField
pointField is a vectorField.
void flipNormals()
Flip normals. All concave become convex, all internal external.
dimensionedScalar cos(const dimensionedScalar &ds)
line< point, const point & > linePointRef
Line using referred points.
labelList regionEdges_
Feature edges which are on the boundary between regions.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
static label convexStart_
Index of the start of the convex feature points - static as 0.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label multipleStart() const
Return the index of the start of the multiply-connected feature.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
static label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
label flatStart_
Index of the start of the flat feature edges.
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
Istream & operator>>(Istream &, directionInfo &)
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
~extendedEdgeMesh()
Destructor.
sideVolumeType
Normals point to the outside.
static label externalStart_
Index of the start of the external feature edges - static as 0.
void transfer(extendedEdgeMesh &)
Transfer the contents of the argument and annul the argument.
virtual void writeStats(Ostream &) const
HashSet wordHashSet
A HashSet with word keys.
autoPtr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
Simple random number generator.
const triSurface & surface() const
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Istream and Ostream manipulators taking arguments.
label start() const
Return start vertex label.
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
OFstream which keeps track of vertices.
defineTypeNameAndDebug(combustionModel, 0)
Points connected by edges.
label openStart() const
Return the index of the start of the open feature edges.
fileName lessExt() const
Return file name without extension (part before last .)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
virtual void writeStats(Ostream &os) const
Dump some information.
virtual void reset(const Xfer< pointField > &points, const Xfer< edgeList > &edges)
Reset primitive data (points, edges)
const List< sideVolumeType > & normalVolumeTypes() const
Return.
label internalStart() const
Return the index of the start of the internal feature edges.
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.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
virtual void clear()
Clear all storage.
void setSize(const label)
Reset size of List.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Xfer< extendedEdgeMesh > xfer()
Transfer contents to the Xfer container.
label nRegionEdges() const
Return number of region edges.
label multipleStart_
Index of the start of the multiply-connected feature edges.
vector point
Point is a vector.
static const Foam::NamedEnum< pointStatus, 4 > pointStatusNames_
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label flatStart() const
Return the index of the start of the flat feature edges.
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
A List with indirect addressing.
const labelListList & normalDirections() const
Ostream & operator<<(Ostream &, const ensightPart &)
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
word ext() const
Return file name extension (part after last .)
const edgeList & edges() const
Return edges.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
static void write(const fileName &, const edgeMesh &)
Write to file.
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Standard boundBox + extra functionality for use in octree.
static label nPointTypes
Number of possible point types (i.e. number of slices)
static wordHashSet writeTypes()
const labelListList & edgeFaces() const
Return edge-face addressing.
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
bool hit() const
Is there a hit.
label mixedStart() const
Return the index of the start of the mixed type feature points.
Omanip< int > setw(const int i)
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
Triangulated surface description with patch information.
label nonFeatureStart_
Index of the start of the non-feature points.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
autoPtr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
const fileName & name() const
Return the name of the stream.
DynamicField< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const labelList & featureEdges() const
Return feature edge list.
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Holds feature edges/points of surface.
label size() const
Return the number of elements in the UPtrList.
const labelListList & pointEdges() const
Return edges.