Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
NewtonRaphson Class Reference

Class for solving a non-linear system in a few iterations until the norm of the residuals reaches a certain tolerance or a maximun number of iterations is reached. More...

#include <NewtonRaphson.hpp>

Inheritance diagram for NewtonRaphson:
Collaboration diagram for NewtonRaphson:

Public Member Functions

 NewtonRaphson (std::unique_ptr< LinearSystem > &solver, std::shared_ptr< Mesh > &mesh, double tol=1E-6, unsigned int nIters=50, unsigned int flag=1, double ldFactor=0.02)
 Creates a Linear object. More...
 
 ~NewtonRaphson ()
 Destroys this NewtonRaphson object. More...
 
bool ComputeNewIncrement (std::shared_ptr< Mesh > &mesh, unsigned int i=0)
 Computes a new incremental solution. More...
 
const Eigen::VectorXd & GetDisplacementIncrement ()
 Gets the displacement increment. More...
 
void SetLoadFactor (double factor)
 Set the load factor. More...
 
void SetIntegrator (std::shared_ptr< Integrator > &integrator)
 Sets the integrator for this algorithm. More...
 
- Public Member Functions inherited from Algorithm
 Algorithm (const std::shared_ptr< Mesh > &mesh, unsigned int flag=1, double NormFactor=1.0)
 Creates a Algorithm object. More...
 
virtual ~Algorithm ()=0
 Destroys this Algorithm object. More...
 
void ReverseStatesIncrements (std::shared_ptr< Mesh > &mesh)
 Reverse the incremental state variables to its pervious converged one in the mesh. More...
 
void UpdateStatesIncrements (std::shared_ptr< Mesh > &mesh, const Eigen::VectorXd &dU)
 Update the incremental state variables in the mesh. More...
 
void ReducedParallelResidual (const Eigen::VectorXd &Feff, double &Residual)
 Construct the residual vector force from each processor. More...
 
double ComputeConvergence (const Eigen::VectorXd &Force, const Eigen::VectorXd &Delta, const Eigen::VectorXd &delta, unsigned int k)
 Computes convergence tests for this algorithm. More...
 

Protected Attributes

double Tolerance
 Convergence tolerance. More...
 
double LoadFactor
 Incremental load factor. More...
 
unsigned int nMaxIterations
 Maximum allowed number of iterations. More...
 
Eigen::VectorXd dU
 Incremental displacement. More...
 
std::unique_ptr< LinearSystemtheSolver
 The linear system solver. More...
 
std::shared_ptr< IntegratortheIntegrator
 The time-domain integrator. More...
 
- Protected Attributes inherited from Algorithm
Eigen::SparseMatrix< double > Total2FreeMatrix
 Operator that enforced restrain/constraint. More...
 

Detailed Description

Class for solving a non-linear system in a few iterations until the norm of the residuals reaches a certain tolerance or a maximun number of iterations is reached.

See also
Algorithm.hpp Integrator.hpp

Constructor & Destructor Documentation

◆ NewtonRaphson()

NewtonRaphson::NewtonRaphson ( std::unique_ptr< LinearSystem > &  solver,
std::shared_ptr< Mesh > &  mesh,
double  tol = 1E-6,
unsigned int  nIters = 50,
unsigned int  flag = 1,
double  ldFactor = 0.02 
)

Creates a Linear object.

Parameters
solverPointer to the LinearSystem solver to be employed.
meshPointer to the Mesh container to extract Node and Element.
tolThe tolerance for which the solution is assumed to converge.
nItersThe number of maximum itertions for convergence.
flagThe convergence test to be performeds.
ldFactorThe incremental load factor for external loads.
Note
More details can be found at NewtonRaphson.
See also
NewtonRaphson::Tolerance, NewtonRaphson::LoadFactor, NewtonRaphson::nMaxIterations.

◆ ~NewtonRaphson()

NewtonRaphson::~NewtonRaphson ( )

Destroys this NewtonRaphson object.

Member Function Documentation

◆ ComputeNewIncrement()

bool NewtonRaphson::ComputeNewIncrement ( std::shared_ptr< Mesh > &  mesh,
unsigned int  i = 0 
)
virtual

Computes a new incremental solution.

Parameters
meshThe finite element Mesh object.
iThe time step number to be solved.
Returns
Whether or not the algorithm was successful.
Note
More details can be found at NewtonRaphson.

Implements Algorithm.

◆ GetDisplacementIncrement()

const Eigen::VectorXd& NewtonRaphson::GetDisplacementIncrement ( )
virtual

Gets the displacement increment.

Returns
The incremental displacement vector.
Note
More details can be found at NewtonRaphson.

Implements Algorithm.

◆ SetIntegrator()

void NewtonRaphson::SetIntegrator ( std::shared_ptr< Integrator > &  integrator)
virtual

Sets the integrator for this algorithm.

Parameters
integratorPointer to the Integrator to obtain the effective stiffness and force.

Implements Algorithm.

◆ SetLoadFactor()

void NewtonRaphson::SetLoadFactor ( double  factor)
virtual

Set the load factor.

Parameters
factorThe incremental load factor.

Implements Algorithm.

Member Data Documentation

◆ dU

Eigen::VectorXd NewtonRaphson::dU
protected

Incremental displacement.

◆ LoadFactor

double NewtonRaphson::LoadFactor
protected

Incremental load factor.

◆ nMaxIterations

unsigned int NewtonRaphson::nMaxIterations
protected

Maximum allowed number of iterations.

◆ theIntegrator

std::shared_ptr<Integrator> NewtonRaphson::theIntegrator
protected

The time-domain integrator.

◆ theSolver

std::unique_ptr<LinearSystem> NewtonRaphson::theSolver
protected

The linear system solver.

◆ Tolerance

double NewtonRaphson::Tolerance
protected

Convergence tolerance.