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 : #pragma once 11 : 12 : #include "ElementUserObject.h" 13 : #include "GlobalStrainUserObjectInterface.h" 14 : 15 : #include "RankTwoTensor.h" 16 : #include "RankFourTensor.h" 17 : 18 : class GlobalStrainUserObject : public ElementUserObject, public GlobalStrainUserObjectInterface 19 : { 20 : public: 21 : static InputParameters validParams(); 22 : 23 : GlobalStrainUserObject(const InputParameters & parameters); 24 : 25 : void initialize() override; 26 : void execute() override; 27 : void threadJoin(const UserObject & uo) override; 28 : void finalize() override; 29 : virtual const RankTwoTensor & getResidual() const override; 30 : virtual const RankFourTensor & getJacobian() const override; 31 : virtual const VectorValue<bool> & getPeriodicDirections() const override; 32 : 33 : /** 34 : * Calculate additional applied stresses 35 : */ 36 6232 : virtual void computeAdditionalStress(){}; 37 : 38 : protected: 39 : /// Base name of the material system 40 : const std::string _base_name; 41 : 42 : const MaterialProperty<RankFourTensor> & _dstress_dstrain; 43 : 44 : /// The stress tensor 45 : const MaterialProperty<RankTwoTensor> & _stress; 46 : 47 : RankTwoTensor _applied_stress_tensor; 48 : RankTwoTensor _residual; 49 : RankFourTensor _jacobian; 50 : 51 : const unsigned int _dim; 52 : 53 : /// Number of displacement variables 54 : const unsigned int _ndisp; 55 : 56 : /// Variable numbers of the displacement variables 57 : std::vector<unsigned int> _disp_var; 58 : VectorValue<bool> _periodic_dir; 59 : };