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)
154 pointEdgesPtr_(
nullptr)
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;
291 const scalar mergeDist,
311 pointEdgesPtr_.clear();
316 pointEdgesPtr_.clear();
321 edge&
e = edges_[edgeI];
323 label p0 = pointMap[e[0]];
324 label p1 = pointMap[e[1]];
345 const edge&
e = edges_[edgeI];
349 if (edgeToLabel.insert(e, newEdgeI))
360 edges_[iter()] = iter.key();
373 const edge&
e = edges_[edgeI];
375 if (existingEdges.insert(e, curEdgeI))
383 Info<<
"Merging duplicate edges: " 384 << edges_.
size() - existingEdges.size()
385 <<
" edges will be deleted." <<
endl;
388 edges_.
setSize(existingEdges.size());
392 edges_[iter()] = iter.key();
396 pointEdgesPtr_.clear();
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?
#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?
Xfer< edgeMesh > xfer()
Transfer contents to the Xfer container.
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...
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.
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(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.
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?