https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SCZMInterfaceKernelBase.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
12template <bool is_ad>
15{
17
18 params.addRequiredParam<unsigned int>("component",
19 "The component of the displacement vector this kernel is "
20 "working on: component == 0 => X, 1 => Y, 2 => Z");
21 params.suppressParameter<bool>("use_displaced_mesh");
22 params.addRequiredCoupledVar("displacements", "The string containing displacement variables");
23 params.addParam<std::string>("base_name", "Material property base name");
24 params.addParam<std::string>("traction_global_name",
25 "traction_global",
26 "Name of the traction material property (global frame)");
27 params.addParam<bool>(
28 "no_shifted",
29 false,
30 "Disable the shifted integration corrections while retaining the same interface kernel and "
31 "cohesive-zone model. Shifted integration is enabled by default and is the intended SBM "
32 "mode; disable it only to isolate the effect of the correction terms for verification and "
33 "comparison.");
34
35 return params;
36}
37
38template <bool is_ad>
40 const InputParameters & parameters)
41 : JvarMapKernelInterface<SBMInterfaceBase<is_ad>>(parameters),
42 _base_name(this->isParamValid("base_name") &&
43 !this->template getParam<std::string>("base_name").empty()
44 ? this->template getParam<std::string>("base_name") + "_"
45 : ""),
46 _component(this->template getParam<unsigned int>("component")),
47 _ndisp(this->coupledComponents("displacements")),
48 _traction_global(this->template getGenericMaterialPropertyByName<RealVectorValue, is_ad>(
49 _base_name + this->template getParam<std::string>("traction_global_name"))),
50 _shifted(!this->template getParam<bool>("no_shifted"))
51{
52 if (_ndisp != this->_mesh.dimension())
53 this->paramError("displacements", "Number of displacements must match problem dimension.");
54
55 if (_ndisp > 3 || _ndisp < 1)
56 this->paramError("displacements",
57 "The SCZM material requires 1, 2, or 3 displacement variables.");
58}
59
60template <bool is_ad>
63{
64 auto residual = _traction_global[this->_qp](_component);
65
66 switch (type)
67 {
68 case Moose::Element:
69 residual *= -this->_test[this->_i][this->_qp];
70 break;
71
72 case Moose::Neighbor:
73 residual *= this->_test_neighbor[this->_i][this->_qp];
74 break;
75 }
76
77 return residual;
78}
79
Moose::GenericType< Real, is_ad > GenericReal
void ErrorVector unsigned int
void suppressParameter(const std::string &name)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Template base providing signed-distance and normal-vector utilities for SBM objects.
Definition SBMBase.h:27
static InputParameters validParams()
Definition SBMBase.C:15
Base class for AD and non-AD shifted cohesive zone interface kernels.
static InputParameters validParams()
SCZMInterfaceKernelBaseTempl(const InputParameters &parameters)
GenericReal< is_ad > computeQpResidual(Moose::DGResidualType type) override
const unsigned int _ndisp
Number of displacement components.
DGResidualType