44 "tetra4",
"pyramid5",
"penta6",
"hexa8",
"nfaced"
50 "Support exactly 5 cell types (tetra4, pyramid5, penta6, hexa8, nfaced)"
56void Foam::ensightCells::resizeAll()
62 auto iter = offsets_.begin();
65 for (
const label
n : sizes_)
102 for (
int typei = 0; typei < nTypes; ++typei)
114 for (label
n : sizes_)
140 for (
int typei = 0; typei < nTypes; ++typei)
150 for (
int typei=0; typei < nTypes; ++typei)
152 const labelRange sub(
range(elemType(typei)));
156 SubList<label> ids(addressing(), sub);
164template<
class Addressing>
165void Foam::ensightCells::classifyImpl
168 const Addressing& cellIds
184 for (
const label
id : cellIds)
186 const cellModel& model = shapes[id].model();
188 elemType etype(elemType::NFACED);
191 etype = elemType::TETRA4;
193 else if (model == pyr)
195 etype = elemType::PYRAMID5;
197 else if (model == prism)
199 etype = elemType::PENTA6;
201 else if (model ==
hex)
203 etype = elemType::HEXA8;
215 for (
const label
id : cellIds)
217 const cellModel& model = shapes[id].model();
219 elemType etype(elemType::NFACED);
222 etype = elemType::TETRA4;
224 else if (model == pyr)
226 etype = elemType::PYRAMID5;
228 else if (model == prism)
230 etype = elemType::PENTA6;
232 else if (model ==
hex)
234 etype = elemType::HEXA8;
265 classifyImpl(
mesh, selection);
273 os.writeEntry(
"id", index()+1);
274 os.writeEntry(
"name",
name());
275 os.writeEntry(
"size", size());
A 1D vector of objects of type <T> with a fixed length <N>.
bool empty() const noexcept
True if range is empty (zero-sized).
void resize(const label len)
Adjust allocated size of list.
static FOAM_NO_DANGLING_REFERENCE const manifoldCellsMeshObject & New(const polyMesh &mesh, Args &&... args)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
A non-owning sub-view of a List (allocated or unallocated storage).
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Maps a geometry to a set of cell primitives.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
Sorting/classification of cells (3D) into corresponding ensight element types.
static const char * key(const elemType etype) noexcept
The ensight element name for the specified 'Cell' type.
label totalSize() const noexcept
The global size of all element types.
void reduce()
Sum element counts across all processes.
void sort()
Sort element lists numerically.
void classify(const polyMesh &mesh)
Classify cell types and set the element lists.
static constexpr int nTypes
Number of 'Cell' element types (5).
virtual void writeDict(Ostream &os, const bool full=false) const
Write information about the object as a dictionary, optionally write all element addresses.
label size(const elemType etype) const
Processor-local size of the specified element type.
ensightCells()
Default construct, with part index 0.
static const char * elemNames[nTypes]
The ensight 'Cell' element type names.
elemType
Supported ensight 'Cell' element types.
void clear()
Set addressable sizes to zero, free up addressing memory.
FixedList< label, nTypes > sizes() const
Processor-local sizes per element type.
const labelList & cellIds() const
Processor-local cell ids of all elements.
void clearOut()
Clear any demand-driven data.
void rename(const string &value)
Change the part name or description.
label index() const noexcept
The index in a list (0-based).
const labelList & addressing() const noexcept
Element addressing.
ensightPart()
Default construct. Index=0, identifier = -1.
void clear()
Clear element addressing.
A range or interval of labels defined by a start and a size.
bool manifold() const
True if any manifold cells detected (globally) Triggers demand-driven filtering if required.
Mesh consisting of general polyhedral cells.
const cellShapeList & cellShapes() const
Return cell shapes.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
IOstream & hex(IOstream &io)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
void sort(UList< T > &list)
Sort the list.
static constexpr const zero Zero
Global zero (0).
Ostream & endEntry(Ostream &os)
Write end entry (';') followed by newline.
UList< label > labelUList
A UList of labels.
List< cellShape > cellShapeList
List of cellShape.