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