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
// ============================================================================
// == ==
// == 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 */
/** \ingroup Input
*
* \brief
* Static class which reads a macro triangulation file and creates
* the corresponding macro mesh.
*/
class MacroReader
{
public:
/// 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,
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 void basicDOFCheckFct(ElInfo* elInfo, Mesh *mesh, int iadmin);
friend class MacroInfo;
};
/** \ingroup Input
* \brief
* Used for reading a macro triangulation
*/
class MacroInfo
{
public:
MEMORY_MANAGED(MacroInfo);
DegreeOfFreedom **dof;
/// coords[j][k]: kth coordinate of global vertex j
WorldVector<double> *coords;
/// mel_vertex[i][k]: global index of kth vertex of element i
/// true, if neighbour information is in macro file
/// true, if boundary information is in macro file
bool bound_set;
public:
/// 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);
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:
int read_indices(FILE *file, DimVec<int> &id);
};
}
#endif