Go to the documentation of this file.
45 return wordHashSet(*fileExtensionConstructorTablePtr_);
51 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
98 ext =
name.lessExt().ext();
100 return canReadType(ext, verbose);
108 if (pointEdgesPtr_.valid())
125 fileFormats::edgeMeshFormatsCore(),
156 points_.transfer(pointLst());
157 edges_.transfer(edgeLst());
173 pointEdgesPtr_.clear();
187 points_.transfer(pointLst());
192 edges_.transfer(edgeLst());
195 pointEdgesPtr_.clear();
203 edges_.transfer(
mesh.edges_);
204 pointEdgesPtr_ =
mesh.pointEdgesPtr_;
216 edgeRegion.
setSize(edges_.size());
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];
255 const labelList& pEdges = pointEdges()[
e[fp]];
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,
310 pointEdgesPtr_.clear();
312 points_.transfer(newPoints);
315 pointEdgesPtr_.clear();
320 edge&
e = edges_[edgeI];
322 label p0 = pointMap[
e[0]];
323 label p1 = pointMap[
e[1]];
344 const edge&
e = edges_[edgeI];
348 if (edgeToLabel.
insert(
e, newEdgeI))
355 edges_.setSize(newEdgeI);
359 edges_[iter()] = iter.key();
372 const edge&
e = edges_[edgeI];
374 if (existingEdges.
insert(
e, curEdgeI))
382 Info<<
"Merging duplicate edges: "
383 << edges_.size() - existingEdges.
size()
384 <<
" edges will be deleted." <<
endl;
387 edges_.setSize(existingEdges.
size());
391 edges_[iter()] = iter.key();
395 pointEdgesPtr_.clear();
virtual ~edgeMesh()
Destructor.
label regions(labelList &edgeRegion) const
Find connected regions. Set region number per edge.
A class for handling words, derived from string.
A class for handling file names.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
#define forAll(list, i)
Loop across all elements in list.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual void scalePoints(const scalar)
Scale points. A non-positive factor is ignored.
edgeMesh()
Construct null.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Xfer< edgeMesh > xfer()
Transfer contents to the Xfer container.
virtual void mergePoints(const scalar mergeDist, labelList &)
Merge common points (points within mergeDist). Return map from.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void invertManyToMany(const label len, const UList< InList > &, List< OutList > &)
Invert many-to-many.
A HashTable with keys but without contents.
A simple container for copying or transferring objects of type <T>.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
static wordHashSet writeTypes()
static wordHashSet readTypes()
Macros for easy insertion into member function selection tables.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
label size() const
Return number of elements in table.
pointIOField points_
Points.
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
const double e
Elementary charge.
virtual void mergeEdges()
Merge duplicate edges.
virtual void clear()
Clear all storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of List.
List< labelList > labelListList
A List of labelList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void reset(const Xfer< pointField > &points, const Xfer< edgeList > &edges)
Reset primitive data (points, edges)
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
HashSet wordHashSet
A HashSet with word keys.
Various functions to operate on Lists.
void size(const label)
Override size to be inconsistent with allocated storage.
void transfer(edgeMesh &)
Transfer the contents of the argument and annul the argument.
defineTypeNameAndDebug(combustionModel, 0)
Points connected by edges.
void calcPointEdges() const
Calculate point-edge addressing (inverse of 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 name(const complex &)
Return a string representation of a complex.