LCOV - code coverage report
Current view: top level - src/materials - ComputeMultipleInelasticCosseratStress.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 42 44 95.5 %
Date: 2025-07-25 05:00:39 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://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             : #include "ComputeMultipleInelasticCosseratStress.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", ComputeMultipleInelasticCosseratStress);
      13             : 
      14             : InputParameters
      15         720 : ComputeMultipleInelasticCosseratStress::validParams()
      16             : {
      17         720 :   InputParameters params = ComputeMultipleInelasticStress::validParams();
      18         720 :   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         720 :   return params;
      24           0 : }
      25             : 
      26         540 : ComputeMultipleInelasticCosseratStress::ComputeMultipleInelasticCosseratStress(
      27         540 :     const InputParameters & parameters)
      28             :   : ComputeMultipleInelasticStress(parameters),
      29         540 :     _curvature(getMaterialProperty<RankTwoTensor>("curvature")),
      30         540 :     _elastic_flexural_rigidity_tensor(
      31         540 :         getMaterialProperty<RankFourTensor>("elastic_flexural_rigidity_tensor")),
      32         540 :     _couple_stress(declareProperty<RankTwoTensor>("couple_stress")),
      33        1080 :     _couple_stress_old(getMaterialPropertyOld<RankTwoTensor>("couple_stress")),
      34         540 :     _Jacobian_mult_couple(declareProperty<RankFourTensor>("couple_Jacobian_mult")),
      35        1620 :     _compliance(getMaterialProperty<RankFourTensor>(_base_name + "compliance_tensor"))
      36             : {
      37         540 : }
      38             : 
      39             : void
      40       76288 : ComputeMultipleInelasticCosseratStress::initQpStatefulProperties()
      41             : {
      42       76288 :   ComputeMultipleInelasticStress::initQpStatefulProperties();
      43       76288 :   _couple_stress[_qp].zero();
      44       76288 : }
      45             : 
      46             : void
      47      173856 : ComputeMultipleInelasticCosseratStress::computeQpStress()
      48             : {
      49      173856 :   ComputeMultipleInelasticStress::computeQpStress();
      50             : 
      51      173856 :   _couple_stress[_qp] = _elastic_flexural_rigidity_tensor[_qp] * _curvature[_qp];
      52      173856 :   if (_fe_problem.currentlyComputingJacobian())
      53       37984 :     _Jacobian_mult_couple[_qp] = _elastic_flexural_rigidity_tensor[_qp];
      54             : 
      55      173856 :   if (_perform_finite_strain_rotations)
      56             :   {
      57        8640 :     _couple_stress[_qp] =
      58        8640 :         _rotation_increment[_qp] * _couple_stress[_qp] * _rotation_increment[_qp].transpose();
      59        8640 :     _Jacobian_mult_couple[_qp].rotate(_rotation_increment[_qp]);
      60             :   }
      61      173856 : }
      62             : 
      63             : void
      64          64 : ComputeMultipleInelasticCosseratStress::computeQpJacobianMult()
      65             : {
      66          64 :   if (_tangent_operator_type == TangentOperatorEnum::elastic)
      67           0 :     _Jacobian_mult[_qp] = _elasticity_tensor[_qp];
      68             :   else
      69             :   {
      70          64 :     _Jacobian_mult[_qp] = _consistent_tangent_operator[0];
      71         128 :     for (unsigned i_rmm = 1; i_rmm < _num_models; ++i_rmm)
      72          64 :       _Jacobian_mult[_qp] =
      73          64 :           _consistent_tangent_operator[i_rmm] * _compliance[_qp] * _Jacobian_mult[_qp];
      74             :   }
      75          64 : }
      76             : 
      77             : void
      78       26976 : ComputeMultipleInelasticCosseratStress::computeAdmissibleState(
      79             :     unsigned model_number,
      80             :     RankTwoTensor & elastic_strain_increment,
      81             :     RankTwoTensor & inelastic_strain_increment,
      82             :     RankFourTensor & consistent_tangent_operator)
      83             : {
      84       26976 :   const RankTwoTensor trial_stress = _stress[_qp];
      85       26976 :   const RankTwoTensor applied_strain_increment = elastic_strain_increment;
      86             : 
      87       26976 :   ComputeMultipleInelasticStress::computeAdmissibleState(model_number,
      88             :                                                          elastic_strain_increment,
      89             :                                                          inelastic_strain_increment,
      90             :                                                          consistent_tangent_operator);
      91             : 
      92       26976 :   inelastic_strain_increment = _compliance[_qp] * (trial_stress - _stress[_qp]);
      93       26976 :   elastic_strain_increment = applied_strain_increment - inelastic_strain_increment;
      94       26976 : }

Generated by: LCOV version 1.14