44 return wordHashSet(*fileExtensionConstructorTablePtr_);
50 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
97 ext =
name.lessExt().ext();
99 return canReadType(ext, verbose);
105 void Foam::edgeMesh::calcPointEdges()
const
107 if (pointEdgesPtr_.valid())
124 fileFormats::edgeMeshFormatsCore(),
127 pointEdgesPtr_(nullptr)
137 fileFormats::edgeMeshFormatsCore(),
140 pointEdgesPtr_(nullptr)
150 fileFormats::edgeMeshFormatsCore(),
151 points_(move(pointLst)),
152 edges_(move(edgeLst)),
153 pointEdgesPtr_(nullptr)
169 pointEdgesPtr_.clear();
183 points_.transfer(pointLst);
188 edges_.transfer(edgeLst);
191 pointEdgesPtr_.clear();
198 points_.transfer(mesh.points_);
199 edges_.transfer(mesh.edges_);
200 pointEdgesPtr_ = mesh.pointEdgesPtr_;
206 edgeRegion.
setSize(edges_.size());
209 label startEdgeI = 0;
210 label currentRegion = 0;
214 while (startEdgeI < edges_.size() && edgeRegion[startEdgeI] != -1)
219 if (startEdgeI == edges_.size())
227 edgeRegion[startEdgeI] = currentRegion;
230 while (edgesToVisit.
size())
238 label edgeI = edgesToVisit[i];
241 const edge&
e = edges_[edgeI];
245 const labelList& pEdges = pointEdges()[
e[fp]];
249 label nbrEdgeI = pEdges[pEdgeI];
251 if (edgeRegion[nbrEdgeI] == -1)
253 edgeRegion[nbrEdgeI] = currentRegion;
254 newEdgesToVisit.
append(nbrEdgeI);
260 edgesToVisit.
transfer(newEdgesToVisit);
265 return currentRegion;
272 if (scaleFactor > 0 && scaleFactor != 1.0)
274 points_ *= scaleFactor;
286 const edge&
e = edges_[edgeI];
288 if (existingEdges.
insert(
e, curEdgeI))
296 Info<<
"Merging duplicate edges: "
297 << edges_.size() - existingEdges.
size()
298 <<
" edges will be deleted." <<
endl;
301 edges_.setSize(existingEdges.
size());
305 edges_[iter()] = iter.key();
309 pointEdgesPtr_.clear();
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into member function selection tables.
Macros for easy insertion into run-time selection tables.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A HashTable with keys but without contents.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Points connected by edges.
virtual void scalePoints(const scalar)
Scale points. A non-positive factor is ignored.
virtual void mergeEdges()
Merge duplicate edges.
virtual ~edgeMesh()
Destructor.
virtual void reset(pointField &&points, edgeList &&edges)
Reset primitive data (points, edges)
static wordHashSet writeTypes()
edgeMesh()
Construct null.
void transfer(edgeMesh &)
Transfer the contents of the argument and annul the argument.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
label regions(labelList &edgeRegion) const
Find connected regions. Set region number per edge.
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
virtual void clear()
Clear all storage.
static wordHashSet readTypes()
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling file names.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
List< labelList > labelListList
A List of labelList.
defineTypeNameAndDebug(combustionModel, 0)
HashSet wordHashSet
A HashSet with word keys.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
void invertManyToMany(const label len, const UList< InList > &, List< OutList > &)
Invert many-to-many.