1 |
francois |
287 |
//------------------------------------------------------------
|
2 |
|
|
//------------------------------------------------------------
|
3 |
|
|
// MAGiC
|
4 |
|
|
// Jean Christophe Cuilli�e et Vincent FRANCOIS
|
5 |
|
|
// D�artement de G�ie M�anique - UQTR
|
6 |
|
|
//------------------------------------------------------------
|
7 |
|
|
// Le projet MAGIC est un projet de recherche du d�artement
|
8 |
|
|
// de g�ie m�anique de l'Universit�du Qu�ec �
|
9 |
|
|
// Trois Rivi�es
|
10 |
|
|
// Les librairies ne peuvent �re utilis�s sans l'accord
|
11 |
|
|
// des auteurs (contact : francois@uqtr.ca)
|
12 |
|
|
//------------------------------------------------------------
|
13 |
|
|
//------------------------------------------------------------
|
14 |
|
|
//
|
15 |
|
|
// mailleur3d_optimisation.h
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 �11H23
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
#ifndef mailleur3d_optimisationH
|
25 |
|
|
#define mailleur3d_optimisationH
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
#ifdef WINDOWS_VERSION
|
30 |
|
|
#ifdef BUILT_DLL_MAILLEUR
|
31 |
|
|
#define DLLPORTMAIL __declspec(dllexport)
|
32 |
|
|
#else
|
33 |
|
|
#define DLLPORTMAIL __declspec(dllimport)
|
34 |
|
|
#endif
|
35 |
|
|
#else
|
36 |
|
|
#define DLLPORTMAIL
|
37 |
|
|
#endif
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
#ifdef BORLANDCPP
|
42 |
|
|
#include <map.h>
|
43 |
|
|
#else
|
44 |
|
|
#include <map>
|
45 |
|
|
#define CLK_TCK CLOCKS_PER_SEC
|
46 |
|
|
#endif
|
47 |
|
|
|
48 |
|
|
#include <vector>
|
49 |
|
|
#include "mg_maillage.h"
|
50 |
|
|
#include "mg_geometrie.h"
|
51 |
|
|
#include "mg_volume.h"
|
52 |
|
|
#include "tpl_octree.h"
|
53 |
francois |
445 |
#include "mailleur.h"
|
54 |
francois |
287 |
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
francois |
445 |
class DLLPORTMAIL MAILLEUR3D_OPTIMISATION: public MAILLEUR
|
60 |
francois |
287 |
{
|
61 |
|
|
public:
|
62 |
|
|
typedef std::multimap<double,class M3D_TETRA*,std::less<double> > ORDRE_TETRA;
|
63 |
|
|
typedef std::map<unsigned long,ORDRE_TETRA::iterator,std::less<unsigned long> > ORDRE_TETRA_PARID;
|
64 |
|
|
|
65 |
|
|
MAILLEUR3D_OPTIMISATION(MG_MAILLAGE* mgmai,int niv);
|
66 |
|
|
virtual ~MAILLEUR3D_OPTIMISATION();
|
67 |
francois |
551 |
virtual void change_niveau_optimisation(int num);
|
68 |
|
|
virtual int get_niveau_optimisation(void);
|
69 |
francois |
287 |
|
70 |
francois |
445 |
|
71 |
francois |
551 |
virtual void optimise(MG_VOLUME* mgvol);
|
72 |
|
|
virtual void maille(MG_GROUPE_TOPOLOGIQUE* mggt) {} ;
|
73 |
francois |
287 |
|
74 |
francois |
288 |
protected:
|
75 |
francois |
551 |
virtual void optimise(MG_VOLUME* mgvol,int& nbmauvais);
|
76 |
|
|
virtual int bouge_point(MG_VOLUME* mgvol,class M3D_NOEUD* noeud,double& crit,double& x,double& y, double& z);
|
77 |
|
|
virtual void remaille_coquille(MG_NOEUD* noeud1,MG_NOEUD* noeud2, double& crit, class COQUILLE& coque);
|
78 |
|
|
virtual void ajouter_ordre_tetra(M3D_TETRA* tet,int num=1);
|
79 |
|
|
virtual void supprimer_ordre_tetra(M3D_TETRA* tet);
|
80 |
|
|
virtual double get_volume(MG_TETRA* tet);
|
81 |
|
|
virtual double get_volume(double *xyz1,double *xyz2,double *xyz3,double *xyz4);
|
82 |
francois |
287 |
|
83 |
|
|
ORDRE_TETRA lst_tetra[2];
|
84 |
|
|
ORDRE_TETRA_PARID lst_tetraid[2];
|
85 |
|
|
int niveau_optimisation;
|
86 |
|
|
|
87 |
francois |
551 |
virtual class MG_TRIANGLE* insere_triangle(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,int origine);
|
88 |
|
|
virtual MG_TRIANGLE* cree_triangle(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_SEGMENT* segment1,MG_SEGMENT* segment2,MG_SEGMENT* segment3,int origine);
|
89 |
|
|
virtual MG_SEGMENT* cree_segment(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int origine);
|
90 |
francois |
287 |
|
91 |
|
|
|
92 |
|
|
MG_MAILLAGE* mg_maillage;
|
93 |
francois |
551 |
virtual void o3d_data(void);
|
94 |
|
|
virtual void o3d_data2(void);
|
95 |
francois |
287 |
int tab_solution[7][1430][8];
|
96 |
|
|
int tab_face[7][120][3];
|
97 |
|
|
};
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
class COQUILLE
|
103 |
|
|
{
|
104 |
|
|
public:
|
105 |
|
|
COQUILLE():volume(0) {};
|
106 |
|
|
~COQUILLE() {};
|
107 |
|
|
|
108 |
|
|
int taille;
|
109 |
|
|
MG_TETRA* tet[10];
|
110 |
|
|
MG_NOEUD* new_tetra[64];
|
111 |
|
|
double volume;
|
112 |
|
|
};
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
//---------------------------------------------------------------------------
|
126 |
|
|
#endif
|