PerezFougetSubstepperExplicitMarkII.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2  * _
3  * _ __ ___ __ _ _ __ _ __ ___ ___ | |_
4  * | '_ ` _ \ / _` | '__| '_ ` _ \ / _ \| __|
5  * | | | | | | (_| | | | | | | | | (_) | |_
6  * |_| |_| |_|\__,_|_| |_| |_| |_|\___/ \__|
7  *
8  * Unit of Strength of Materials and Structural Analysis
9  * University of Innsbruck,
10  * 2020 - today
11  *
12  * festigkeitslehre@uibk.ac.at
13  *
14  * Matthias Neuner matthias.neuner@uibk.ac.at
15  *
16  * This file is part of the MAteRialMOdellingToolbox (marmot).
17  *
18  * This library is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU Lesser General Public
20  * License as published by the Free Software Foundation; either
21  * version 2.1 of the License, or (at your option) any later version.
22  *
23  * The full text of the license can be found in the file LICENSE.md at
24  * the top level directory of marmot.
25  * ---------------------------------------------------------------------
26  */
27 
28 #pragma once
29 #include "Marmot/MarmotJournal.h"
30 #include "Marmot/MarmotTypedefs.h"
31 
33 
36  template < int nSizeMatTangent >
38 
39  public:
40  typedef Eigen::Matrix< double, nSizeMatTangent, nSizeMatTangent > TangentSizedMatrix;
41  typedef Eigen::Matrix< double, nSizeMatTangent, 6 > MatrixStateStrain;
43  double minimumStepSize,
44  double scaleUpFactor,
45  double scaleDownFactor,
47  const Matrix6d& Cel );
48 
50  bool isFinished();
52  double getNextSubstep();
54  bool decreaseSubstepSize();
55 
57  void finishElasticSubstep();
58 
62  void finishSubstep( const TangentSizedMatrix& dXdY, const TangentSizedMatrix& dYdXOld );
63 
66 
67  private:
69  const int nPassesToIncrease;
70 
74 
75  const Matrix6d& Cel;
78 
80  };
81 } // namespace Marmot::NumericalAlgorithms
82 
84  template < int n >
86  double minimumStepSize,
87  double scaleUpFactor,
88  double scaleDownFactor,
89  int nPassesToIncrease,
90  const Matrix6d& Cel )
91  :
92 
93  initialStepSize( initialStepSize ),
94  minimumStepSize( minimumStepSize ),
95  scaleUpFactor( scaleUpFactor ),
96  scaleDownFactor( scaleDownFactor ),
97  nPassesToIncrease( nPassesToIncrease ),
98  currentProgress( 0.0 ),
99  currentSubstepSize( initialStepSize ),
100  passedSubsteps( 0 ),
101  Cel( Cel )
102  {
103  consistentTangent = MatrixStateStrain::Zero();
104  I76.setZero();
105  I76.topLeftCorner( 6, 6 ) = Matrix6d::Identity();
106  I77 = TangentSizedMatrix::Identity();
107  }
108 
109  template < int n >
111  {
112  // this is due to numerical accuracy ...
113  return ( 1.0 - currentProgress ) <= 2e-16;
114  }
115 
116  template < int n >
118  {
119  if ( passedSubsteps >= nPassesToIncrease )
120  currentSubstepSize *= scaleUpFactor;
121 
122  const double remainingProgress = 1.0 - currentProgress;
123  if ( remainingProgress < currentSubstepSize )
124  currentSubstepSize = remainingProgress;
125 
126  passedSubsteps++;
127  currentProgress += currentSubstepSize;
128 
129  return currentSubstepSize;
130  }
131 
132  template < int n >
134  {
135  currentProgress -= currentSubstepSize;
136  passedSubsteps = 0;
137 
138  currentSubstepSize *= scaleDownFactor;
139 
140  if ( currentSubstepSize < minimumStepSize )
141  return MarmotJournal::warningToMSG( "UMAT: Substepper: Minimal stepzsize reached" );
142  else
143  return MarmotJournal::notificationToMSG( "UMAT: Substepper: Decreasing stepsize" );
144  }
145 
146  template < int n >
148  {
149  consistentTangent += currentSubstepSize * I76 * Cel;
150  }
151 
152  template < int n >
154  {
155  consistentTangent.applyOnTheLeft( I77 - dYdXOld );
156  consistentTangent += currentSubstepSize * I76 * Cel;
157  consistentTangent.applyOnTheLeft( dXdY );
158  }
159 
160  template < int n >
162  {
163  return consistentTangent.topLeftCorner( 6, 6 );
164  }
165 } // namespace Marmot::NumericalAlgorithms
Marmot::NumericalAlgorithms::PerezFougetSubstepper::I77
TangentSizedMatrix I77
Definition: PerezFougetSubstepperExplicitMarkII.h:77
Marmot::NumericalAlgorithms
Definition: MarmotNumericalDifferentiation.h:34
Marmot::NumericalAlgorithms::PerezFougetSubstepper::Cel
const Matrix6d & Cel
Definition: PerezFougetSubstepperExplicitMarkII.h:75
Marmot::NumericalAlgorithms::PerezFougetSubstepper::scaleDownFactor
const double scaleDownFactor
Definition: PerezFougetSubstepperExplicitMarkII.h:68
MarmotJournal.h
Marmot::NumericalAlgorithms::PerezFougetSubstepper::currentProgress
double currentProgress
Definition: PerezFougetSubstepperExplicitMarkII.h:71
MarmotTypedefs.h
Marmot::Matrix6d
Eigen::Matrix< double, 6, 6 > Matrix6d
Definition: MarmotTypedefs.h:35
Marmot::NumericalAlgorithms::PerezFougetSubstepper::decreaseSubstepSize
bool decreaseSubstepSize()
decrease the next subincrement
Definition: PerezFougetSubstepperExplicitMarkII.h:133
Marmot::NumericalAlgorithms::PerezFougetSubstepper::currentSubstepSize
double currentSubstepSize
Definition: PerezFougetSubstepperExplicitMarkII.h:72
MarmotJournal::notificationToMSG
static bool notificationToMSG(const std::string &message)
Marmot::NumericalAlgorithms::PerezFougetSubstepper::consistentTangent
MatrixStateStrain consistentTangent
Definition: PerezFougetSubstepperExplicitMarkII.h:79
Marmot::NumericalAlgorithms::PerezFougetSubstepper::PerezFougetSubstepper
PerezFougetSubstepper(double initialStepSize, double minimumStepSize, double scaleUpFactor, double scaleDownFactor, int nPassesToIncrease, const Matrix6d &Cel)
Definition: PerezFougetSubstepperExplicitMarkII.h:85
Marmot::NumericalAlgorithms::PerezFougetSubstepper::I76
MatrixStateStrain I76
Definition: PerezFougetSubstepperExplicitMarkII.h:76
Marmot::NumericalAlgorithms::PerezFougetSubstepper
Definition: PerezFougetSubstepperExplicitMarkII.h:37
Marmot::NumericalAlgorithms::PerezFougetSubstepper::finishSubstep
void finishSubstep(const TangentSizedMatrix &dXdY, const TangentSizedMatrix &dYdXOld)
Definition: PerezFougetSubstepperExplicitMarkII.h:153
Marmot::NumericalAlgorithms::PerezFougetSubstepper::getNextSubstep
double getNextSubstep()
get the next subincrement size
Definition: PerezFougetSubstepperExplicitMarkII.h:117
Marmot::NumericalAlgorithms::PerezFougetSubstepper::isFinished
bool isFinished()
check if subincrementation process has finished
Definition: PerezFougetSubstepperExplicitMarkII.h:110
Marmot::NumericalAlgorithms::PerezFougetSubstepper::TangentSizedMatrix
Eigen::Matrix< double, nSizeMatTangent, nSizeMatTangent > TangentSizedMatrix
Definition: PerezFougetSubstepperExplicitMarkII.h:40
Marmot::NumericalAlgorithms::PerezFougetSubstepper::MatrixStateStrain
Eigen::Matrix< double, nSizeMatTangent, 6 > MatrixStateStrain
Definition: PerezFougetSubstepperExplicitMarkII.h:41
Marmot::NumericalAlgorithms::PerezFougetSubstepper::nPassesToIncrease
const int nPassesToIncrease
Definition: PerezFougetSubstepperExplicitMarkII.h:69
Marmot::NumericalAlgorithms::PerezFougetSubstepper::scaleUpFactor
const double scaleUpFactor
Definition: PerezFougetSubstepperExplicitMarkII.h:68
Marmot::NumericalAlgorithms::PerezFougetSubstepper::passedSubsteps
int passedSubsteps
Definition: PerezFougetSubstepperExplicitMarkII.h:73
Marmot::NumericalAlgorithms::PerezFougetSubstepper::finishElasticSubstep
void finishElasticSubstep()
finish an elastic only subincrement
Definition: PerezFougetSubstepperExplicitMarkII.h:147
Marmot::NumericalAlgorithms::PerezFougetSubstepper::minimumStepSize
const double minimumStepSize
Definition: PerezFougetSubstepperExplicitMarkII.h:68
Marmot::NumericalAlgorithms::PerezFougetSubstepper::initialStepSize
const double initialStepSize
Definition: PerezFougetSubstepperExplicitMarkII.h:68
MarmotJournal::warningToMSG
static bool warningToMSG(const std::string &message)
Marmot::NumericalAlgorithms::PerezFougetSubstepper::consistentStiffness
Matrix6d consistentStiffness()
get the consistent algorithmic tangent
Definition: PerezFougetSubstepperExplicitMarkII.h:161