libMesh
continuation_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_CONTINUATION_SYSTEM_H
21 #define LIBMESH_CONTINUATION_SYSTEM_H
22 
23 // Local Includes
24 #include "libmesh/fem_system.h"
25 
26 // C++ includes
27 
28 namespace libMesh
29 {
30 
31 // Forward Declarations
32 template <typename T> class LinearSolver;
33 class NewtonSolver;
34 
56 {
57 public:
63  const std::string & name,
64  const unsigned int number);
65 
69  virtual ~ContinuationSystem ();
70 
75 
79  typedef FEMSystem Parent;
80 
85  virtual void clear () override;
86 
90  virtual void solve () override;
91 
98  void continuation_solve();
99 
104  void advance_arcstep();
105 
116 
121  bool quiet;
122 
128  void set_max_arclength_stepsize(Real maxds) { ds=maxds; ds_current=maxds; }
129 
135 
141 
148 
156  void save_current_solution();
157 
162 
168 
175 
182 
189 
195  //Real tau;
196 
202  unsigned int n_backtrack_steps;
203 
210 
215 
221  enum Predictor {
226 
231 
236  };
237 
239 
248 
257 
258 protected:
263  virtual void init_data () override;
264 
288 
290 
291 
292 
293 private:
300  void initialize_tangent();
301 
305  void solve_tangent();
306 
312  void update_solution();
313 
317  void set_Theta();
318 
323  void set_Theta_LOCA();
324 
329  void apply_predictor();
330 
339 
344 
349 
354 
360 
365 
371 
377  std::unique_ptr<LinearSolver<Number>> linear_solver;
378 
383 
390 
397 
404 
410 
415 
420 
424  unsigned int newton_step;
425 };
426 
427 } // namespace libMesh
428 
429 #endif // LIBMESH_CONTINUATION_SYSTEM_H
libMesh::ContinuationSystem::Theta_LOCA
Real Theta_LOCA
Another normalization parameter, which is described in the LOCA manual.
Definition: continuation_system.h:188
libMesh::ContinuationSystem::~ContinuationSystem
virtual ~ContinuationSystem()
Destructor.
Definition: continuation_system.C:72
libMesh::ContinuationSystem::du_ds
NumericVector< Number > * du_ds
Extra work vectors used by the continuation algorithm.
Definition: continuation_system.h:338
libMesh::ContinuationSystem::Invalid_Predictor
Invalid predictor.
Definition: continuation_system.h:235
libMesh::ContinuationSystem::ds_current
Real ds_current
Value of stepsize currently in use.
Definition: continuation_system.h:409
libMesh::ContinuationSystem::init_data
virtual void init_data() override
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
Definition: continuation_system.C:90
libMesh::ContinuationSystem::tangent_initialized
bool tangent_initialized
False until initialize_tangent() is called.
Definition: continuation_system.h:382
libMesh::ContinuationSystem::RHS_Mode
RHS_Mode
There are (so far) two different vectors which may be assembled using the assembly routine: 1....
Definition: continuation_system.h:286
libMesh::ContinuationSystem::set_max_arclength_stepsize
void set_max_arclength_stepsize(Real maxds)
Sets (initializes) the max-allowable ds value and the current ds value.
Definition: continuation_system.h:128
libMesh::ContinuationSystem::ds_min
Real ds_min
The minimum-allowed steplength, defaults to 1.e-8.
Definition: continuation_system.h:214
libMesh::ContinuationSystem::G_Lambda
Definition: continuation_system.h:287
libMesh::ContinuationSystem::solve
virtual void solve() override
Perform a standard "solve" of the system, without doing continuation.
Definition: continuation_system.C:121
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::ContinuationSystem::z
NumericVector< Number > * z
Temporary vector "z" ...
Definition: continuation_system.h:364
libMesh::System::number
unsigned int number() const
Definition: system.h:2075
libMesh::ContinuationSystem::Residual
Definition: continuation_system.h:286
libMesh::ContinuationSystem::ds
Real ds
The initial arclength stepsize, selected by the user.
Definition: continuation_system.h:403
libMesh::ContinuationSystem::y
NumericVector< Number > * y
Temporary vector "y" ...
Definition: continuation_system.h:353
libMesh::FEMSystem
This class provides a specific system class.
Definition: fem_system.h:53
libMesh::ContinuationSystem::min_continuation_parameter
Real min_continuation_parameter
The minimum-allowable value of the continuation parameter.
Definition: continuation_system.h:167
libMesh::ContinuationSystem::continuation_solve
void continuation_solve()
Perform a continuation solve of the system.
Definition: continuation_system.C:358
libMesh::NumericVector< Number >
libMesh::ContinuationSystem::continuation_parameter
Real * continuation_parameter
The continuation parameter must be a member variable of the derived class, and the "continuation_para...
Definition: continuation_system.h:115
libMesh::ContinuationSystem::Euler
First-order Euler predictor.
Definition: continuation_system.h:225
libMesh::ContinuationSystem::linear_solver
std::unique_ptr< LinearSolver< Number > > linear_solver
We maintain our own linear solver interface, for solving custom systems of equations and/or things wh...
Definition: continuation_system.h:377
libMesh::ContinuationSystem::previous_ds
Real previous_ds
The previous arcstep length used.
Definition: continuation_system.h:419
libMesh::ContinuationSystem::sys_type
ContinuationSystem sys_type
The type of system.
Definition: continuation_system.h:74
libMesh::ContinuationSystem::previous_dlambda_ds
Real previous_dlambda_ds
The old parameter tangent value.
Definition: continuation_system.h:414
libMesh::ContinuationSystem::delta_u
NumericVector< Number > * delta_u
Temporary vector "delta u" ...
Definition: continuation_system.h:370
libMesh::ContinuationSystem::solve_tangent
void solve_tangent()
Special solve algorithm for solving the tangent system.
Definition: continuation_system.C:957
libMesh::ContinuationSystem::predictor
Predictor predictor
Definition: continuation_system.h:238
libMesh::ContinuationSystem::y_old
NumericVector< Number > * y_old
Temporary vector "y_old" ...
Definition: continuation_system.h:359
libMesh::ContinuationSystem::max_continuation_parameter
Real max_continuation_parameter
The maximum-allowable value of the continuation parameter.
Definition: continuation_system.h:174
libMesh::ContinuationSystem::previous_du_ds
NumericVector< Number > * previous_du_ds
The value of du_ds from the previous solution.
Definition: continuation_system.h:343
libMesh::ContinuationSystem::set_Theta_LOCA
void set_Theta_LOCA()
A centralized function for setting the other normalization parameter, i.e.
Definition: continuation_system.C:1136
libMesh::ContinuationSystem::newton_progress_check
bool newton_progress_check
True by default, the Newton progress check allows the Newton loop to exit if half the allowed iterati...
Definition: continuation_system.h:256
libMesh::ContinuationSystem::n_backtrack_steps
unsigned int n_backtrack_steps
Another scaling parameter suggested by the LOCA people.
Definition: continuation_system.h:202
libMesh::ContinuationSystem::apply_predictor
void apply_predictor()
Applies the predictor to the current solution to get a guess for the next solution.
Definition: continuation_system.C:1376
libMesh::ContinuationSystem::newton_step
unsigned int newton_step
Loop counter for nonlinear (Newton) iteration loop.
Definition: continuation_system.h:424
libMesh::ContinuationSystem::solution_tolerance
double solution_tolerance
How tightly should the Newton iterations attempt to converge ||delta_u|| Defaults to 1....
Definition: continuation_system.h:140
libMesh::NewtonSolver
This class defines a solver which uses the default libMesh linear solver in a quasiNewton method to h...
Definition: newton_solver.h:46
libMesh::ContinuationSystem::old_continuation_parameter
Real old_continuation_parameter
The system also keeps track of the old value of the continuation parameter.
Definition: continuation_system.h:161
libMesh::ContinuationSystem::save_current_solution
void save_current_solution()
Stores the current solution and continuation parameter (as "previous_u" and "old_continuation_paramet...
Definition: continuation_system.C:1365
libMesh::ContinuationSystem::clear
virtual void clear() override
Clear all the data structures associated with the system.
Definition: continuation_system.C:80
libMesh::EquationSystems
This is the EquationSystems class.
Definition: equation_systems.h:74
libMesh::ContinuationSystem::Parent
FEMSystem Parent
The type of the parent.
Definition: continuation_system.h:79
libMesh::ContinuationSystem::quiet
bool quiet
If quiet==false, the System prints extra information about what it is doing.
Definition: continuation_system.h:121
libMesh::System::name
const std::string & name() const
Definition: system.h:2067
libMesh::ContinuationSystem::newton_stepgrowth_aggressiveness
Real newton_stepgrowth_aggressiveness
A measure of how rapidly one should attempt to grow the arclength stepsize based on the number of New...
Definition: continuation_system.h:247
libMesh::ContinuationSystem::advance_arcstep
void advance_arcstep()
Call this function after a continuation solve to compute the tangent and get the next initial guess.
Definition: continuation_system.C:937
libMesh::ContinuationSystem::n_arclength_reductions
unsigned int n_arclength_reductions
Number of arclength reductions to try when Newton fails to reduce the residual.
Definition: continuation_system.h:209
libMesh::ContinuationSystem::Predictor
Predictor
The code provides the ability to select from different predictor schemes for getting the initial gues...
Definition: continuation_system.h:221
libMesh::ContinuationSystem::AB2
Second-order explicit Adams-Bashforth predictor.
Definition: continuation_system.h:230
libMesh::ContinuationSystem::initialize_tangent
void initialize_tangent()
Before starting arclength continuation, we need at least 2 prior solutions (both solution and u_previ...
Definition: continuation_system.C:131
libMesh::ContinuationSystem::ContinuationSystem
ContinuationSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
Definition: continuation_system.C:29
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::ContinuationSystem::rhs_mode
RHS_Mode rhs_mode
Definition: continuation_system.h:289
libMesh::ContinuationSystem::Theta
Real Theta
Arclength normalization parameter.
Definition: continuation_system.h:181
libMesh::ContinuationSystem::initial_newton_tolerance
double initial_newton_tolerance
How much to try to reduce the residual by at the first (inexact) Newton step.
Definition: continuation_system.h:147
libMesh::ContinuationSystem::set_Theta
void set_Theta()
A centralized function for setting the normalization parameter theta.
Definition: continuation_system.C:1066
libMesh::ContinuationSystem::continuation_parameter_tolerance
double continuation_parameter_tolerance
How tightly should the Newton iterations attempt to converge delta_lambda.
Definition: continuation_system.h:134
libMesh::ContinuationSystem::update_solution
void update_solution()
This function (which assumes the most recent tangent vector has been computed) updates the solution a...
Definition: continuation_system.C:1193
libMesh::ContinuationSystem
This class inherits from the FEMSystem.
Definition: continuation_system.h:55
libMesh::ContinuationSystem::previous_u
NumericVector< Number > * previous_u
The solution at the previous value of the continuation variable.
Definition: continuation_system.h:348
libMesh::ContinuationSystem::dlambda_ds
Real dlambda_ds
The most recent value of the derivative of the continuation parameter with respect to s.
Definition: continuation_system.h:396
libMesh::ContinuationSystem::newton_solver
NewtonSolver * newton_solver
A pointer to the underlying Newton solver used by the DiffSystem.
Definition: continuation_system.h:389