www.mooseframework.org
HomogenizationKernel.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "HomogenizationKernel.h"
8 #include "Material.h"
9 #include "SymmElasticityTensor.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Kernel>();
16  params.addRequiredRangeCheckedParam<unsigned int>("component",
17  "component >= 0 & component < 3",
18  "An integer corresponding to the direction "
19  "the variable this kernel acts in. (0 for x, "
20  "1 for y, 2 for z)");
21  params.addRequiredRangeCheckedParam<unsigned int>(
22  "column",
23  "column >= 0 & column < 6",
24  "An integer corresponding to the direction the "
25  "variable this kernel acts in. (0 for xx, 1 for yy, 2 "
26  "for zz, 3 for xy, 4 for yz, 5 for zx)");
27  params.addParam<std::string>(
28  "appended_property_name", "", "Name appended to material properties to make them unique");
29 
30  return params;
31 }
32 
33 HomogenizationKernel::HomogenizationKernel(const InputParameters & parameters)
34  : Kernel(parameters),
35 
36  _elasticity_tensor(getMaterialProperty<SymmElasticityTensor>(
37  "elasticity_tensor" + getParam<std::string>("appended_property_name"))),
38  _component(getParam<unsigned int>("component")),
39  _column(getParam<unsigned int>("column"))
40 {
41 }
42 
43 Real
45 {
46  unsigned k = 0, l = 0;
47 
48  if (_column == 0)
49  {
50  k = 0;
51  l = 0;
52  }
53 
54  if (_column == 1)
55  {
56  k = 1;
57  l = 1;
58  }
59 
60  if (_column == 2)
61  {
62  k = 2;
63  l = 2;
64  }
65 
66  if (_column == 3)
67  {
68  k = 0;
69  l = 1;
70  }
71 
72  if (_column == 4)
73  {
74  k = 1;
75  l = 2;
76  }
77 
78  if (_column == 5)
79  {
80  k = 2;
81  l = 0;
82  }
83 
84  const unsigned J(3 * l + k);
85 
86  ColumnMajorMatrix E(_elasticity_tensor[_qp].columnMajorMatrix9x9());
87 
88  Real value(0);
89 
90  // Compute positive value since we are computing a residual not a rhs
91  for (unsigned j = 0; j < 3; j++)
92  {
93  const unsigned I = 3 * j + _component;
94  value += E(I, J) * _grad_test[_i][_qp](j);
95  }
96 
97  return value;
98 }
This class defines a basic set of capabilities any elasticity tensor should have. ...
const MaterialProperty< SymmElasticityTensor > & _elasticity_tensor
virtual Real computeQpResidual()
const unsigned int _column
InputParameters validParams< HomogenizationKernel >()
HomogenizationKernel(const InputParameters &parameters)
const unsigned int _component