Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
NewtonRaphson.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // Seismo Virtual Laboratory
4 // Module for Serial and Parallel Analysis of seismic
5 // wave propagation and soil-structure interaction simulation
6 // Copyright (C) 2018-2021, The California Institute of Technology
7 // All Rights Reserved.
8 //
9 // Commercial use of this program without express permission of the California
10 // Institute of Technology, is strictly prohibited. See file "COPYRIGHT" in
11 // main directory for information on usage and redistribution, and for a
12 // DISCLAIMER OF ALL WARRANTIES.
13 //
14 //==============================================================================
15 //
16 // Written by:
17 // Danilo S. Kusanovic (dkusanov@caltech.edu)
18 // Elnaz E. Seylabi (elnaze@unr.edu)
19 //
20 // Supervised by:
21 // Domniki M. Asimaki (domniki@caltech.edu)
22 //
23 // References :
24 // [1] Finite Element Procedures, Bathe, K.J., Chapter 8: pages 755-759.
25 // Prentice-Hall, 1996.
26 //
27 // Description:
32 //------------------------------------------------------------------------------
33 
34 #ifndef _NEWTONRAPHSON_HPP_
35 #define _NEWTONRAPHSON_HPP_
36 
37 #include <memory>
38 #include <Eigen/Dense>
39 #include <Eigen/SparseCore>
40 
41 #include "Mesh.hpp"
42 #include "LoadCombo.hpp"
43 #include "Algorithm.hpp"
44 #include "Integrator.hpp"
45 #include "LinearSystem.hpp"
46 
54 class NewtonRaphson : public Algorithm {
55 
56  public:
66  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);
67 
70 
76  bool ComputeNewIncrement(std::shared_ptr<Mesh> &mesh, unsigned int i=0);
77 
81  const Eigen::VectorXd& GetDisplacementIncrement();
82 
85  void SetLoadFactor(double factor);
86 
89  void SetIntegrator(std::shared_ptr<Integrator> &integrator);
90 
91  protected:
93  double Tolerance;
94 
96  double LoadFactor;
97 
99  unsigned int nMaxIterations;
100 
102  Eigen::VectorXd dU;
103 
105  std::unique_ptr<LinearSystem> theSolver;
106 
108  std::shared_ptr<Integrator> theIntegrator;
109 };
110 
111 #endif
This file contains the abstract "LinearSystem object" declarations, which defines the library to solv...
Virtual class for defining how the solution between two steps is going to be carried out...
Definition: Algorithm.hpp:52
double LoadFactor
Incremental load factor.
Definition: NewtonRaphson.hpp:96
Eigen::VectorXd dU
Incremental displacement.
Definition: NewtonRaphson.hpp:102
double Tolerance
Convergence tolerance.
Definition: NewtonRaphson.hpp:93
unsigned int flag
Convergence test to be performed.
Definition: Algorithm.hpp:124
Class for solving a non-linear system in a few iterations until the norm of the residuals reaches a c...
Definition: NewtonRaphson.hpp:54
This file contains the "Load Combination" class declarations, which defines how the loads are going t...
void SetIntegrator(std::shared_ptr< Integrator > &integrator)
Sets the integrator for this algorithm.
~NewtonRaphson()
Destroys this NewtonRaphson object.
This file contains the "Integrator object" declarations, and defines how the dynamic solution between...
unsigned int nMaxIterations
Maximum allowed number of iterations.
Definition: NewtonRaphson.hpp:99
This file contains the "Mesh object" declarations, which stores nodes, materials, elements...
bool ComputeNewIncrement(std::shared_ptr< Mesh > &mesh, unsigned int i=0)
Computes a new incremental solution.
const Eigen::VectorXd & GetDisplacementIncrement()
Gets the displacement increment.
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.
void SetLoadFactor(double factor)
Set the load factor.
std::shared_ptr< Integrator > theIntegrator
The time-domain integrator.
Definition: NewtonRaphson.hpp:108
std::unique_ptr< LinearSystem > theSolver
The linear system solver.
Definition: NewtonRaphson.hpp:105