https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputePlaneIncrementalStrain.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 "UserObject.h"
12
14
17{
20 "Compute strain increment for small strain under 2D planar assumptions.");
21 params.addParam<UserObjectName>("subblock_index_provider",
22 "SubblockIndexProvider user object name");
23 params.addCoupledVar("scalar_out_of_plane_strain",
24 "Scalar variable for generalized plane strain");
25 params.addCoupledVar("out_of_plane_strain", "Nonlinear variable for plane stress condition");
26
27 return params;
28}
29
31 : ADCompute2DIncrementalStrain(parameters),
32 _subblock_id_provider(isParamValid("subblock_index_provider")
33 ? &getUserObject<SubblockIndexProvider>("subblock_index_provider")
34 : nullptr),
35 _scalar_out_of_plane_strain_coupled(isCoupledScalar("scalar_out_of_plane_strain")),
36 _out_of_plane_strain_coupled(isCoupled("out_of_plane_strain")),
37 _out_of_plane_strain(_out_of_plane_strain_coupled ? adCoupledValue("out_of_plane_strain")
38 : _ad_zero),
39 _out_of_plane_strain_old(_out_of_plane_strain_coupled ? coupledValueOld("out_of_plane_strain")
40 : _zero)
41{
43 mooseError("Must define only one of out_of_plane_strain or scalar_out_of_plane_strain");
44
46 {
47 const auto nscalar_strains = coupledScalarComponents("scalar_out_of_plane_strain");
48 _scalar_out_of_plane_strain.resize(nscalar_strains);
49 _scalar_out_of_plane_strain_old.resize(nscalar_strains);
50 for (unsigned int i = 0; i < nscalar_strains; ++i)
51 {
52 _scalar_out_of_plane_strain[i] = &adCoupledScalarValue("scalar_out_of_plane_strain", i);
53 _scalar_out_of_plane_strain_old[i] = &coupledScalarValueOld("scalar_out_of_plane_strain", i);
54 }
55 }
56}
57
66
67Real
registerMooseObject("SolidMechanicsApp", ADComputePlaneIncrementalStrain)
DualNumber< Real, DNDerivativeType, true > ADReal
ADCompute2DIncrementalStrain defines a strain increment only for incremental strains in 2D geometries...
ADComputePlaneIncrementalStrain defines strain increment for small strains in a 2D planar simulation.
const bool _scalar_out_of_plane_strain_coupled
Whether out-of-plane strain scalar variables are coupled.
ADComputePlaneIncrementalStrain(const InputParameters &parameters)
unsigned int getCurrentSubblockIndex() const
gets its subblock index for current element
const ADVariableValue & _out_of_plane_strain
Current and old values of the out-of-plane strain variable.
std::vector< const VariableValue * > _scalar_out_of_plane_strain_old
virtual ADReal computeOutOfPlaneGradDisp() override
Computes the current out-of-plane component of the displacement gradient; as a virtual function,...
std::vector< const ADVariableValue * > _scalar_out_of_plane_strain
Current and old values of the out-of-plane strain scalar variable.
virtual Real computeOutOfPlaneGradDispOld() override
Computes the old out-of-plane component of the displacement gradient; as a virtual function,...
const bool _out_of_plane_strain_coupled
Whether an out-of-plane strain variable is coupled.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
void mooseError(Args &&... args) const
unsigned int coupledScalarComponents(const std::string &var_name) const
const VariableValue & coupledScalarValueOld(const std::string &var_name, unsigned int comp=0) const
const ADVariableValue & adCoupledScalarValue(const std::string &var_name, unsigned int comp=0) const
Abstract base class for user objects that provide an index for a given element that is independent of...