Line data Source code
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 "ComputeCosseratSmallStrain.h" 11 : 12 : // MOOSE includes 13 : #include "PermutationTensor.h" 14 : 15 : #include "libmesh/quadrature.h" 16 : 17 : registerMooseObject("SolidMechanicsApp", ComputeCosseratSmallStrain); 18 : 19 : InputParameters 20 264 : ComputeCosseratSmallStrain::validParams() 21 : { 22 264 : InputParameters params = ComputeStrainBase::validParams(); 23 264 : params.addClassDescription("Compute small Cosserat strains"); 24 528 : params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables"); 25 264 : return params; 26 0 : } 27 : 28 198 : ComputeCosseratSmallStrain::ComputeCosseratSmallStrain(const InputParameters & parameters) 29 : : ComputeStrainBase(parameters), 30 198 : _curvature(declareProperty<RankTwoTensor>("curvature")), 31 198 : _nrots(coupledComponents("Cosserat_rotations")), 32 198 : _wc(coupledValues("Cosserat_rotations")), 33 396 : _grad_wc(coupledGradients("Cosserat_rotations")) 34 : { 35 198 : if (_nrots != 3) 36 0 : mooseError("ComputeCosseratSmallStrain: This Material is only defined for 3-dimensional " 37 : "simulations so 3 Cosserat rotation variables are needed"); 38 198 : } 39 : 40 : void 41 105456 : ComputeCosseratSmallStrain::computeQpProperties() 42 : { 43 : auto strain = RankTwoTensor::initializeFromRows( 44 105456 : (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]); 45 105456 : RealVectorValue wc_vector((*_wc[0])[_qp], (*_wc[1])[_qp], (*_wc[2])[_qp]); 46 : 47 421824 : for (unsigned i = 0; i < LIBMESH_DIM; ++i) 48 1265472 : for (unsigned j = 0; j < LIBMESH_DIM; ++j) 49 3796416 : for (unsigned k = 0; k < LIBMESH_DIM; ++k) 50 2847312 : strain(i, j) += PermutationTensor::eps(i, j, k) * wc_vector(k); 51 : 52 105456 : _total_strain[_qp] = strain; 53 : 54 105456 : _mechanical_strain[_qp] = strain; 55 107136 : for (auto es : _eigenstrains) 56 1680 : _mechanical_strain[_qp] -= (*es)[_qp]; 57 : 58 105456 : _curvature[_qp] = RankTwoTensor::initializeFromRows( 59 105456 : (*_grad_wc[0])[_qp], (*_grad_wc[1])[_qp], (*_grad_wc[2])[_qp]); 60 105456 : }