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 : #pragma once 11 : 12 : #ifdef NEML2_ENABLED 13 : #include "neml2/tensors/LabeledVector.h" 14 : #include "neml2/tensors/LabeledMatrix.h" 15 : #endif 16 : 17 : #include "ComputeLagrangianObjectiveStress.h" 18 : #include "NEML2SolidMechanicsInterface.h" 19 : 20 : /** 21 : * This material performs the objective stress update using a NEML2 material model. 22 : */ 23 : class CauchyStressFromNEML2 : public NEML2SolidMechanicsInterface<ComputeLagrangianObjectiveStress> 24 : { 25 : public: 26 : static InputParameters validParams(); 27 : CauchyStressFromNEML2(const InputParameters & parameters); 28 : 29 : #ifndef NEML2_ENABLED 30 : protected: 31 0 : virtual void computeQpSmallStress() override {} 32 : 33 : #else 34 : virtual void initialSetup() override; 35 : virtual void computeProperties() override; 36 : 37 : protected: 38 : virtual void initQpStatefulProperties() override; 39 : virtual void computeQpSmallStress() override; 40 : 41 : /// Advance state and forces in time 42 : virtual void advanceStep(); 43 : 44 : /// Update the forces driving the material model update 45 : virtual void updateForces(); 46 : 47 : /// Apply the predictor to set current trial state 48 : virtual void applyPredictor(); 49 : 50 : /// Perform the material update 51 : virtual void solve(); 52 : 53 : // @{ Variables and properties computed by MOOSE 54 : /// The old mechanical strain 55 : const MaterialProperty<RankTwoTensor> * _mechanical_strain_old; 56 : 57 : /// The temperature 58 : const VariableValue * _temperature; 59 : 60 : /// The old temperature 61 : const VariableValue * _temperature_old; 62 : // @} 63 : 64 : /// The input vector of the material model 65 : neml2::LabeledVector _in; 66 : 67 : /// The output vector of the material model 68 : neml2::LabeledVector _out; 69 : 70 : /// The derivative of the output vector w.r.t. the input vector 71 : neml2::LabeledMatrix _dout_din; 72 : 73 : /// The state variables of the NEML2 material model (stored as MOOSE material properties) 74 : std::map<neml2::LabeledAxisAccessor, MaterialProperty<std::vector<Real>> *> _state_vars; 75 : 76 : /// The old state variables of the NEML2 material model (stored as MOOSE material properties) 77 : std::map<neml2::LabeledAxisAccessor, const MaterialProperty<std::vector<Real>> *> _state_vars_old; 78 : 79 : #endif // NEML2_ENABLED 80 : };