20 #ifdef gsSpectra_ENABLED
51 const ALResidual_t & ALResidual,
53 : m_residualFun(ALResidual),
56 m_jacobian = Jacobian;
59 return m_jacobian(x,m);
69 m_basisResidualF = 0.0;
70 m_basisResidualU = 0.0;
77 const ALResidual_t & Residual,
79 : m_residualFun(Residual),
82 m_djacobian = dJacobian;
91 m_basisResidualF = 0.0;
92 m_basisResidualU = 0.0;
98 virtual gsStatus status() {
return m_status; }
101 virtual index_t numDofs() {
return m_forcing.size();}
112 m_initialized =
true;
120 m_options.
setReal(
"Length",length);
128 m_adaptiveLength = adaptive;
136 m_adaptiveLength = adaptive;
143 m_adaptiveLength =
true;
167 virtual T solutionL()
const {
return m_L;}
168 virtual T solutionDL()
const {
return m_DeltaL;}
169 virtual const gsVector<T> & solutionV()
const {
return m_V;}
172 virtual bool isStable()
const {
return m_stability;}
181 virtual void resetStep() {m_DeltaUold.setZero(); m_DeltaLold = 0;}
184 virtual void setInitialGuess(
const gsVector<T> & Uguess,
const T & Lguess) {m_Uguess = Uguess; m_Lguess = Lguess;}
185 virtual void setPrevious(
const gsVector<T> & Uprev,
const T & Lprev)
189 m_DeltaUold =
m_U - m_Uprev;
190 m_DeltaLold =
m_L - m_Lprev;
211 virtual T distance(
const gsVector<T>& DeltaU,
const T DeltaL)
const
268 virtual void _computeStability(
const gsVector<T> & x,
bool jacobian=
true, T shift = -1e2);
294 virtual bool _bisectionSolve(
const gsVector<T> & U,
const T L,
const T tol);
307 virtual void _step();
322 virtual gsVector<T>
solveSystem(
const gsVector<T> & F);
325 virtual gsVector<T> computeResidual(
const gsVector<T> & U,
const T & L);
326 virtual void computeResidual();
332 virtual gsSparseMatrix<T>
_computeJacobian(
const gsVector<T> & U,
const gsVector<T> & dU);
333 virtual gsSparseMatrix<T> computeJacobian(
const gsVector<T> & U,
const gsVector<T> & dU);
334 virtual gsSparseMatrix<T> computeJacobian(
const gsVector<T> & U);
335 virtual gsSparseMatrix<T> computeJacobian();
361 virtual void predictorGuess() = 0;
375 Jacobian_t m_jacobian;
376 dJacobian_t m_djacobian;
377 const ALResidual_t m_residualFun;
378 const gsVector<T> m_forcing;
380 mutable typename gsSparseSolver<T>::uPtr m_solver;
414 mutable gsOptionList m_options;
430 bool m_adaptiveLength;
472 T m_basisResidualKTPhi;
551 #ifndef GISMO_BUILD_LIB
552 #include GISMO_HPP_HEADER(gsALMBase.hpp)
virtual void defaultOptions()
Set default options.
Definition: gsALMBase.hpp:23
gsVector< T > m_deltaLs
Vector with lambda updates.
Definition: gsALMBase.h:504
virtual gsStatus computeStability(bool jacobian=true, T shift=-1e2)
Calculates the stability of the solution x.
Definition: gsALMBase.hpp:521
virtual void computeUbar()
Compute .
Definition: gsALMBase.hpp:249
virtual index_t _bisectionObjectiveFunction(const gsVector< T > &x, bool jacobian=true)
Returns the objective function for the bisection method given solution x.
Definition: gsALMBase.hpp:737
T m_residue
Force residuum.
Definition: gsALMBase.h:457
virtual void setLength(T length, index_t iterations)
Set arc length to length, enables adaptive steps aiming for iterations number of iterations per step...
Definition: gsALMBase.h:140
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
gsVector< T > m_deltaUbar
u_bar
Definition: gsALMBase.h:491
virtual T tolerance() const
Returns the tolerance value used.
Definition: gsALMBase.h:155
virtual const gsVector< T > & solutionU() const
Return the solution vector and factor.
Definition: gsALMBase.h:165
bool m_converged
Convergence result.
Definition: gsALMBase.h:454
virtual void stepOutput()=0
Provide step-wise output.
virtual void setLength(T length, bool adaptive)
Set arc length to length, enables adaptive steps.
Definition: gsALMBase.h:125
virtual gsStatus step()
Perform one arc-length step.
Definition: gsALMBase.hpp:328
virtual bool stabilityChange() const
Checks if the stability of the system changed since the previously known solution.
Definition: gsALMBase.hpp:623
T m_toleranceF
Tolerance value to decide convergence - Force criterion.
Definition: gsALMBase.h:436
gsVector< T > m_deltaUt
u_t
Definition: gsALMBase.h:493
virtual index_t stability() const
Computes the stability: -1 if unstable, +1 if stable.
Definition: gsALMBase.hpp:617
gsALMBase(const Jacobian_t &Jacobian, const ALResidual_t &ALResidual, const gsVector< T > &Force)
Constructor.
Definition: gsALMBase.h:50
virtual void quasiNewtonIteration()=0
Perform iteration using quasi-newton method.
virtual gsStatus computeSingularPoint(const gsVector< T > &U, const T &L, bool switchBranch=false, bool jacobian=false, bool testPoint=true)
Calculates the singular point.
Definition: gsALMBase.hpp:450
virtual void computeUt()
Compute .
Definition: gsALMBase.hpp:255
virtual gsOptionList & options()
Access the options.
Definition: gsALMBase.h:200
virtual gsSparseMatrix< T > _computeJacobian(const gsVector< T > &U, const gsVector< T > &dU)
Compute the jacobian matrix.
Definition: gsALMBase.hpp:214
virtual T reduceLength(T fac=0.5)
Reduce the length by multiplication with a factor fac.
Definition: gsALMBase.hpp:120
T m_residueU
Displacement residuum.
Definition: gsALMBase.h:464
virtual void setSolution(const gsVector< T > &U, const T &L)
Sets the solution.
Definition: gsALMBase.h:194
virtual void quasiNewtonPredictor()=0
Provide a specialized predictor when using quasi newton methods.
T m_residueF
Force residuum.
Definition: gsALMBase.h:460
virtual void _step()
Implementation of step.
Definition: gsALMBase.hpp:354
virtual void initMethods()=0
Initialize the ALM.
T m_relax
Relaxation factor.
Definition: gsALMBase.h:479
virtual void _extendedSystemIteration()
Perform an extended system iteration.
Definition: gsALMBase.hpp:705
virtual void setOptions(gsOptionList options)
Set the options to options.
Definition: gsALMBase.h:203
T m_deltaL
Update of update of lambda.
Definition: gsALMBase.h:502
#define index_t
Definition: gsConfig.h:32
gsStatus
Definition: gsStructuralAnalysisTypes.h:20
virtual index_t numIterations() const
Returns the number of Newton iterations performed.
Definition: gsALMBase.h:152
virtual void computeResidualNorms()
Compute the residual error norms.
Definition: gsALMBase.hpp:151
index_t m_desiredIterations
Number of desired iterations.
Definition: gsALMBase.h:424
virtual bool isBifurcation(bool jacobian=false)
Returns true if the point is a bifurcation.
Definition: gsALMBase.hpp:514
virtual void _computeStability(const gsVector< T > &x, bool jacobian=true, T shift=-1e2)
See computeStability.
Definition: gsALMBase.hpp:547
index_t m_maxIterations
Maximum number of Arc Length iterations allowed.
Definition: gsALMBase.h:421
virtual void setLength(T length, bool adaptive, index_t iterations)
Set arc length to length, enables adaptive steps aiming for iterations number of iterations per step...
Definition: gsALMBase.h:133
virtual void setSolutionStep(const gsVector< T > &DU, const T &DL)
Sets the solution step.
Definition: gsALMBase.h:197
void setReal(const std::string &label, const Real &value)
Sets an existing option label to be equal to value.
Definition: gsOptionList.cpp:166
virtual bool converged() const
True if the Arc Length method converged.
Definition: gsALMBase.h:149
std::function< bool(gsVector< T > const &, gsSparseMatrix< T > &) > Jacobian_t
Jacobian.
Definition: gsStructuralAnalysisTypes.h:83
gsVector< T > m_DeltaU
Update of displacement vector.
Definition: gsALMBase.h:489
virtual void _computeSingularPoint(const gsVector< T > &U, const T &L, bool switchBranch=false, bool jacobian=false, bool testPoint=true)
See computeSingularPoint.
Definition: gsALMBase.hpp:422
gsSparseMatrix< T > m_jacMat
Jacobian matrix.
Definition: gsALMBase.h:510
Provides a list of labeled parameters/options that can be set and accessed easily.
virtual void applyOptions()
Apply the options.
Definition: gsALMBase.h:209
virtual void resetStep()
Resets the step.
Definition: gsALMBase.h:181
std::function< bool(gsVector< T > const &, const T, gsVector< T > &)> ALResidual_t
Arc-Length Residual, Fint-lambda*Fext.
Definition: gsStructuralAnalysisTypes.h:67
virtual void initiateStep()=0
Initiate the first iteration.
virtual void initialize(bool stability=true)
Initialize the arc-length method, computes the stability of the initial configuration if stability is...
Definition: gsALMBase.h:110
T m_DeltaL
Update of lambdaGeneralizedSelfAdjointEigenSolver.
Definition: gsALMBase.h:500
gsALMBase(const dJacobian_t &dJacobian, const ALResidual_t &Residual, const gsVector< T > &Force)
Constructor using the jacobian that takes the solution and the solution step.
Definition: gsALMBase.h:76
virtual void setLength(T length)
Set arc length to length.
Definition: gsALMBase.h:118
virtual const void options_into(gsOptionList options)
Return the options into options.
Definition: gsALMBase.h:206
T m_residueL
Load residuum.
Definition: gsALMBase.h:468
virtual bool _extendedSystemSolve(const gsVector< T > &U, const T L, const T tol)
Perform an extended system solve to find a singular point.
Definition: gsALMBase.hpp:630
T m_residueKTPhi
Singular point.
Definition: gsALMBase.h:471
virtual T indicator() const
Returns the value of the Determinant or other indicator.
Definition: gsALMBase.h:161
virtual T residue() const
Returns the error after solving the nonlinear system.
Definition: gsALMBase.h:158
virtual bool _testSingularPoint(bool jacobian=false)
Tests if a point is a bifurcation point.
Definition: gsALMBase.hpp:475
virtual void _initOutputExtended()
Initialize the output for extended iterations.
Definition: gsALMBase.hpp:862
T m_tolerance
Tolerance value to decide convergence.
Definition: gsALMBase.h:433
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition: gsOptionList.cpp:253
virtual void computeLength()
Compute the adaptive arc-length.
Definition: gsALMBase.hpp:106
Provides a status object and typedefs.
Header file for using Spectra extension.
gsVector< T > m_U
Displacement vector (present, at previously converged point)
Definition: gsALMBase.h:487
virtual bool _bisectionSolve(const gsVector< T > &U, const T L, const T tol)
Perform a bisection system solve to find a singular point.
Definition: gsALMBase.hpp:753
T m_L
Lambda (present, at previously converged point)
Definition: gsALMBase.h:498
virtual void switchBranch()
Switches branches.
Definition: gsALMBase.hpp:842
std::function< bool(gsVector< T > const &, gsVector< T > const &, gsSparseMatrix< T > &) > dJacobian_t
Jacobian with solution update as argument.
Definition: gsStructuralAnalysisTypes.h:87
index_t m_numIterations
Number of Arc Length iterations performed.
Definition: gsALMBase.h:418
virtual void iteration()=0
A single iteration.
virtual bool isStable() const
Returns if solution passed a bifurcation point.
Definition: gsALMBase.h:172
This is the main header file that collects wrappers of Eigen for linear algebra.
T m_arcLength
Length of the step in the u,f plane.
Definition: gsALMBase.h:427
virtual void initOutput()=0
Initialize the output.
virtual void init(bool stability)
Initialize the solver.
Definition: gsALMBase.hpp:96
virtual T resetLength()
Reset the length.
Definition: gsALMBase.hpp:127
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
gsVector< T > m_resVec
Value of residual function.
Definition: gsALMBase.h:514
virtual void factorizeMatrix(const gsSparseMatrix< T > &M)
Factorize the matrix M.
Definition: gsALMBase.hpp:186
T m_toleranceU
Tolerance value to decide convergence - Displacement criterion.
Definition: gsALMBase.h:439
Performs the arc length method to solve a nonlinear system of equations.
Definition: gsALMBase.h:37
virtual void _stepOutputExtended()
Step output for extended iterations.
Definition: gsALMBase.hpp:887
virtual gsVector< T > solveSystem(const gsVector< T > &F)
Solve the system with right-hand side F.
Definition: gsALMBase.hpp:201
virtual void iterationFinish()=0
Finish the iterations.
virtual T _bisectionTerminationFunction(const gsVector< T > &x, bool jacobian=true)
Returns the termination function for the bisection method given solution x.
Definition: gsALMBase.hpp:745
Real getReal(const std::string &label) const
Reads value for option label from options.
Definition: gsOptionList.cpp:44
T m_indicator
Indicator for bifurcation.
Definition: gsALMBase.h:475
virtual void predictor()=0
Step predictor.
virtual void getOptions()
Apply options.
Definition: gsALMBase.hpp:57
gsVector< T > m_deltaU
Update of update of displacement vector.
Definition: gsALMBase.h:495