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
|
#ifndef COMMON_H
#define COMMON_H
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define zero (double)0.0
#define one (double)1.0
#define two (double)2.0
#define three (double)3.0
#define four (double)4.0
#define five (double)5.0
#define six (double)6.0
#define seven (double)7.0
#define eight (double)8.0
#define pi (double)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;
Vector bary;
Vertex vert;
int neigh[3];
Vector norm[3];
double area;
edge edg[3];
int parent;
int child[4];
} **tri;
void read_input();
void mesh_init();
void mesh_refin();
void write_mesh();
void geometry();
void initialize();
void permut(int*,int*,int*);
void solver();
void lmg();
void restriction(int,triangle*,triangle*);
void restriction_res(int,double[],double[],triangle*);
void interpolation(int,triangle*,triangle*,double[]);
void forcing(int*,int*,int,int,triangle*,triangle*,
node*,node*,int**,int**);
void runge_kutta(int*,int,triangle*,node*,int**,double*);
void right_hand_side(int*,int,triangle*, node*,int**,double[]);
void right_hand_side2(int*,int,triangle*, node*,int**,double[]);
void cal_err(int,double[],double*,int*);
void output_struc();
void output_unstruc();
void mesh_conn();
#endif |
Partager