Debian Codegraph @

3rdparty/mshmet/src/sourceslib/mshmet.h

raw
1 #ifndef _MSHMET_H
2 #define _MSHMET_H
3
4 #include <assert.h>
5 #include <stdlib.h>
6 #include <stdio.h>
7 #include <limits.h>
8 #include <math.h>
9 #include <string.h>
10 #include <signal.h>
11 #include <ctype.h>
12
13 #include "chrono.h"
14 #include "memory.h"
15 #include "libmeshb7.h"
16 #include "eigenv.h"
17
18 #define MS_VER "3.0a"
19 #define MS_REL "Feb. 15, 2010"
20 #define MS_CPY "Copyright (c) LJLL, 2007-10"
21 #define MS_STR "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
22
23 #define PRECI 1.0
24 #define EPS 1.e-6
25 #define EPS1 1.e-20
26 #define EPST -1.e-2
27 #define EPSR 1.e+2
28 #define LONMAX 4096
29
30 #define CTE2D 2.0 / 9.0
31 #define CTE3D 9.0 / 32.0
32
33 #define MS_MAX(a,b) ( ((a) < (b)) ? (b) : (a) )
34 #define MS_MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
35
36 extern char idir[5];
37
38 typedef struct {
39 double c[3];
40 int s,nv,mark;
41 unsigned char b,h;
42 } Point;
43 typedef Point * pPoint;
44
45 typedef struct {
46 int v[3];
47 int mark;
48 } Tria;
49 typedef Tria * pTria;
50
51 typedef struct {
52 int v[4];
53 int mark;
54 } Tetra;
55 typedef Tetra * pTetra;
56
57 typedef struct {
58 double delta;
59 double min[3],max[3];
60 float eps,hmin,hmax,width,ani,hgrad,map;
61 int nnu,nsol,nlis;
62 char imprim,ddebug,iso,bin,metric,ls;
63 } Info;
64
65 typedef struct {
66 int min,max,nxt;
67 } hedge;
68
69 typedef struct {
70 int size,nhmax,hnxt;
71 hedge *item;
72 } Hash;
73 typedef Hash * pHash;
74
75 typedef struct {
76 int np,nt,ne,ver,dim;
77 int *adja,mark;
78 char *name,*mname;
79
80 pPoint point;
81 pTria tria;
82 pTetra tetra;
83 Info info;
84 } Mesh;
85 typedef Mesh * pMesh;
86
87 typedef struct {
88 int np,ver,dim,type,size,typtab[GmfMaxTyp];
89 double *sol,*met,*hes,*grd,*nn,umin,umax;
90 char *name,*outn,*mapname;
91 } Sol;
92 typedef Sol * pSol;
93
94
95 /* prototypes */
96 int loadMesh(pMesh ,char *);
97 int loadSol(pSol ,Info *,char *);
98 int loadMetric(pSol ,Info *,char *);
99 int saveMet(pSol ,Info *,char *);
100 int saveSol(pSol ,Info *,char *);
101 int outder(pMesh ,pSol );
102 int scaleMesh(pMesh ,pSol );
103 int unscaleMesh(pMesh ,pSol );
104
105 int mshme1(pMesh ,pSol );
106
107 /* function pointers */
108 int boulep_3d(pMesh ,int ,int ,int *);
109 int boulep_2d(pMesh ,int ,int ,int *);
110 int hashel_3d(pMesh );
111 int hashel_2d(pMesh );
112 int gradLS_3d(pMesh ,pSol ,int ,int );
113 int gradLS_2d(pMesh ,pSol ,int ,int );
114 int gradLS_s(pMesh ,pSol ,int ,int );
115 int hessLS_3d(pMesh ,pSol ,int ,int );
116 int hessLS_2d(pMesh ,pSol ,int ,int );
117 int hessLS_s(pMesh ,pSol ,int ,int );
118 int avgval_3d(pMesh ,pSol ,int );
119 int avgval_2d(pMesh ,pSol ,int );
120 int clsval_3d(pMesh ,pSol ,int );
121 int clsval_2d(pMesh ,pSol ,int );
122 double getSol_3d(pSol ,int ,int );
123 double getSol_2d(pSol ,int ,int );
124 int nrmhes_3d(pMesh ,pSol ,int );
125 int nrmhes_2d(pMesh ,pSol ,int );
126 int redsim_3d(double *,double *,double *);
127 int redsim_2d(double *,double *,double *);
128 int defmet_3d(pMesh ,pSol ,int );
129 int defmet_2d(pMesh ,pSol ,int );
130 int defmet_s(pMesh ,pSol ,int );
131 int metrLS_3d(pMesh mesh,pSol );
132 int metrLS_2d(pMesh mesh,pSol );
133 int lissag_3d(pMesh mesh,pSol sol,int is,int it);
134 int lissag_2d(pMesh mesh,pSol sol,int is,int it);
135 pHash hashEdge_3d(pMesh mesh);
136 pHash hashEdge_2d(pMesh mesh);
137
138 extern int (*boulep)(pMesh ,int ,int ,int *);
139 extern int (*hashel)(pMesh );
140 extern int (*gradLS)(pMesh ,pSol ,int ,int );
141 extern int (*hessLS)(pMesh ,pSol ,int ,int );
142 extern int (*avgval)(pMesh ,pSol ,int );
143 extern int (*clsval)(pMesh ,pSol ,int );
144 extern int (*nrmhes)(pMesh ,pSol ,int );
145 extern int (*redsim)(double *,double *,double *);
146 extern int (*defmet)(pMesh ,pSol ,int );
147 extern double (*getSol)(pSol ,int ,int );
148 extern int (*metrLS)(pMesh mesh,pSol );
149 extern int (*lissag)(pMesh ,pSol , int ,int );
150
151 #endif