libMesh
continuation_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 () libmesh_override;
86 
90  virtual void solve () libmesh_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 () libmesh_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 
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
This is the EquationSystems class.
Real Theta
Arclength normalization parameter.
Real previous_dlambda_ds
The old parameter tangent value.
Real dlambda_ds
The most recent value of the derivative of the continuation parameter with respect to s...
void set_max_arclength_stepsize(Real maxds)
Sets (initializes) the max-allowable ds value and the current ds value.
NumericVector< Number > * previous_u
The solution at the previous value of the continuation variable.
virtual void solve() libmesh_override
Perform a standard "solve" of the system, without doing continuation.
UniquePtr< LinearSolver< Number > > linear_solver
We maintain our own linear solver interface, for solving custom systems of equations and/or things wh...
Real initial_newton_tolerance
How much to try to reduce the residual by at the first (inexact) Newton step.
Real old_continuation_parameter
The system also keeps track of the old value of the continuation parameter.
NumericVector< Number > * previous_du_ds
The value of du_ds from the previous solution.
Real * continuation_parameter
The continuation parameter must be a member variable of the derived class, and the "continuation_para...
NumericVector< Number > * delta_u
Temporary vector "delta u" ...
virtual void clear() libmesh_override
Clear all the data structures associated with the system.
Real solution_tolerance
How tightly should the Newton iterations attempt to converge ||delta_u|| Defaults to 1...
Predictor
The code provides the ability to select from different predictor schemes for getting the initial gues...
The libMesh namespace provides an interface to certain functionality in the library.
This class provides a specific system class.
Definition: fem_system.h:53
const std::string & name() const
Definition: system.h:1998
This class defines a solver which uses the default libMesh linear solver in a quasiNewton method to h...
Definition: newton_solver.h:46
void continuation_solve()
Perform a continuation solve of the system.
This class inherits from the FEMSystem.
void set_Theta_LOCA()
A centralized function for setting the other normalization parameter, i.e.
Real Theta_LOCA
Another normalization parameter, which is described in the LOCA manual.
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
Real ds_min
The minimum-allowed steplength, defaults to 1.e-8.
void advance_arcstep()
Call this function after a continuation solve to compute the tangent and get the next initial guess...
unsigned int n_arclength_reductions
Number of arclength reductions to try when Newton fails to reduce the residual.
bool tangent_initialized
False until initialize_tangent() is called.
NumericVector< Number > * du_ds
Extra work vectors used by the continuation algorithm.
Real max_continuation_parameter
The maximum-allowable value of the continuation parameter.
ContinuationSystem sys_type
The type of system.
NumericVector< Number > * z
Temporary vector "z" ...
NumericVector< Number > * y_old
Temporary vector "y_old" ...
NumericVector< Number > * y
Temporary vector "y" ...
Real ds
The initial arclength stepsize, selected by the user.
void apply_predictor()
Applies the predictor to the current solution to get a guess for the next solution.
Real newton_stepgrowth_aggressiveness
A measure of how rapidly one should attempt to grow the arclength stepsize based on the number of New...
bool quiet
If quiet==false, the System prints extra information about what it is doing.
Real previous_ds
The previous arcstep length used.
void set_Theta()
A centralized function for setting the normalization parameter theta.
ContinuationSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
Real min_continuation_parameter
The minimum-allowable value of the continuation parameter.
Real ds_current
Value of stepsize currently in use.
NewtonSolver * newton_solver
A pointer to the underlying Newton solver used by the DiffSystem.
void initialize_tangent()
Before starting arclength continuation, we need at least 2 prior solutions (both solution and u_previ...
void save_current_solution()
Stores the current solution and continuation parameter (as "previous_u" and "old_continuation_paramet...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RHS_Mode
There are (so far) two different vectors which may be assembled using the assembly routine: 1...
unsigned int number() const
Definition: system.h:2006
virtual void init_data() libmesh_override
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used...
virtual ~ContinuationSystem()
Destructor.
bool newton_progress_check
True by default, the Newton progress check allows the Newton loop to exit if half the allowed iterati...
unsigned int n_backtrack_steps
Another scaling parameter suggested by the LOCA people.
Real continuation_parameter_tolerance
How tightly should the Newton iterations attempt to converge delta_lambda.
void solve_tangent()
Special solve algorithm for solving the tangent system.
FEMSystem Parent
The type of the parent.
void update_solution()
This function (which assumes the most recent tangent vector has been computed) updates the solution a...
Second-order explicit Adams-Bashforth predictor.
First-order Euler predictor.
unsigned int newton_step
Loop counter for nonlinear (Newton) iteration loop.