https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADCZMInterfaceKernelBase.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
12
19
21 : ADInterfaceKernel(parameters),
22 _base_name(isParamValid("base_name") && !getParam<std::string>("base_name").empty()
23 ? getParam<std::string>("base_name") + "_"
24 : ""),
25 _component(getParam<unsigned int>("component")),
26 _ndisp(coupledComponents("displacements")),
27 _traction_global(getADMaterialPropertyByName<RealVectorValue>(
28 _base_name + getParam<std::string>("traction_global_name")))
29{
30 // Enforce consistency
31 if (_ndisp != _mesh.dimension())
32 paramError("displacements", "Number of displacements must match problem dimension.");
33
34 if (_ndisp > 3 || _ndisp < 1)
35 mooseError("the CZM material requires 1, 2 or 3 displacement variables");
36}
37
40{
42
43 switch (type)
44 {
45 // [test_secondary-test_primary]*T where T represents the traction.
46 case Moose::Element:
47 r *= -_test[_i][_qp];
48 break;
49 case Moose::Neighbor:
50 r *= _test_neighbor[_i][_qp];
51 break;
52 }
53
54 return r;
55}
DualNumber< Real, DNDerivativeType, true > ADReal
void ErrorVector unsigned int
static InputParameters validParams()
const unsigned int _ndisp
number of displacement components
ADCZMInterfaceKernelBase(const InputParameters &parameters)
const ADMaterialProperty< RealVectorValue > & _traction_global
const unsigned int _component
the displacement component this kernel is operating on (0=x, 1=y, 2 =z)
ADReal computeQpResidual(Moose::DGResidualType type) override
const OutputTools< T >::VariableTestValue & _test_neighbor
const OutputTools< T >::VariableTestValue & _test
static InputParameters validParams()
const std::string & type() const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
virtual unsigned int dimension() const
DGResidualType