Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/meshgen2d/src/include/Mesh.h
3203 views
1
#if !defined( MESH_MESH_H )
2
#define MESH_MESH_H
3
4
#include "MeshParser.h"
5
#include <map>
6
#include <fstream>
7
8
class GeometryNode;
9
class GeometryEdge;
10
class Node;
11
class Element;
12
class BoundaryElement;
13
class Body;
14
class BGMesh;
15
16
typedef std::map< int, Body * > BodyMap;
17
typedef std::map< int, Body * >::iterator BodyMapIt;
18
typedef std::map< int, GeometryNode * > GeometryNodeMap;
19
typedef std::map< int, GeometryNode * >::iterator GeometryNodeMapIt;
20
typedef std::map< int, GeometryEdge * > GeometryEdgeMap;
21
typedef std::map< int, GeometryEdge * >::iterator GeometryEdgeMapIt;
22
typedef std::map< int, Node * > NodeMap;
23
typedef std::map< int, Node * >::iterator NodeMapIt;
24
25
class Mesh
26
{
27
public:
28
Mesh();
29
void convertEdgeFormat( MeshParser& parser );
30
void discretize();
31
void createMiddleNodes();
32
33
void outputFlat(std::ofstream& o);
34
35
void output( std::ofstream& o );
36
37
void outputHeader( std::ofstream& o );
38
void outputNodes( std::ofstream& o );
39
void outputElements( std::ofstream& o );
40
void outputBoundary( std::ofstream& o );
41
42
protected:
43
BodyMap bodies;
44
GeometryNodeMap geometryNodes;
45
GeometryEdgeMap geometryEdges;
46
NodeMap fixedNodes;
47
NodeMap meshNodes;
48
std::list< Element * > elements;
49
std::vector< BoundaryElement * > boundaryElements;
50
};
51
52
#endif /* MESH_MESH_H */
53
54