51 return wordHashSet(*fileExtensionConstructorTablePtr_);
57 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
94 return canReadType(ext, verbose);
100 void Foam::edgeMesh::calcPointEdges()
const 105 <<
"pointEdges already calculated." 110 auto& pointEdges = *pointEdgesPtr_;
122 pointEdgesPtr_.reset(
nullptr);
133 points_.transfer(
mesh.points_);
134 edges_.transfer(
mesh.edges_);
135 pointEdgesPtr_ = std::move(
mesh.pointEdgesPtr_);
141 edgeRegion.
setSize(edges_.size());
144 label startEdgeI = 0;
145 label currentRegion = 0;
149 while (startEdgeI < edges_.size() && edgeRegion[startEdgeI] != -1)
154 if (startEdgeI == edges_.size())
162 edgeRegion[startEdgeI] = currentRegion;
165 while (edgesToVisit.size())
168 DynamicList<label> newEdgesToVisit(edgesToVisit.size());
173 label edgeI = edgesToVisit[i];
176 const edge&
e = edges_[edgeI];
180 const labelList& pEdges = pointEdges()[
e[fp]];
184 label nbrEdgeI = pEdges[pEdgeI];
186 if (edgeRegion[nbrEdgeI] == -1)
188 edgeRegion[nbrEdgeI] = currentRegion;
189 newEdgesToVisit.
append(nbrEdgeI);
195 edgesToVisit.transfer(newEdgesToVisit);
201 return currentRegion;
208 if (scaleFactor > VSMALL && !
equal(scaleFactor, 1))
210 points_ *= scaleFactor;
229 pointEdgesPtr_.reset(
nullptr);
231 for (edge&
e : edges_)
233 e = edge(pointMap,
e);
244 bitSet pointIsUsed(points_.size());
246 label nUniqEdges = 0;
247 label nUniqPoints = 0;
250 const edge&
e = edges_[edgeI];
254 if (
e[0] !=
e[1] && uniqEdges.insert(
e))
256 if (nUniqEdges != edgeI)
258 edges_[nUniqEdges] =
e;
260 edges_[nUniqEdges].sort();
263 if (pointIsUsed.set(
e[0]))
267 if (pointIsUsed.set(
e[1]))
276 Info<<
"Merging duplicate edges: " 277 << (edges_.size() - nUniqEdges)
278 <<
" edges will be deleted, " 279 << (points_.size() - nUniqPoints)
280 <<
" unused points will be removed." <<
endl;
283 if (nUniqEdges < edges_.size())
285 pointEdgesPtr_.reset(
nullptr);
286 edges_.setSize(nUniqEdges);
289 if (nUniqPoints < points_.size())
291 pointEdgesPtr_.reset(
nullptr);
301 if (pointIsUsed.test(pointi))
303 pointMap[pointi] = newId;
308 points_[newId] = points_[pointi];
313 points_.setSize(newId);
316 for (edge&
e : edges_)
318 e = edge(pointMap,
e);
A class for handling file names.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
bool equal(const T &a, const T &b)
Compare two values for equality.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
HashSet< edge, Hash< edge > > edgeHashSet
A HashSet with edge for its key. Hashing (and ==) on an edge is symmetric.
List< labelList > labelListList
List of labelList.
Macros for easy insertion into run-time selection tables.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
word ext() const
Return file name extension (part after last .)
static wordHashSet writeTypes()
Summary of supported write file types.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
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 expressions::valueTypeCode::INVALID.
bool has_ext() const
Various checks for extensions.
A class for handling words, derived from Foam::string.
virtual void mergePoints(const scalar mergeDist)
Geometric merge points (points within mergeDist) prior to.
static wordHashSet readTypes()
Summary of supported read file types.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
label inplaceMergePoints(PointList &points, const scalar mergeTol, const bool verbose, labelList &pointToUnique)
Inplace merge points, preserving the original point order. All points closer/equal mergeTol are to be...
errorManip< error > abort(error &err)
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
Mesh data needed to do the Finite Area discretisation.
Geometric merging of points. See below.
virtual void clear()
Clear all storage.
virtual void mergeEdges()
Merge duplicate edges and eliminate unused points.
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
void transfer(edgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
Macros for easy insertion into member function selection tables.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
List< label > labelList
A List of labels.
label regions(labelList &edgeRegion) const
Find connected regions. Set region number per edge.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
void invertManyToMany(const label len, const UList< InputIntListType > &input, List< OutputIntListType > &output)
Invert many-to-many.