LCOV - code coverage report
Current view: top level - include/materials - CappedWeakPlaneStressUpdate.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 1 1 100.0 %
Date: 2025-07-25 05:00:39 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #pragma once
      11             : 
      12             : #include "TwoParameterPlasticityStressUpdate.h"
      13             : #include "SolidMechanicsHardeningModel.h"
      14             : 
      15             : #include <array>
      16             : 
      17             : /**
      18             :  * CappedWeakPlaneStressUpdate performs the return-map
      19             :  * algorithm and associated stress updates for plastic
      20             :  * models that describe capped weak-plane plasticity
      21             :  *
      22             :  * It assumes various things about the elasticity tensor, viz
      23             :  * E(i,i,j,k) = 0 except if k=j
      24             :  * E(0,0,i,j) = E(1,1,i,j)
      25             :  */
      26             : class CappedWeakPlaneStressUpdate : public TwoParameterPlasticityStressUpdate
      27             : {
      28             : public:
      29             :   static InputParameters validParams();
      30             : 
      31             :   CappedWeakPlaneStressUpdate(const InputParameters & parameters);
      32             : 
      33             :   /**
      34             :    * Does the model require the elasticity tensor to be isotropic?
      35             :    */
      36         570 :   bool requiresIsotropicTensor() override { return false; }
      37             : 
      38             : protected:
      39             :   /// Hardening model for cohesion
      40             :   const SolidMechanicsHardeningModel & _cohesion;
      41             : 
      42             :   /// Hardening model for tan(phi)
      43             :   const SolidMechanicsHardeningModel & _tan_phi;
      44             : 
      45             :   /// Hardening model for tan(psi)
      46             :   const SolidMechanicsHardeningModel & _tan_psi;
      47             : 
      48             :   /// Hardening model for tensile strength
      49             :   const SolidMechanicsHardeningModel & _tstrength;
      50             : 
      51             :   /// Hardening model for compressive strength
      52             :   const SolidMechanicsHardeningModel & _cstrength;
      53             : 
      54             :   /// The cone vertex is smoothed by this amount
      55             :   const Real _small_smoother2;
      56             : 
      57             :   /// Initialize the NR proceedure from a guess coming from perfect plasticity
      58             :   const bool _perfect_guess;
      59             : 
      60             :   /**
      61             :    * This allows some simplification in the return-map process.
      62             :    * If the tensile yield function yf[1] >= 0 at the trial stress then
      63             :    * clearly the quadpoint is not going to fail in compression, so
      64             :    * _stress_return_type is set to no_compression, and every time
      65             :    * the compressive yield function is evaluated it is set -(very large).
      66             :    * If the compressive yield function yf[2] >= 0 at the trial stress
      67             :    * then clearly the quadpoint is not going to fail in tension, so
      68             :    * _stress_return_type is set to no_tension, and every time the
      69             :    * tensile yield function is evaluated it is set -(very large).
      70             :    * Otherwise (and at the very end after return-map) _stress_return_type
      71             :    * is set to nothing_special.
      72             :    */
      73             :   enum class StressReturnType
      74             :   {
      75             :     nothing_special,
      76             :     no_compression,
      77             :     no_tension
      78             :   } _stress_return_type;
      79             : 
      80             :   /// trial value of stress(0, 2)
      81             :   Real _in_trial02;
      82             : 
      83             :   /// trial value of stress(1, 2)
      84             :   Real _in_trial12;
      85             : 
      86             :   /// trial value of q
      87             :   Real _in_q_trial;
      88             : 
      89             :   virtual void yieldFunctionValues(Real p,
      90             :                                    Real q,
      91             :                                    const std::vector<Real> & intnl,
      92             :                                    std::vector<Real> & yf) const override;
      93             : 
      94             :   virtual void computeAllQ(Real p,
      95             :                            Real q,
      96             :                            const std::vector<Real> & intnl,
      97             :                            std::vector<yieldAndFlow> & all_q) const override;
      98             : 
      99             :   virtual void consistentTangentOperator(const RankTwoTensor & stress_trial,
     100             :                                          Real p_trial,
     101             :                                          Real q_trial,
     102             :                                          const RankTwoTensor & stress,
     103             :                                          Real p,
     104             :                                          Real q,
     105             :                                          Real gaE,
     106             :                                          const yieldAndFlow & smoothed_q,
     107             :                                          const RankFourTensor & Eijkl,
     108             :                                          bool compute_full_tangent_operator,
     109             :                                          RankFourTensor & cto) const override;
     110             : 
     111             :   virtual void setStressAfterReturn(const RankTwoTensor & stress_trial,
     112             :                                     Real p_ok,
     113             :                                     Real q_ok,
     114             :                                     Real gaE,
     115             :                                     const std::vector<Real> & intnl,
     116             :                                     const yieldAndFlow & smoothed_q,
     117             :                                     const RankFourTensor & Eijkl,
     118             :                                     RankTwoTensor & stress) const override;
     119             : 
     120             :   virtual void preReturnMap(Real p_trial,
     121             :                             Real q_trial,
     122             :                             const RankTwoTensor & stress_trial,
     123             :                             const std::vector<Real> & intnl_old,
     124             :                             const std::vector<Real> & yf,
     125             :                             const RankFourTensor & Eijkl) override;
     126             : 
     127             :   virtual void initializeVars(Real p_trial,
     128             :                               Real q_trial,
     129             :                               const std::vector<Real> & intnl_old,
     130             :                               Real & p,
     131             :                               Real & q,
     132             :                               Real & gaE,
     133             :                               std::vector<Real> & intnl) const override;
     134             : 
     135             :   virtual void setIntnlValues(Real p_trial,
     136             :                               Real q_trial,
     137             :                               Real p,
     138             :                               Real q,
     139             :                               const std::vector<Real> & intnl_old,
     140             :                               std::vector<Real> & intnl) const override;
     141             : 
     142             :   virtual void setIntnlDerivatives(Real p_trial,
     143             :                                    Real q_trial,
     144             :                                    Real p,
     145             :                                    Real q,
     146             :                                    const std::vector<Real> & intnl,
     147             :                                    std::vector<std::vector<Real>> & dintnl) const override;
     148             : 
     149             :   virtual void computePQ(const RankTwoTensor & stress, Real & p, Real & q) const override;
     150             : 
     151             :   virtual void initializeReturnProcess() override;
     152             : 
     153             :   virtual void finalizeReturnProcess(const RankTwoTensor & rotation_increment) override;
     154             : 
     155             :   virtual void setEppEqq(const RankFourTensor & Eijkl, Real & Epp, Real & Eqq) const override;
     156             : 
     157             :   virtual RankTwoTensor dpdstress(const RankTwoTensor & stress) const override;
     158             : 
     159             :   virtual RankFourTensor d2pdstress2(const RankTwoTensor & stress) const override;
     160             : 
     161             :   virtual RankTwoTensor dqdstress(const RankTwoTensor & stress) const override;
     162             : 
     163             :   virtual RankFourTensor d2qdstress2(const RankTwoTensor & stress) const override;
     164             : };

Generated by: LCOV version 1.14