www.mooseframework.org
HomogenizationKernel.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 
10 #include "HomogenizationKernel.h"
11 #include "Material.h"
12 #include "SymmElasticityTensor.h"
13 
14 registerMooseObjectDeprecated("SolidMechanicsApp", HomogenizationKernel, "07/30/2020 24:00");
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<Kernel>();
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  params.addRequiredRangeCheckedParam<unsigned int>(
27  "column",
28  "column >= 0 & column < 6",
29  "An integer corresponding to the direction the "
30  "variable this kernel acts in. (0 for xx, 1 for yy, 2 "
31  "for zz, 3 for xy, 4 for yz, 5 for zx)");
32  params.addParam<std::string>(
33  "appended_property_name", "", "Name appended to material properties to make them unique");
34 
35  return params;
36 }
37 
38 HomogenizationKernel::HomogenizationKernel(const InputParameters & parameters)
39  : Kernel(parameters),
40 
41  _elasticity_tensor(getMaterialProperty<SymmElasticityTensor>(
42  "elasticity_tensor" + getParam<std::string>("appended_property_name"))),
43  _component(getParam<unsigned int>("component")),
44  _column(getParam<unsigned int>("column"))
45 {
46  mooseDeprecated(name(), ": HomogenizationKernel is deprecated. \
47  The solid_mechanics module will be removed from MOOSE on July 31, 2020. \
48  Please update your input files to utilize the tensor_mechanics equivalents of \
49  models based on solid_mechanics. A detailed migration guide that was developed \
50  for BISON, but which is generally applicable to any MOOSE model is available at: \
51  https://mooseframework.org/bison/tutorials/mechanics_conversion/overview.html");
52 }
53 
54 Real
56 {
57  unsigned k = 0, l = 0;
58 
59  if (_column == 0)
60  {
61  k = 0;
62  l = 0;
63  }
64 
65  if (_column == 1)
66  {
67  k = 1;
68  l = 1;
69  }
70 
71  if (_column == 2)
72  {
73  k = 2;
74  l = 2;
75  }
76 
77  if (_column == 3)
78  {
79  k = 0;
80  l = 1;
81  }
82 
83  if (_column == 4)
84  {
85  k = 1;
86  l = 2;
87  }
88 
89  if (_column == 5)
90  {
91  k = 2;
92  l = 0;
93  }
94 
95  const unsigned J(3 * l + k);
96 
97  ColumnMajorMatrix E(_elasticity_tensor[_qp].columnMajorMatrix9x9());
98 
99  Real value(0);
100 
101  // Compute positive value since we are computing a residual not a rhs
102  for (unsigned j = 0; j < 3; j++)
103  {
104  const unsigned I = 3 * j + _component;
105  value += E(I, J) * _grad_test[_i][_qp](j);
106  }
107 
108  return value;
109 }
SymmElasticityTensor.h
HomogenizationKernel::HomogenizationKernel
HomogenizationKernel(const InputParameters &parameters)
Definition: HomogenizationKernel.C:38
validParams< HomogenizationKernel >
InputParameters validParams< HomogenizationKernel >()
Definition: HomogenizationKernel.C:18
HomogenizationKernel::_component
const unsigned int _component
Definition: HomogenizationKernel.h:33
SymmElasticityTensor
This class defines a basic set of capabilities any elasticity tensor should have.
Definition: SymmElasticityTensor.h:55
HomogenizationKernel
Definition: HomogenizationKernel.h:22
name
const std::string name
Definition: Setup.h:21
registerMooseObjectDeprecated
registerMooseObjectDeprecated("SolidMechanicsApp", HomogenizationKernel, "07/30/2020 24:00")
HomogenizationKernel::_elasticity_tensor
const MaterialProperty< SymmElasticityTensor > & _elasticity_tensor
Definition: HomogenizationKernel.h:30
HomogenizationKernel::computeQpResidual
virtual Real computeQpResidual()
Definition: HomogenizationKernel.C:55
HomogenizationKernel::_column
const unsigned int _column
Definition: HomogenizationKernel.h:34
HomogenizationKernel.h