www.mooseframework.org
MultiPlasticityDebugger.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #ifndef MULTIPLASTICITYDEBUGGER_H
8 #define MULTIPLASTICITYDEBUGGER_H
9 
11 
13 
14 template <>
15 InputParameters validParams<MultiPlasticityDebugger>();
16 
23 {
24 public:
25  MultiPlasticityDebugger(const MooseObject * moose_object);
26 
32 
37  void checkDerivatives();
38 
44  void checkJacobian(const RankFourTensor & E_inv, const std::vector<Real> & intnl_old);
45 
49  void checkSolution(const RankFourTensor & E_inv);
50 
51 protected:
58  MooseEnum _fspb_debug;
59 
61  RankTwoTensor _fspb_debug_stress;
62 
64  std::vector<Real> _fspb_debug_pm;
65 
67  std::vector<Real> _fspb_debug_intnl;
68 
71 
73  std::vector<Real> _fspb_debug_pm_change;
74 
76  std::vector<Real> _fspb_debug_intnl_change;
77 
78 private:
86  void fddyieldFunction_dstress(const RankTwoTensor & stress,
87  const std::vector<Real> & intnl,
88  std::vector<RankTwoTensor> & df_dstress);
89 
97  void fddyieldFunction_dintnl(const RankTwoTensor & stress,
98  const std::vector<Real> & intnl,
99  std::vector<Real> & df_dintnl);
100 
108  virtual void fddflowPotential_dstress(const RankTwoTensor & stress,
109  const std::vector<Real> & intnl,
110  std::vector<RankFourTensor> & dr_dstress);
111 
118  virtual void fddflowPotential_dintnl(const RankTwoTensor & stress,
119  const std::vector<Real> & intnl,
120  std::vector<RankTwoTensor> & dr_dintnl);
121 
137  virtual void fdJacobian(const RankTwoTensor & stress,
138  const std::vector<Real> & intnl_old,
139  const std::vector<Real> & intnl,
140  const std::vector<Real> & pm,
141  const RankTwoTensor & delta_dp,
142  const RankFourTensor & E_inv,
143  bool eliminate_ld,
144  std::vector<std::vector<Real>> & jac);
145 
146  bool dof_included(unsigned int dof, const std::vector<bool> & deactivated_due_to_ld);
147 };
148 
149 #endif // MULTIPLASTICITYDEBUGGER_H
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.
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.
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.
InputParameters validParams< MultiPlasticityDebugger >()