45 return wordHashSet(*fileExtensionConstructorTablePtr_);
51 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
100 return canReadType(ext, verbose);
106 void Foam::edgeMesh::calcPointEdges()
const 108 if (pointEdgesPtr_.valid())
125 fileFormats::edgeMeshFormatsCore(),
128 pointEdgesPtr_(nullptr)
141 pointEdgesPtr_(
nullptr)
152 points_(move(pointLst)),
153 edges_(move(edgeLst)),
154 pointEdgesPtr_(
nullptr)
170 pointEdgesPtr_.clear();
192 pointEdgesPtr_.clear();
201 pointEdgesPtr_ = mesh.pointEdgesPtr_;
210 label startEdgeI = 0;
211 label currentRegion = 0;
215 while (startEdgeI < edges_.
size() && edgeRegion[startEdgeI] != -1)
220 if (startEdgeI == edges_.
size())
228 edgeRegion[startEdgeI] = currentRegion;
231 while (edgesToVisit.
size())
239 label edgeI = edgesToVisit[i];
242 const edge&
e = edges_[edgeI];
250 label nbrEdgeI = pEdges[pEdgeI];
252 if (edgeRegion[nbrEdgeI] == -1)
254 edgeRegion[nbrEdgeI] = currentRegion;
255 newEdgesToVisit.
append(nbrEdgeI);
261 edgesToVisit.
transfer(newEdgesToVisit);
266 return currentRegion;
273 if (scaleFactor > 0 && scaleFactor != 1.0)
275 points_ *= scaleFactor;
282 const scalar mergeDist,
302 pointEdgesPtr_.clear();
307 pointEdgesPtr_.clear();
312 edge&
e = edges_[edgeI];
314 label p0 = pointMap[e[0]];
315 label p1 = pointMap[e[1]];
336 const edge&
e = edges_[edgeI];
340 if (edgeToLabel.insert(e, newEdgeI))
351 edges_[iter()] = iter.key();
364 const edge&
e = edges_[edgeI];
366 if (existingEdges.insert(e, curEdgeI))
374 Info<<
"Merging duplicate edges: " 375 << edges_.
size() - existingEdges.size()
376 <<
" edges will be deleted." <<
endl;
379 edges_.
setSize(existingEdges.size());
383 edges_[iter()] = iter.key();
387 pointEdgesPtr_.clear();
List< labelList > labelListList
A List of labelList.
void transfer(edgeMesh &)
Transfer the contents of the argument and annul the argument.
A HashTable with keys but without contents.
#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.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void mergePoints(const scalar mergeDist, labelList &)
Merge common points (points within mergeDist). Return map from.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void scalePoints(const scalar)
Scale points. A non-positive factor is ignored.
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 .)
Macros for easy insertion into run-time selection tables.
edgeMesh()
Construct null.
Various functions to operate on Lists.
static wordHashSet writeTypes()
const labelListList & pointEdges() const
Return edges.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
static wordHashSet readTypes()
HashSet wordHashSet
A HashSet with word keys.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
Points connected by edges.
virtual void reset(pointField &&points, edgeList &&edges)
Reset primitive data (points, edges)
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
virtual void clear()
Clear all storage.
void setSize(const label)
Reset size of List.
virtual void mergeEdges()
Merge duplicate edges.
label mergePoints(const UList< Type > &points, const scalar mergeTol, const bool verbose, labelList &pointMap, const Type &origin=Type::zero)
Sorts and merges points. All points closer than/equal mergeTol get merged.
fileName lessExt() const
Return file name without extension (part before last .)
Macros for easy insertion into member function selection tables.
void invertManyToMany(const label len, const UList< InList > &, List< OutList > &)
Invert many-to-many.
const doubleScalar e
Elementary charge.
label regions(labelList &edgeRegion) const
Find connected regions. Set region number per edge.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
static const Vector< scalar > zero
virtual ~edgeMesh()
Destructor.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?