1 |
francois |
283 |
|
2 |
|
|
#include <math.h> |
3 |
|
|
#include <stdio.h> |
4 |
|
|
#include <string.h> |
5 |
|
|
#include <stdlib.h> |
6 |
|
|
#include "r3d_struct.h" |
7 |
|
|
#include "m3d_const.h" |
8 |
|
|
#include "m3d_hotes.h" |
9 |
|
|
#include "prototype2.h" |
10 |
|
|
extern GEST_MEM *gest_r ; |
11 |
|
|
extern int debug ; |
12 |
|
|
extern int nb_max_noe ; |
13 |
|
|
extern int nb_max_ele ; |
14 |
|
|
int r3d_maidft(void) |
15 |
|
|
{ |
16 |
|
|
|
17 |
|
|
|
18 |
|
|
/* debut du code executable */ |
19 |
|
|
/* initialisations des variables */ |
20 |
|
|
|
21 |
|
|
/* ----------------------------------------------------- */ |
22 |
|
|
/* creation de la BD */ |
23 |
|
|
/* ----------------------------------------------------- */ |
24 |
|
|
|
25 |
|
|
/* creation noeuds et faces */ |
26 |
|
|
if (!r3d_c_bd()) |
27 |
|
|
{ |
28 |
|
|
if (debug) printf("%s\n"," erreur creation bd M3D_MAIDFT") ; |
29 |
|
|
return(FAUX) ; |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
/* |
33 |
|
|
----------------------------------------------------------------------------- |
34 |
|
|
constitution du maillage |
35 |
|
|
----------------------------------------------------------------------------- |
36 |
|
|
*/ |
37 |
|
|
if (!r3d_c_mai()) |
38 |
|
|
{ |
39 |
|
|
return(FAUX) ; |
40 |
|
|
} |
41 |
|
|
/* if (debug) printf("%s\n"," Remaillage termine") ;*/ |
42 |
|
|
FREE_ALLOC(connec) |
43 |
|
|
|
44 |
|
|
/* |
45 |
|
|
----------------------------------------------------------------------------------------- |
46 |
|
|
elimination des noeuds non connectes et renumerotation des noeuds |
47 |
|
|
compactage des listes de coordonnees et elements |
48 |
|
|
----------------------------------------------------------------------------------------- |
49 |
|
|
*/ |
50 |
|
|
|
51 |
|
|
FREE_ALLOC(tetra) |
52 |
|
|
gest_r->corresp = (int*)calloc((gest_r->nb_noeud +1),sizeof(int)) ; |
53 |
|
|
if (gest_r->corresp == NULL ) |
54 |
|
|
{ |
55 |
|
|
if (debug) printf("%s\n"," erreur alloc corresp M3D_MAIDFT ") ; |
56 |
|
|
return(FAUX) ; |
57 |
|
|
} |
58 |
|
|
/* face */ |
59 |
|
|
FREE_ALLOC(face) |
60 |
|
|
|
61 |
|
|
if (!r3d_comp()) |
62 |
|
|
{ |
63 |
|
|
if (debug) printf("%s\n"," erreur compactage M3D_MAIDFT ") ; |
64 |
|
|
return(FAUX) ; |
65 |
|
|
} |
66 |
|
|
gest_r->corresp = NULL ; |
67 |
|
|
|
68 |
|
|
/* noeuds */ |
69 |
|
|
FREE_ALLOC(noeud) |
70 |
|
|
|
71 |
|
|
return(VRAI) ; |
72 |
|
|
} |