MAGiC
V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
CAD4FE_mg_utils.h
Aller à la documentation de ce fichier.
1
//####//------------------------------------------------------------
2
//####//------------------------------------------------------------
3
//####// MAGiC
4
//####// Jean Christophe Cuilliere et Vincent FRANCOIS
5
//####// Departement de Genie Mecanique - UQTR
6
//####//------------------------------------------------------------
7
//####// MAGIC est un projet de recherche de l equipe ERICCA
8
//####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9
//####// http://www.uqtr.ca/ericca
10
//####// http://www.uqtr.ca/
11
//####//------------------------------------------------------------
12
//####//------------------------------------------------------------
13
//####//
14
//####// CAD4FE_mg_utils.h
15
//####//
16
//####//------------------------------------------------------------
17
//####//------------------------------------------------------------
18
//####// COPYRIGHT 2000-2024
19
//####// jeu 13 jun 2024 11:58:56 EDT
20
//####//------------------------------------------------------------
21
//####//------------------------------------------------------------
22
23
#ifndef CAD4FE_mg_utilsH
24
#define CAD4FE_mg_utilsH
25
26
#include "
CAD4FE_Common_platform.h
"
27
28
#include "
mg_maillage.h
"
29
#include "
mg_geometrie.h
"
30
#include "
tpl_grille.h
"
31
#include "
mg_volume.h
"
32
33
34
#define MG_TRIANGLE_GET_NOEUDS(triang,vec_nodes) \
35
vec_nodes[0] = triang->get_noeud1(); \
36
vec_nodes[1] = triang->get_noeud2(); \
37
vec_nodes[2] = triang->get_noeud3();
38
39
#define MG_TRIANGLE_GET_SEGMENTS(triang,vec_segs) \
40
vec_segs[0] = triang->get_segment1(); \
41
vec_segs[1] = triang->get_segment2(); \
42
vec_segs[2] = triang->get_segment3();
43
44
#define MG_SEGMENT_GET_NOEUDS(seg,vec_nodes)\
45
vec_nodes[0] = seg->get_noeud1();\
46
vec_nodes[1] = seg->get_noeud2();
47
48
#define MG_SEGMENT_GET_2TRIANGLES(seg,vec_triangles)\
49
vec_triangles[0]=
50
51
#define MG_SOMMET_GET_XYZ(s,xyz) xyz[0]=s->get_point()->evaluer(xyz)
52
53
class
MG_UTILS
{
54
public
:
55
56
57
static
void
MG_NOEUD_GET_XYZ
(
MG_NOEUD
*
node
,
double
* xyz){
58
xyz[0]=
node
->get_x(); xyz[1]=
node
->get_y(); xyz[2]=
node
->get_z();
59
}
60
static
void
MG_NOEUD_GET_XYZ
(
MG_NOEUD
*
node
,
float
* xyz){
61
xyz[0]=
node
->get_x(); xyz[1]=
node
->get_y(); xyz[2]=
node
->get_z();
62
}
63
64
static
void
GetFEVCount
(
MG_VOLUME
* __volume,
int
* __faceCount,
int
* __edgeCount,
int
* __vertexCount);
65
66
67
static
void
MG_MAILLAGE_GetBoundingBox
(
MG_MAILLAGE
* __mesh,
double
__bbox [6] );
68
69
70
static
double
MG_MAILLAGE_GetVolume
(
MG_MAILLAGE
* __mesh);
71
static
double
MG_MAILLAGE_GetSurface
(
MG_MAILLAGE
* __mesh);
72
73
74
75
template
<
class
A>
76
void
77
TPL_GRILLE_Construct
(
double
__bbox[6],
int
__nb_steps[3],
TPL_GRILLE<A>
& __grid)
78
{
79
// Compute the center of the bounding box
80
double
center[3];
81
for
(
int
i=0; i<3; i++)
82
center[i] = .5*(__bbox[i] + __bbox[3+i]);
83
84
// Compute the size of each cell of the grid
85
double
step[3];
86
for
(
int
i=0; i<3; i++)
87
step[i] = (__bbox[3+i] - __bbox[i])/__nb_steps[i];
88
89
// Enlarge the bounding box of the grid
90
// by 10 % of cell's size
91
double
bbox[6];
92
for
(
int
i=0; i<6; i++) bbox[i] = __bbox[i];
93
for
(
int
i=0; i<3; i++)
94
bbox[i+3] += .1*step[i];
95
96
// Construct the grid with the enlarged bounding box
97
__grid.
initialiser
(bbox[0], bbox[1], bbox[2], bbox[3], bbox[4], bbox[5], __nb_steps[0], __nb_steps[1], __nb_steps[2]);
98
}
99
100
101
};
102
103
#endif
MG_UTILS
Definition:
CAD4FE_mg_utils.h:53
MG_UTILS::MG_NOEUD_GET_XYZ
static void MG_NOEUD_GET_XYZ(MG_NOEUD *node, float *xyz)
Definition:
CAD4FE_mg_utils.h:60
MG_UTILS::MG_MAILLAGE_GetBoundingBox
static void MG_MAILLAGE_GetBoundingBox(MG_MAILLAGE *__mesh, double __bbox[6])
Definition:
CAD4FE_mg_utils.cpp:40
mg_geometrie.h
MG_UTILS::MG_MAILLAGE_GetSurface
static double MG_MAILLAGE_GetSurface(MG_MAILLAGE *__mesh)
Definition:
CAD4FE_mg_utils.cpp:108
CAD4FE_Common_platform.h
MG_UTILS::TPL_GRILLE_Construct
void TPL_GRILLE_Construct(double __bbox[6], int __nb_steps[3], TPL_GRILLE< A > &__grid)
Definition:
CAD4FE_mg_utils.h:77
TPL_GRILLE
Definition:
tpl_grille.h:121
MG_VOLUME
Definition:
mg_volume.h:33
MG_UTILS::GetFEVCount
static void GetFEVCount(MG_VOLUME *__volume, int *__faceCount, int *__edgeCount, int *__vertexCount)
Definition:
CAD4FE_mg_utils.cpp:144
MG_UTILS::MG_MAILLAGE_GetVolume
static double MG_MAILLAGE_GetVolume(MG_MAILLAGE *__mesh)
Definition:
CAD4FE_mg_utils.cpp:69
MG_NOEUD
Definition:
mg_noeud.h:41
MG_UTILS::MG_NOEUD_GET_XYZ
static void MG_NOEUD_GET_XYZ(MG_NOEUD *node, double *xyz)
Definition:
CAD4FE_mg_utils.h:57
tpl_grille.h
node
#define node(i, j)
mg_maillage.h
MG_MAILLAGE
Definition:
mg_maillage.h:62
TPL_GRILLE::initialiser
virtual void initialiser(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, int nb_pasx, int nb_pasy, int nb_pasz)
Definition:
tpl_grille.h:142
mg_volume.h
home
francois
tmp
lib
CAD4FE
src
CAD4FE_mg_utils.h
Généré le Jeudi 12 Juin 2025 23:00:07 pour MAGiC par
1.8.17