Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.mooseframework.org 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("TensorMechanicsApp", CosseratStressDivergenceTensors); 18 : 19 : InputParameters 20 816 : CosseratStressDivergenceTensors::validParams() 21 : { 22 816 : InputParameters params = StressDivergenceTensors::validParams(); 23 1632 : params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables"); 24 816 : return params; 25 0 : } 26 : 27 408 : CosseratStressDivergenceTensors::CosseratStressDivergenceTensors(const InputParameters & parameters) 28 : : StressDivergenceTensors(parameters), 29 408 : _nrots(coupledComponents("Cosserat_rotations")), 30 816 : _wc_var(_nrots) 31 : { 32 1632 : for (unsigned i = 0; i < _nrots; ++i) 33 1224 : _wc_var[i] = coupled("Cosserat_rotations", i); 34 408 : } 35 : 36 : Real 37 12797952 : CosseratStressDivergenceTensors::computeQpOffDiagJacobian(unsigned int jvar) 38 : { 39 34618368 : for (unsigned int v = 0; v < _nrots; ++v) 40 28480512 : if (jvar == _wc_var[v]) 41 6660096 : return ElasticityTensorTools::elasticJacobianWC( 42 6660096 : _Jacobian_mult[_qp], _component, v, _grad_test[_i][_qp], _phi[_j][_qp]); 43 : 44 6137856 : return StressDivergenceTensors::computeQpOffDiagJacobian(jvar); 45 : }