VTK  9.6.20260519
vtkCPExodusIIElementBlock.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
14
15#ifndef vtkCPExodusIIElementBlock_h
16#define vtkCPExodusIIElementBlock_h
17
18#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
19#include "vtkIOExodusModule.h" // For export macro
20#include "vtkObject.h"
21
22#include "vtkMappedUnstructuredGrid.h" // For mapped unstructured grid wrapper
23
24#include <string> // For std::string
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkGenericCell;
28
29class VTK_DEPRECATED_IN_9_7_0("No longer needed") VTKIOEXODUS_EXPORT vtkCPExodusIIElementBlockImpl
30 : public vtkObject
31{
32public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
36
45 int* elements, const std::string& type, int numElements, int nodesPerElement);
46
47 // API for vtkMappedUnstructuredGrid's implementation.
50 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds);
51 void GetFaceStream(vtkIdType cellId, vtkIdList* ptIds);
53 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds);
55 void GetIdsOfCellsOfType(int type, vtkIdTypeArray* array);
57
58 // This container is read only -- these methods do nothing but print a
59 // warning.
60 void Allocate(vtkIdType numCells, int extSize = 1000);
62 vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
63 VTK_SIZEHINT(ptIds, npts);
64 vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkCellArray* faces)
65 VTK_SIZEHINT(ptIds, npts);
66
67 void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
68
69protected:
72
73private:
75 void operator=(const vtkCPExodusIIElementBlockImpl&) = delete;
76
77 // Convert between Exodus node ids and VTK point ids.
78 static vtkIdType NodeToPoint(const int& id) { return static_cast<vtkIdType>(id - 1); }
79 static int PointToNode(const vtkIdType& id) { return static_cast<int>(id + 1); }
80
81 // Convenience methods to get pointers into the element array.
82 int* GetElementStart(vtkIdType cellId) const
83 {
84 return this->Elements + (cellId * this->CellSize);
85 }
86 int* GetElementEnd(vtkIdType cellId) const
87 {
88 return this->Elements + (cellId * this->CellSize) + this->CellSize;
89 }
90 int* GetStart() const { return this->Elements; }
91 int* GetEnd() const { return this->Elements + (this->NumberOfCells * this->CellSize); }
92
93 int* Elements;
94 int CellType;
95 int CellSize;
96 vtkIdType NumberOfCells;
97};
98
100 VTK_DEPRECATED_IN_9_7_0("No longer needed") VTKIOEXODUS_EXPORT);
101
102VTK_ABI_NAMESPACE_END
103#endif // vtkCPExodusIIElementBlock_h
vtkIdType InsertNextCell(int type, vtkIdList *ptIds)
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkCellArray *faces)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)
~vtkCPExodusIIElementBlockImpl() override
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[])
int GetCellType(vtkIdType cellId)
void Allocate(vtkIdType numCells, int extSize=1000)
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
void GetPolyhedronFaces(vtkIdType cellId, vtkCellArray *faces)
bool SetExodusConnectivityArray(int *elements, const std::string &type, int numElements, int nodesPerElement)
Set the Exodus element block data.
void GetFaceStream(vtkIdType cellId, vtkIdList *ptIds)
static vtkCPExodusIIElementBlockImpl * New()
Uses an Exodus II element block as a vtkMappedUnstructuredGrid's implementation.
object to represent cell connectivity
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:135
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
#define VTK_DEPRECATED_IN_9_7_0(reason)
#define vtkMakeExportedMappedUnstructuredGrid(_className, _impl, _exportDecl)
int vtkIdType
Definition vtkType.h:363
#define VTK_SIZEHINT(...)