preCICE v3.1.2
Loading...
Searching...
No Matches
ExportVTK.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4#include <iosfwd>
5#include <string>
6#include "io/Export.hpp"
7#include "logging/Logger.hpp"
8
9namespace precice {
10namespace mesh {
11class Mesh;
12}
13} // namespace precice
14
15namespace precice {
16namespace io {
17
19class ExportVTK : public Export {
20public:
22 virtual void doExport(
23 const std::string &name,
24 const std::string &location,
25 const mesh::Mesh & mesh);
26
27 static void initializeWriting(
28 std::ofstream &filestream);
29
30 static void writeHeader(std::ostream &outFile);
31
32 static void writeVertex(
33 const Eigen::VectorXd &position,
34 std::ostream & outFile);
35
36 static void writeLine(
37 int vertexIndices[2],
38 std::ostream &outFile);
39
40 static void writeTriangle(
41 int vertexIndices[3],
42 std::ostream &outFile);
43
44 static void writeTetrahedron(
45 int vertexIndices[4],
46 std::ostream &outFile);
47
48private:
49 mutable logging::Logger _log{"io::ExportVTK"};
50
52 std::ofstream & outFile,
53 const std::string &filename) const;
54
55 void exportMesh(
56 std::ofstream & outFile,
57 const mesh::Mesh &mesh);
58
59 void exportData(
60 std::ofstream & outFile,
61 const mesh::Mesh &mesh);
62
63 void exportGradient(
64 std::ofstream & outFile,
65 const mesh::Mesh &mesh);
66};
67
68} // namespace io
69} // namespace precice
std::string name
Writes polygonal, or triangle meshes to vtk files.
Definition ExportVTK.hpp:19
void exportData(std::ofstream &outFile, const mesh::Mesh &mesh)
logging::Logger _log
Definition ExportVTK.hpp:49
static void writeVertex(const Eigen::VectorXd &position, std::ostream &outFile)
static void writeHeader(std::ostream &outFile)
static void writeLine(int vertexIndices[2], std::ostream &outFile)
static void initializeWriting(std::ofstream &filestream)
static void writeTetrahedron(int vertexIndices[4], std::ostream &outFile)
void openFile(std::ofstream &outFile, const std::string &filename) const
void exportMesh(std::ofstream &outFile, const mesh::Mesh &mesh)
Definition ExportVTK.cpp:45
virtual void doExport(const std::string &name, const std::string &location, const mesh::Mesh &mesh)
Perform writing to VTK file.
Definition ExportVTK.cpp:20
static void writeTriangle(int vertexIndices[3], std::ostream &outFile)
void exportGradient(std::ofstream &outFile, const mesh::Mesh &mesh)
Abstract base class of all classes exporting container data structures.
Definition Export.hpp:15
This class provides a lightweight logger.
Definition Logger.hpp:16
Container and creator for meshes.
Definition Mesh.hpp:39
Main namespace of the precice library.