LCOV - code coverage report
Current view: top level - src/materials - ComputeEigenstrainBeamBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 20 21 95.2 %
Date: 2025-09-04 07:57:23 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 "ComputeEigenstrainBeamBase.h"
      11             : 
      12             : InputParameters
      13          58 : ComputeEigenstrainBeamBase::validParams()
      14             : {
      15          58 :   InputParameters params = Material::validParams();
      16         116 :   params.addRequiredParam<std::string>("eigenstrain_name",
      17             :                                        "Material property name for the eigenstrain vector computed "
      18             :                                        "by this model. IMPORTANT: The name of this property must "
      19             :                                        "also be provided to the strain calculator.");
      20          58 :   return params;
      21           0 : }
      22             : 
      23          44 : ComputeEigenstrainBeamBase::ComputeEigenstrainBeamBase(const InputParameters & parameters)
      24             :   : Material(parameters),
      25          44 :     _eigenstrain_name(getParam<std::string>("eigenstrain_name")),
      26          44 :     _disp_eigenstrain(declareProperty<RealVectorValue>("disp_" + _eigenstrain_name)),
      27          44 :     _rot_eigenstrain(declareProperty<RealVectorValue>("rot_" + _eigenstrain_name)),
      28         132 :     _step_zero(declareRestartableData<bool>("step_zero", true))
      29             : {
      30          44 : }
      31             : 
      32             : void
      33         400 : ComputeEigenstrainBeamBase::initQpStatefulProperties()
      34             : {
      35             :   // This property can be promoted to be stateful by other models that use it,
      36             :   // so it needs to be initalized.
      37             :   RealVectorValue a;
      38         400 :   _disp_eigenstrain[_qp] = a;
      39         400 :   _rot_eigenstrain[_qp] = a;
      40         400 : }
      41             : 
      42             : void
      43         920 : ComputeEigenstrainBeamBase::computeQpProperties()
      44             : {
      45         920 :   if (_t_step >= 1)
      46         920 :     _step_zero = false;
      47             : 
      48             :   // Skip the eigenstrain calculation in step zero because no solution is computed during
      49             :   // the zeroth step, hence computing the eigenstrain in the zeroth step would result in
      50             :   // an incorrect calculation of mechanical_strain, which is stateful.
      51         920 :   if (!_step_zero)
      52         920 :     computeQpEigenstrain();
      53         920 : }

Generated by: LCOV version 1.14