https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputeShellStress.C
Go to the documentation of this file.
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
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
23
26{
28 params.addClassDescription("Compute in-plane stress using elasticity for shell");
29 params.addRequiredParam<std::string>("through_thickness_order",
30 "Quadrature order in out of plane direction");
31 return params;
32}
33
35 : Material(parameters)
36{
37 // get number of quadrature points along thickness based on order
38 std::unique_ptr<libMesh::QGauss> t_qrule = std::make_unique<libMesh::QGauss>(
39 1, Utility::string_to_enum<Order>(getParam<std::string>("through_thickness_order")));
40 _t_points = t_qrule->get_points();
41 _elasticity_tensor.resize(_t_points.size());
42 _stress.resize(_t_points.size());
43 _stress_old.resize(_t_points.size());
44 _strain_increment.resize(_t_points.size());
47 _global_stress.resize(_t_points.size());
48 _local_stress.resize(_t_points.size());
49 for (unsigned int t = 0; t < _t_points.size(); ++t)
50 {
52 &getADMaterialProperty<RankFourTensor>("elasticity_tensor_t_points_" + std::to_string(t));
53 _stress[t] = &declareADProperty<RankTwoTensor>("stress_t_points_" + std::to_string(t));
54 _stress_old[t] =
55 &getMaterialPropertyOldByName<RankTwoTensor>("stress_t_points_" + std::to_string(t));
57 &getADMaterialProperty<RankTwoTensor>("strain_increment_t_points_" + std::to_string(t));
58 // rotation matrix and stress for output purposes only
60 &getMaterialProperty<RankTwoTensor>("local_transformation_t_points_" + std::to_string(t));
61 _covariant_transformation_matrix[t] = &getMaterialProperty<RankTwoTensor>(
62 "covariant_transformation_t_points_" + std::to_string(t));
64 &declareProperty<RankTwoTensor>("global_stress_t_points_" + std::to_string(t));
65 _local_stress[t] =
66 &declareProperty<RankTwoTensor>("local_stress_t_points_" + std::to_string(t));
67 }
68}
69
70void
72{
73 // initialize stress tensor to zero
74 for (unsigned int i = 0; i < _t_points.size(); ++i)
75 (*_stress[i])[_qp].zero();
76}
77
78void
80{
81 for (unsigned int i = 0; i < _t_points.size(); ++i)
82 {
83 (*_stress[i])[_qp] =
85
86 for (unsigned int ii = 0; ii < 3; ++ii)
87 for (unsigned int jj = 0; jj < 3; ++jj)
88 _unrotated_stress(ii, jj) = MetaPhysicL::raw_value((*_stress[i])[_qp](ii, jj));
89 (*_global_stress[i])[_qp] = (*_covariant_transformation_matrix[i])[_qp].transpose() *
93 }
94}
registerMooseObject("SolidMechanicsApp", ADComputeShellStress)
std::vector< const MaterialProperty< RankTwoTensor > * > _stress_old
Material property for old stress.
std::vector< const MaterialProperty< RankTwoTensor > * > _covariant_transformation_matrix
Covariant base vector matrix material property to transform stress.
static InputParameters validParams()
std::vector< const ADMaterialProperty< RankFourTensor > * > _elasticity_tensor
Material property for elasticity tensor.
virtual void initQpStatefulProperties() override
std::vector< MaterialProperty< RankTwoTensor > * > _global_stress
Global stress tensor material property.
std::vector< Point > _t_points
Quadrature points along thickness.
ADComputeShellStress(const InputParameters &parameters)
std::vector< MaterialProperty< RankTwoTensor > * > _local_stress
local stress tensor material property
std::vector< const ADMaterialProperty< RankTwoTensor > * > _strain_increment
Material property for strain increment.
RankTwoTensor _unrotated_stress
Real value of stress in the local coordinate system.
std::vector< ADMaterialProperty< RankTwoTensor > * > _stress
Material property for current stress.
std::vector< const MaterialProperty< RankTwoTensor > * > _local_transformation_matrix
Transformation matrix to map the global stress to the element's local coordinate.
virtual void computeQpProperties() override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
RankTwoTensorTempl< T > transpose() const
auto raw_value(const Eigen::Map< T > &in)