www.mooseframework.org
ADComputeShellStress.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 
10 #include "ADComputeShellStress.h"
11 #include "RankTwoTensor.h"
12 #include "RankFourTensor.h"
14 
15 #include "libmesh/quadrature.h"
16 #include "libmesh/utility.h"
17 #include "libmesh/enum_quadrature_type.h"
18 #include "libmesh/fe_type.h"
19 #include "libmesh/string_to_enum.h"
20 #include "libmesh/quadrature_gauss.h"
21 
22 registerADMooseObject("TensorMechanicsApp", ADComputeShellStress);
23 
26  ADMaterial,
27  params.addClassDescription("Compute in-plane stress using elasticity for shell");
28  params.addRequiredParam<std::string>("through_thickness_order",
29  "Quadrature order in out of plane direction"););
30 
31 template <ComputeStage compute_stage>
33  : ADMaterial<compute_stage>(parameters)
34 {
35  // get number of quadrature points along thickness based on order
36  std::unique_ptr<QGauss> t_qrule = libmesh_make_unique<QGauss>(
37  1, Utility::string_to_enum<Order>(getParam<std::string>("through_thickness_order")));
38  _t_points = t_qrule->get_points();
39  _elasticity_tensor.resize(_t_points.size());
40  _stress.resize(_t_points.size());
41  _stress_old.resize(_t_points.size());
42  _strain_increment.resize(_t_points.size());
43  _rotation_matrix.resize(_t_points.size());
44  _global_stress.resize(_t_points.size());
45  for (unsigned int t = 0; t < _t_points.size(); ++t)
46  {
48  &getADMaterialProperty<RankFourTensor>("elasticity_tensor_t_points_" + std::to_string(t));
49  _stress[t] = &declareADProperty<RankTwoTensor>("stress_t_points_" + std::to_string(t));
50  _stress_old[t] =
51  &getMaterialPropertyOldByName<RankTwoTensor>("stress_t_points_" + std::to_string(t));
53  &getADMaterialProperty<RankTwoTensor>("strain_increment_t_points_" + std::to_string(t));
54  // rotation matrix and stress for output purposes only
55  _rotation_matrix[t] =
56  &getMaterialProperty<RankTwoTensor>("rotation_t_points_" + std::to_string(t));
57  _global_stress[t] =
58  &declareProperty<RankTwoTensor>("global_stress_t_points_" + std::to_string(t));
59  }
60 }
61 
62 template <ComputeStage compute_stage>
63 void
65 {
66  // initialize stress tensor to zero
67  for (unsigned int i = 0; i < _t_points.size(); ++i)
68  (*_stress[i])[_qp].zero();
69 }
70 
71 template <ComputeStage compute_stage>
72 void
74 {
75  for (unsigned int i = 0; i < _t_points.size(); ++i)
76  {
77  (*_stress[i])[_qp] =
78  (*_stress_old[i])[_qp] + (*_elasticity_tensor[i])[_qp] * (*_strain_increment[i])[_qp];
79 
80  for (unsigned int ii = 0; ii < 3; ++ii)
81  for (unsigned int jj = 0; jj < 3; ++jj)
82  _unrotated_stress(ii, jj) = MetaPhysicL::raw_value((*_stress[i])[_qp](ii, jj));
83  (*_global_stress[i])[_qp] =
84  (*_rotation_matrix[i])[_qp].transpose() * _unrotated_stress * (*_rotation_matrix[i])[_qp];
85  }
86 }
ADComputeShellStress::computeQpProperties
virtual void computeQpProperties() override
Definition: ADComputeShellStress.C:73
ADComputeIsotropicElasticityTensorShell.h
ADComputeShellStress::ADComputeShellStress
ADComputeShellStress(const InputParameters &parameters)
Definition: ADComputeShellStress.C:32
ADComputeShellStress::_t_points
std::vector< Point > _t_points
Quadrature points along thickness.
Definition: ADComputeShellStress.h:59
ADComputeShellStress::_rotation_matrix
std::vector< const MaterialProperty< RankTwoTensor > * > _rotation_matrix
Rotation matrix material property.
Definition: ADComputeShellStress.h:62
ADComputeShellStress::_strain_increment
std::vector< const ADMaterialProperty(RankTwoTensor) * > _strain_increment
Material property for strain increment.
Definition: ADComputeShellStress.h:47
ADComputeShellStress::_stress_old
std::vector< const MaterialProperty< RankTwoTensor > * > _stress_old
Material property for old stress.
Definition: ADComputeShellStress.h:53
defineADValidParams
defineADValidParams(ADComputeShellStress, ADMaterial, params.addClassDescription("Compute in-plane stress using elasticity for shell");params.addRequiredParam< std::string >("through_thickness_order", "Quadrature order in out of plane direction");)
ADComputeShellStress
Definition: ADComputeShellStress.h:19
ADComputeShellStress::_stress
std::vector< ADMaterialProperty(RankTwoTensor) * > _stress
Material property for current stress.
Definition: ADComputeShellStress.h:50
ADComputeShellStress::_elasticity_tensor
std::vector< const ADMaterialProperty(RankFourTensor) * > _elasticity_tensor
Material property for elasticity tensor.
Definition: ADComputeShellStress.h:56
ADComputeShellStress::_global_stress
std::vector< MaterialProperty< RankTwoTensor > * > _global_stress
Global stress tensor material property.
Definition: ADComputeShellStress.h:65
ADComputeShellStress::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: ADComputeShellStress.C:64
ADComputeShellStress.h
registerADMooseObject
registerADMooseObject("TensorMechanicsApp", ADComputeShellStress)