https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CZMInterfaceKernelBase Class Referenceabstract

Base class for implementing DG cohesive zone models (CZM) for 1D,2D, and 3D traction separation laws. More...

#include <CZMInterfaceKernelBase.h>

Inheritance diagram for CZMInterfaceKernelBase:
[legend]

Public Types

typedef std::vector< intJvarMap
 

Public Member Functions

 CZMInterfaceKernelBase (const InputParameters &parameters)
 
virtual void computeOffDiagJacobian (unsigned int jvar) override
 
unsigned int mapJvarToCvar (unsigned int jvar)
 
int mapJvarToCvar (unsigned int jvar, const JvarMap &jvar_map)
 
bool mapJvarToCvar (unsigned int jvar, unsigned int &cvar)
 
const JvarMapgetJvarMap ()
 
const JvarMapgetParameterJvarMap (std::string parameter_name)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

Real computeQpResidual (Moose::DGResidualType type) override
 
Real computeQpJacobian (Moose::DGJacobianType type) override
 
Real computeQpOffDiagJacobian (Moose::DGJacobianType type, unsigned int jvar) override
 
virtual Real computeDResidualDDisplacement (const unsigned int &component_j, const Moose::DGJacobianType &type) const =0
 method computing the derivative of residual[_component] w.r.t displacement[component_j]
 

Protected Attributes

const std::string _base_name
 Base name of the material system that this kernel applies to.
 
const unsigned int _component
 the displacement component this kernel is operating on (0=x, 1=y, 2 =z)
 
const unsigned int _ndisp
 number of displacement components
 
std::vector< MooseVariable * > _vars
 
const unsigned int _n_args
 
std::vector< unsigned int_disp_var
 Coupled displacement component variable IDs.
 
std::vector< unsigned int_disp_neighbor_var
 
const MaterialProperty< RealVectorValue > & _traction_global
 
const MaterialProperty< RankTwoTensor > & _dtraction_djump_global
 

Private Attributes

const std::size_t _jvar_max_size
 
JvarMap _jvar_map
 
std::map< std::string, JvarMap_jvar_local_map
 

Detailed Description

Base class for implementing DG cohesive zone models (CZM) for 1D,2D, and 3D traction separation laws.

This kernel operates only on a single displacement compenent. One kernel is required for each displacement component.

Definition at line 19 of file CZMInterfaceKernelBase.h.

Constructor & Destructor Documentation

◆ CZMInterfaceKernelBase()

CZMInterfaceKernelBase::CZMInterfaceKernelBase ( const InputParameters parameters)

Definition at line 30 of file CZMInterfaceKernelBase.C.

32 _base_name(isParamValid("base_name") && !getParam<std::string>("base_name").empty()
33 ? getParam<std::string>("base_name") + "_"
34 : ""),
35 _component(getParam<unsigned int>("component")),
36 _ndisp(coupledComponents("displacements")),
40 _traction_global(getMaterialPropertyByName<RealVectorValue>(
41 _base_name + getParam<std::string>("traction_global_name"))),
43 getMaterialPropertyByName<RankTwoTensor>(_base_name + "dtraction_djump_global"))
44{
45 // Enforce consistency
46 if (_ndisp != _mesh.dimension())
47 paramError("displacements", "Number of displacements must match problem dimension.");
48
49 if (_ndisp > 3 || _ndisp < 1)
50 mooseError("the CZM material requires 1, 2 or 3 displacement variables");
51
52 for (unsigned int i = 0; i < _ndisp; ++i)
53 {
54 _disp_var[i] = coupled("displacements", i);
55 _disp_neighbor_var[i] = coupled("displacements", i);
56 _vars[i] = getVar("displacements", i);
57 }
58}
void mooseError(Args &&... args)
void ErrorVector unsigned int
std::vector< MooseVariable * > _vars
const unsigned int _component
the displacement component this kernel is operating on (0=x, 1=y, 2 =z)
std::vector< unsigned int > _disp_var
Coupled displacement component variable IDs.
const MaterialProperty< RealVectorValue > & _traction_global
const MaterialProperty< RankTwoTensor > & _dtraction_djump_global
const std::string _base_name
Base name of the material system that this kernel applies to.
std::vector< unsigned int > _disp_neighbor_var
const unsigned int _ndisp
number of displacement components
VectorValue< Real > RealVectorValue

Member Function Documentation

◆ computeDResidualDDisplacement()

virtual Real CZMInterfaceKernelBase::computeDResidualDDisplacement ( const unsigned int component_j,
const Moose::DGJacobianType type 
) const
protectedpure virtual

method computing the derivative of residual[_component] w.r.t displacement[component_j]

Implemented in CZMInterfaceKernelSmallStrain, and CZMInterfaceKernelTotalLagrangian.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ computeQpJacobian()

Real CZMInterfaceKernelBase::computeQpJacobian ( Moose::DGJacobianType  type)
overrideprotected

Definition at line 79 of file CZMInterfaceKernelBase.C.

80{
81 // retrieve the diagonal Jacobian coefficient dependning on the displacement
82 // component (_component) this kernel is working on
84}
virtual Real computeDResidualDDisplacement(const unsigned int &component_j, const Moose::DGJacobianType &type) const =0
method computing the derivative of residual[_component] w.r.t displacement[component_j]

◆ computeQpOffDiagJacobian()

Real CZMInterfaceKernelBase::computeQpOffDiagJacobian ( Moose::DGJacobianType  type,
unsigned int  jvar 
)
overrideprotected

Definition at line 87 of file CZMInterfaceKernelBase.C.

88{
89 // bail out if jvar is not coupled
90 if (getJvarMap()[jvar] < 0)
91 return 0.0;
92
93 // Jacobian of the residul[_component] w.r.t to the coupled displacement
94 // component[off_diag_component]
95 for (unsigned int off_diag_component = 0; off_diag_component < _ndisp; ++off_diag_component)
96 {
97 if (jvar == _disp_var[off_diag_component])
98 return computeDResidualDDisplacement(off_diag_component, type);
99 }
100 // this is the place where one should implement derivatives of the residual w.r.t. other variables
101 return 0.0;
102}

◆ computeQpResidual()

Real CZMInterfaceKernelBase::computeQpResidual ( Moose::DGResidualType  type)
overrideprotected

Definition at line 61 of file CZMInterfaceKernelBase.C.

62{
64
65 switch (type)
66 {
67 // [test_secondary-test_primary]*T where T represents the traction.
68 case Moose::Element:
69 r *= -_test[_i][_qp];
70 break;
71 case Moose::Neighbor:
72 r *= _test_neighbor[_i][_qp];
73 break;
74 }
75 return r;
76}
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ validParams()

InputParameters CZMInterfaceKernelBase::validParams ( )
static

Definition at line 13 of file CZMInterfaceKernelBase.C.

14{
16 params.addRequiredParam<unsigned int>("component",
17 "the component of the "
18 "displacement vector this kernel is working on:"
19 " component == 0, ==> X"
20 " component == 1, ==> Y"
21 " component == 2, ==> Z");
22 params.suppressParameter<bool>("use_displaced_mesh");
23 params.addRequiredCoupledVar("displacements", "the string containing displacement variables");
24 params.addParam<std::string>("base_name", "Material property base name");
25 params.set<std::string>("traction_global_name") = "traction_global";
26
27 return params;
28}
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)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()

Referenced by ADCZMInterfaceKernelBase::validParams(), CZMInterfaceKernelSmallStrain::validParams(), and CZMInterfaceKernelTotalLagrangian::validParams().

Member Data Documentation

◆ _base_name

const std::string CZMInterfaceKernelBase::_base_name
protected

Base name of the material system that this kernel applies to.

Definition at line 35 of file CZMInterfaceKernelBase.h.

◆ _component

const unsigned int CZMInterfaceKernelBase::_component
protected

◆ _disp_neighbor_var

std::vector<unsigned int> CZMInterfaceKernelBase::_disp_neighbor_var
protected

Definition at line 46 of file CZMInterfaceKernelBase.h.

Referenced by CZMInterfaceKernelBase().

◆ _disp_var

std::vector<unsigned int> CZMInterfaceKernelBase::_disp_var
protected

Coupled displacement component variable IDs.

Definition at line 45 of file CZMInterfaceKernelBase.h.

Referenced by computeQpOffDiagJacobian(), and CZMInterfaceKernelBase().

◆ _dtraction_djump_global

const MaterialProperty<RankTwoTensor>& CZMInterfaceKernelBase::_dtraction_djump_global
protected

◆ _ndisp

const unsigned int CZMInterfaceKernelBase::_ndisp
protected

number of displacement components

Definition at line 41 of file CZMInterfaceKernelBase.h.

Referenced by computeQpOffDiagJacobian(), and CZMInterfaceKernelBase().

◆ _traction_global

const MaterialProperty<RealVectorValue>& CZMInterfaceKernelBase::_traction_global
protected

Definition at line 54 of file CZMInterfaceKernelBase.h.

Referenced by computeQpResidual().

◆ _vars

std::vector<MooseVariable *> CZMInterfaceKernelBase::_vars
protected

The documentation for this class was generated from the following files: