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 932 : CosseratStressDivergenceTensors::validParams() 21 : { 22 932 : InputParameters params = StressDivergenceTensors::validParams(); 23 1864 : params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables"); 24 932 : params.addClassDescription("Stress divergence tensor with the additional Jacobian terms for the " 25 : "Cosserat rotation variables."); 26 932 : return params; 27 0 : } 28 : 29 466 : CosseratStressDivergenceTensors::CosseratStressDivergenceTensors(const InputParameters & parameters) 30 : : StressDivergenceTensors(parameters), 31 466 : _nrots(coupledComponents("Cosserat_rotations")), 32 932 : _wc_var(_nrots) 33 : { 34 1864 : for (unsigned i = 0; i < _nrots; ++i) 35 1398 : _wc_var[i] = coupled("Cosserat_rotations", i); 36 466 : } 37 : 38 : Real 39 15710208 : CosseratStressDivergenceTensors::computeQpOffDiagJacobian(unsigned int jvar) 40 : { 41 44442624 : for (unsigned int v = 0; v < _nrots; ++v) 42 37100544 : if (jvar == _wc_var[v]) 43 8368128 : return ElasticityTensorTools::elasticJacobianWC( 44 8368128 : _Jacobian_mult[_qp], _component, v, _grad_test[_i][_qp], _phi[_j][_qp]); 45 : 46 7342080 : return StressDivergenceTensors::computeQpOffDiagJacobian(jvar); 47 : }