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 "CosseratStressDivergenceTensors.h" 11 : #include "Material.h" 12 : #include "RankFourTensor.h" 13 : #include "ElasticityTensorTools.h" 14 : #include "RankTwoTensor.h" 15 : #include "MooseMesh.h" 16 : 17 : registerMooseObject("SolidMechanicsApp", CosseratStressDivergenceTensors); 18 : 19 : InputParameters 20 1632 : CosseratStressDivergenceTensors::validParams() 21 : { 22 1632 : InputParameters params = StressDivergenceTensors::validParams(); 23 3264 : params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables"); 24 1632 : params.addClassDescription("Stress divergence tensor with the additional Jacobian terms for the " 25 : "Cosserat rotation variables."); 26 1632 : return params; 27 0 : } 28 : 29 816 : CosseratStressDivergenceTensors::CosseratStressDivergenceTensors(const InputParameters & parameters) 30 : : StressDivergenceTensors(parameters), 31 816 : _nrots(coupledComponents("Cosserat_rotations")), 32 1632 : _wc_var(_nrots) 33 : { 34 3264 : for (unsigned i = 0; i < _nrots; ++i) 35 2448 : _wc_var[i] = coupled("Cosserat_rotations", i); 36 816 : } 37 : 38 : Real 39 25595904 : CosseratStressDivergenceTensors::computeQpOffDiagJacobian(unsigned int jvar) 40 : { 41 69236736 : for (unsigned int v = 0; v < _nrots; ++v) 42 56961024 : if (jvar == _wc_var[v]) 43 13320192 : return ElasticityTensorTools::elasticJacobianWC( 44 13320192 : _Jacobian_mult[_qp], _component, v, _grad_test[_i][_qp], _phi[_j][_qp]); 45 : 46 12275712 : return StressDivergenceTensors::computeQpOffDiagJacobian(jvar); 47 : }