LCOV - code coverage report
Current view: top level - src/kernels - ADStressDivergenceRSphericalTensors.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 17 20 85.0 %
Date: 2024-02-27 11:53:14 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://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 "ADStressDivergenceRSphericalTensors.h"
      11             : #include "ElasticityTensorTools.h"
      12             : #include "FEProblem.h"
      13             : #include "MooseMesh.h"
      14             : #include "Assembly.h"
      15             : 
      16             : registerMooseObject("TensorMechanicsApp", ADStressDivergenceRSphericalTensors);
      17             : 
      18             : InputParameters
      19          72 : ADStressDivergenceRSphericalTensors::validParams()
      20             : {
      21          72 :   InputParameters params = ADStressDivergenceTensors::validParams();
      22          72 :   params.addClassDescription(
      23             :       "Calculate stress divergence for a spherically symmetric 1D problem in polar coordinates.");
      24          72 :   params.set<unsigned int>("component") = 0;
      25          72 :   return params;
      26           0 : }
      27             : 
      28          36 : ADStressDivergenceRSphericalTensors::ADStressDivergenceRSphericalTensors(
      29          36 :     const InputParameters & parameters)
      30          36 :   : ADStressDivergenceTensors(parameters)
      31             : {
      32          36 :   if (_component != 0)
      33           0 :     mooseError("Invalid component for this 1D RSpherical problem.");
      34          36 : }
      35             : 
      36             : void
      37          36 : ADStressDivergenceRSphericalTensors::initialSetup()
      38             : {
      39          36 :   if (getBlockCoordSystem() != Moose::COORD_RSPHERICAL)
      40           0 :     mooseError("The coordinate system in the Problem block must be set to RSPHERICAL for 1D "
      41             :                "spherically symmetric geometries.");
      42          36 : }
      43             : 
      44             : ADReal
      45        6616 : ADStressDivergenceRSphericalTensors::computeQpResidual()
      46             : {
      47        6616 :   return _grad_test[_i][_qp](0) * _stress[_qp](0, 0) +                 // stress_{rr} part 1
      48        6616 :          (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](1, 1) + // stress_{\theta \theta}
      49       13232 :          (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](2, 2);  // stress_{\phi \phi}
      50             : }

Generated by: LCOV version 1.14