LCOV - code coverage report
Current view: top level - src/kernels - ADWeakPlaneStress.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 16 16 100.0 %
Date: 2025-07-25 05:00:39 Functions: 3 3 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 "ADWeakPlaneStress.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", ADWeakPlaneStress);
      13             : 
      14             : InputParameters
      15          60 : ADWeakPlaneStress::validParams()
      16             : {
      17          60 :   InputParameters params = ADKernelValue::validParams();
      18          60 :   params.addClassDescription("Plane stress kernel to provide out-of-plane strain contribution.");
      19         120 :   params.addParam<std::string>("base_name", "Material property base name");
      20         120 :   MooseEnum direction("x y z", "z");
      21         120 :   params.addParam<MooseEnum>("out_of_plane_strain_direction",
      22             :                              direction,
      23             :                              "The direction of the out-of-plane strain variable");
      24          60 :   params.set<bool>("use_displaced_mesh") = false;
      25             : 
      26          60 :   return params;
      27          60 : }
      28             : 
      29          30 : ADWeakPlaneStress::ADWeakPlaneStress(const InputParameters & parameters)
      30             :   : ADKernelValue(parameters),
      31          30 :     _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
      32          60 :     _stress(getADMaterialProperty<RankTwoTensor>(_base_name + "stress")),
      33          90 :     _direction(getParam<MooseEnum>("out_of_plane_strain_direction"))
      34             : {
      35          30 : }
      36             : 
      37             : ADReal
      38        5440 : ADWeakPlaneStress::precomputeQpResidual()
      39             : {
      40        5440 :   return _stress[_qp](_direction, _direction);
      41             : }

Generated by: LCOV version 1.14