Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
GmshReader.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_GmshReader_H_
9#define model_GmshReader_H_
10
11#include <iostream>
12#include <string>
13#include <fstream>
14#include <vector>
15#include <map>
16#include <assert.h>
17#include <chrono>
18
19#include <Eigen/Dense>
20
21
22
23namespace model
24{
25
27 {
28
29 const int dim;
30 const int tag;
31 const std::string name;
32
33 };
34
36 {
37 int ID;
38 int type;
39 std::vector<int> tags;
40 std::vector<size_t> nodeIDs;
41
42 };
43
44 class GmshReader : private std::map<size_t,Eigen::Vector3d>
45 /* */,private std::map<size_t,GmshElement>
46 /* */,private std::map<int,GmshPhysicalName>
47 {// based on documentation here http://www.manpagez.com/info/gmsh/gmsh-2.2.6/gmsh_63.php
48
49
50 static std::map<int,std::string> getElementTypes();
51 static int numberOfNodes(const int& type);
52
53 public:
54
55 const std::map<int,std::string> elementTypes;
56 float version;
57 int format;
58 int size;
62 std::map<int,size_t> numberElementsByType;
63
64 GmshReader(const std::string& meshFileName);
65 GmshReader(const std::string& meshFileName,const Eigen::Matrix<double,3,3>& A,const Eigen::Matrix<double,3,1>& x0);
66 const std::map<size_t,Eigen::Vector3d>& nodes() const;
67 std::map<size_t,Eigen::Vector3d>& nodes();
68 const std::map<size_t,GmshElement>& elements() const;
69 std::map<size_t,GmshElement>& elements();
70 std::map<int,GmshPhysicalName>& physicalNames();
71 const std::map<int,GmshPhysicalName>& physicalNames() const;
72 void readVersion2(std::ifstream& meshFile,const Eigen::Matrix<double,3,3>& A,const Eigen::Matrix<double,3,1>& x0);
73 void read(const std::string& meshFileName,const Eigen::Matrix<double,3,3>& A,const Eigen::Matrix<double,3,1>& x0);
74
75 };
76}
77#endif
78
const std::map< size_t, Eigen::Vector3d > & nodes() const
std::map< int, GmshPhysicalName > & physicalNames()
const std::map< size_t, GmshElement > & elements() const
GmshReader(const std::string &meshFileName)
void readVersion2(std::ifstream &meshFile, const Eigen::Matrix< double, 3, 3 > &A, const Eigen::Matrix< double, 3, 1 > &x0)
const std::map< int, std::string > elementTypes
Definition GmshReader.h:55
void read(const std::string &meshFileName, const Eigen::Matrix< double, 3, 3 > &A, const Eigen::Matrix< double, 3, 1 > &x0)
std::map< int, size_t > numberElementsByType
Definition GmshReader.h:62
function infiniteDisplacement syms Ax Ay Az Bx By Bz qx qy qz u L x y z real A
std::vector< int > tags
Definition GmshReader.h:39
std::vector< size_t > nodeIDs
Definition GmshReader.h:40
const std::string name
Definition GmshReader.h:31