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[0] = pointMap[
e[0]];
234 e[1] = pointMap[
e[1]];
245 bitSet pointIsUsed(points_.size());
247 label nUniqEdges = 0;
248 label nUniqPoints = 0;
251 const edge&
e = edges_[edgeI];
255 if (
e[0] !=
e[1] && uniqEdges.insert(
e))
257 if (nUniqEdges != edgeI)
259 edges_[nUniqEdges] =
e;
261 edges_[nUniqEdges].sort();
264 if (pointIsUsed.set(
e[0]))
268 if (pointIsUsed.set(
e[1]))
277 Info<<
"Merging duplicate edges: " 278 << (edges_.size() - nUniqEdges)
279 <<
" edges will be deleted, " 280 << (points_.size() - nUniqPoints)
281 <<
" unused points will be removed." <<
endl;
284 if (nUniqEdges < edges_.size())
286 pointEdgesPtr_.reset(
nullptr);
287 edges_.setSize(nUniqEdges);
290 if (nUniqPoints < points_.size())
292 pointEdgesPtr_.reset(
nullptr);
302 if (pointIsUsed.test(pointi))
304 pointMap[pointi] = newId;
309 points_[newId] = points_[pointi];
314 points_.setSize(newId);
319 edge&
e = edges_[edgeI];
321 e[0] = pointMap[
e[0]];
322 e[1] = pointMap[
e[1]];
List< labelList > labelListList
A List of labelList.
A class for handling file names.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#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.
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 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)
HashSet< edge, Hash< edge > > edgeHashSet
A HashSet with edge for its key.
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.
bool equal(const T &s1, const T &s2)
Compare two values for equality.
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.