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(),
173 pointEdgesPtr_.clear();
195 pointEdgesPtr_.clear();
204 pointEdgesPtr_ = mesh.pointEdgesPtr_;
219 label startEdgeI = 0;
220 label currentRegion = 0;
224 while (startEdgeI < edges_.
size() && edgeRegion[startEdgeI] != -1)
229 if (startEdgeI == edges_.
size())
237 edgeRegion[startEdgeI] = currentRegion;
240 while (edgesToVisit.
size())
248 label edgeI = edgesToVisit[i];
251 const edge&
e = edges_[edgeI];
259 label nbrEdgeI = pEdges[pEdgeI];
261 if (edgeRegion[nbrEdgeI] == -1)
263 edgeRegion[nbrEdgeI] = currentRegion;
264 newEdgesToVisit.
append(nbrEdgeI);
270 edgesToVisit.
transfer(newEdgesToVisit);
275 return currentRegion;
282 if (scaleFactor > 0 && scaleFactor != 1.0)
284 points_ *= scaleFactor;
306 pointEdgesPtr_.clear();
313 edge&
e = edges_[edgeI];
315 label p0 = pointMap[e[0]];
316 label p1 = pointMap[e[1]];
337 const edge&
e = edges_[edgeI];
341 if (edgeToLabel.insert(e, newEdgeI))
352 edges_[iter()] = iter.key();
365 const edge&
e = edges_[edgeI];
367 if (existingEdges.insert(e, curEdgeI))
375 Info<<
"Merging duplicate edges: " 376 << edges_.
size() - existingEdges.size()
377 <<
" edges will be deleted." <<
endl;
380 edges_.
setSize(existingEdges.size());
384 edges_[iter()] = iter.key();
A simple container for copying or transferring objects of type <T>.
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?
const double e
Elementary charge.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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?
Xfer< edgeMesh > xfer()
Transfer contents to the Xfer container.
Macros for easy insertion into run-time selection tables.
edgeMesh()
Construct null.
Various functions to operate on Lists.
static wordHashSet writeTypes()
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
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 mergePoints(const scalar mergeDist)
Merge common points (points within mergeDist)
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.
fileName lessExt() const
Return file name without extension (part before last .)
virtual void reset(const Xfer< pointField > &points, const Xfer< 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.
label regions(labelList &edgeRegion) const
Find connected regions. Set region number per edge.
virtual void clear()
Clear all storage.
void setSize(const label)
Reset size of List.
void mergeEdges()
Merge similar 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.
word ext() const
Return file name extension (part after last .)
Macros for easy insertion into member function selection tables.
void invertManyToMany(const label len, const UList< InList > &, List< OutList > &)
Invert many-to-many.
static const Vector< scalar > zero
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
virtual ~edgeMesh()
Destructor.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
const labelListList & pointEdges() const
Return edges.