LCOV - code coverage report
Current view: top level - src/materials - ComputeCosseratLinearElasticStress.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #32971 (54bef8) with base c6cf66 Lines: 19 21 90.5 %
Date: 2026-05-29 20:40:07 Functions: 4 4 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 "ComputeCosseratLinearElasticStress.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", ComputeCosseratLinearElasticStress);
      13             : 
      14             : InputParameters
      15         264 : ComputeCosseratLinearElasticStress::validParams()
      16             : {
      17         264 :   InputParameters params = ComputeCosseratStressBase::validParams();
      18         264 :   params.addClassDescription(
      19             :       "Compute Cosserat stress and couple-stress elasticity for small strains");
      20         264 :   return params;
      21           0 : }
      22             : 
      23         198 : ComputeCosseratLinearElasticStress::ComputeCosseratLinearElasticStress(
      24         198 :     const InputParameters & parameters)
      25             :   : ComputeCosseratStressBase(parameters),
      26         198 :     _elasticity_tensor_name(_base_name + "elasticity_tensor"),
      27         198 :     _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_elasticity_tensor_name))
      28             : {
      29         198 : }
      30             : 
      31             : void
      32         195 : ComputeCosseratLinearElasticStress::initialSetup()
      33             : {
      34         390 :   if (hasBlockMaterialProperty<RankTwoTensor>(_base_name + "strain_increment"))
      35           0 :     mooseError("This linear elastic stress calculation only works for small strains");
      36         195 : }
      37             : 
      38             : void
      39      105456 : ComputeCosseratLinearElasticStress::computeQpStress()
      40             : {
      41      105456 :   _stress[_qp] = _elasticity_tensor[_qp] * _mechanical_strain[_qp];
      42      105456 :   _stress_couple[_qp] = _elastic_flexural_rigidity_tensor[_qp] * _curvature[_qp];
      43             : 
      44      105456 :   _elastic_strain[_qp] = _mechanical_strain[_qp];
      45             : 
      46      105456 :   _Jacobian_mult[_qp] = _elasticity_tensor[_qp];
      47      105456 :   _Jacobian_mult_couple[_qp] = _elastic_flexural_rigidity_tensor[_qp];
      48      105456 : }

Generated by: LCOV version 1.14