24 return "UnstructuredGrid";
40 oss <<
"NumberOfPoints=\"" << mesh.
nVertices() <<
"\" ";
48 out <<
" <PDataArray type=\"Int32\" Name=\"connectivity\" NumberOfComponents=\"1\"/>\n";
49 out <<
" <PDataArray type=\"Int32\" Name=\"offsets\" NumberOfComponents=\"1\"/>\n";
50 out <<
" <PDataArray type=\"UInt8\" Name=\"types\" NumberOfComponents=\"1\"/>\n";
51 out <<
" </PCells>\n";
58 outFile <<
" <Cells>\n";
59 outFile <<
" <DataArray type=\"Int32\" Name=\"connectivity\" NumberOfComponents=\"1\" format=\"ascii\">\n";
71 outFile <<
" </DataArray> \n";
72 outFile <<
" <DataArray type=\"Int32\" Name=\"offsets\" NumberOfComponents=\"1\" format=\"ascii\">\n";
74 for (
size_t i = 1; i <= mesh.
triangles().size(); i++) {
75 outFile << 3 * i <<
" ";
78 for (
size_t i = 1; i <= mesh.
edges().size(); i++) {
79 outFile << 2 * i + triangleOffset <<
" ";
81 const auto tetraOffset = 2 * mesh.
edges().
size() + triangleOffset;
82 for (
size_t i = 1; i <= mesh.
tetrahedra().size(); i++) {
83 outFile << 4 * i + tetraOffset <<
" ";
86 outFile <<
" </DataArray>\n";
87 outFile <<
" <DataArray type=\"UInt8\" Name=\"types\" NumberOfComponents=\"1\" format=\"ascii\">\n";
89 for (
size_t i = 1; i <= mesh.
triangles().size(); i++) {
92 for (
size_t i = 1; i <= mesh.
edges().size(); i++) {
95 for (
size_t i = 1; i <= mesh.
tetrahedra().size(); i++) {
99 outFile <<
" </DataArray>\n";
100 outFile <<
" </Cells>\n";
std::string getVTKFormat() const override
void writeParallelCells(std::ostream &out) const override
std::string getParallelExtension() const override
std::string getPieceExtension() const override
std::string getPieceAttributes(const mesh::Mesh &mesh) const override
void exportConnectivity(std::ostream &outFile, const mesh::Mesh &mesh) const override
static void writeLine(const mesh::Edge &edge, std::ostream &outFile)
static void writeTriangle(const mesh::Triangle &triangle, std::ostream &outFile)
static void writeTetrahedron(const mesh::Tetrahedron &tetra, std::ostream &outFile)
Linear edge of a mesh, defined by two Vertex objects.
Container and creator for meshes.
std::size_t nVertices() const
Returns the number of vertices.
TetraContainer & tetrahedra()
Returns modifiable container holding all tetrahedra.
TriangleContainer & triangles()
Returns modifiable container holding all triangles.
EdgeContainer & edges()
Returns modifiable container holding all edges.
Tetrahedron of a mesh, defined by 4 vertices.
Triangle of a mesh, defined by three vertices.
provides Import and Export of the coupling mesh and data.