www.mooseframework.org
MultiPlasticityDebugger.h
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 
10 #pragma once
11 
13 
20 {
21 public:
23 
24  MultiPlasticityDebugger(const MooseObject * moose_object);
25 
31 
36  void checkDerivatives();
37 
43  void checkJacobian(const RankFourTensor & E_inv, const std::vector<Real> & intnl_old);
44 
48  void checkSolution(const RankFourTensor & E_inv);
49 
50 protected:
58 
61 
63  std::vector<Real> _fspb_debug_pm;
64 
66  std::vector<Real> _fspb_debug_intnl;
67 
70 
72  std::vector<Real> _fspb_debug_pm_change;
73 
75  std::vector<Real> _fspb_debug_intnl_change;
76 
77 private:
85  void fddyieldFunction_dstress(const RankTwoTensor & stress,
86  const std::vector<Real> & intnl,
87  std::vector<RankTwoTensor> & df_dstress);
88 
96  void fddyieldFunction_dintnl(const RankTwoTensor & stress,
97  const std::vector<Real> & intnl,
98  std::vector<Real> & df_dintnl);
99 
107  virtual void fddflowPotential_dstress(const RankTwoTensor & stress,
108  const std::vector<Real> & intnl,
109  std::vector<RankFourTensor> & dr_dstress);
110 
117  virtual void fddflowPotential_dintnl(const RankTwoTensor & stress,
118  const std::vector<Real> & intnl,
119  std::vector<RankTwoTensor> & dr_dintnl);
120 
136  virtual void fdJacobian(const RankTwoTensor & stress,
137  const std::vector<Real> & intnl_old,
138  const std::vector<Real> & intnl,
139  const std::vector<Real> & pm,
140  const RankTwoTensor & delta_dp,
141  const RankFourTensor & E_inv,
142  bool eliminate_ld,
143  std::vector<std::vector<Real>> & jac);
144 
145  bool dof_included(unsigned int dof, const std::vector<bool> & deactivated_due_to_ld);
146 };
void fddyieldFunction_dintnl(const RankTwoTensor &stress, const std::vector< Real > &intnl, std::vector< Real > &df_dintnl)
The finite-difference derivative of yield function(s) with respect to internal parameter(s) ...
virtual void fdJacobian(const RankTwoTensor &stress, const std::vector< Real > &intnl_old, const std::vector< Real > &intnl, const std::vector< Real > &pm, const RankTwoTensor &delta_dp, const RankFourTensor &E_inv, bool eliminate_ld, std::vector< std::vector< Real >> &jac)
The Jacobian calculated using finite differences.
void fddyieldFunction_dstress(const RankTwoTensor &stress, const std::vector< Real > &intnl, std::vector< RankTwoTensor > &df_dstress)
The finite-difference derivative of yield function(s) with respect to stress.
MooseEnum _fspb_debug
none - don&#39;t do any debugging crash - currently inactive jacobian - check the jacobian entries jacobi...
Real _fspb_debug_stress_change
Debug finite-differencing parameter for the stress.
virtual void fddflowPotential_dintnl(const RankTwoTensor &stress, const std::vector< Real > &intnl, std::vector< RankTwoTensor > &dr_dintnl)
The finite-difference derivative of the flow potentials with respect to internal parameters.
static InputParameters validParams()
std::vector< Real > _fspb_debug_intnl_change
Debug finite-differencing parameters for the internal parameters.
virtual void fddflowPotential_dstress(const RankTwoTensor &stress, const std::vector< Real > &intnl, std::vector< RankFourTensor > &dr_dstress)
The finite-difference derivative of the flow potential(s) with respect to stress. ...
std::vector< Real > _fspb_debug_intnl
Debug the Jacobian entires at these internal parameters.
MultiPlasticityLinearSystem computes the linear system and handles linear-dependence removal for use ...
void outputAndCheckDebugParameters()
Outputs the debug parameters: _fspb_debug_stress, _fspd_debug_pm, etc and checks that they are sized ...
void checkSolution(const RankFourTensor &E_inv)
Checks that Ax does equal b in the NR procedure.
void checkDerivatives()
Checks the derivatives, eg dyieldFunction_dstress by using finite difference approximations.
RankTwoTensor _fspb_debug_stress
Debug the Jacobian entries at this stress.
bool dof_included(unsigned int dof, const std::vector< bool > &deactivated_due_to_ld)
std::vector< Real > _fspb_debug_pm_change
Debug finite-differencing parameters for the plastic multipliers.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _fspb_debug_pm
Debug the Jacobian entires at these plastic multipliers.
MultiPlasticityDebugger computes various finite-difference things to help developers remove bugs in t...
MultiPlasticityDebugger(const MooseObject *moose_object)
void checkJacobian(const RankFourTensor &E_inv, const std::vector< Real > &intnl_old)
Checks the full Jacobian, which is just certain linear combinations of the dyieldFunction_dstress, etc, by using finite difference approximations.