1 /*!
2  * \file   mfront/src/RousselierTanguyBesson2002StressCriterion.cxx
3  * \brief
4  * \author Thomas Helfer, Jérémy Hure, Mohamed Shokeir
5  * \date   14/04/2020
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 "TFEL/Raise.hxx"
15 #include "MFront/StandardElastoViscoPlasticityBrick.hxx"
16 #include "MFront/BehaviourBrick/BrickUtilities.hxx"
17 #include "MFront/BehaviourBrick/OptionDescription.hxx"
18 #include "MFront/BehaviourBrick/StressPotential.hxx"
19 #include "MFront/BehaviourBrick/RousselierTanguyBesson2002StressCriterion.hxx"
20 
21 namespace mfront {
22 
23   namespace bbrick {
24 
25     RousselierTanguyBesson2002StressCriterion::
RousselierTanguyBesson2002StressCriterion()26         RousselierTanguyBesson2002StressCriterion()
27         : StandardPorousStressCriterionBase("RousselierTanguyBesson2002") {
28     }  // end of RousselierTanguyBesson2002StressCriterion
29 
30     std::vector<mfront::BehaviourSymmetryType>
getSupportedBehaviourSymmetries() const31     RousselierTanguyBesson2002StressCriterion::getSupportedBehaviourSymmetries()
32         const {
33       return {mfront::ISOTROPIC, mfront::ORTHOTROPIC};
34     }  // end of getSupportedBehaviourSymmetries
35 
36     std::vector<OptionDescription>
getOptions() const37     RousselierTanguyBesson2002StressCriterion::getOptions() const {
38       auto opts = StressCriterionBase::getOptions();
39       opts.emplace_back("DR", "first coefficient of the Roussielier model",
40                         OptionDescription::MATERIALPROPERTY);
41       opts.emplace_back("qR", "second coefficient of the Roussielier model",
42                         OptionDescription::MATERIALPROPERTY);
43       return opts;
44     }  // end of getOptions
45 
46     StressCriterion::PorosityEffectOnFlowRule
47     RousselierTanguyBesson2002StressCriterion::
getPorosityEffectOnEquivalentPlasticStrain() const48         getPorosityEffectOnEquivalentPlasticStrain() const {
49       return StressCriterion::
50           STANDARD_POROSITY_CORRECTION_ON_EQUIVALENT_PLASTIC_STRAIN;
51     }  // end of getPorosityEffectOnEquivalentPlasticStrain
52 
53     std::string
updatePorosityUpperBound(const BehaviourDescription &,const std::string & id,const Role r) const54     RousselierTanguyBesson2002StressCriterion::updatePorosityUpperBound(
55         const BehaviourDescription&,
56         const std::string& id,
57         const Role r) const {
58       if (!((r == STRESSCRITERION) || (r == STRESSANDFLOWCRITERION))) {
59         tfel::raise(
60             "RousselierTanguyBesson2002StressCriterion::"
61             "updatePorosityUpperBound: invalid call for this stress criterion. "
62             "This method is not valid for flow criteria (i.e. when the stress "
63             "criterion is used to dertermine the flow direction in non "
64             "associated plasticity).");
65       }
66       const auto bound = std::string(
67           mfront::StandardElastoViscoPlasticityBrick::porosityUpperBound);
68       const auto params =
69           StressCriterion::getVariableId("sscb_parameters", id, r);
70       return "this->" + bound + " = " +   //
71              "std::min(this->" + bound +  //
72              ", 3 / (2 * this->" + params + ".DR));\n";
73       }  // end of
74          // RousselierTanguyBesson2002StressCriterion::updatePorosityUpperBound()
75 
76       RousselierTanguyBesson2002StressCriterion::
77           ~RousselierTanguyBesson2002StressCriterion() = default;
78 
79   }  // end of namespace bbrick
80 
81 }  // end of namespace mfront
82