www.mooseframework.org
ADPowerLawCreepExceptionTest.C
Go to the documentation of this file.
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 
11 
12 #include "NonlinearSystemBase.h"
13 
14 registerADMooseObject("TensorMechanicsTestApp", ADPowerLawCreepExceptionTest);
15 
17 
18 template <ComputeStage compute_stage>
19 InputParameters
21 {
23  params.addClassDescription(
24  "This class duplicates the ADPowerLawCreepStressUpdate, except at the 2nd time step and the "
25  "1st iteration, at which time a high residual is computed, forcing an exception.");
26  return params;
27 }
28 
29 template <ComputeStage compute_stage>
31  const InputParameters & parameters)
32  : ADPowerLawCreepStressUpdate<compute_stage>(parameters)
33 {
34 }
35 
36 template <ComputeStage compute_stage>
37 ADReal
39  const ADReal & scalar)
40 {
41  if (_fe_problem.getNonlinearSystemBase().getCurrentNonlinearIterationNumber() == 1 &&
42  _t_step == 1 && _dt > 0.9)
43  return 1.0;
44 
46  scalar);
47 }
48 
49 template <ComputeStage compute_stage>
50 ADReal
52  const ADReal & effective_trial_stress, const ADReal & scalar)
53 {
54  if (_fe_problem.getNonlinearSystemBase().getCurrentNonlinearIterationNumber() == 1 &&
55  _t_step == 1 && _dt > 0.9)
56  return 1.0;
57 
59  scalar);
60 }
ADPowerLawCreepExceptionTest::computeResidual
virtual ADReal computeResidual(const ADReal &effective_trial_stress, const ADReal &scalar) override
Compute the residual for a predicted value of the scalar.
Definition: ADPowerLawCreepExceptionTest.C:38
ADPowerLawCreepExceptionTest::validParams
static InputParameters validParams()
Definition: ADPowerLawCreepExceptionTest.C:20
ADPowerLawCreepStressUpdate::computeDerivative
virtual ADReal computeDerivative(const ADReal &effective_trial_stress, const ADReal &scalar) override
Compute the derivative of the residual as a function of the scalar variable.
Definition: ADPowerLawCreepStressUpdate.C:80
ADPowerLawCreepStressUpdate::validParams
static InputParameters validParams()
Definition: ADPowerLawCreepStressUpdate.C:18
ADPowerLawCreepStressUpdate::computeResidual
virtual ADReal computeResidual(const ADReal &effective_trial_stress, const ADReal &scalar) override
Compute the residual for a predicted value of the scalar.
Definition: ADPowerLawCreepStressUpdate.C:69
ADPowerLawCreepExceptionTest::ADPowerLawCreepExceptionTest
ADPowerLawCreepExceptionTest(const InputParameters &parameters)
Definition: ADPowerLawCreepExceptionTest.C:30
ADPowerLawCreepStressUpdate
This class uses the stress update material in a radial return isotropic creep model.
Definition: ADPowerLawCreepStressUpdate.h:15
ADPowerLawCreepExceptionTest::computeDerivative
virtual ADReal computeDerivative(const ADReal &effective_trial_stress, const ADReal &scalar) override
Compute the derivative of the residual as a function of the scalar variable.
Definition: ADPowerLawCreepExceptionTest.C:51
ADPowerLawCreepExceptionTest.h
defineADLegacyParams
defineADLegacyParams(ADPowerLawCreepExceptionTest)
ADPowerLawCreepExceptionTest
Definition: ADPowerLawCreepExceptionTest.h:15
registerADMooseObject
registerADMooseObject("TensorMechanicsTestApp", ADPowerLawCreepExceptionTest)