37void Foam::primitiveMesh::calcCellPoints()
const
41 Pout<<
"primitiveMesh::cellCellPoints() : "
42 <<
"calculating cellPoints" <<
endl;
58 <<
"cellPoints already calculated"
64 cpPtr_ = std::make_unique<labelListList>(
nCells());
71 cpPtr_ = std::make_unique<labelListList>(
nCells());
72 auto& cellPointAddr = *cpPtr_;
81 DynamicList<label> currPoints(256);
83 const label loopLen =
nCells();
85 for (label celli = 0; celli < loopLen; ++celli)
88 usedPoints.unset(currPoints);
91 for (
const label facei : cellLst[celli])
93 for (
const label pointi : faceLst[facei])
96 if (usedPoints.set(pointi))
98 currPoints.push_back(pointi);
103 cellPointAddr[celli] = currPoints;
126 DynamicList<label>& storage
131 return cellPoints()[celli];
139 for (
const label facei : cFaces)
141 set.insert(fcs[facei]);
145 if (storage.capacity() <
set.size())
147 storage.setCapacity(
set.size());
150 for (
const label pointi : set)
152 storage.push_back(pointi);
161 return cellPoints(celli, labelSet_, labels_);
Various functions to operate on Lists.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void push_back(const T &val)
Copy append an element to the end of this list.
label capacity() const noexcept
Size of the underlying storage.
void setCapacity(const label len)
Alter the size of the underlying storage.
bool hasPointCells() const noexcept
const labelListList & pointCells() const
virtual const faceList & faces() const =0
Return faces.
label nPoints() const noexcept
Number of mesh points.
const labelListList & cellPoints() const
label nCells() const noexcept
Number of mesh cells.
bool hasCellPoints() const noexcept
const cellList & cells() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
void invertManyToMany(const label len, const UList< InputIntListType > &input, List< OutputIntListType > &output)
Invert many-to-many.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< cell > cellList
List of cell.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.