41 const Foam::polyMesh*
const Foam::ensightPartCells::polyMeshNullPtr_ =
nullptr;
47 "(tetra4 pyramid5 penta6 hexa8 nfaced)" 54 void Foam::ensightPartCells::classify
69 size_ = mesh.nCells();
75 size_ = idList.
size();
85 for (
label listI = 0; listI < size_; ++listI)
90 cellId = idList[listI];
93 const cellShape& cellShape = cellShapes[
cellId];
94 const cellModel& cellModel = cellShape.model();
100 else if (cellModel == pyr)
104 else if (cellModel == prism)
108 else if (cellModel == hex)
133 for (
label listI = 0; listI < size_; ++listI)
135 label cellId = listI;
138 cellId = idList[listI];
141 const cellShape& cellShape = cellShapes[
cellId];
142 const cellModel& cellModel = cellShape.model();
144 if (cellModel == tet)
146 tetCells[nTet++] =
cellId;
148 else if (cellModel == pyr)
150 pyramidCells[nPyr++] =
cellId;
152 else if (cellModel == prism)
154 prismCells[nPrism++] =
cellId;
156 else if (cellModel == hex)
158 hexCells[nHex++] =
cellId;
162 polyCells[nPoly++] =
cellId;
168 elemLists_.setSize(elementTypes().size());
170 elemLists_[tetra4Elements].transfer(tetCells);
171 elemLists_[pyramid5Elements].transfer(pyramidCells);
172 elemLists_[penta6Elements].transfer(prismCells);
173 elemLists_[hexa8Elements].transfer(hexCells);
174 elemLists_[nfacedElements].transfer(polyCells);
183 const string& partDescription
187 mesh_(*polyMeshNullPtr_)
214 classify(mesh, idList);
228 classify(mesh, cZone);
278 if (usedPoints[f[fp]] == -1)
280 usedPoints[f[fp]] = nPoints++;
291 if (usedPoints[ptI] > -1)
293 usedPoints[ptI] = nPoints++;
302 void Foam::ensightPartCells::writeConnectivity
338 const face& cf = meshFaces[cFace[facei]];
360 if (
id == owner[faceId])
364 os.
write(pointMap[cf[ptI]] + 1);
371 os.
write(pointMap[cf[0]] + 1);
372 for (
label ptI = cf.
size()-1; ptI > 0; --ptI)
374 os.
write(pointMap[cf[ptI]] + 1);
390 const cellShape& cellPoints = cellShapes[id];
396 os.
write(pointMap[cellPoints[ptI]] + 1);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or nullptr.
label nPoints
Number of points used.
A face is a list of labels corresponding to mesh vertices.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
const cellShapeList & cellShapes() const
Return cell shapes.
Specialised Ensight output with extra geometry file header.
const pointField & points_
pointField referenced
Track the points used by the part and map global to local indices.
An implementation of ensightPart to hold volume mesh cells.
const cellList & cells() const
labelListList elemLists_
Simple labelList with a name.
labelList list
Map global to local indices.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
virtual const pointField & points() const
Return raw points.
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
A class for handling words, derived from string.
void reconstruct(Istream &)
Reconstruct part characteristics (eg, element types) from Istream.
virtual const labelList & faceOwner() const
Return face owner.
virtual void writeGeometry(ensightGeoFile &) const
Write geometry.
List< label > labelList
A List of labels.
const word & name() const
Return name.
virtual const faceList & faces() const
Return raw faces.
virtual Ostream & writeKeyword(const string &key)
Write keyword with trailing newline.
virtual Ostream & write(const char *buf, std::streamsize count)
Binary write.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Base class for ensightPartCells and ensightPartFaces.
defineTypeNameAndDebug(combustionModel, 0)
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
static const polyMesh *const polyMeshNullPtr_
void newline()
Add carriage return to ascii stream.
label offset_
Start offset for elemLists_.
Mesh consisting of general polyhedral cells.
virtual void writeGeometry(ensightGeoFile &) const
Write geometry.
static const List< word > elemTypes_
label size() const
Return the number of elements in the UList.
ensightPartCells(label partNumber, const string &partDescription)
Construct empty part with number and description.
virtual ~ensightPartCells()
Destructor.
const polyMesh & mesh_
Mesh referenced.