https://mooseframework.inl.gov
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 
11 #include "CZMInterfaceKernelBase.h"
12 
15 {
17  return params;
18 }
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 
38 ADReal
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 }
const unsigned int _ndisp
number of displacement components
const ADMaterialProperty< RealVectorValue > & _traction_global
DGResidualType
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
ADReal computeQpResidual(Moose::DGResidualType type) override
virtual unsigned int dimension() const
const unsigned int _component
the displacement component this kernel is operating on (0=x, 1=y, 2 =z)
const std::string & type() const
void paramError(const std::string &param, Args... args) const
static InputParameters validParams()
const OutputTools< T >::VariableTestValue & _test_neighbor
void mooseError(Args &&... args) const
ADCZMInterfaceKernelBase(const InputParameters &parameters)
void ErrorVector unsigned int
const OutputTools< T >::VariableTestValue & _test