G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsNewtonIterator< T > Class Template Reference

Detailed Description

template<class T>
class gismo::gsNewtonIterator< T >

Performs Newton iterations to solve a nonlinear system of PDEs.

Template Parameters
Tcoefficient type
+ Collaboration diagram for gsNewtonIterator< T >:

Public Member Functions

bool converged () const
 Tells whether the Newton method converged.
 
void firstIteration ()
 Solves linear system obtained using linear elasticity in first step and computes residual.
 
 gsNewtonIterator (gsAssembler< T > &assembler, const gsMultiPatch< T > &initialSolution)
 
void nextIteration ()
 Solves linear system in each iteration based on last solution and computes residual.
 
index_t numIterations () const
 Returns the number of Newton iterations performed.
 
residue () const
 Returns the error after solving the nonlinear system.
 
void setMaxIterations (index_t nIter)
 Set the maximum number of Newton iterations allowed.
 
void setTolerance (T tol)
 Set the tolerance for convergence.
 
const gsMultiPatch< T > & solution () const
 Returns the latest configuration.
 
void solve ()
 Applies Newton method and Performs Newton iterations until convergence or maximum iterations.
 
tolerance () const
 Returns the tolerance value used.
 

Protected Attributes

gsAssembler< T > & m_assembler
 gsAssemblerBase object to generate the linear system for each iteration
 
bool m_converged
 Convergence result.
 
gsMultiPatch< T > m_curSolution
 The latest/current solution.
 
index_t m_maxIterations
 Maximum number of Newton iterations allowed.
 
index_t m_numIterations
 Number of Newton iterations performed.
 
m_residue
 Final error.
 
gsSparseSolver::LU m_solver
 Linear solver employed.
 
m_tolerance
 Tolerance value to decide convergence.
 
gsMatrix< T > m_updateVector
 Solution of the linear system in each iteration.
 
m_updnorm
 Norm of the current Newton update vector.
 

Constructor & Destructor Documentation

gsNewtonIterator ( gsAssembler< T > &  assembler,
const gsMultiPatch< T > &  initialSolution 
)
inline

Constructor giving access to the gsAssemblerBase object to create a linear system per iteration