ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/solveur/src/sl_triangle21.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months ago) by francois
File size: 5063 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_triangle21.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     #pragma hdrstop
25     #include <math.h>
26     #include "sl_triangle21.h"
27     #include "fem_segment.h"
28     #include "fem_noeud.h"
29     #include "fem_triangle.h"
30     #pragma package(smart_init)
31    
32     SL_TRIANGLE21::SL_TRIANGLE21(class FEM_TRIANGLE *mgseg):SL_TRIANGLE(mgseg)
33     {
34     }
35    
36     SL_TRIANGLE21::SL_TRIANGLE21(SL_TRIANGLE21& mdd):SL_TRIANGLE(mdd)
37     {
38     }
39    
40     SL_TRIANGLE21::~SL_TRIANGLE21()
41     {
42     }
43    
44     int SL_TRIANGLE21::nb_point_gauss(void)
45     {
46     return 1;
47     }
48    
49    
50     int SL_TRIANGLE21::nb_fonction_interpolation(void)
51     {
52     return 6;
53     }
54    
55     void SL_TRIANGLE21::get_point_gauss(int num,double *xyz,double& poids)
56     {
57     xyz[0]=0.33333333333333333333333333333333;
58     xyz[1]=0.33333333333333333333333333333333;
59     poids=0.5;
60     }
61    
62     double SL_TRIANGLE21::get_fonction_interpolation(int num,double *uv)
63     {
64     double val;
65     double landa=1-uv[0]-uv[1];
66     switch (num)
67     {
68     case 1:val=-landa*(1-2*landa);break;
69     case 2:val=4*uv[0]*landa;break;
70     case 3:val=-uv[0]*(1-2*uv[0]);break;
71     case 4:val=4*uv[0]*uv[1];break;
72     case 5:val=-uv[1]*(1-2*uv[1]);break;
73     case 6:val=4*uv[1]*landa;break;
74     }
75     return val;
76     }
77    
78     double SL_TRIANGLE21::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
79     {
80     double val;
81     double landa=1-uv[0]-uv[1];
82     switch (num)
83     {
84     case 1:switch (num_variable)
85     {
86     case 1:val=1-4*landa;break;
87     case 2:val=1-4*landa;break;
88     } break;
89     case 2:switch (num_variable)
90     {
91     case 1:val=4*(landa-uv[0]);break;
92     case 2:val=-4*uv[0];break;
93     }break;
94     case 3:switch (num_variable)
95     {
96     case 1:val=-1+4*uv[0];break;
97     case 2:val=0.;break;
98     }break;
99     case 4:switch (num_variable)
100     {
101     case 1:val=4*uv[1];break;
102     case 2:val=4*uv[0];break;
103     }break;
104     case 5:switch (num_variable)
105     {
106     case 1:val=0.;break;
107     case 2:val=-1+4*uv[1];break;
108     }break;
109     case 6:switch (num_variable)
110     {
111     case 1:val=-4*uv[1];break;
112     case 2:val=4*(landa-uv[1]);break;
113     }break;
114     }
115     return val;
116    
117     }
118    
119     double SL_TRIANGLE21::get_jacobien(double* jac,double *uv,int& li,int& col,double unite)
120     {
121    
122     double xyz[18];
123    
124     int nb_nd=((FEM_TRIANGLE*) mai)->get_nb_fem_noeud();
125    
126     for(int i=0;i<nb_nd;i++)
127     {
128     FEM_NOEUD* fmnd=((FEM_SEGMENT*) mai)->get_fem_noeud(i);
129     double *xyz1=fmnd->get_coord();
130    
131     xyz[3*i] =unite*xyz1[0];
132     xyz[3*i+1]=unite*xyz1[1];
133     xyz[3*i+2]=unite*xyz1[2];
134    
135     }
136    
137    
138    
139     double landa=1-uv[0]-uv[1];
140     li=2;col=3;
141    
142     jac[0]=xyz[0]*(1-4*landa)+xyz[3]*(4*(landa-uv[0]))+ xyz[6]*(-1+4*uv[0])+ xyz[9]*(4*uv[1])+ xyz[15]*(-4*uv[1]);
143     jac[1]=xyz[1]*(1-4*landa)+xyz[4]*(4*(landa-uv[0]))+ xyz[7]*(-1+4*uv[0])+ xyz[10]*(4*uv[1])+xyz[16]*(-4*uv[1]);
144     jac[2]=xyz[2]*(1-4*landa)+xyz[5]*(4*(landa-uv[0]))+ xyz[8]*(-1+4*uv[0])+ xyz[11]*(4*uv[1])+xyz[17]*(-4*uv[1]);
145    
146     jac[3]=xyz[0]*(1-4*landa)+xyz[3]*(-4*uv[0])+ xyz[9]*(4*uv[0])+ xyz[12]*(-1+4*uv[1])+ xyz[15]*(4*(landa-uv[1]));
147     jac[4]=xyz[1]*(1-4*landa)+xyz[4]*(-4*uv[0])+ xyz[10]*(4*uv[0])+ xyz[13]*(-1+4*uv[1])+ xyz[16]*(4*(landa-uv[1]));
148     jac[5]=xyz[2]*(1-4*landa)+xyz[5]*(-4*uv[0])+ xyz[11]*(4*uv[0])+ xyz[14]*(-1+4*uv[1])+ xyz[17]*(4*(landa-uv[1]));
149    
150    
151     double DEUX_A=sqrt((jac[1]*jac[5]-jac[4]*jac[2])*(jac[1]*jac[5]-jac[4]*jac[2])+(jac[0]*jac[5]-jac[3]*jac[2])*(jac[0]*jac[5]-jac[3]*jac[2])+(jac[0]*jac[4]-jac[3]*jac[1])*(jac[0]*jac[4]-jac[3]*jac[1]));
152    
153     return DEUX_A;
154    
155     }
156    
157     void SL_TRIANGLE21::get_inverse_jacob(double* jac,double*j,double unite)
158     {
159     return;
160     }
161    
162    
163    
164     int SL_TRIANGLE21::nb_point_extrapolation()
165     {
166     return 3;
167     }
168    
169    
170