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 78 79 80 81 82 83
|
#ifndef COMMON_H
#define COMMON_H
#define zero 0.0
#define one 1.0
#define two 2.0
#define three 3.0
#define four 4.0
#define five 5.0
#define six 6.0
#define seven 7.0
#define eight 8.0
#define pi acos(-one)
extern int nmesh;
extern int multigrid, testcase;
extern double tol, cll, clr;
extern double **dt;
extern double *p2h;
extern double **increment;
extern int *nelems, *nnodes, *fcc;
extern int ***pbc_list;
extern int **nb_elem_pbc;
struct Vector
{
double x, y;
};
struct Vertex
{
int nod1, nod2, nod3;
};
struct node
{
double u;
int *elem;
double x, y;
}
**nod;
struct edge
{
int nod1, nod2;
double length;
int bd_mark;
};
struct triangle
{
double u;
struct Vector bary;
struct Vertex vert;
int neigh[3];
struct Vector norm[3];
double area;
struct edge edg[3];
int parent;
int child[4];
}
**tri;
void read_input (void);
void mesh_init (void);
void mesh_refin (void);
void write_mesh (void);
void geometry (void);
void initialize (void);
void permut (int *, int *, int *);
void solver (void);
void lmg (void);
void restriction (int, struct triangle *, struct triangle *);
void restriction_res (int, double[], double[], struct triangle *);
void interpolation (int, struct triangle *, struct triangle *, double[]);
void forcing (int *, int *, int, int, struct triangle *, struct triangle *,
struct node *, struct node *, int **, int **);
void runge_kutta (int *, int, struct triangle *, struct node *, int **, double *);
void right_hand_side (int *, int, struct triangle *, struct node *, int **, double[]);
void right_hand_side2 (int *, int, struct triangle *, struct node *, int **, double[]);
void cal_err (int, double[], double *, int *);
void output_struc (void);
void output_unstruc (void);
void mesh_conn (void);
#endif |
Partager