ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/fem_segment3.cpp
Revision: 310
Committed: Thu Jan 26 21:14:45 2012 UTC (13 years, 3 months ago) by francois
File size: 5473 byte(s)
Log Message:
Ajout des elements quadrangle et hexaedre dans les maillages FEM
Changement de la version des fichier de visu sous GMSH. Les .pos ont disparus et tout est intégré dans les .msh

File Contents

# User Rev Content
1 francois 283 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4     // Jean Christophe Cuilli�re et Vincent FRANCOIS
5     // D�partement de G�nie M�canique - UQTR
6     //------------------------------------------------------------
7     // Le projet MAGIC est un projet de recherche du d�partement
8     // de g�nie m�canique de l'Universit� du Qu�bec �
9     // Trois Rivi�res
10     // Les librairies ne peuvent �tre utilis�es sans l'accord
11     // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // fem_segment3.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20     // Version du 02/03/2006 � 11H22
21     //------------------------------------------------------------
22     //------------------------------------------------------------
23    
24    
25     #include "gestionversion.h"
26     #include "fem_segment3.h"
27     #include "fem_noeud.h"
28     #include "fem_maillage.h"
29     #include "mg_element_maillage.h"
30    
31    
32 francois 309 FEM_SEGMENT3::FEM_SEGMENT3(unsigned long num,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT1(num,mai),FEM_TEMPLATE_ELEMENT<3>(tabnoeud)
33 francois 283 {
34     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==1) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
35 francois 309 tab[0]->get_lien_element1()->ajouter(this);
36     tab[1]->get_lien_element1()->ajouter(this);
37     tab[2]->get_lien_element1()->ajouter(this);
38     get_fem_noeudpetitid()->get_lien_petit_element1()->ajouter(this);
39 francois 283 }
40    
41 francois 309 FEM_SEGMENT3::FEM_SEGMENT3(class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT1(mai),FEM_TEMPLATE_ELEMENT<3>(tabnoeud)
42 francois 283 {
43     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==1) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
44 francois 309 tab[0]->get_lien_element1()->ajouter(this);
45     tab[1]->get_lien_element1()->ajouter(this);
46     tab[2]->get_lien_element1()->ajouter(this);
47     get_fem_noeudpetitid()->get_lien_petit_element1()->ajouter(this);
48 francois 283 }
49    
50 francois 309 FEM_SEGMENT3::FEM_SEGMENT3(FEM_SEGMENT3& mdd):FEM_ELEMENT1(mdd),FEM_TEMPLATE_ELEMENT<3>(mdd)
51 francois 283 {
52     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==1) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
53 francois 309 tab[0]->get_lien_element1()->ajouter(this);
54     tab[1]->get_lien_element1()->ajouter(this);
55     tab[2]->get_lien_element1()->ajouter(this);
56     get_fem_noeudpetitid()->get_lien_petit_element1()->ajouter(this);
57 francois 283 }
58    
59     FEM_SEGMENT3::~FEM_SEGMENT3()
60     {
61     if (liaison_topologique==NULL) return;
62     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->supprimer(this);
63 francois 309 tab[0]->get_lien_element1()->supprimer(this);
64     tab[1]->get_lien_element1()->supprimer(this);
65     get_fem_noeudpetitid()->get_lien_petit_element1()->supprimer(this);
66 francois 283 }
67    
68     FEM_ELEMENT_MAILLAGE* FEM_SEGMENT3::dupliquer(FEM_MAILLAGE *femmai,long decalage)
69     {
70     FEM_NOEUD* tabnoeud[3];
71     tabnoeud[0]=femmai->get_fem_noeudid(tab[0]->get_id()+decalage);
72     tabnoeud[1]=femmai->get_fem_noeudid(tab[1]->get_id()+decalage);
73     tabnoeud[2]=femmai->get_fem_noeudid(tab[2]->get_id()+decalage);
74     FEM_SEGMENT3* seg=new FEM_SEGMENT3(get_id()+decalage,maillage,tabnoeud);
75 francois 309 femmai->ajouter_fem_element1(seg);
76 francois 283 return seg;
77     }
78    
79    
80    
81     int FEM_SEGMENT3::get_type_entite(void)
82     {
83     return IDFEM_SEGMENT3;
84     }
85    
86     int FEM_SEGMENT3::get_dimension(void)
87     {
88     return 1;
89     }
90    
91    
92     int FEM_SEGMENT3::get_nb_fem_noeud(void)
93     {
94     return FEM_TEMPLATE_ELEMENT<3>::get_nb_fem_noeud();
95     }
96    
97     FEM_NOEUD* FEM_SEGMENT3::get_fem_noeud(int num)
98     {
99     return FEM_TEMPLATE_ELEMENT<3>::get_fem_noeud(num);
100     }
101    
102     void FEM_SEGMENT3::change_noeud(int num,FEM_NOEUD* noeud)
103     {
104     FEM_TEMPLATE_ELEMENT<3>::change_noeud(num,noeud);
105     }
106    
107     BOITE_3D& FEM_SEGMENT3::get_boite_3D(void)
108     {
109     return FEM_TEMPLATE_ELEMENT<3>::get_boite_3D();
110     }
111    
112    
113    
114     void FEM_SEGMENT3::enregistrer(std::ostream& o)
115     {
116     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_SEGMENT3($"<< get_lien_topologie()->get_id() << ",$" << maillage->get_id() << ",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ");" << std::endl;
117     else o << "%" << get_id() << "=FEM_SEGMENT3(NULL,$" << maillage->get_id() <<",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ");" << std::endl;
118     }
119 francois 310 int FEM_SEGMENT3::nb_fonction_interpolation(void)
120     {
121     return 3;
122     }
123    
124    
125     double FEM_SEGMENT3::get_fonction_interpolation(int num,double *uv)
126     {
127     double val;
128     switch (num)
129     {
130     case 1:
131     val=-0.5*uv[0]*(1.-uv[0]);
132     break;
133     case 2:
134     val=1.-uv[0]*uv[0];
135     break;
136     case 3:
137     val=0.5*uv[0]*(1.+uv[0]);
138     break;
139     }
140     return val;
141     }
142    
143     double FEM_SEGMENT3::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
144     {
145     double val;
146    
147     switch (num)
148     {
149     case 1:
150     switch (num_variable)
151     {
152     case 1:
153     val=-0.5+uv[0];
154     break;
155     case 2:
156     val=-2.*uv[0];
157     break;
158     case 3:
159     val=0.5+uv[0];
160     break;
161     }
162     break;
163    
164     }
165     return val;
166     }
167    
168     double FEM_SEGMENT3::get_jacobien(double* jac,double *uv,int& li,int& col,double unite)
169     {
170    
171     }
172    
173     void FEM_SEGMENT3::get_inverse_jacob(double* j,double *uv,double unite)
174     {
175    
176     }