G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsALMLoadControl.hpp
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <typeinfo>
17 #include <gsStructuralAnalysis/src/gsALMSolvers/gsALMHelper.h>
18 
19 namespace gismo
20 {
21 
22 template <class T>
24 {
25  m_jacMat = computeJacobian();
26  this->factorizeMatrix(m_jacMat);
27  computeUbar(); // rhs contains residual and should be computed every time
28 
29 }
30 
31 template <class T>
33 {
34  m_jacMat = computeJacobian();
35  this->factorizeMatrix(m_jacMat);
36 }
37 
38 template <class T>
40 {
41  m_numDof = m_forcing.size();
42  m_DeltaU = m_U = gsVector<T>::Zero(m_numDof);
43  m_DeltaL = m_L = 0.0;
44 }
45 
46 // ------------------------------------------------------------------------------------------------------------
47 // ---------------------------------------Load Control method--------------------------------------------------------
48 // ------------------------------------------------------------------------------------------------------------
49 
50 template <class T>
52 {
53  computeUbar(); // rhs contains residual and should be computed every time
54 
55  // Compute next solution
56  m_deltaU = m_deltaUbar;
57  m_DeltaU += m_deltaU;
58 }
59 
60 template <class T>
62 {
63  // (m_U,m_L) is the present solution (iteratively updated)
64  // (m_Uprev,m_Lprev) is the previously converged solution before (m_Lprev,m_Uprev)
65 
66  // Reset step
67  m_DeltaU = m_deltaU = gsVector<T>::Zero(m_numDof);
68  m_DeltaL = m_deltaL = 0.0;
69 }
70 
71 template <class T>
73 {
74  m_jacMat = computeJacobian();
75  this->factorizeMatrix(m_jacMat);
76 
77  m_DeltaL = m_deltaL = m_arcLength;
78  m_deltaUt = this->solveSystem(m_forcing);
79  m_DeltaU = m_deltaL*m_deltaUt;
80 
81  // gsDebugVar(m_DeltaU.norm());
82  m_note+= "predictor\t";
83 }
84 
85 template <class T>
87 {
88  m_jacMat = computeJacobian();
89  this->factorizeMatrix(m_jacMat);
90 
91  m_DeltaL = m_deltaL = m_Lguess - m_L;
92  m_deltaUt = this->solveSystem(m_forcing);
93  m_DeltaU = m_deltaL*m_deltaUt;
94 
95  // gsDebugVar(m_DeltaU.norm());
96  m_note+= "predictor\t";
97 }
98 
99 template <class T>
101 {
102  m_converged = true;
103  m_Uprev = m_U;
104  m_Lprev = m_L;
105  m_U += m_DeltaU;
106  m_L += m_DeltaL;
107 }
108 
109 // ------------------------------------------------------------------------------------------------------------
110 // ---------------------------------------Output functions-----------------------------------------------------
111 // ------------------------------------------------------------------------------------------------------------
112 
113 template <class T>
115 {
116  gsInfo<<"\t";
117  gsInfo<<std::setw(4)<<std::left<<"It.";
118  gsInfo<<std::setw(17)<<std::left<<"Res. F";
119  gsInfo<<std::setw(17)<<std::left<<"|dU|/|Du|";
120  gsInfo<<std::setw(17)<<std::left<<"|U|";
121  gsInfo<<std::setw(17)<<std::left<<"L";
122  gsInfo<<std::setw(17)<<std::left<<"|DU|";
123  gsInfo<<std::setw(17)<<std::left<<"DL";
124  gsInfo<<std::setw(17)<<std::left<<"|dU|";
125  gsInfo<<std::setw(17)<<std::left<<"dL";
126  gsInfo<<std::setw(17)<<std::left<<"Dmin";
127  gsInfo<<std::setw(17)<<std::left<<"m_note";
128  gsInfo<<"\n";
129 
130  m_note = "";
131 }
132 
133 template <class T>
135 {
136  computeStability(false);
137 
138  gsInfo<<"\t";
139  gsInfo<<std::setw(4)<<std::left<<m_numIterations;
140  gsInfo<<std::setw(17)<<std::left<<m_residueF;
141  gsInfo<<std::setw(17)<<std::left<<m_residueU;
142  gsInfo<<std::setw(17)<<std::left<<(m_U+m_DeltaU).norm();
143  gsInfo<<std::setw(17)<<std::left<<(m_L + m_DeltaL);
144  gsInfo<<std::setw(17)<<std::left<<m_DeltaU.norm();
145  gsInfo<<std::setw(17)<<std::left<<m_DeltaL;
146  gsInfo<<std::setw(17)<<std::left<<m_deltaU.norm();
147  gsInfo<<std::setw(17)<<std::left<<m_deltaL;
148  gsInfo<<std::setw(17)<<std::left<<m_indicator;
149  gsInfo<<std::setw(17)<<std::left<<m_note;
150  gsInfo<<"\n";
151 
152  m_note = "";
153 }
154 
155 } // namespace gismo
Performs the load-controlled arc length method to solve a nonlinear equation system.
Definition: gsALMLoadControl.h:29
void initMethods()
See gsALMBase.
Definition: gsALMLoadControl.hpp:39
void iterationFinish()
See gsALMBase.
Definition: gsALMLoadControl.hpp:100
void initiateStep()
See gsALMBase.
Definition: gsALMLoadControl.hpp:61
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition: gsVector.h:35
void initOutput()
See gsALMBase.
Definition: gsALMLoadControl.hpp:114
#define gsInfo
Definition: gsDebug.h:43
void iteration()
See gsALMBase.
Definition: gsALMLoadControl.hpp:51
void predictor()
See gsALMBase.
Definition: gsALMLoadControl.hpp:72
void quasiNewtonPredictor()
See gsALMBase.
Definition: gsALMLoadControl.hpp:23
void quasiNewtonIteration()
See gsALMBase.
Definition: gsALMLoadControl.hpp:32
void stepOutput()
See gsALMBase.
Definition: gsALMLoadControl.hpp:134