1 |
|
1 |
/*****************************************************************
|
2 |
|
|
|
3 |
|
|
m3d_ord_front.c Type:Func
|
4 |
|
|
|
5 |
|
|
Arrangement d un nouveau element dans le front
|
6 |
|
|
|
7 |
|
|
Date de creation : Wed Mar 6 15:07:24 1996
|
8 |
|
|
|
9 |
|
|
Derniere version : Thu May 8 18:21:24 1997
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
Vincent FRANCOIS
|
23 |
|
|
|
24 |
|
|
*****************************************************************/
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
/**************************/
|
31 |
|
|
/* include */
|
32 |
|
|
#include <stdio.h>
|
33 |
|
|
#include <math.h>
|
34 |
|
|
#include "const.h"
|
35 |
|
|
#include "memoire.h"
|
36 |
|
|
#include "struct.h"
|
37 |
|
|
#include "prototype.h"
|
38 |
|
|
|
39 |
|
|
/**************************/
|
40 |
|
|
/* variables globales */
|
41 |
|
|
extern struct environnement env;
|
42 |
|
|
extern struct s_mesh *mesh;
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
/**************************/
|
47 |
|
|
/* programme principal */
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
void m3d_ord_front(struct s_front3d *ele, int type)
|
51 |
|
|
{
|
52 |
|
|
int num;
|
53 |
|
|
float n1n2[4],n1n3[4],n2n3[4];
|
54 |
|
|
struct s_noeud *no1,*no2,*no3;
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
//if (type==NONFORCE)
|
58 |
|
|
// {
|
59 |
|
|
no1=ADRESSE(ele->n1,noeud,mesh->);
|
60 |
|
|
no2=ADRESSE(ele->n2,noeud,mesh->);
|
61 |
|
|
no3=ADRESSE(ele->n3,noeud,mesh->);
|
62 |
|
|
VEC(n1n2,no1,no2);
|
63 |
|
|
VEC(n1n3,no1,no3);
|
64 |
|
|
VEC(n2n3,no2,no3);
|
65 |
|
|
NORME(n1n2);
|
66 |
|
|
NORME(n1n3);
|
67 |
|
|
NORME(n2n3);
|
68 |
|
|
ele->longueur=0.33333333*(n1n2[3]+n1n3[3]+n2n3[3]);
|
69 |
|
|
// }
|
70 |
|
|
if (type==NONFORCE)
|
71 |
|
|
{
|
72 |
|
|
num=(int)(ele->longueur/env.dens*10.);
|
73 |
|
|
if (num>10) num=10;
|
74 |
|
|
}
|
75 |
|
|
else
|
76 |
|
|
{
|
77 |
|
|
num=type;
|
78 |
|
|
if (num>11) num=11;
|
79 |
|
|
}
|
80 |
|
|
ele->type=num;
|
81 |
|
|
if (mesh->tete_front3d[num]==NULL)
|
82 |
|
|
{
|
83 |
|
|
mesh->tete_front3d[num]=ele;
|
84 |
|
|
ele->precedent=NULL;
|
85 |
|
|
ele->suivant=NULL;
|
86 |
|
|
mesh->queue_front3d[num]=ele;
|
87 |
|
|
}
|
88 |
|
|
else
|
89 |
|
|
{
|
90 |
|
|
ele->precedent=mesh->queue_front3d[num];
|
91 |
|
|
mesh->queue_front3d[num]->suivant=ele;
|
92 |
|
|
mesh->queue_front3d[num]=ele;
|
93 |
|
|
ele->suivant=NULL;
|
94 |
|
|
}
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
}
|