My Project
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 
21 {
22 public:
23  ResultWriter(std::string, Mesh mesh);
24 
25  bool writeSTL;
26  bool open();
27  void save();
28  void writeNormalStress();
29 
51  void writeMomentStress(std::vector<Node>, int);
52  void writeInertialAxes();
53 
68 
69  void writeScalarData(std::string, std::vector<double>);
70  void writeSingleValue(std::string, double);
71  void writeBoundaryNodes(int, std::vector<int>);
72 
73  // *************** VTK ***************
74  void writeVtkHeader();
75  void writeMeshTopology(std::vector<Node>& nodes, std::vector<Element*>& elements);
76  void writePointScalarData(std::string name, MatrixXd data);
77  void writePointVectorData(std::string name, MatrixXd data);
78 
79 
80 private:
81  Mesh mesh;
82  std::string fileName;
83 };
84 
85 #endif
Contains mesh data and has function to calculate and retrieve mesh properties.
Definition: Mesh.h:20
Opens and writes results to file.
Definition: ResultWriter.h:20
void writePointVectorData(std::string name, MatrixXd data)
Writes point vector data to result VTK file.
Definition: ResultWriter.cpp:243
bool writeSTL
Boolean that decides wether to write regular VTK format or STL format.
Definition: ResultWriter.h:25
void writePointScalarData(std::string name, MatrixXd data)
Writes Scalar values to result VTK file.
Definition: ResultWriter.cpp:231
void writeInertialAxes()
Writes the angle of one of the inertial axes to file.
Definition: ResultWriter.cpp:67
void writeMeshTopology(std::vector< Node > &nodes, std::vector< Element * > &elements)
Writes the mesh topology to the result file.
Definition: ResultWriter.cpp:166
void writeMeshAreaProperties()
Writes mesh properties to result file.
Definition: ResultWriter.cpp:72
ResultWriter(std::string, Mesh mesh)
Constructor taking the filename and mesh as parameters.
Definition: ResultWriter.cpp:12
void writeScalarData(std::string, std::vector< double >)
Writes scalar data.
Definition: ResultWriter.cpp:113
void writeSingleValue(std::string, double)
Writes single value.
Definition: ResultWriter.cpp:103
void save()
Closes the file.
Definition: ResultWriter.cpp:155
bool open()
Opens the file given by the filename.
Definition: ResultWriter.cpp:145
void writeVtkHeader()
Writes header for result VTK file, with version information.
Definition: ResultWriter.cpp:160
void writeMomentStress(std::vector< Node >, int)
Writes moment stresses to the result VTK file.
Definition: ResultWriter.cpp:22
void writeBoundaryNodes(int, std::vector< int >)
Writes the boundary nodes to the VTK result file.
Definition: ResultWriter.cpp:127
void writeNormalStress()
Writes the normal stresses to the result VTK file.
Definition: ResultWriter.cpp:57