ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/solveur/src/sl_localisation.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months ago) by francois
File size: 3577 byte(s)
Log Message:
compatibilité Ubuntu 22.04
Suppression des refeences à Windows
Ajout d'une banière

File Contents

# User Rev Content
1 francois 1158 //####//------------------------------------------------------------
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     //####// sl_localisation.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:57 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 5 #include "gestionversion.h"
23    
24    
25     #pragma hdrstop
26    
27     #include "sl_localisation.h"
28    
29    
30     #pragma package(smart_init)
31    
32    
33    
34     SL_LOCALISATION::SL_LOCALISATION()
35     {
36     }
37    
38    
39     SL_LOCALISATION::~SL_LOCALISATION()
40     {
41    
42     }
43    
44     /*
45     void SL_LOCALISATION::get_localisation(int* tab_noeud,int* tab_seg,int* tab_comb,int t_tab_noeud,int t_tab_seg)
46     {
47    
48     for(int i=0;i<t_tab_noeud;i++)
49     {
50    
51     int num=tab_noeud[i];
52    
53     FEM_NOEUD* mgnoeud=mai->get_mg_noeudid(num);
54     int j=mgnoeud->get_nouveau_numero();
55    
56     tab_comb[3*i]=3*j;
57     tab_comb[3*i+1]=3*j+1;
58     tab_comb[3*i+2]=3*j+2;
59    
60     }
61    
62    
63     for(int k=0;k<t_tab_seg;k++)
64     {
65    
66     int num=tab_seg[k];
67    
68     FEM_SEGMENT* mgseg=mai->get_mg_segmentid(k);
69     int j=mgseg->get_nouveau_numero();
70    
71     tab_comb[3*i] =3*j;
72     tab_comb[3*i+1]=3*j+1;
73     tab_comb[3*i+1]=3*j+2;
74    
75     }
76    
77     } */
78    
79     void SL_LOCALISATION::get_localisation(int* tab_inp,int* tab_out,int t_tab_inp)
80     {
81    
82     for(int i=0;i<t_tab_inp;i++)
83     {
84    
85     int num=tab_inp[i];
86    
87     tab_out[3*i]=3*num;
88     tab_out[3*i+1]=3*num+1;
89     tab_out[3*i+2]=3*num+2;
90    
91     }
92    
93    
94     }
95    
96    
97     void SL_LOCALISATION::get_localisation_contrainte(int* tab_inp,int* tab_out,int t_tab_inp)
98     {
99    
100     for(int i=0;i<t_tab_inp;i++)
101     {
102     int num=tab_inp[i];
103     // if(num==tab[i])
104     // {
105     tab_out[6*i]=6*num;
106     tab_out[6*i+1]=6*num+1;
107     tab_out[6*i+2]=6*num+2;
108     tab_out[6*i+3]=6*num+3;
109     tab_out[6*i+4]=6*num+4;
110     tab_out[6*i+5]=6*num+5;
111    
112    
113     }
114     /* for(int k=0;k<nb_segm;k++)
115     {
116     FEM_SEGMENT* mgseg=mai->get_mg_segment(k);
117     int num1=mgseg->get_id();
118     if(num1==(unsigned)tab[i])
119     {
120     ttab[6*i] =6*(k+nb_noeud);
121     ttab[6*i+1]=6*(k+nb_noeud)+1;
122     ttab[6*i+2]=6*(k+nb_noeud)+2;
123     ttab[6*i+3]=6*(k+nb_noeud)+3;
124     ttab[6*i+4]=6*(k+nb_noeud)+4;
125     ttab[6*i+5]=6*(k+nb_noeud)+5;
126     }
127     }
128    
129    
130     } */
131    
132     }
133    
134     void SL_LOCALISATION::get_localisation_contrainte_equiv(FEM_MAILLAGE*mai,int* tab,int* ttab,int taille_tab)
135     {
136     int nb_noeud=mai->get_nb_fem_noeud();
137     int nb_segm=mai->get_nb_fem_segment();
138     for(int i=0;i<taille_tab;i++)
139     {
140    
141     for(int j=0;j<nb_noeud;j++)
142     {
143     FEM_NOEUD* mgnoeud=mai->get_fem_noeud(j);
144     int num=mgnoeud->get_id();
145     if(num==tab[i])
146     {
147     ttab[i]=j;
148     }
149     }
150     for(int k=0;k<nb_segm;k++)
151     {
152     FEM_SEGMENT* mgseg=mai->get_fem_segment(k);
153     int num1=mgseg->get_id();
154     if(num1==tab[i])
155     {
156     ttab[i] =(k+nb_noeud);
157    
158     }
159     }
160    
161    
162     }
163    
164     }