ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/fem_segment2.cpp
Revision: 195
Committed: Thu Jul 16 22:05:49 2009 UTC (15 years, 10 months ago) by francois
Original Path: magic/lib/geometrie/geometrie/src/fem_segment2.cpp
File size: 4193 byte(s)
Log Message:
Ajout de groupe de topologie pour appliquer des algos sur une partie du fichier magic seulement
Ajout de methode qui permette de connaitre la topologie sous jacente a une topologie donnee
Gestion des maillages FEM qui ne sont attaches a une geometrie

File Contents

# User Rev Content
1 5 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4 francois 195 // Jean Christophe Cuilli�re et Vincent FRANCOIS
5     // D�partement de G�nie M�canique - UQTR
6 5 //------------------------------------------------------------
7 francois 195 // 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 5 // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // fem_segment2.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20 francois 195 // Version du 02/03/2006 � 11H22
21 5 //------------------------------------------------------------
22     //------------------------------------------------------------
23    
24    
25     #include "gestionversion.h"
26     #include "fem_segment2.h"
27     #include "fem_noeud.h"
28     #include "fem_maillage.h"
29     #include "mg_element_maillage.h"
30    
31     FEM_SEGMENT2::FEM_SEGMENT2(unsigned long num,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_SEGMENT(num,mai),FEM_TEMPLATE_ELEMENT<2>(tabnoeud)
32     {
33 francois 195 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==1) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
34 5 tab[0]->get_lien_segment()->ajouter(this);
35     tab[1]->get_lien_segment()->ajouter(this);
36     get_fem_noeudpetitid()->get_lien_petit_segment()->ajouter(this);
37     }
38    
39     FEM_SEGMENT2::FEM_SEGMENT2(class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_SEGMENT(mai),FEM_TEMPLATE_ELEMENT<2>(tabnoeud)
40     {
41 francois 195 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==1) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
42 5 tab[0]->get_lien_segment()->ajouter(this);
43     tab[1]->get_lien_segment()->ajouter(this);
44     get_fem_noeudpetitid()->get_lien_petit_segment()->ajouter(this);
45     }
46    
47     FEM_SEGMENT2::FEM_SEGMENT2(FEM_SEGMENT2& mdd):FEM_SEGMENT(mdd),FEM_TEMPLATE_ELEMENT<2>(mdd)
48     {
49 francois 195 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==1) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
50 5 tab[0]->get_lien_segment()->ajouter(this);
51     tab[1]->get_lien_segment()->ajouter(this);
52     get_fem_noeudpetitid()->get_lien_petit_segment()->ajouter(this);
53     }
54    
55     FEM_SEGMENT2::~FEM_SEGMENT2()
56     {
57     if (liaison_topologique==NULL) return;
58     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->supprimer(this);
59     tab[0]->get_lien_segment()->supprimer(this);
60     tab[1]->get_lien_segment()->supprimer(this);
61     get_fem_noeudpetitid()->get_lien_petit_segment()->supprimer(this);
62     }
63    
64     FEM_ELEMENT_MAILLAGE* FEM_SEGMENT2::dupliquer(FEM_MAILLAGE *femmai,long decalage)
65     {
66     FEM_NOEUD* tabnoeud[2];
67     tabnoeud[0]=femmai->get_fem_noeudid(tab[0]->get_id()+decalage);
68     tabnoeud[1]=femmai->get_fem_noeudid(tab[1]->get_id()+decalage);
69     FEM_SEGMENT2* seg=new FEM_SEGMENT2(get_id()+decalage,maillage,tabnoeud);
70     femmai->ajouter_fem_segment(seg);
71     return seg;
72     }
73    
74    
75    
76    
77     int FEM_SEGMENT2::get_type_entite(void)
78     {
79     return IDFEM_SEGMENT2;
80     }
81    
82     int FEM_SEGMENT2::get_dimension(void)
83     {
84     return 1;
85     }
86    
87    
88    
89     int FEM_SEGMENT2::get_nb_fem_noeud(void)
90     {
91     return FEM_TEMPLATE_ELEMENT<2>::get_nb_fem_noeud();
92     }
93    
94     FEM_NOEUD* FEM_SEGMENT2::get_fem_noeud(int num)
95     {
96     return FEM_TEMPLATE_ELEMENT<2>::get_fem_noeud(num);
97     }
98    
99     void FEM_SEGMENT2::change_noeud(int num,FEM_NOEUD* noeud)
100     {
101     FEM_TEMPLATE_ELEMENT<2>::change_noeud(num,noeud);
102     }
103    
104     BOITE_3D& FEM_SEGMENT2::get_boite_3D(void)
105     {
106     return FEM_TEMPLATE_ELEMENT<2>::get_boite_3D();
107     }
108    
109    
110     void FEM_SEGMENT2::enregistrer(std::ostream& o)
111     {
112     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_SEGMENT2($"<< get_lien_topologie()->get_id() << ",$"<< maillage->get_id() << ",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ");" << std::endl;
113     else o << "%" << get_id() << "=FEM_SEGMENT2(NULL,$" << maillage->get_id() <<",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ");" << std::endl;
114     }