Herezh_dev/Enumeration/Enum_variable_metrique.cc
Gérard Rio ece68c42db V 7.012 : résolution du pb de l'utilisation de l'accélération dans une fonction nD
Introduction du calcul de l'accélération interpolée, au niveau de la métrique
Intro de nouveaux affichages au niveau des fonctions nD
2023-06-01 08:47:54 +02:00

287 lines
11 KiB
C++

// FICHIER : Enum_variable_metrique.cc
// 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-2022 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 "Enum_variable_metrique.h"
# include <iostream>
using namespace std; //introduces namespace std
#include <stdlib.h>
#include "Sortie.h"
//#ifdef SYSTEM_MAC_OS_X
// #include <stringfwd.h> // a priori ce n'est pas portable
//#el
#if defined SYSTEM_MAC_OS_CARBON
#include <stringfwd.h> // a priori ce n'est pas portable
#else
#include <string.h> // pour le flot en memoire centrale
#endif
#include <string>
string Nom_Enum_variable_metrique (Enum_variable_metrique id_nom)
// Retourne le nom en caractère correspondant a l'identificateur
// de type enumere id_mater
{
string result;
switch (id_nom)
{
case iM0 :result="iM0";break;
case iMt :result="iMt";break;
case idMt :result="idMt";break;
case iMtdt :result="iMtdt";break;
case idMtdt :result="idMtdt";break;
case iV0 :result="iV0";break;
case iVt :result="iVt";break;
case idVt :result="idVt";break;
case iVtdt :result="iVtdt";break;
case idVtdt :result="idVtdt";break;
case igamma0 :result="igamma0";break;
case igammat :result="igammat";break;
case igammatdt :result="igammatdt";break;
case igiB_0 :result="igiB_0";break;
case igiB_t :result="igiB_t";break;
case igiB_tdt :result="igiB_tdt";break;
case igiH_0 :result="igiH_0";break;
case igiH_t :result="igiH_t";break;
case igiH_tdt :result="igiH_tdt";break;
case igijBB_0 :result="igijBB_0";break;
case igijBB_t :result="igijBB_t";break;
case igijBB_tdt :result="igijBB_tdt";break;
case igijHH_0 :result="igijHH_0";break;
case igijHH_t :result="igijHH_t";break;
case igijHH_tdt :result="igijHH_tdt";break;
case id_giB_t :result="id_giB_t";break;
case id_giB_tdt :result="id_giB_tdt";break;
case id_giH_t :result="id_giH_t";break;
case id_giH_tdt :result="id_giH_tdt";break;
case id_gijBB_t :result="id_gijBB_t";break;
case id_gijBB_tdt :result="id_gijBB_tdt";break;
case id_gijHH_t : result="id_gijHH_t"; break;
case id_gijHH_tdt : result="id_gijHH_tdt"; break;
case id_jacobien_t : result="id_jacobien_t"; break;
case id_jacobien_tdt : result="id_jacobien_tdt"; break;
case id2_gijBB_tdt : result="id2_gijBB_tdt"; break;
case igradVmoyBB_t : result="igradVBB_t"; break;
case igradVmoyBB_tdt : result="igradVBB_tdt"; break;
case igradVBB_t : result="igradVBB_t"; break;
case igradVBB_tdt : result="igradVBB_tdt"; break;
case id_gradVmoyBB_t : result="id_gradVBB_t"; break;
case id_gradVmoyBB_tdt : result="id_gradVBB_tdt"; break;
case id_gradVBB_t : result="id_gradVBB_t"; break;
case id_gradVBB_tdt : result="id_gradVBB_tdt"; break;
default :
cout << "\nErreur : valeur incorrecte du type Enum_variable_metrique !\n";
cout << "Nom_Enum_variable_metrique(Enum_variable_metrique ) \n";
Sortie(1);
};
return result;
};
Enum_variable_metrique Id_nom_Enum_variable_metrique (char* nom)
// Retourne la variable de type enumere associe au nom
{
Enum_variable_metrique result;
if ( strcmp(nom,"iM0")==0 ) result=iM0;
else if ( strcmp(nom,"iMt")==0 ) result=iMt;
else if ( strcmp(nom,"idMt")==0 ) result=idMt;
else if ( strcmp(nom,"iMtdt")==0 ) result=iMtdt;
else if ( strcmp(nom,"idMtdt")==0 ) result=idMtdt;
else if ( strcmp(nom,"iV0")==0 ) result=iV0;
else if ( strcmp(nom,"iVt")==0 ) result=iVt;
else if ( strcmp(nom,"idVt")==0 ) result=idVt;
else if ( strcmp(nom,"iVtdt")==0 ) result=iVtdt;
else if ( strcmp(nom,"idVtdt")==0 ) result=idVtdt;
else if ( strcmp(nom,"igamma0")==0 ) result=igamma0;
else if ( strcmp(nom,"igammat")==0 ) result=igammat;
else if ( strcmp(nom,"igammatdt")==0 ) result=igammatdt;
else if ( strcmp(nom,"igiB_0")==0 ) result=igiB_0;
else if ( strcmp(nom,"igiB_t")==0 ) result=igiB_t;
else if ( strcmp(nom,"igiB_tdt")==0 ) result=igiB_tdt;
else if ( strcmp(nom,"igiH_0")==0 ) result=igiH_0;
else if ( strcmp(nom,"igiH_t")==0 ) result=igiH_t;
else if ( strcmp(nom,"igiH_tdt")==0 ) result=igiH_tdt;
else if ( strcmp(nom,"igijBB_0")==0 ) result=igijBB_0;
else if ( strcmp(nom,"igijBB_t")==0 ) result=igijBB_t;
else if ( strcmp(nom,"igijBB_tdt")==0 ) result=igijBB_tdt;
else if ( strcmp(nom,"igijHH_0")==0 ) result=igijHH_0;
else if ( strcmp(nom,"igijHH_t")==0 ) result=igijHH_t;
else if ( strcmp(nom,"igijHH_tdt")==0 ) result=igijHH_tdt;
else if ( strcmp(nom,"id_giB_t")==0 ) result=id_giB_t;
else if ( strcmp(nom,"id_giB_tdt")==0 ) result=id_giB_tdt;
else if ( strcmp(nom,"id_giH_t")==0 ) result=id_giH_t;
else if ( strcmp(nom,"id_giH_tdt")==0 ) result=id_giH_tdt;
else if ( strcmp(nom,"id_gijBB_t")==0 ) result=id_gijBB_t;
else if ( strcmp(nom,"id_gijBB_tdt")==0 ) result=id_gijBB_tdt;
else if ( strcmp(nom,"id_gijHH_t")==0 ) result=id_gijHH_t;
else if ( strcmp(nom,"id_gijHH_tdt")==0 ) result=id_gijHH_tdt;
else if ( strcmp(nom,"id_jacobien_t")==0 ) result=id_jacobien_t;
else if ( strcmp(nom,"id_jacobien_tdt")==0 ) result=id_jacobien_tdt;
else if ( strcmp(nom,"id2_gijBB_tdt")==0 ) result=id2_gijBB_tdt;
else if ( strcmp(nom,"igradVmoyBB_t")==0 ) result=igradVBB_t;
else if ( strcmp(nom,"igradVmoyBB_tdt")==0 ) result=igradVBB_tdt;
else if ( strcmp(nom,"igradVBB_t")==0 ) result=igradVBB_t;
else if ( strcmp(nom,"igradVBB_tdt")==0 ) result=igradVBB_tdt;
else if ( strcmp(nom,"id_gradVmoyBB_t")==0 ) result=id_gradVBB_t;
else if ( strcmp(nom,"id_gradVmoyBB_tdt")==0 ) result=id_gradVBB_tdt;
else if ( strcmp(nom,"id_gradVBB_t")==0 ) result=id_gradVBB_t;
else if ( strcmp(nom,"id_gradVBB_tdt")==0 ) result=id_gradVBB_tdt;
else
{
cout << "\nErreur : nom inconnu !\n";
cout << "Id_nom_Enum_variable_metrique(char* ) \n";
Sortie(1);
};
return result;
};
// surcharge de l'operator de lecture
istream & operator >> (istream & entree, Enum_variable_metrique& a)
{ char nom_Enum_variable_metrique[150];
entree >> nom_Enum_variable_metrique;
a = Id_nom_Enum_variable_metrique ( nom_Enum_variable_metrique);
return entree;
};
// surcharge de l'operator d'ecriture
ostream & operator << (ostream & sort, const Enum_variable_metrique& a)
{ // on ecrit la forme caractère
sort << Nom_Enum_variable_metrique(a) << " ";
return sort;
};
string Nom_Enum_variable_metsfe (Enum_variable_metsfe id_nom)
// Retourne le nom en caractère correspondant a l'identificateur
// de type enumere id_mater
{
string result;
switch (id_nom)
{
case iP0 :result="iP0";break;
case iPt :result="iPt";break;
case idPt :result="idPt";break;
case iPtdt :result="iPtdt";break;
case idPtdt :result="idPtdt";break;
case iaiB_0 :result="iaiB_0";break;
case iaiB_t :result="iaiB_t";break;
case iaiB_tdt :result="iaiB_tdt";break;
case iaiH_0 :result="iaiH_0";break;
case iaiH_t :result="iaiH_t";break;
case iaiH_tdt :result="iaiH_tdt";break;
case iaijBB_0 :result="iaijBB_0";break;
case iaijBB_t :result="iaijBB_t";break;
case iaijBB_tdt :result="iaijBB_tdt";break;
case iaijHH_0 :result="iaijHH_0";break;
case iaijHH_t :result="iaijHH_t";break;
case iaijHH_tdt :result="iaijHH_tdt";break;
case id_aiB_t :result="id_aiB_t";break;
case id_aiB_tdt :result="id_aiB_tdt";break;
case id_aiH_t :result="id_aiH_t";break;
case id_aiH_tdt :result="id_aiH_tdt";break;
case id_aijBB_t :result="id_aijBB_t";break;
case id_aijBB_tdt :result="id_aijBB_tdt";break;
case id_aijHH_t : result="id_aijHH_t"; break;
case id_aijHH_tdt : result="id_aijHH_tdt"; break;
case id_ajacobien_t : result="id_ajacobien_t"; break;
case id_ajacobien_tdt : result="id_ajacobien_tdt"; break;
default :
cout << "\nErreur : valeur incorrecte du type Enum_variable_metsfe !\n";
cout << "Nom_Enum_variable_metsfe(Enum_variable_metsfe ) \n";
Sortie(1);
};
return result;
};
Enum_variable_metsfe Id_nom_Enum_variable_metsfe (char* nom)
// Retourne la variable de type enumere associe au nom
{
Enum_variable_metsfe result;
if ( strcmp(nom,"iP0")==0 ) result=iP0;
else if ( strcmp(nom,"iPt")==0 ) result=iPt;
else if ( strcmp(nom,"idPt")==0 ) result=idPt;
else if ( strcmp(nom,"iPtdt")==0 ) result=iPtdt;
else if ( strcmp(nom,"idPtdt")==0 ) result=idPtdt;
else if ( strcmp(nom,"iaiB_0")==0 ) result=iaiB_0;
else if ( strcmp(nom,"iaiB_t")==0 ) result=iaiB_t;
else if ( strcmp(nom,"iaiB_tdt")==0 ) result=iaiB_tdt;
else if ( strcmp(nom,"iaiH_0")==0 ) result=iaiH_0;
else if ( strcmp(nom,"iaiH_t")==0 ) result=iaiH_t;
else if ( strcmp(nom,"iaiH_tdt")==0 ) result=iaiH_tdt;
else if ( strcmp(nom,"iaijBB_0")==0 ) result=iaijBB_0;
else if ( strcmp(nom,"iaijBB_t")==0 ) result=iaijBB_t;
else if ( strcmp(nom,"iaijBB_tdt")==0 ) result=iaijBB_tdt;
else if ( strcmp(nom,"iaijHH_0")==0 ) result=iaijHH_0;
else if ( strcmp(nom,"iaijHH_t")==0 ) result=iaijHH_t;
else if ( strcmp(nom,"iaijHH_tdt")==0 ) result=iaijHH_tdt;
else if ( strcmp(nom,"id_aiB_t")==0 ) result=id_aiB_t;
else if ( strcmp(nom,"id_aiB_tdt")==0 ) result=id_aiB_tdt;
else if ( strcmp(nom,"id_aiH_t")==0 ) result=id_aiH_t;
else if ( strcmp(nom,"id_aiH_tdt")==0 ) result=id_aiH_tdt;
else if ( strcmp(nom,"id_aijBB_t")==0 ) result=id_aijBB_t;
else if ( strcmp(nom,"id_aijBB_tdt")==0 ) result=id_aijBB_tdt;
else if ( strcmp(nom,"id_aijHH_t")==0 ) result=id_aijHH_t;
else if ( strcmp(nom,"id_aijHH_tdt")==0 ) result=id_aijHH_tdt;
else if ( strcmp(nom,"id_ajacobien_t")==0 ) result=id_ajacobien_t;
else if ( strcmp(nom,"id_ajacobien_tdt")==0 ) result=id_ajacobien_tdt;
else
{
cout << "\nErreur : nom inconnu !\n";
cout << "Id_nom_Enum_variable_metsfe(char* ) \n";
Sortie(1);
};
return result;
};
// surcharge de l'operator de lecture
istream & operator >> (istream & entree, Enum_variable_metsfe& a)
{ char nom_Enum_variable_metsfe[150];
entree >> nom_Enum_variable_metsfe;
a = Id_nom_Enum_variable_metsfe ( nom_Enum_variable_metsfe);
return entree;
};
// surcharge de l'operator d'ecriture
ostream & operator << (ostream & sort, const Enum_variable_metsfe& a)
{ // on ecrit la forme caractère
sort << Nom_Enum_variable_metsfe(a) << " ";
return sort;
};