www.mooseframework.org
AsymptoticExpansionHomogenizationKernel.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 
15 
16 InputParameters
18 {
19  InputParameters params = Kernel::validParams();
20  params.addClassDescription("Kernel for asymptotic expansion homogenization for elasticity");
21  params.addRequiredRangeCheckedParam<unsigned int>("component",
22  "component >= 0 & component < 3",
23  "An integer corresponding to the direction "
24  "the variable this kernel acts in. (0 for x, "
25  "1 for y, 2 for z)");
26  MooseEnum column("xx yy zz yz xz xy");
27  params.addRequiredParam<MooseEnum>("column",
28  column,
29  "The column of the material matrix this kernel acts in. "
30  "(xx, yy, zz, yz, xz, or xy)");
31 
32  params.addParam<std::string>("base_name",
33  "Optional parameter that allows the user to define "
34  "multiple mechanics material systems on the same "
35  "block, i.e. for multiple phases");
36 
37  return params;
38 }
39 
41  const InputParameters & parameters)
42  : Kernel(parameters),
43 
44  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
45  _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_base_name + "elasticity_tensor")),
46  _component(getParam<unsigned int>("component")),
47  _column(getParam<MooseEnum>("column")),
48  _k_index({{0, 1, 2, 1, 0, 0}}),
49  _l_index({{0, 1, 2, 2, 2, 1}}),
50  _k(_k_index[_column]),
51  _l(_l_index[_column])
52 {
53 }
54 
55 Real
57 {
58  Real value = 0;
59 
60  for (unsigned j = 0; j < 3; j++)
61  value += _grad_test[_i][_qp](j) * _elasticity_tensor[_qp](_component, j, _k, _l);
62 
63  return value;
64 }
AsymptoticExpansionHomogenizationKernel::AsymptoticExpansionHomogenizationKernel
AsymptoticExpansionHomogenizationKernel(const InputParameters &parameters)
Definition: AsymptoticExpansionHomogenizationKernel.C:40
AsymptoticExpansionHomogenizationKernel::validParams
static InputParameters validParams()
Definition: AsymptoticExpansionHomogenizationKernel.C:17
AsymptoticExpansionHomogenizationKernel::computeQpResidual
virtual Real computeQpResidual()
Definition: AsymptoticExpansionHomogenizationKernel.C:56
defineLegacyParams
defineLegacyParams(AsymptoticExpansionHomogenizationKernel)
AsymptoticExpansionHomogenizationKernel.h
validParams
InputParameters validParams()
AsymptoticExpansionHomogenizationKernel::_k
const unsigned int _k
Definition: AsymptoticExpansionHomogenizationKernel.h:38
AsymptoticExpansionHomogenizationKernel::_component
const unsigned int _component
Definition: AsymptoticExpansionHomogenizationKernel.h:34
AsymptoticExpansionHomogenizationKernel::_l
const unsigned int _l
Definition: AsymptoticExpansionHomogenizationKernel.h:39
RankFourTensorTempl
Definition: ACGrGrElasticDrivingForce.h:20
registerMooseObject
registerMooseObject("TensorMechanicsApp", AsymptoticExpansionHomogenizationKernel)
AsymptoticExpansionHomogenizationKernel::_elasticity_tensor
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Definition: AsymptoticExpansionHomogenizationKernel.h:31
AsymptoticExpansionHomogenizationKernel
Definition: AsymptoticExpansionHomogenizationKernel.h:20