2021-09-15 12:00:56 +02:00
|
|
|
// FICHIER : EnumCourbe1D.cp
|
|
|
|
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
//
|
2023-05-03 17:23:49 +02:00
|
|
|
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
|
2021-09-15 12:00:56 +02:00
|
|
|
// 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 "EnumCourbe1D.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_Courbe1D (EnumCourbe1D id_Courbe1D)
|
|
|
|
// Retourne le nom de la Courbe1 correspondant a l'identificateur
|
|
|
|
// de type enumere id_Courbe1D
|
|
|
|
{
|
|
|
|
|
|
|
|
string result;
|
|
|
|
switch (id_Courbe1D)
|
|
|
|
{
|
|
|
|
case COURBEPOLYLINEAIRE_1_D :result="COURBEPOLYLINEAIRE_1_D";break;
|
|
|
|
case COURBEPOLYHERMITE_1_D :result="COURBEPOLYHERMITE_1_D";break;
|
|
|
|
case COURBE_EXPOAFF :result="COURBE_EXPOAFF";break;
|
|
|
|
case COURBE_UN_MOINS_COS :result="COURBE_UN_MOINS_COS";break;
|
|
|
|
case CPL1D :result="CPL1D";break;
|
|
|
|
case COURBEPOLYNOMIALE :result="COURBEPOLYNOMIALE";break;
|
|
|
|
case F1_ROND_F2 :result="F1_ROND_F2";break;
|
|
|
|
case F1_PLUS_F2 :result="F1_PLUS_F2";break;
|
|
|
|
case F_CYCLIQUE :result="F_CYCLIQUE";break;
|
|
|
|
case F_CYCLE_ADD :result="F_CYCLE_ADD";break;
|
|
|
|
case F_UNION_1D :result="F_UNION_1D";break;
|
|
|
|
case COURBE_TRIPODECOS3PHI :result="COURBE_TRIPODECOS3PHI";break;
|
|
|
|
case COURBE_SIXPODECOS3PHI :result="COURBE_SIXPODECOS3PHI";break;
|
|
|
|
case COURBE_POLY_LAGRANGE :result="COURBE_POLY_LAGRANGE";break;
|
|
|
|
case COURBE_EXPO_N :result="COURBE_EXPO_N";break;
|
|
|
|
case COURBE_EXPO2_N :result="COURBE_EXPO2_N";break;
|
|
|
|
case COURBE_RELAX_EXPO :result="COURBE_RELAX_EXPO";break;
|
|
|
|
case COURBE_COS :result="COURBE_COS";break;
|
|
|
|
case COURBE_SIN :result="COURBE_SIN";break;
|
|
|
|
case COURBE_TANH :result="COURBE_TANH";break;
|
|
|
|
case COURBE_LN_COSH :result="COURBE_LN_COSH";break;
|
|
|
|
case COURBE_EXPRESSION_LITTERALE_1D :result="COURBE_EXPRESSION_LITTERALE_1D";break;
|
|
|
|
case COURBE_EXPRESSION_LITTERALE_AVEC_DERIVEE_1D :result="COURBE_EXPRESSION_LITTERALE_AVEC_DERIVEE_1D";break;
|
|
|
|
case AUCUNE_COURBE1D :result="AUCUNE_COURBE1D";break;
|
|
|
|
default :
|
|
|
|
cout << "\nErreur : valeur incorrecte du type EnumCourbe1D !\n";
|
|
|
|
cout << "Nom_Courbe1D(EnumCourbe1D ) \n";
|
|
|
|
Sortie(1);
|
|
|
|
};
|
|
|
|
return result;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
EnumCourbe1D Id_Nom_Courbe1D (const string& nom_Courbe1D)
|
|
|
|
// Retourne la variable de type enumere associee au nom de la Courbe1D
|
|
|
|
{
|
|
|
|
|
|
|
|
EnumCourbe1D result;
|
|
|
|
if ( nom_Courbe1D == "COURBEPOLYLINEAIRE_1_D" )
|
|
|
|
result=COURBEPOLYLINEAIRE_1_D;
|
|
|
|
else if ( nom_Courbe1D == "COURBEPOLYHERMITE_1_D" )
|
|
|
|
result=COURBEPOLYHERMITE_1_D;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_EXPOAFF" )
|
|
|
|
result=COURBE_EXPOAFF;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_UN_MOINS_COS" )
|
|
|
|
result=COURBE_UN_MOINS_COS;
|
|
|
|
else if ( nom_Courbe1D == "CPL1D" )
|
|
|
|
result=CPL1D;
|
|
|
|
else if ( nom_Courbe1D == "COURBEPOLYNOMIALE" )
|
|
|
|
result=COURBEPOLYNOMIALE;
|
|
|
|
else if ( nom_Courbe1D == "F1_ROND_F2" )
|
|
|
|
result=F1_ROND_F2;
|
|
|
|
else if ( nom_Courbe1D == "F1_PLUS_F2" )
|
|
|
|
result=F1_PLUS_F2;
|
|
|
|
else if ( nom_Courbe1D == "F_CYCLIQUE" )
|
|
|
|
result=F_CYCLIQUE;
|
|
|
|
else if ( nom_Courbe1D == "F_CYCLE_ADD" )
|
|
|
|
result=F_CYCLE_ADD;
|
|
|
|
else if ( nom_Courbe1D == "F_UNION_1D" )
|
|
|
|
result=F_UNION_1D;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_TRIPODECOS3PHI" )
|
|
|
|
result=COURBE_TRIPODECOS3PHI;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_SIXPODECOS3PHI" )
|
|
|
|
result=COURBE_SIXPODECOS3PHI;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_POLY_LAGRANGE" )
|
|
|
|
result=COURBE_POLY_LAGRANGE;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_EXPO_N" )
|
|
|
|
result=COURBE_EXPO_N;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_EXPO2_N" )
|
|
|
|
result=COURBE_EXPO2_N;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_RELAX_EXPO" )
|
|
|
|
result=COURBE_RELAX_EXPO;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_COS" )
|
|
|
|
result=COURBE_COS;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_SIN" )
|
|
|
|
result=COURBE_SIN;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_TANH" )
|
|
|
|
result=COURBE_TANH;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_LN_COSH" )
|
|
|
|
result=COURBE_LN_COSH;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_EXPRESSION_LITTERALE_1D" )
|
|
|
|
result=COURBE_EXPRESSION_LITTERALE_1D;
|
|
|
|
else if ( nom_Courbe1D == "COURBE_EXPRESSION_LITTERALE_AVEC_DERIVEE_1D" )
|
|
|
|
result=COURBE_EXPRESSION_LITTERALE_AVEC_DERIVEE_1D;
|
|
|
|
else if ( nom_Courbe1D == "AUCUNE_COURBE1D" )
|
|
|
|
result=AUCUNE_COURBE1D;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cout << "\nErreur : nom de la Courbe1D inconnu !: " << nom_Courbe1D << "\n";
|
|
|
|
cout << "Id_Nom_Courbe1D (... \n";
|
|
|
|
Sortie(1);
|
|
|
|
};
|
|
|
|
return result;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// Retourne vrai si le nom passé en argument représente un type de courbe reconnu
|
|
|
|
// sinon false
|
|
|
|
bool Type_EnumCourbe1D_existe(const string& nom)
|
|
|
|
{ bool result;
|
|
|
|
if ( nom == "COURBEPOLYLINEAIRE_1_D") result=true;
|
|
|
|
else if ( nom == "COURBEPOLYHERMITE_1_D") result=true;
|
|
|
|
else if ( nom == "COURBE_EXPOAFF") result=true;
|
|
|
|
else if ( nom == "COURBE_UN_MOINS_COS") result=true;
|
|
|
|
else if ( nom == "CPL1D") result=true;
|
|
|
|
else if ( nom == "COURBEPOLYNOMIALE") result=true;
|
|
|
|
else if ( nom == "F1_ROND_F2") result=true;
|
|
|
|
else if ( nom == "F1_PLUS_F2") result=true;
|
|
|
|
else if ( nom == "F_CYCLIQUE") result=true;
|
|
|
|
else if ( nom == "F_CYCLE_ADD") result=true;
|
|
|
|
else if ( nom == "F_UNION_1D") result=true;
|
|
|
|
else if ( nom == "COURBE_TRIPODECOS3PHI") result=true;
|
|
|
|
else if ( nom == "COURBE_SIXPODECOS3PHI") result=true;
|
|
|
|
else if ( nom == "COURBE_POLY_LAGRANGE") result=true;
|
|
|
|
else if ( nom == "COURBE_EXPO_N") result=true;
|
|
|
|
else if ( nom == "COURBE_EXPO2_N") result=true;
|
|
|
|
else if ( nom == "COURBE_RELAX_EXPO") result=true;
|
|
|
|
else if ( nom == "COURBE_COS") result=true;
|
|
|
|
else if ( nom == "COURBE_SIN") result=true;
|
|
|
|
else if ( nom == "COURBE_TANH") result=true;
|
|
|
|
else if ( nom == "COURBE_LN_COSH") result=true;
|
|
|
|
else if ( nom == "COURBE_EXPRESSION_LITTERALE_1D") result=true;
|
|
|
|
else if ( nom == "COURBE_EXPRESSION_LITTERALE_AVEC_DERIVEE_1D") result=true;
|
|
|
|
else if ( nom == "AUCUNE_COURBE1D") result=true;
|
|
|
|
else result = false;
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
|
|
|
|
// surcharge de l'operator de lecture
|
|
|
|
istream & operator >> (istream & entree, EnumCourbe1D& a)
|
|
|
|
{ string nom_EnumCourbe1D;
|
|
|
|
entree >> nom_EnumCourbe1D;
|
|
|
|
a = Id_Nom_Courbe1D ( nom_EnumCourbe1D);
|
|
|
|
return entree;
|
|
|
|
};
|
|
|
|
|
|
|
|
// surcharge de l'operator d'ecriture
|
|
|
|
ostream & operator << (ostream & sort, const EnumCourbe1D& a)
|
|
|
|
{ // on ecrit la forme caractère
|
|
|
|
sort << Nom_Courbe1D(a) << " ";
|
|
|
|
return sort;
|
|
|
|
};
|
|
|
|
|
|
|
|
|