Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/meshgen2d/src/include/MeshParser.h
3203 views
1
#if !defined( MESH_MESHPARSER_H )
2
#define MESH_MESHPARSER_H
3
4
#include <fstream>
5
#include <vector>
6
#include <map>
7
8
#include "Tokens.h"
9
10
class MeshParser
11
{
12
public:
13
friend class Mesh;
14
MeshParser( const char *path );
15
MeshParser( const char *path, std::map<int, BGMeshToken*> *ebgs);
16
~MeshParser();
17
18
void readInputFile();
19
int readExplicitBGMesh(BGMeshToken *bg);
20
21
protected:
22
int ignoreComment();
23
int readHeader();
24
int readNodes();
25
int readEdges();
26
int readBodies();
27
int readLayers( const int layerCount );
28
int readSeed();
29
int readLoops( const int loopCount );
30
int readFixedNodes( const int fixedNodeCount );
31
int readBGMesh();
32
int readBoundary();
33
34
int readWord( const char *ref );
35
int readInteger( int& ref );
36
int readDouble( double& ref );
37
int readString( std::string& ref );
38
39
std::ifstream s;
40
41
int nodeCount;
42
int edgeCount;
43
int bodyCount;
44
45
double delta;
46
double scale;
47
48
std::vector< NodeToken * > nodes;
49
std::vector< EdgeToken * > edges;
50
std::vector< BodyToken * > bodies;
51
BoundaryToken *boundary;
52
53
std::map<int, BGMeshToken *> *bgmeshes;
54
55
BodyToken *currentBody;
56
LayerToken *currentLayer;
57
SeedToken *currentSeed;
58
};
59
60
#endif /* MESH_MESHPARSER_H */
61
62