www.mooseframework.org
ADStressDivergenceRSphericalTensors.C
Go to the documentation of this file.
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 
11 #include "ElasticityTensorTools.h"
12 #include "FEProblem.h"
13 #include "MooseMesh.h"
14 #include "Assembly.h"
15 
17 
19 
20 template <ComputeStage compute_stage>
21 InputParameters
23 {
25  params.addClassDescription(
26  "Calculate stress divergence for a spherically symmetric 1D problem in polar coordinates.");
27  params.set<unsigned int>("component") = 0;
28  return params;
29 }
30 
31 template <ComputeStage compute_stage>
33  const InputParameters & parameters)
34  : ADStressDivergenceTensors<compute_stage>(parameters)
35 {
36  if (_component != 0)
37  mooseError("Invalid component for this 1D RSpherical problem.");
38 }
39 
40 template <ComputeStage compute_stage>
41 void
43 {
44  if (getBlockCoordSystem() != Moose::COORD_RSPHERICAL)
45  mooseError("The coordinate system in the Problem block must be set to RSPHERICAL for 1D "
46  "spherically symmetric geometries.");
47 }
48 
49 template <ComputeStage compute_stage>
50 ADReal
52 {
53  return _grad_test[_i][_qp](0) * _stress[_qp](0, 0) + // stress_{rr} part 1
54  (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](1, 1) + // stress_{\theta \theta}
55  (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](2, 2); // stress_{\phi \phi}
56 }
ADStressDivergenceTensors
ADStressDivergenceTensors is the automatic differentiation version of StressDivergenceTensors.
Definition: ADStressDivergenceTensors.h:26
ADStressDivergenceRSphericalTensors
ADStressDivergenceRSphericalTensors is the automatic differentiation version of StressDivergenceTenso...
Definition: ADStressDivergenceRSphericalTensors.h:16
registerADMooseObject
registerADMooseObject("TensorMechanicsApp", ADStressDivergenceRSphericalTensors)
ADStressDivergenceRSphericalTensors::computeQpResidual
ADReal computeQpResidual() override
Definition: ADStressDivergenceRSphericalTensors.C:51
ADStressDivergenceRSphericalTensors::initialSetup
void initialSetup() override
Definition: ADStressDivergenceRSphericalTensors.C:42
ADStressDivergenceTensors::validParams
static InputParameters validParams()
Definition: ADStressDivergenceTensors.C:20
ADStressDivergenceTensors::_component
const unsigned int _component
Definition: ADStressDivergenceTensors.h:54
ElasticityTensorTools.h
ADStressDivergenceRSphericalTensors::ADStressDivergenceRSphericalTensors
ADStressDivergenceRSphericalTensors(const InputParameters &parameters)
Definition: ADStressDivergenceRSphericalTensors.C:32
ADStressDivergenceRSphericalTensors.h
ADStressDivergenceRSphericalTensors::validParams
static InputParameters validParams()
Definition: ADStressDivergenceRSphericalTensors.C:22
defineADLegacyParams
defineADLegacyParams(ADStressDivergenceRSphericalTensors)