44 "tetra4",
"pyramid5",
"penta6",
"hexa8",
"nfaced" 50 "Support exactly 5 cell types (tetra4, pyramid5, penta6, hexa8, nfaced)" 56 void 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)
142 sizes_[typei] = size(
elemType(typei));
150 for (
int typei=0; typei < nTypes; ++typei)
152 const labelRange sub(
range(elemType(typei)));
156 SubList<label> ids(addressing(), sub);
164 template<
class Addressing>
165 void Foam::ensightCells::classifyImpl
167 const polyMesh&
mesh,
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;
255 classifyImpl(
mesh, cellIds);
265 classifyImpl(
mesh, selection);
void clear()
Clear element addressing.
void classify(const polyMesh &mesh)
Classify cell types and set the element lists.
A 1D vector of objects of type <T> with a fixed length <N>.
void resize(const label len)
Adjust allocated size of list.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
IOstream & hex(IOstream &io)
static const manifoldCellsMeshObject & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
A range or interval of labels defined by a start and a size.
void sort()
Sort element lists numerically.
const cellShapeList & cellShapes() const
Return cell shapes.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & endEntry(Ostream &os)
Write end entry (';') followed by newline.
virtual void writeDict(Ostream &os, const bool full=false) const
Write information about the object as a dictionary, optionally write all element addresses.
ensightCells()
Default construct, with part index 0.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void clearOut()
Clear any demand-driven data.
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
FixedList< label, nTypes > sizes() const
Processor-local sizes per element type.
void sort(UList< T > &list)
Sort the list.
Sorting/classification of cells (3D) into corresponding ensight element types.
virtual Ostream & endBlock()
Write end block group.
elemType
Supported ensight 'Cell' element types.
void reduce()
Sum element counts across all processes.
const labelList & addressing() const noexcept
Element addressing.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void clear()
Set addressable sizes to zero, free up addressing memory.
Base class for ensightCells, ensightFaces, ensightOutputSurfaces.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
static const char * key(const elemType etype) noexcept
The ensight element name for the specified 'Cell' type.
bool manifold() const
True if any manifold cells detected (globally) Triggers demand-driven filtering if required...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
label nCells() const noexcept
Number of mesh cells.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
static const char * elemNames[nTypes]
The ensight 'Cell' element type names.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
Mesh consisting of general polyhedral cells.
label totalSize() const noexcept
The global size of all element types.
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
static constexpr int nTypes
Number of 'Cell' element types (5)
static constexpr const zero Zero
Global zero (0)