1 line
No EOL
6.3 KiB
C++
Executable file
1 line
No EOL
6.3 KiB
C++
Executable file
|
|
|
|
// This file is part of the Herezh++ application.
|
|
//
|
|
// The finite element software Herezh++ is dedicated to the field
|
|
// of mechanics for large transformations of solid structures.
|
|
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
|
|
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
|
|
//
|
|
// Herezh++ is distributed under GPL 3 license ou ultérieure.
|
|
//
|
|
// Copyright (C) 1997-2021 Université Bretagne Sud (France)
|
|
// AUTHOR : Gérard Rio
|
|
// E-MAIL : gerardrio56@free.fr
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License,
|
|
// or (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
// See the GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
//
|
|
// For more information, please consult: <https://herezh.irdl.fr/>.
|
|
|
|
#include "Hyper10.h"
|
|
#include "Loi_comp_abstraite.hc"
|
|
|
|
# include <iostream>
|
|
using namespace std; //introduces namespace std
|
|
#include <math.h>
|
|
#include <stdlib.h>
|
|
#include "Sortie.h"
|
|
|
|
|
|
Hyper10::Hyper10 () : // Constructeur par defaut
|
|
Hyper3D(ISOHYPER10,false),K(0.),Qor(0.),mur(0.),mu_inf(0.)
|
|
{};
|
|
// Constructeur de copie
|
|
Hyper10::Hyper10 (const Hyper10& loi) :
|
|
Hyper3D (loi),K(loi.K),Qor(loi.Qor),mur(loi.mur),mu_inf(loi.mu_inf)
|
|
{};
|
|
|
|
|
|
// Lecture des donnees de la classe sur fichier
|
|
void Hyper10::LectureDonneesParticulieres (UtilLecture * entreePrinc)
|
|
{ // lecture des quatres coefficients de la loi
|
|
*(entreePrinc->entree) >> K >> Qor >> mur >> mu_inf ;
|
|
// appel au niveau de la classe mère
|
|
Loi_comp_abstraite::Lecture_type_deformation_et_niveau_commentaire
|
|
(*entreePrinc,lesFonctionsnD,false);
|
|
};
|
|
// affichage de la loi
|
|
void Hyper10::Affiche()
|
|
{ cout << " \n loi de comportement 3D hyperélastique isotrope nb 10 : " << Nom_comp(id_comp)
|
|
<< " paramètres : \n";
|
|
cout << " K= " << K << " ; Qor = " << Qor << " ; mur = " << mur << " ; mu_inf = " << mu_inf ;
|
|
cout << endl;
|
|
};
|
|
|
|
// test si la loi est complete
|
|
int Hyper10::TestComplet()
|
|
{ int ret = LoiAbstraiteGeneral::TestComplet();
|
|
if ((K == 0.) && (Qor == 0.) && (mur == 0.) && (mu_inf == 0.))
|
|
{ cout << " \n Les paramètres ne sont pas défini pour la loi " << Nom_comp(id_comp)
|
|
<< '\n';
|
|
ret = 0;
|
|
}
|
|
|
|
return ret;
|
|
};
|
|
|
|
|
|
|
|
// =========== METHODES Protégées dérivant de virtuelles : ==============
|
|
// calcul du potentiel et de ses dérivées non compris la phase
|
|
void Hyper10::Potentiel(double & ,double & V,double& Qeps,
|
|
double& E,double& EV,double& EQeps)
|
|
{ // le potentiel
|
|
double co1 = Qor*Qor/2./mur;
|
|
double A = cosh(2.*mur*Qeps/Qor);
|
|
double co2 = co1 / A * 2.* mur/Qor ;
|
|
double logV = log(V);
|
|
double Ksur6 = K/6.;double Ksur12logVsurV = K/12.*log(V)/V;
|
|
double deux_mu_inf_Qeps = mu_inf * 2. * Qeps;
|
|
E = Ksur6 * (logV)*(logV)
|
|
+ co1*log(A) + mu_inf*Qeps*Qeps;
|
|
EV = Ksur12logVsurV;
|
|
EQeps = co1/A * sinh(2.*mur*Qeps/Qor) * 2.*mur/Qor ;
|
|
};
|
|
// calcul du potentiel et de ses dérivées avec la phase
|
|
void Hyper10::PotentielPhase(double & ,double & ,double& ,
|
|
double& ,double & ,
|
|
double& ,double& ,double& ,double& )
|
|
{ // le potentiel ne dépend pas de la phase d'où un message d'erreur
|
|
{ cout << "\nErreur : Hyper10::PotentielPhase( ... !";
|
|
cout << "\n le potentiel Hyper10 ne dépend pas de la phase !\n";
|
|
Sortie(1);
|
|
};
|
|
|
|
};
|
|
// calcul du potentiel sans phase et dérivées avec ses variations par rapport aux ddl
|
|
void Hyper10::Potentiel_et_var(double & ,Tableau<double> & ,
|
|
double & V,Tableau<double> & dV,double& Qeps,
|
|
Tableau<double> & dQeps,
|
|
double& E,Tableau <double>& dE,double& EV,Tableau <double>& dEV,
|
|
double& EQeps,Tableau <double>& dEQeps,double& EVV,Tableau <double>& dEVV,
|
|
double& EQQ,Tableau <double>& dEQQ,double& EVQ,Tableau <double>& dEVQ )
|
|
{ // le potentiel
|
|
double co1 = Qor*Qor/2./mur;
|
|
double A = cosh(2.*mur*Qeps/Qor);
|
|
double unsurA = 1./A;
|
|
double co2 = co1 / A * 2.* mur/Qor ;
|
|
double logV = log(V);
|
|
double Ksur6 = K/6.;double Ksur12logVsurV = K/12.*log(V)/V;
|
|
double deux_mu_inf_Qeps = mu_inf * 2. * Qeps;
|
|
double unsurV = 1./V;double unsurV2 = unsurV * unsurV;
|
|
E = Ksur6 * (logV)*(logV)
|
|
+ co1*log(A) + mu_inf*Qeps*Qeps;
|
|
EV = Ksur12logVsurV;
|
|
EQeps = co1/A * sinh(2.*mur*Qeps/Qor) * 2.*mur/Qor ;
|
|
double Ksur12surV2 = Ksur6/2.* unsurV2;
|
|
EVV = Ksur12surV2*(1. - logV);
|
|
double Ap = sinh(2.*mur*Qeps/Qor)*2.*mur/Qor;
|
|
EQQ = - co1 * unsurA * unsurA * Ap;
|
|
EVQ = 0.;
|
|
|
|
// calcul des variations
|
|
double r1 = EQQ * Ap ;
|
|
int nbddl = dV.Taille();
|
|
for (int i = 1; i<= nbddl; i++)
|
|
{ dE(i) = Ksur12logVsurV * dV(i) + co2 * dQeps(i) + deux_mu_inf_Qeps * dQeps(i);
|
|
dEV(i) = Ksur12surV2 * dV(i);
|
|
dEQeps(i) = (r1 + co1 * 2.*mur/Qor * 2.*mur/Qor) * dQeps(i);
|
|
dEVV(i) = -(Ksur12surV2 * 2.*(1. - logV) + Ksur12surV2* unsurV)*dV(i);
|
|
dEQQ(i) = (2.* co1 * unsurA * unsurA * unsurA * Ap * Ap - co1 * unsurA * unsurA)
|
|
* A *2.*mur/Qor * dQeps(i);
|
|
dEVQ(i) = 0.;
|
|
};
|
|
};
|
|
// calcul du potentiel avec phase et dérivées avec ses variations par rapport aux ddl
|
|
void Hyper10::PotentielPhase_et_var(double & ,Tableau<double> & ,
|
|
double &,Tableau<double> & ,double& ,
|
|
Tableau<double> & ,double& ,Tableau<double> & ,
|
|
double & ,Tableau<double> & ,double& ,Tableau <double>& ,double& ,Tableau <double>& ,
|
|
double& ,Tableau <double>& ,
|
|
double& ,Tableau <double>& ,double& ,Tableau <double>& ,
|
|
double& ,Tableau <double>& ,double& ,Tableau <double>& ,
|
|
double& ,Tableau <double>& ,double& ,Tableau <double>& ,
|
|
double& ,Tableau <double>& )
|
|
{ // le potentiel ne dépend pas de la phase d'où un message d'erreur
|
|
cout << "\nErreur : Hyper10::PotentielPhase_et_var( ... !";
|
|
cout << "\n le potentiel Hyper10 ne dépend pas de la phase !\n";
|
|
Sortie(1);
|
|
};
|
|
|