Herezh_dev/Elements/Mecanique/SFE/Sfeg.cc

1 line
8.8 KiB
C++
Raw Normal View History

#include "debug.h" #include "Triangleg.h" #include "Segment.h" #include "MathUtil.h" // constructeur // dimension 2, nbi pt integ, nbne noeuds, 1 face, 3 aretes Triangleg::Triangleg( int nbi, int nbne) : ElemGeom(2,nbi,nbne,1,3) { // definition de la face face(1) = this; NONF(1).Change_taille(NBNE); for (int i=1;i<=NBNE;i++) NONF(1)(i) = i;// def du pointeur de ligne double LAMBDA; // variable de calcul intermediaire // ------------------------------ // choix des points d'integration // ------------------------------ if (Nbi()==1) { KSI(1)= 1./3.; ETA(1)= KSI(1); WI(1)= 0.5 ; } else if (Nbi() == 3) { KSI(1)= 0.5; ETA(1)= 0.5; WI(1)= 1. /6.; KSI(2)= 0.; ETA(2)= 0.5 ; WI(2)= 1. /6.; KSI(3)= 0.5 ; ETA(3)= 0. ; WI(3)= 1. /6. ; } else if (Nbi()==4) { KSI(1)= 1. /3.; ETA(1)= 1. /3. ; WI(1)= -27. /96.; KSI(2)= 1. /5.; ETA(2)= 1. /5. ; WI(2)= 25. /96. ; KSI(3)= 3. /5.; ETA(3)= 1. /5.; WI(3)= 25. /96.; KSI(4)= 1. /5.; ETA(4)= 3. /5.; WI(4)= 25. /96.; } else { cout << "\n erreur, le nombre de point d\'integration demande n\'est pas implante "; cout << " nbi = " << Nbi(); cout << "\n Triangleg::Triangleg( int nbi, int nbne) " << endl; Sortie (1); } //-------------------------------- //def des arretes //-------------------------------- //def des aretes int nbil; // nb de pt d'integ par ligne if (Nbi() == 1) nbil = 1; else nbil = 2; int nbnel; // nb de noeud du segment if (NBNE == 3) nbnel = 2; else nbnel = 3; seg(1) = new Segment(nbil,nbnel); for (int il=2;il<= NBSE; il++) // ici NBSE = 3 seg(il) = seg(1); // def des tableaux de connection des noeuds des cotes if (NBNE == 3) { for (int i =1;i<=NBSE;i++) NONS(i).Change_taille(2); NONS(1)(1) = 1;NONS(1)(2) = 2;NONS(2)(1) = 2;NONS(2)(2) = 3; NONS(3)(1) = 3;NONS(3)(2) = 1; } else { for (int i =1;i<=NBSE;i++) NONS(i).Change_taille(3); NONS(1)(1) = 1;NONS(1)(2) = 4;NONS(1)(3) = 2; NONS(2)(1) = 2;NONS(2)(2) = 5;NONS(2)(3) = 3; NONS(3)(1) = 3;NONS(3)(2) = 6;NONS(3)(3) = 1; } //-------------------------------- //valeurs aux points d'integration //-------------------------------- //----------------------------------------------------- //------------------- cas lineaire -------------------- //----------------------------------------------------- if (NBNE== 3) for (int NI = 1; NI<= Nbi(); NI++) { //------------------------------ //des fonctions d'interpolations //------------------------------ tabPhi(NI)(1) = 1. - KSI(NI) - ETA(NI); tabPhi(NI)(2) = KSI(NI); tabPhi(NI)(3) = ETA(NI); //----------------- //de leurs derivees //----------------- tabDPhi(NI)(1,1) = -1.; tabDPhi(NI)(2,1) = -1.; tabDPhi(NI)(1,2) = 1.; tabDPhi(NI)(2,2) = 0.; tabDPhi(NI)(1,3) = 0.; tabDPhi(NI)(2,3) = 1.; } //--------------------------------------------------------- //--------------------- cas quadratique ------------------- //--------------------------------------------------------- else if (NBNE== 6) for (int NI = 1; NI<= Nbi(); NI++) { LAMBDA= 1. - KSI(NI) - ETA(NI); //------------------------------ //des fonctions d'interpolations //------------------------------ tabPhi(NI)(1) = -LAMBDA * (1. -2. * LAMBDA); tabPhi(NI)(2) = -KSI(NI) * (1. -2. * KSI(NI));