1 /*!
2  * \file   mfront/include/MFront/BehaviourDSLDescription.hxx
3  * \brief
4  *
5  * \author Thomas Helfer
6  * \date   29/08/2019
7  * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights
8  * reserved.
9  * This project is publicly released under either the GNU GPL Licence
10  * or the CECILL-A licence. A copy of thoses licences are delivered
11  * with the sources of TFEL. CEA or EDF may also distribute this
12  * project under specific licensing conditions.
13  */
14 
15 #ifndef LIB_MFRONT_BEHAVIOURDSLDECRIPTION_HXX
16 #define LIB_MFRONT_BEHAVIOURDSLDECRIPTION_HXX
17 
18 #include <vector>
19 #include <string>
20 #include "TFEL/Material/ModellingHypothesis.hxx"
21 #include "TFEL/Material/MechanicalBehaviour.hxx"
22 #include "MFront/MFrontConfig.hxx"
23 #include "MFront/BehaviourSymmetryType.hxx"
24 #include "MFront/IntegrationScheme.hxx"
25 
26 namespace mfront {
27 
28   /*!
29    * \brief structure used to give information about a DSL.
30    *
31    * This structure has been introducted to ease the implementation of
32    * `tfel-editor`'s behaviour wizard.
33    */
34   struct MFRONT_VISIBILITY_EXPORT BehaviourDSLDescription {
35     //! a simple alias
36     using ModellingHypothesis = tfel::material::ModellingHypothesis;
37     //! a simple alias
38     using Hypothesis = ModellingHypothesis::Hypothesis;
39     //! a simple alias
40     using BehaviourType =
41         tfel::material::MechanicalBehaviourBase::BehaviourType;
42     //! \brief default constructor
43     BehaviourDSLDescription();
44     //! \brief copy constructor
45     BehaviourDSLDescription(const BehaviourDSLDescription&);
46     //! \brief move constructor
47     BehaviourDSLDescription(BehaviourDSLDescription&&);
48     //! \brief standard assignement
49     BehaviourDSLDescription& operator=(const BehaviourDSLDescription&);
50     //! \brief move assignement
51     BehaviourDSLDescription& operator=(BehaviourDSLDescription&&);
52     //! \brief destructor
53     ~BehaviourDSLDescription();
54     //! \brief type of the behaviour handled
55     BehaviourType behaviourType =
56         tfel::material::MechanicalBehaviourBase::GENERALBEHAVIOUR;
57     //! \brief integration scheme
58     IntegrationScheme integrationScheme =
59         IntegrationScheme::UNDEFINEDINTEGRATIONSCHEME;
60     //! \brief supported modelling hypotheses
61     std::vector<Hypothesis> supportedModellingHypotheses =
62         ModellingHypothesis::getModellingHypotheses();
63     //! \brief supported behaviour symmetry
64     std::vector<BehaviourSymmetryType> supportedBehaviourSymmetries = {
65         mfront::ISOTROPIC, mfront::ORTHOTROPIC};
66     //! \brief list of typical code blocks that may be defined by the user
67     std::vector<std::string> typicalCodeBlocks;
68     //! \brief minimal body of a MFront file
69     std::string minimalMFrontFileBody;
70     //! \brief allow user defined material properties
71     bool allowUserDefinedMaterialProperties = true;
72     //! \brief allow user defined parameters
73     bool allowUserDefinedParameters = true;
74     //! \brief allow user defined state variables
75     bool allowUserDefinedStateVariables = true;
76     //! \brief allow user defined auxiliary state variables
77     bool allowUserDefinedAuxiliaryStateVariables = true;
78     //! \brief allow user defined integration variables
79     bool allowUserDefinedIntegrationVariables = true;
80     //! \brief allow user defined external state variables
81     bool allowUserDefinedExternalStateVariables = true;
82     //! \brief allow user defined local variables
83     bool allowUserDefinedLocalVariables = true;
84     //! \brief allow the definition of the crystal structure
85     bool allowCrystalStructureDefinition = true;
86     //! \brief require the definition of the crystal structure
87     bool requireCrystalStructureDefinition = false;
88     //! \brief allow the definition of the elastic properties
89     bool allowElasticPropertiesDefinition = true;
90     //! \brief allow the definition stiffness tensor
91     bool allowStiffnessTensorDefinition = true;
92     //! \brief require the definition stiffness tensor
93     bool requireStiffnessTensorDefinition = false;
94 
95   };  // end of struct BehaviourDSLDescription
96 
97   /*!
98    * \return a default description for DSLs handling strain based behaviours.
99    */
100   MFRONT_VISIBILITY_EXPORT BehaviourDSLDescription
101   getDefaultStrainBasedBehaviourDSLDescription();
102   /*!
103    * \return a default description for DSLs handling finite strain behaviours.
104    */
105   MFRONT_VISIBILITY_EXPORT BehaviourDSLDescription
106   getDefaultFiniteStrainBehaviourDSLDescription();
107 
108   /*!
109    * \brief a small function checking of all the modelling hypotheses can be
110    * supported.
111    * \param[in] d: behaviour DSL description
112    * \return true if all modelling hypotheses can be supported
113    */
114   MFRONT_VISIBILITY_EXPORT bool supportAllModellingHypothes(
115       const BehaviourDSLDescription&);
116 
117 }  // end of namespace mfront
118 
119 #endif /* LIB_MFRONT_BEHAVIOURDSLDECRIPTION_HXX */
120