51 return wordHashSet(*fileExtensionConstructorTablePtr_);
57 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
92 return canReadType(ext, verbose);
98void Foam::edgeMesh::calcPointEdges()
const
103 <<
"pointEdges already calculated."
108 auto& pointEdges = *pointEdgesPtr_;
120 pointEdgesPtr_.reset(
nullptr);
131 points_.transfer(
mesh.points_);
132 edges_.transfer(
mesh.edges_);
133 pointEdgesPtr_ = std::move(
mesh.pointEdgesPtr_);
139 edgeRegion.
setSize(edges_.size());
142 label startEdgeI = 0;
143 label currentRegion = 0;
147 while (startEdgeI < edges_.size() && edgeRegion[startEdgeI] != -1)
152 if (startEdgeI == edges_.size())
160 edgeRegion[startEdgeI] = currentRegion;
163 while (edgesToVisit.
size())
171 label edgeI = edgesToVisit[i];
174 const edge&
e = edges_[edgeI];
178 const labelList& pEdges = pointEdges()[
e[fp]];
182 label nbrEdgeI = pEdges[pEdgeI];
184 if (edgeRegion[nbrEdgeI] == -1)
186 edgeRegion[nbrEdgeI] = currentRegion;
187 newEdgesToVisit.
append(nbrEdgeI);
193 edgesToVisit.
transfer(newEdgesToVisit);
199 return currentRegion;
206 if (scaleFactor > VSMALL && !
equal(scaleFactor, 1))
208 points_ *= scaleFactor;
227 pointEdgesPtr_.reset(
nullptr);
229 for (
edge&
e : edges_)
231 e[0] = pointMap[
e[0]];
232 e[1] = pointMap[
e[1]];
243 bitSet pointIsUsed(points_.size());
245 label nUniqEdges = 0;
246 label nUniqPoints = 0;
249 const edge&
e = edges_[edgeI];
255 if (nUniqEdges != edgeI)
257 edges_[nUniqEdges] =
e;
259 edges_[nUniqEdges].sort();
262 if (pointIsUsed.
set(
e[0]))
266 if (pointIsUsed.
set(
e[1]))
275 Info<<
"Merging duplicate edges: "
276 << (edges_.size() - nUniqEdges)
277 <<
" edges will be deleted, "
278 << (points_.size() - nUniqPoints)
279 <<
" unused points will be removed." <<
endl;
282 if (nUniqEdges < edges_.size())
284 pointEdgesPtr_.reset(
nullptr);
285 edges_.setSize(nUniqEdges);
288 if (nUniqPoints < points_.size())
290 pointEdgesPtr_.reset(
nullptr);
300 if (pointIsUsed.
test(pointi))
302 pointMap[pointi] = newId;
307 points_[newId] = points_[pointi];
317 edge&
e = edges_[edgeI];
319 e[0] = pointMap[
e[0]];
320 e[1] = pointMap[
e[1]];
Various functions to operate on Lists.
Macros for easy insertion into member function selection tables.
Macros for easy insertion into run-time selection tables.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
Mesh data needed to do the Finite Area discretisation.
virtual void mergeEdges()
Merge duplicate edges and eliminate unused points.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
static wordHashSet writeTypes()
Summary of supported write file types.
virtual void mergePoints(const scalar mergeDist)
Geometric merge points (points within mergeDist) prior to.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
virtual void clear()
Clear all storage.
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
static wordHashSet readTypes()
Summary of supported read file types.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling file names.
const labelList & regions() const
transferModelList & transfer()
Transfer.
A class for handling words, derived from Foam::string.
word ext() const
Return file name extension (part after last .)
word lessExt() const
Return word without extension (part before last .)
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define defineMemberFunctionSelectionTable(baseType, funcName, argNames)
Define run-time selection table.
Geometric merging of points. See below.
void invertManyToMany(const label len, const UList< InputIntListType > &input, List< OutputIntListType > &output)
Invert many-to-many.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool equal(const T &s1, const T &s2)
Compare two values for equality.
List< labelList > labelListList
A List of labelList.
errorManip< error > abort(error &err)
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
label inplaceMergePoints(PointList &points, const scalar mergeTol, const bool verbose, labelList &pointToUnique)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.