libMesh
continuation_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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 namespace libMesh
27 {
28 
29 // Forward Declarations
30 template <typename T> class LinearSolver;
31 class NewtonSolver;
32 
54 {
55 public:
61  const std::string & name,
62  const unsigned int number);
63 
69  ContinuationSystem (const ContinuationSystem &) = delete;
73  virtual ~ContinuationSystem ();
74 
79 
83  typedef FEMSystem Parent;
84 
89  virtual void clear () override;
90 
94  virtual void solve () override;
95 
102  void continuation_solve();
103 
108  void advance_arcstep();
109 
120 
125  bool quiet;
126 
132  void set_max_arclength_stepsize(Real maxds) { ds=maxds; ds_current=maxds; }
133 
139 
145 
152 
160  void save_current_solution();
161 
166 
172 
179 
186 
193 
199  //Real tau;
200 
206  unsigned int n_backtrack_steps;
207 
214 
219 
225  enum Predictor {
230 
235 
240  };
241 
243 
252 
261 
262 protected:
267  virtual void init_data () override;
268 
292 
294 
295 
296 
297 private:
304  void initialize_tangent();
305 
309  void solve_tangent();
310 
316  void update_solution();
317 
321  void set_Theta();
322 
327  void set_Theta_LOCA();
328 
333  void apply_predictor();
334 
343 
348 
353 
358 
364 
369 
375 
380 
387 
394 
401 
407 
412 
417 
421  unsigned int newton_step;
422 };
423 
424 } // namespace libMesh
425 
426 #endif // LIBMESH_CONTINUATION_SYSTEM_H
This is the EquationSystems class.
double initial_newton_tolerance
How much to try to reduce the residual by at the first (inexact) Newton step.
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 clear() override
Clear all the data structures associated with the system.
double continuation_parameter_tolerance
How tightly should the Newton iterations attempt to converge delta_lambda.
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.
ContinuationSystem & operator=(const ContinuationSystem &)=delete
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" ...
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
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.
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.
unsigned int number() const
Definition: system.h:2269
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" ...
double solution_tolerance
How tightly should the Newton iterations attempt to converge ||delta_u|| Defaults to 1...
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.
virtual void solve() override
Perform a standard "solve" of the system, without doing continuation.
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...
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.
const std::string & name() const
Definition: system.h:2261
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...
virtual void init_data() override
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used...
Second-order explicit Adams-Bashforth predictor.
First-order Euler predictor.
unsigned int newton_step
Loop counter for nonlinear (Newton) iteration loop.