MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
fem_template_element.cpp
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 //####// fem_template_element.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:55 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 #include <math.h>
26 #include "fem_template_element.h"
27 #include "fem_noeud.h"
28 #include "mg_element_maillage.h"
29 
31 {
32 }
33 
34 
36 {
37  double xmax=-1e308,ymax=-1e308,zmax=-1e308;
38  double xmin=1e308,ymin=1e308,zmin=1e308;
39  for (int i=0;i<N;i++)
40  {
41  tab[i]=tabnoeud[i];
42  FEM_NOEUD* noeud=tab[i];
43  double x=noeud->get_x();
44  if (x<xmin) xmin=x;
45  if (x>xmax) xmax=x;
46  double y=noeud->get_y();
47  if (y<ymin) ymin=y;
48  if (y>ymax) ymax=y;
49  double z=noeud->get_z();
50  if (z<zmin) zmin=z;
51  if (z>zmax) zmax=z;
52  }
53  boite.reinit(xmin,ymin,zmin,xmax,ymax,zmax);
54 }
55 
56 
57 template <int N> void FEM_TEMPLATE_ELEMENT<N>::reinit_boite_3D(void)
58 {
59  double xmax=-1e308,ymax=-1e308,zmax=-1e308;
60  double xmin=1e308,ymin=1e308,zmin=1e308;
61  for (int i=0;i<N;i++)
62  {
63  FEM_NOEUD* noeud=tab[i];
64  double x=noeud->get_x();
65  if (x<xmin) xmin=x;
66  if (x>xmax) xmax=x;
67  double y=noeud->get_y();
68  if (y<ymin) ymin=y;
69  if (y>ymax) ymax=y;
70  double z=noeud->get_z();
71  if (z<zmin) zmin=z;
72  if (z>zmax) zmax=z;
73  }
74  boite.reinit(xmin,ymin,zmin,xmax,ymax,zmax);
75 }
76 
77 
78 
80 {
81  for (int i=0;i<N;i++)
82  tab[i]=mdd.tab[i];
83  boite=mdd.boite;
84 }
85 
86 
87 
89 {
90 }
91 
92 
93 
95 {
96  return N;
97 }
98 
99 
101 {
102  return tab[num];
103 }
104 
105 
106 template <int N> void FEM_TEMPLATE_ELEMENT<N>::change_noeud(int num,FEM_NOEUD* noeud)
107 {
108  tab[num]=noeud;
109 }
110 
112 {
113  long id=tab[0]->get_id();
114  FEM_NOEUD* noeud=tab[0];
115  for (int i=0;i<N;i++)
116  {
117  long id2=tab[i]->get_id();
118  if (id2<id)
119  {
120  id=id2;
121  noeud=tab[i];
122  }
123  }
124  return noeud;
125 }
126 
128 {
129  return boite;
130 }
131 
132 #ifdef BORLANDCPP
133 template class __export FEM_TEMPLATE_ELEMENT<1>;
134 template class __export FEM_TEMPLATE_ELEMENT<2>;
135 template class __export FEM_TEMPLATE_ELEMENT<3>;
136 template class __export FEM_TEMPLATE_ELEMENT<6>;
137 template class __export FEM_TEMPLATE_ELEMENT<4>;
138 template class __export FEM_TEMPLATE_ELEMENT<10>;
139 template class __export FEM_TEMPLATE_ELEMENT<8>;
140 template class __export FEM_TEMPLATE_ELEMENT<20>;
141 template class __export FEM_TEMPLATE_ELEMENT<15>;
142 
143 #else
144 #ifdef GCC
145 template class FEM_TEMPLATE_ELEMENT<1>;
146 template class FEM_TEMPLATE_ELEMENT<2>;
147 template class FEM_TEMPLATE_ELEMENT<3>;
148 template class FEM_TEMPLATE_ELEMENT<6>;
149 template class FEM_TEMPLATE_ELEMENT<4>;
150 template class FEM_TEMPLATE_ELEMENT<10>;
151 template class FEM_TEMPLATE_ELEMENT<8>;
152 template class FEM_TEMPLATE_ELEMENT<20>;
153 template class FEM_TEMPLATE_ELEMENT<15>;
154 #else
155 #endif
156 #endif
gestionversion.h
FEM_TEMPLATE_ELEMENT::get_boite_3D
virtual BOITE_3D & get_boite_3D(void)
Definition: fem_template_element.cpp:127
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
fem_noeud.h
mg_element_maillage.h
FEM_TEMPLATE_ELEMENT::FEM_TEMPLATE_ELEMENT
FEM_TEMPLATE_ELEMENT()
Definition: fem_template_element.cpp:30
FEM_TEMPLATE_ELEMENT::get_fem_noeud
virtual FEM_NOEUD * get_fem_noeud(int num)
Definition: fem_template_element.cpp:100
FEM_TEMPLATE_ELEMENT::~FEM_TEMPLATE_ELEMENT
virtual ~FEM_TEMPLATE_ELEMENT()
Definition: fem_template_element.cpp:88
FEM_NOEUD::get_y
virtual double get_y(double coef=0.)
Definition: fem_noeud.cpp:210
FEM_TEMPLATE_ELEMENT::boite
BOITE_3D boite
Definition: fem_template_element.h:58
FEM_TEMPLATE_ELEMENT::change_noeud
virtual void change_noeud(int num, FEM_NOEUD *noeud)
Definition: fem_template_element.cpp:106
FEM_TEMPLATE_ELEMENT::get_fem_noeudpetitid
virtual FEM_NOEUD * get_fem_noeudpetitid(void)
Definition: fem_template_element.cpp:111
FEM_NOEUD::get_x
virtual double get_x(double coef=0.)
Definition: fem_noeud.cpp:205
FEM_NOEUD
Definition: fem_noeud.h:35
BOITE_3D
Definition: ot_boite_3d.h:27
FEM_TEMPLATE_ELEMENT::get_nb_fem_noeud
virtual int get_nb_fem_noeud(void)
Definition: fem_template_element.cpp:94
FEM_NOEUD::get_z
virtual double get_z(double coef=0.)
Definition: fem_noeud.cpp:215
FEM_TEMPLATE_ELEMENT::tab
FEM_NOEUD * tab[N]
Definition: fem_template_element.h:57
fem_template_element.h
FEM_TEMPLATE_ELEMENT::reinit_boite_3D
virtual void reinit_boite_3D(void)
Definition: fem_template_element.cpp:57
FEM_TEMPLATE_ELEMENT
Definition: fem_template_element.h:35