www.mooseframework.org
ComputeCosseratSmallStrain.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 
9 
10 // MOOSE includes
11 #include "PermutationTensor.h"
12 
13 #include "libmesh/quadrature.h"
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<ComputeStrainBase>();
20  params.addClassDescription("Compute small Cosserat strains");
21  params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables");
22  return params;
23 }
24 
25 ComputeCosseratSmallStrain::ComputeCosseratSmallStrain(const InputParameters & parameters)
26  : ComputeStrainBase(parameters),
27  _curvature(declareProperty<RankTwoTensor>("curvature")),
28  _nrots(coupledComponents("Cosserat_rotations")),
29  _wc(_nrots),
30  _grad_wc(_nrots)
31 {
32  if (_nrots != 3)
33  mooseError("ComputeCosseratSmallStrain: This Material is only defined for 3-dimensional "
34  "simulations so 3 Cosserat rotation variables are needed");
35  for (unsigned i = 0; i < _nrots; ++i)
36  {
37  _wc[i] = &coupledValue("Cosserat_rotations", i);
38  _grad_wc[i] = &coupledGradient("Cosserat_rotations", i);
39  }
40 }
41 
42 void
44 {
45  RankTwoTensor strain((*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
46  RealVectorValue wc_vector((*_wc[0])[_qp], (*_wc[1])[_qp], (*_wc[2])[_qp]);
47 
48  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
49  for (unsigned j = 0; j < LIBMESH_DIM; ++j)
50  for (unsigned k = 0; k < LIBMESH_DIM; ++k)
51  strain(i, j) += PermutationTensor::eps(i, j, k) * wc_vector(k);
52 
53  _total_strain[_qp] = strain;
54 
55  _mechanical_strain[_qp] = strain;
56  for (auto es : _eigenstrains)
57  _mechanical_strain[_qp] -= (*es)[_qp];
58 
59  _curvature[_qp] = RankTwoTensor((*_grad_wc[0])[_qp], (*_grad_wc[1])[_qp], (*_grad_wc[2])[_qp]);
60 }
ComputeCosseratSmallStrain(const InputParameters &parameters)
const unsigned int _nrots
the number of Cosserat rotation variables supplied by the user (must be 3 in current implementation) ...
MaterialProperty< RankTwoTensor > & _mechanical_strain
MaterialProperty< RankTwoTensor > & _curvature
the Cosserat curvature strain: curvature_ij = nabla_j CosseratRotation_i
InputParameters validParams< ComputeCosseratSmallStrain >()
virtual void computeQpProperties() override
std::vector< const VariableValue * > _wc
The Cosserat rotations.
std::vector< const VariableGradient * > _grad_wc
Grad(Cosserat rotation)
ComputeStrainBase is the base class for strain tensors.
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
InputParameters validParams< ComputeStrainBase >()
std::vector< const VariableGradient * > _grad_disp