63 const cellModel& model,
64 const FixedList<label, N>& labels,
80 const cellModel& model,
103 m(cellModel::ptr(model))
116 const bool doCollapse
120 m(cellModel::ptr(model))
131 const word& modelName,
133 const bool doCollapse
137 m(cellModel::ptr(modelName))
204 labelList modelToMesh(localFaces.size(), -1);
208 const auto& localF = localFaces[i];
210 for (
const label meshFacei : cFaces)
212 if (allFaces[meshFacei] == localF)
214 modelToMesh[i] = meshFacei;
235 labelList modelToMesh(localEdges.size(), -1);
239 const auto&
e = localEdges[i];
241 for (
const label edgei : cEdges)
243 if (allEdges[edgei] ==
e)
245 modelToMesh[i] = edgei;
257 return m->
face(modelFacei, *
this);
263 return m->faces(*
this);
274 for (
const auto&
f : oldFaces)
276 auto& newF = newFaces[newFacei];
277 newF.resize(
f.size());
280 label prevVerti = -1;
282 for (
const label verti :
f)
284 if (verti != prevVerti)
286 newF[newFp++] = verti;
291 if ((newFp > 1) && (newF[newFp-1] == newF[0]))
303 newFaces.resize(newFacei);
311 return m->
edge(modelEdgei, *
this);
317 return m->edges(*
this);
335 label result = (empty() ? -1 : (*this)[0]);
337 for (
const label pointi : *
this)
351 label result = (empty() ? -1 : (*this)[0]);
353 for (
const label pointi : *
this)
369 const bool doCollapse
385 const cellModel& model,
386 const FixedList<label, N>& labels,
387 const bool doCollapse
406 for (
auto& vrt :
static_cast<labelList&
>(*
this))
A 1D vector of objects of type <T> with a fixed length <N>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void resize(const label len)
Adjust allocated size of list.
A List with indirect addressing. Like IndirectList but does not store addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const noexcept
label size() const noexcept
void size(const label n)
Older name for setAddressableSize.
const Vector< Cmpt > & centre(const Foam::UList< Vector< Cmpt > > &) const noexcept
Return this (for point which is a typedef to Vector<scalar>).
scalar mag() const
The length (L2-norm) of the vector.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Maps a geometry to a set of cell primitives.
modelType
Enumeration of commonly used cellModel types.
const cellModel & model() const
Model reference.
labelList meshEdges(const edgeList &allEdges, const labelList &cEdges) const
Mesh edge labels of this cell (in order of model).
label min() const
Return the smallest vertex label used by the shape or -1 if the shape is empty.
scalar mag(const UList< point > &points) const
Scalar magnitude.
void reset(const cellModel &model, const labelUList &labels, const bool doCollapse=false)
Reset from components.
autoPtr< cellShape > clone() const
Clone.
void collapse()
Collapse shape to correct one after removing duplicate vertices.
Foam::face face(const label modelFacei) const
The face for the specified model face.
pointField points(const UList< point > &meshPoints) const
The points corresponding to this shape.
labelList meshFaces(const faceList &allFaces, const cell &cFaces) const
Mesh face labels of this cell (in order of model).
void operator+=(const label vertexOffset)
Increment (offset) vertices by given amount.
point centre(const UList< point > &points) const
Centroid of the cell.
label nPoints() const noexcept
Number of points.
faceList faces() const
Faces of this cell.
constexpr cellShape() noexcept
Default construct. Empty shape, no cell model.
edgeList edges() const
Edges of this shape.
Foam::edge edge(const label modelEdgei) const
The edge for the specified model edge.
label max() const
Return the largest vertex label used by the shape or -1 if the shape is empty.
faceList collapsedFaces() const
Collapsed faces of this cell.
label nEdges() const
Number of edges.
label nFaces() const
Number of faces.
A cell is defined as a list of faces with extra functionality.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
edge()
Default construct, with invalid vertex labels (-1).
A face is a list of labels corresponding to mesh vertices.
constexpr face() noexcept=default
Default construct.
A class for handling words, derived from Foam::string.
List< edge > edgeList
List of edge.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.