Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// ============================================================================
// == ==
// == crystal growth group ==
// == ==
// == Stiftung caesar ==
// == Ludwig-Erhard-Allee 2 ==
// == 53175 Bonn ==
// == germany ==
// == ==
// ============================================================================
// == ==
// == http://www.caesar.de/cg/AMDiS ==
// == ==
// ============================================================================
/** \file MacroReader.h */
#ifndef AMDIS_MACROREADER_H
#define AMDIS_MACROREADER_H
#include <deque>
#include "Global.h"
#include "FixVec.h"
#include "Boundary.h"
namespace AMDiS {
class Mesh;
class MacroElement;
class ElInfo;
class MacroInfo;
/** \defgroup Input Input module */
// ===========================================================================
// ===== class MacroReader ===================================================
// ===========================================================================
/** \ingroup Input
*
* \brief
* Static class which reads a macro triangulation file and creates
* the corresponding macro mesh.
*/
class MacroReader
{
public:
/** \brief
* Creates a Mesh by reading the macro file with the given filename
*/
static MacroInfo* readMacro(const char *filename,
Mesh* mesh,
const char *periodicFile,
int check);
protected:
static void computeNeighbours(Mesh *mesh);
static void boundaryDOFs(Mesh *mesh);
static void umb(int *ele, Mesh *mesh,
void (*umbvk)(Mesh *mesh, MacroElement*,int k, int *el));
static int macrotest(Mesh *mesh);
static void macroTest(Mesh *mesh, const char *nameneu);
static bool newEdge(Mesh *mesh, MacroElement *mel,
int mel_edge_no, int *n_neigh);
static void fillMelBoundary(Mesh *, MacroElement *mel,
FixVec<BoundaryType ,NEIGH>);
static void fillMelNeigh(MacroElement *mel,
std::deque<MacroElement*>& macro_elements,
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
FixVec<int,NEIGH> ind);
static void umbVkantMacro(Mesh *mesh,
MacroElement *,
int ka,
int *ele);
static void recumb(Mesh *mesh,
MacroElement *mel, MacroElement *macroalt,
int *test, double lg, int ka, int *ele,
void (*umbvk)(Mesh *mesh, MacroElement*,int k, int *el));
static void laengstekante(FixVec<WorldVector<double>,VERTEX> coord,
double *l, int *v);
static void checkMesh(Mesh *mesh);
static int basicCheckFct(ElInfo* e);
static int basicDOFCheckFct(ElInfo* e);
static int basicNodeFct(ElInfo* e);
friend class MacroInfo;
};
// ==========================================================================
// ===== class MacroInfo ====================================================
// ==========================================================================
/** \ingroup Input
* \brief
* Used for reading a macro triangulation
*/
class MacroInfo
{
public:
MEMORY_MANAGED(MacroInfo);
/** \brief
* Pointer to the Mesh
*/
Mesh *mesh;
/** \brief
* list of macro elements
*/
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/** \brief
* vector of all vertex dofs
*/
DegreeOfFreedom **dof;
/** \brief
* coords[j][k]: kth coordinate of global vertex j
*/
WorldVector<double> *coords;
/** \brief
* mel_vertex[i][k]: global index of kth vertex of element i
*/
int **mel_vertex;
/** \brief
* true, if neighbour information is in macro file
*/
bool neigh_set;
/** \brief
* true, if boundary information is in macro file
*/
bool bound_set;
public:
/** \brief
* Fills MacroInfo structure and some pointers in mesh
*/
void fill(Mesh *mesh, int ne, int nv);
/** \brief
* Reads macro triangulation from ascii file in AMDiS format.
* Fills MacroInfo structure.
* Called by Mesh::readMacro(), fills missing information
*/
void readAMDiSMacro(const char *filename, Mesh* mesh);
/** \brief
* Frees memory of MacroInfo
*/
void clear(int ne, int nv);
/** \brief
* Sets the boundary of all edges/faces with no neigbour to a straight
* line/face with dirichlet boundary type
*/
void dirichletBoundary();
void fillBoundaryInfo(Mesh *mesh);
protected:
/** \brief
* Reads indices from macro file
*/
int read_indices(FILE *file, DimVec<int> &id);
};
}
#endif