1 /*!
2  * \file  mfront/src/CastemGetModellingHypothesis.cxx
3  * \brief
4  * \author Thomas Helfer
5  * \brief 17 mar 2011
6  * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights
7  * reserved.
8  * This project is publicly released under either the GNU GPL Licence
9  * or the CECILL-A licence. A copy of thoses licences are delivered
10  * with the sources of TFEL. CEA or EDF may also distribute this
11  * project under specific licensing conditions.
12  */
13 
14 #include<sstream>
15 
16 #include"TFEL/Raise.hxx"
17 #include"MFront/Castem/CastemException.hxx"
18 #include"MFront/Castem/CastemGetModellingHypothesis.hxx"
19 
20 namespace castem
21 {
22 
23   tfel::material::ModellingHypothesis::Hypothesis
getModellingHypothesis(const CastemInt ndi)24   getModellingHypothesis(const CastemInt ndi)
25   {
26     using namespace std;
27     using namespace tfel::material;
28     switch(ndi){
29     case 2:
30       return ModellingHypothesis::TRIDIMENSIONAL;
31     case 0:
32       return ModellingHypothesis::AXISYMMETRICAL;
33     case -1:
34       return ModellingHypothesis::PLANESTRAIN;
35     case -2:
36       return ModellingHypothesis::PLANESTRESS;
37     case -3:
38       return ModellingHypothesis::GENERALISEDPLANESTRAIN;
39     case 14:
40       return ModellingHypothesis::AXISYMMETRICALGENERALISEDPLANESTRAIN;
41 // C                       =  3 a 11 : unidimensionnel plan (massif 1D)
42 // C                       = 12 a 14 : unidimensionnel axisymetrique (massif 1D)
43 // C                       = 15 : unidimensionnel spherique (massif 1D)
44     }
45     ostringstream msg;
46     msg << "castem::getModellingHypothesis : "
47 	<< "invalid argument ('" << ndi << "')";
48     tfel::raise<CastemException>(msg.str());
49   }
50 
51 } // end of namespace castem
52