223 lines
8.5 KiB
C++
Executable file
223 lines
8.5 KiB
C++
Executable file
// FICHIER Enum_StabMembrane.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-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 "Enum_StabMembrane.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>
|
|
|
|
|
|
// Retourne le nom a partir de son identificateur de type enumere
|
|
string Nom_StabMembraneBiel (Enum_StabMembraneBiel id_nom)
|
|
{
|
|
|
|
string result="";
|
|
switch (id_nom)
|
|
{
|
|
case STABMEMBRANE_BIEL_NON_DEFINIE :
|
|
result="STABMEMBRANE_BIEL_NON_DEFINIE";
|
|
break;
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER :
|
|
result="STABMEMBRANE_BIEL_PREMIER_ITER";
|
|
break;
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER_INCR :
|
|
result="STABMEMBRANE_BIEL_PREMIER_ITER_INCR";
|
|
break;
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER :
|
|
result="STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER";
|
|
break;
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR :
|
|
result="STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR";
|
|
break;
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER_NORMALE_AU_NOEUD :
|
|
result="STABMEMBRANE_BIEL_PREMIER_ITER_NORMALE_AU_NOEUD";
|
|
break;
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER_INCR_NORMALE_AU_NOEUD :
|
|
result="STABMEMBRANE_BIEL_PREMIER_ITER_INCR_NORMALE_AU_NOEUD";
|
|
break;
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_NORMALE_AU_NOEUD :
|
|
result="STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_NORMALE_AU_NOEUD";
|
|
break;
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR_NORMALE_AU_NOEUD :
|
|
result="STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR_NORMALE_AU_NOEUD";
|
|
break;
|
|
case STAB_M_B_ITER_1_VIA_F_EXT :
|
|
result="STAB_M_B_ITER_1_VIA_F_EXT";
|
|
break;
|
|
case STAB_M_B_ITER_INCR_1_VIA_F_EXT :
|
|
result="STAB_M_B_ITER_INCR_1_VIA_F_EXT";
|
|
break;
|
|
case STAB_M_B_ITER_1_VIA_F_EXT_NORMALE_AU_NOEUD :
|
|
result="STAB_M_B_ITER_1_VIA_F_EXT_NORMALE_AU_NOEUD";
|
|
break;
|
|
case STAB_M_B_ITER_INCR_1_VIA_F_EXT_NORMALE_AU_NOEUD :
|
|
result="STAB_M_B_ITER_INCR_1_VIA_F_EXT_NORMALE_AU_NOEUD";
|
|
break;
|
|
|
|
default :
|
|
cout << "\nErreur : valeur incorrecte du type Enum_StabMembraneBiel !\n";
|
|
cout << "Nom_StabMembraneBiel(Enum_StabMembraneBiel ) \n";
|
|
Sortie(1);
|
|
};
|
|
return result;
|
|
|
|
};
|
|
|
|
Enum_StabMembraneBiel Id_Enum_StabMembraneBiel (const string& nom_StabMembraneBiel)
|
|
// Retourne la variable de type enumere associee au nom
|
|
{
|
|
|
|
Enum_StabMembraneBiel result;
|
|
if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_NON_DEFINIE" )
|
|
result=STABMEMBRANE_BIEL_NON_DEFINIE;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_PREMIER_ITER" )
|
|
result=STABMEMBRANE_BIEL_PREMIER_ITER;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_PREMIER_ITER_INCR" )
|
|
result=STABMEMBRANE_BIEL_PREMIER_ITER_INCR;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER" )
|
|
result=STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR" )
|
|
result=STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_PREMIER_ITER_NORMALE_AU_NOEUD" )
|
|
result=STABMEMBRANE_BIEL_PREMIER_ITER_NORMALE_AU_NOEUD;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_PREMIER_ITER_INCR_NORMALE_AU_NOEUD" )
|
|
result=STABMEMBRANE_BIEL_PREMIER_ITER_INCR_NORMALE_AU_NOEUD;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_NORMALE_AU_NOEUD" )
|
|
result=STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_NORMALE_AU_NOEUD;
|
|
else if ( nom_StabMembraneBiel == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR_NORMALE_AU_NOEUD" )
|
|
result=STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR_NORMALE_AU_NOEUD;
|
|
else if ( nom_StabMembraneBiel == "STAB_M_B_ITER_1_VIA_F_EXT" )
|
|
result=STAB_M_B_ITER_1_VIA_F_EXT;
|
|
else if ( nom_StabMembraneBiel == "STAB_M_B_ITER_INCR_1_VIA_F_EXT" )
|
|
result=STAB_M_B_ITER_INCR_1_VIA_F_EXT;
|
|
else if ( nom_StabMembraneBiel == "STAB_M_B_ITER_1_VIA_F_EXT_NORMALE_AU_NOEUD" )
|
|
result=STAB_M_B_ITER_1_VIA_F_EXT_NORMALE_AU_NOEUD;
|
|
else if ( nom_StabMembraneBiel == "STAB_M_B_ITER_INCR_1_VIA_F_EXT_NORMALE_AU_NOEUD" )
|
|
result=STAB_M_B_ITER_INCR_1_VIA_F_EXT_NORMALE_AU_NOEUD;
|
|
|
|
else
|
|
{
|
|
cout << "\nErreur : nom " << nom_StabMembraneBiel << " du type de stabilisation d'hourglass inconnue !\n";
|
|
cout << "Id_nom_StabMembraneBiel (const string& nom) \n";
|
|
Sortie(1);
|
|
};
|
|
return result;
|
|
|
|
};
|
|
|
|
|
|
// Retourne vrai si le nom passé en argument représente un type reconnu
|
|
// sinon false
|
|
bool Type_Enum_StabMembraneBiel_existe(const string& nom)
|
|
{ bool result;
|
|
if ( nom == "STABMEMBRANE_BIEL_PREMIER_ITER") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_NON_DEFINIE") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_PREMIER_ITER_INCR") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_PREMIER_ITER_NORMALE_AU_NOEUD") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_PREMIER_ITER_INCR_NORMALE_AU_NOEUD") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_NORMALE_AU_NOEUD") {result=true;}
|
|
else if ( nom == "STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR_NORMALE_AU_NOEUD") {result=true;}
|
|
else if ( nom == "STAB_M_B_ITER_1_VIA_F_EXT") {result=true;}
|
|
else if ( nom == "STAB_M_B_ITER_INCR_1_VIA_F_EXT") {result=true;}
|
|
else if ( nom == "STAB_M_B_ITER_1_VIA_F_EXT_NORMALE_AU_NOEUD") {result=true;}
|
|
else if ( nom == "STAB_M_B_ITER_INCR_1_VIA_F_EXT_NORMALE_AU_NOEUD") {result=true;}
|
|
|
|
else {result = false;}
|
|
return result;
|
|
};
|
|
|
|
|
|
// retourne vrai si le type enumere se termine par _NORMALE_AU_NOEUD
|
|
bool Contient_Normale_au_noeud(Enum_StabMembraneBiel id_StabMembraneBiel)
|
|
{ bool result;
|
|
switch (id_StabMembraneBiel)
|
|
{
|
|
case STABMEMBRANE_BIEL_NON_DEFINIE : case STABMEMBRANE_BIEL_PREMIER_ITER :
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER_INCR : case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER :
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR :
|
|
case STAB_M_B_ITER_1_VIA_F_EXT :
|
|
case STAB_M_B_ITER_INCR_1_VIA_F_EXT :
|
|
result=false;
|
|
break;
|
|
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER_NORMALE_AU_NOEUD :
|
|
case STABMEMBRANE_BIEL_PREMIER_ITER_INCR_NORMALE_AU_NOEUD :
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_NORMALE_AU_NOEUD :
|
|
case STABMEMBRANE_BIEL_Gerschgorin_PREMIER_ITER_INCR_NORMALE_AU_NOEUD :
|
|
case STAB_M_B_ITER_1_VIA_F_EXT_NORMALE_AU_NOEUD :
|
|
case STAB_M_B_ITER_INCR_1_VIA_F_EXT_NORMALE_AU_NOEUD :
|
|
result=true;
|
|
break;
|
|
|
|
default :
|
|
cout << "\nErreur : valeur incorrecte du type Enum_StabMembraneBiel !\n";
|
|
cout << "Contient_Normale_au_noeud(Enum_StabMembraneBiel id_StabMembraneBiel) \n";
|
|
Sortie(1);
|
|
};
|
|
return result;
|
|
};
|
|
|
|
|
|
// surcharge de l'operator de lecture
|
|
istream & operator >> (istream & entree, Enum_StabMembraneBiel& a)
|
|
{ string nom_Enum_StabMembraneBiel;
|
|
entree >> nom_Enum_StabMembraneBiel;
|
|
a = Id_Enum_StabMembraneBiel ( nom_Enum_StabMembraneBiel);
|
|
return entree;
|
|
};
|
|
|
|
// surcharge de l'operator d'ecriture
|
|
ostream & operator << (ostream & sort, const Enum_StabMembraneBiel& a)
|
|
{ // on ecrit la forme caractère
|
|
sort << Nom_StabMembraneBiel(a) << " ";
|
|
return sort;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|