ResultWriter.h
1 #include "stdafx.h"
2 #include "Node.h"
3 #include <vector>
4 #include "Mesh.h"
5 #include "MeshSTL.h"
6 
7 #define EIGEN_NO_DEBUG
8 #include <Eigen/StdVector>
9 
10 #ifndef RESULTWRITER
11 #define RESULTWRITER
12 
14 
20 {
21 public:
28  ResultWriter(std::string fileName, Mesh mesh);
29 
30  bool writeSTL;
31 
35  bool open();
36 
40  void save();
41 
53  void writeVtkHeader();
54 
62  void writeMeshTopology(std::vector<Node>& nodes, std::vector<Element*>& elements);
63 
85  void writePointScalarData(std::string name, MatrixXd data);
86 
106  void writePointVectorData(std::string name, MatrixXd data);
107 
118  void writeCoordinateSystem(std::string name, int size);
119 
126  void writeShearCenter(std::string name, int size);
127 
134  void createTextFile(std::string fileNameNoExt);
135 
139  bool openTXT();
140 
147  void writeMeshSTLTopology(std::vector<Node>& nodes, std::vector<Element*>& elements);
148 
149 
150 private:
152  std::string fileName;
153  static const int extraVTKNodes = 3;
154 };
155 
156 #endif
Mesh mesh
Reference to Mesh object containg mesh data.
Definition: ResultWriter.h:151
Contains mesh data for massive analysis. Performs stress analysis on this mesh.
Definition: Mesh.h:21
Writes results to file for massive analysis.
Definition: ResultWriter.h:19
void writePointVectorData(std::string name, MatrixXd data)
Writes vector data to the result VTK file.
Definition: ResultWriter.cpp:170
bool openTXT()
Opens a .txt file.
Definition: ResultWriter.cpp:312
bool writeSTL
Boolean that decides wether to write regular VTK format or STL format.
Definition: ResultWriter.h:30
static const int extraVTKNodes
Number of extra nodes used for displaying VTK glyphs.
Definition: ResultWriter.h:153
void writePointScalarData(std::string name, MatrixXd data)
Writes scalar data to the result VTK file.
Definition: ResultWriter.cpp:155
void writeMeshTopology(std::vector< Node > &nodes, std::vector< Element * > &elements)
Writes the mesh topology to the result file (all points and polygons needed to represent the cross-se...
Definition: ResultWriter.cpp:45
void writeMeshSTLTopology(std::vector< Node > &nodes, std::vector< Element * > &elements)
Writes the mesh stl topology to the result file (all points and polygons needed to represent the cros...
Definition: ResultWriter.cpp:90
void writeCoordinateSystem(std::string name, int size)
Applies a coordinate system made of VTK glyphs over the result file.
Definition: ResultWriter.cpp:191
void createTextFile(std::string fileNameNoExt)
Creates a .txt file.
Definition: ResultWriter.cpp:226
std::string fileName
File name of file to write results with folder extension.
Definition: ResultWriter.h:152
void save()
Closes the file.
Definition: ResultWriter.cpp:33
bool open()
Opens the file given by the filename.
Definition: ResultWriter.cpp:23
void writeVtkHeader()
writes the header for the .vtk file
Definition: ResultWriter.cpp:38
ResultWriter(std::string fileName, Mesh mesh)
Constructor taking the filename and mesh as parameters.
Definition: ResultWriter.cpp:12
void writeShearCenter(std::string name, int size)
Applies a VTK box glyph at the shear center.
Definition: ResultWriter.cpp:209