LCOV - code coverage report
Current view: top level - src/materials - ComputeMultipleInelasticCosseratStress.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 41 43 95.3 %
Date: 2024-02-27 11:53:14 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.mooseframework.org
       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             : #include "ComputeMultipleInelasticCosseratStress.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", ComputeMultipleInelasticCosseratStress);
      13             : 
      14             : InputParameters
      15         360 : ComputeMultipleInelasticCosseratStress::validParams()
      16             : {
      17         360 :   InputParameters params = ComputeMultipleInelasticStress::validParams();
      18         360 :   params.addClassDescription("Compute state (stress and other quantities such as plastic "
      19             :                              "strains and internal parameters) using an iterative process, as well "
      20             :                              "as Cosserat versions of these quantities.  Only elasticity is "
      21             :                              "currently implemented for the Cosserat versions."
      22             :                              "Combinations of creep models and plastic models may be used");
      23         360 :   return params;
      24           0 : }
      25             : 
      26         270 : ComputeMultipleInelasticCosseratStress::ComputeMultipleInelasticCosseratStress(
      27         270 :     const InputParameters & parameters)
      28             :   : ComputeMultipleInelasticStress(parameters),
      29         270 :     _curvature(getMaterialProperty<RankTwoTensor>("curvature")),
      30         270 :     _elastic_flexural_rigidity_tensor(
      31         270 :         getMaterialProperty<RankFourTensor>("elastic_flexural_rigidity_tensor")),
      32         270 :     _couple_stress(declareProperty<RankTwoTensor>("couple_stress")),
      33         540 :     _couple_stress_old(getMaterialPropertyOld<RankTwoTensor>("couple_stress")),
      34         270 :     _Jacobian_mult_couple(declareProperty<RankFourTensor>("couple_Jacobian_mult")),
      35         810 :     _compliance(getMaterialProperty<RankFourTensor>(_base_name + "compliance_tensor"))
      36             : {
      37         270 : }
      38             : 
      39             : void
      40       38144 : ComputeMultipleInelasticCosseratStress::initQpStatefulProperties()
      41             : {
      42       38144 :   ComputeMultipleInelasticStress::initQpStatefulProperties();
      43       38144 :   _couple_stress[_qp].zero();
      44       38144 : }
      45             : 
      46             : void
      47       87504 : ComputeMultipleInelasticCosseratStress::computeQpStress()
      48             : {
      49       87504 :   ComputeMultipleInelasticStress::computeQpStress();
      50             : 
      51       87504 :   _couple_stress[_qp] = _elastic_flexural_rigidity_tensor[_qp] * _curvature[_qp];
      52       87504 :   if (_fe_problem.currentlyComputingJacobian())
      53       18992 :     _Jacobian_mult_couple[_qp] = _elastic_flexural_rigidity_tensor[_qp];
      54             : 
      55       87504 :   if (_perform_finite_strain_rotations)
      56             :   {
      57             :     _couple_stress[_qp] =
      58        4416 :         _rotation_increment[_qp] * _couple_stress[_qp] * _rotation_increment[_qp].transpose();
      59        4416 :     _Jacobian_mult_couple[_qp].rotate(_rotation_increment[_qp]);
      60             :   }
      61       87504 : }
      62             : 
      63             : void
      64          32 : ComputeMultipleInelasticCosseratStress::computeQpJacobianMult()
      65             : {
      66          32 :   if (_tangent_operator_type == TangentOperatorEnum::elastic)
      67           0 :     _Jacobian_mult[_qp] = _elasticity_tensor[_qp];
      68             :   else
      69             :   {
      70          32 :     _Jacobian_mult[_qp] = _consistent_tangent_operator[0];
      71          64 :     for (unsigned i_rmm = 1; i_rmm < _num_models; ++i_rmm)
      72          32 :       _Jacobian_mult[_qp] =
      73          32 :           _consistent_tangent_operator[i_rmm] * _compliance[_qp] * _Jacobian_mult[_qp];
      74             :   }
      75          32 : }
      76             : 
      77             : void
      78       14096 : ComputeMultipleInelasticCosseratStress::computeAdmissibleState(
      79             :     unsigned model_number,
      80             :     RankTwoTensor & elastic_strain_increment,
      81             :     RankTwoTensor & inelastic_strain_increment,
      82             :     RankFourTensor & consistent_tangent_operator)
      83             : {
      84       14096 :   const RankTwoTensor trial_stress = _stress[_qp];
      85       14096 :   const RankTwoTensor applied_strain_increment = elastic_strain_increment;
      86             : 
      87       14096 :   ComputeMultipleInelasticStress::computeAdmissibleState(model_number,
      88             :                                                          elastic_strain_increment,
      89             :                                                          inelastic_strain_increment,
      90             :                                                          consistent_tangent_operator);
      91             : 
      92       14096 :   inelastic_strain_increment = _compliance[_qp] * (trial_stress - _stress[_qp]);
      93       14096 :   elastic_strain_increment = applied_strain_increment - inelastic_strain_increment;
      94       14096 : }

Generated by: LCOV version 1.14