https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeSmallStrain.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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 "ComputeSmallStrain.h"
11#include "Assembly.h"
12#include "libmesh/quadrature.h"
13
15
18{
20 params.addClassDescription("Compute a small strain.");
21 return params;
22}
23
28
29void
31{
32 Real volumetric_strain = 0.0;
33 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
34 {
35 // strain = (grad_disp + grad_disp^T)/2
36 const auto grad_tensor = RankTwoTensor ::initializeFromRows(
37 (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
38
39 _total_strain[_qp] = (grad_tensor + grad_tensor.transpose()) / 2.0;
40
42 volumetric_strain += _total_strain[_qp].trace() * _JxW[_qp] * _coord[_qp];
43 }
44
46 volumetric_strain /= _current_elem_volume;
47
48 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
49 {
51 {
52 Real trace = _total_strain[_qp].trace();
53 _total_strain[_qp](0, 0) += (volumetric_strain - trace) / 3.0;
54 _total_strain[_qp](1, 1) += (volumetric_strain - trace) / 3.0;
55 _total_strain[_qp](2, 2) += (volumetric_strain - trace) / 3.0;
56 }
57
59 _total_strain[_qp] += (*_global_strain)[_qp];
60
62
63 // Remove the Eigen strain
64 for (auto es : _eigenstrains)
65 _mechanical_strain[_qp] -= (*es)[_qp];
66 }
67}
registerMooseObject("SolidMechanicsApp", ComputeSmallStrain)
ComputeSmallStrain defines a strain tensor, assuming small strains.
ComputeSmallStrain(const InputParameters &parameters)
static InputParameters validParams()
virtual void computeProperties() override
ComputeStrainBase is the base class for strain tensors.
std::vector< const VariableGradient * > _grad_disp
Gradient of displacements.
MaterialProperty< RankTwoTensor > & _mechanical_strain
const Real & _current_elem_volume
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
const MaterialProperty< RankTwoTensor > *const _global_strain
MaterialProperty< RankTwoTensor > & _total_strain
static InputParameters validParams()
const bool _volumetric_locking_correction
void addClassDescription(const std::string &doc_string)