PerezFougetSubstepperTime.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/MarmotTypedefs.h"
30 
42  template < int sizeMaterialState >
44 
45  public:
47  typedef Eigen::Matrix< double, sizeMaterialState, sizeMaterialState > TangentSizedMatrix;
48 
50  double minimumStepSize,
51  double scaleUpFactor,
52  double scaleDownFactor,
53  int nPassesToIncrease );
55  bool isFinished();
57  double getNextSubstep();
59  double getFinishedProgress();
61  bool decreaseSubstepSize();
62 
63  void extendConsistentTangent( const Matrix6d& CelT );
64  void extendConsistentTangent( const Matrix6d& CelT, const TangentSizedMatrix& matTangent );
66 
67  private:
69  const int nPassesToIncrease;
70 
74 
77  };
78 } // namespace Marmot::NumericalAlgorithms
79 
80 #include "Marmot/MarmotJournal.h"
81 
83  template < int s >
85  double minimumStepSize,
86  double scaleUpFactor,
87  double scaleDownFactor,
88  int nPassesToIncrease )
89  : initialStepSize( initialStepSize ),
90  minimumStepSize( minimumStepSize ),
91  scaleUpFactor( scaleUpFactor ),
92  scaleDownFactor( scaleDownFactor ),
93  nPassesToIncrease( nPassesToIncrease ),
94  currentProgress( 0.0 ),
95  currentSubstepSize( initialStepSize ),
96  passedSubsteps( 0 )
97 
98  {
99  elasticTangent = TangentSizedMatrix::Identity();
100  consistentTangent = TangentSizedMatrix::Zero();
101  }
102 
103  template < int s >
105  {
106  return currentProgress >= 1.0;
107  }
108 
109  template < int s >
111  {
112  if ( passedSubsteps >= nPassesToIncrease )
113  currentSubstepSize *= scaleUpFactor;
114 
115  const double remainingProgress = 1.0 - currentProgress;
116  if ( remainingProgress < currentSubstepSize )
117  currentSubstepSize = remainingProgress;
118 
119  passedSubsteps++;
120  currentProgress += currentSubstepSize;
121 
122  return currentSubstepSize;
123  }
124 
125  template < int s >
127  {
128  return currentProgress - currentSubstepSize;
129  }
130 
131  template < int s >
133  {
134  currentProgress -= currentSubstepSize;
135  passedSubsteps = 0;
136 
137  currentSubstepSize *= scaleDownFactor;
138 
139  if ( currentSubstepSize < minimumStepSize )
140  return MarmotJournal::warningToMSG( "UMAT: Substepper: Minimal stepzsize reached" );
141  else
142  return MarmotJournal::notificationToMSG( "UMAT: Substepper: Decreasing stepsize" );
143  }
144 
145  template < int s >
147  {
148 
149  elasticTangent.topLeftCorner( 6, 6 ) = CelT;
150  consistentTangent += currentSubstepSize * elasticTangent;
151  }
152 
153  template < int s >
155  const TangentSizedMatrix& matTangent )
156  {
157  extendConsistentTangent( CelT );
158  consistentTangent.applyOnTheLeft( matTangent );
159  }
160 
161  template < int s >
163  {
164  return consistentTangent.topLeftCorner( 6, 6 );
165  }
166 } // namespace Marmot::NumericalAlgorithms
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime
Definition: PerezFougetSubstepperTime.h:43
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::TangentSizedMatrix
Eigen::Matrix< double, sizeMaterialState, sizeMaterialState > TangentSizedMatrix
Matrix to carry the Jacobian of a material state.
Definition: PerezFougetSubstepperTime.h:47
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::currentProgress
double currentProgress
Definition: PerezFougetSubstepperTime.h:71
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::scaleDownFactor
const double scaleDownFactor
Definition: PerezFougetSubstepperTime.h:68
Marmot::NumericalAlgorithms
Definition: MarmotNumericalDifferentiation.h:34
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::extendConsistentTangent
void extendConsistentTangent(const Matrix6d &CelT)
Definition: PerezFougetSubstepperTime.h:146
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::passedSubsteps
int passedSubsteps
Definition: PerezFougetSubstepperTime.h:73
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::nPassesToIncrease
const int nPassesToIncrease
Definition: PerezFougetSubstepperTime.h:69
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::getFinishedProgress
double getFinishedProgress()
get the total finished progress of the subincrementation process
Definition: PerezFougetSubstepperTime.h:126
MarmotJournal.h
MarmotTypedefs.h
Marmot::Matrix6d
Eigen::Matrix< double, 6, 6 > Matrix6d
Definition: MarmotTypedefs.h:35
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::consistentStiffness
Matrix6d consistentStiffness()
Definition: PerezFougetSubstepperTime.h:162
MarmotJournal::notificationToMSG
static bool notificationToMSG(const std::string &message)
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::getNextSubstep
double getNextSubstep()
get the next subincrement size
Definition: PerezFougetSubstepperTime.h:110
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::scaleUpFactor
const double scaleUpFactor
Definition: PerezFougetSubstepperTime.h:68
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::initialStepSize
const double initialStepSize
Definition: PerezFougetSubstepperTime.h:68
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::PerezFougetSubstepperTime
PerezFougetSubstepperTime(double initialStepSize, double minimumStepSize, double scaleUpFactor, double scaleDownFactor, int nPassesToIncrease)
Definition: PerezFougetSubstepperTime.h:84
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::decreaseSubstepSize
bool decreaseSubstepSize()
decrease the next subincrement
Definition: PerezFougetSubstepperTime.h:132
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::isFinished
bool isFinished()
Check if the subincrementation has finished.
Definition: PerezFougetSubstepperTime.h:104
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::minimumStepSize
const double minimumStepSize
Definition: PerezFougetSubstepperTime.h:68
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::consistentTangent
TangentSizedMatrix consistentTangent
Definition: PerezFougetSubstepperTime.h:76
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::currentSubstepSize
double currentSubstepSize
Definition: PerezFougetSubstepperTime.h:72
Marmot::NumericalAlgorithms::PerezFougetSubstepperTime::elasticTangent
TangentSizedMatrix elasticTangent
Definition: PerezFougetSubstepperTime.h:75
MarmotJournal::warningToMSG
static bool warningToMSG(const std::string &message)