KASKADE 7 development version
Classes | Public Types | Public Member Functions | List of all members
Kaskade::Giant< Grid, Equation, VariableSet, Spaces > Class Template Reference

Solution of a nonlinear system of equations by a damped Newton-method with adaptive precision control of the used iterative linear solver Gbit. More...

#include <giant_gbit.hh>

Detailed Description

template<class Grid, class Equation, class VariableSet, class Spaces>
class Kaskade::Giant< Grid, Equation, VariableSet, Spaces >

Solution of a nonlinear system of equations by a damped Newton-method with adaptive precision control of the used iterative linear solver Gbit.

Template Parameters
GridThe underlying Grid, eg. UGGrid, AlbertaGrid or some type of ALUGrid.
EquationThe name of the equation class, which defines the subclass DomainCache with d1, d2 and BoundaryCache with d1, d2.
VariableSetThe VariableSet of which representation-type is the Newton-iteration vector.
SpacesThe spaces used in the problem formulation.

Definition at line 305 of file giant_gbit.hh.

Classes

struct  NleqInfo
 

Public Types

enum  PrintLevel { none =0 , minimum =1 , verbose =2 , debug =3 }
 
enum  NonlinProblemType { mildlyNonlinear =2 , highlyNonlinear =3 , extremelyNonlinear =4 }
 
enum  AdaptMode { standardMode =0 , quadraticMode =1 }
 

Public Member Functions

 Giant ()
 
void setTolerance (double tol_)
 Sets the error tolerance which the final approximate solution \(x_k\) must fit. The default value is 1.0e-5. More...
 
void setNonlinProblemType (NonlinProblemType nonlinType_)
 Set the classification of the nonlinear problem. The default value is highlyNonlinear. More...
 
void setSafetyFactor (double safetyFactor_)
 Sets the safety factor for the precision control within the linear solver Gbit. The default value is 0.25. More...
 
void setMaximumNoIterations (int maximumIter_)
 Sets the maximum allowed number of Newton-iterations. The default value is 50. More...
 
void setPreconFillLevel (int preconFillLevel_)
 Sets the fillin-level of the preconditioner PrecondType::ILUK. The default fillin-level is 0. More...
 
void setRestricted (bool restricted_)
 Sets the restricted monotonicity-test flag. The default value depends on the selected NonlinProblemType. More...
 
void setAdaptMode (AdaptMode adaptMode_)
 Sets the adapt-mode (linear solver precision control). The default adapt-mode is standardMode. More...
 
void setErrorStream (std::ostream &errorStream_)
 Sets the error-output stream. The default error-output stream is std::cerr. More...
 
void setMonitorStream (std::ostream &monitorStream_)
 Sets the monitor-output stream. The default monitor-output stream is std::cout. More...
 
void setErrorLevel (PrintLevel errorLevel_)
 Sets the error-output level. The default error-output level is verbose. More...
 
void setMonitorLevel (PrintLevel monitorLevel_)
 Sets the monitor-output level. The default monitor-output level is none. More...
 
void setDataLevel (PrintLevel dataLevel_)
 Sets the plot-data-output level. The default plot-data-output level is none. More...
 
void setStatistics (bool statistics_)
 Sets the Timings statistics flag. The default Timings statistics flag level is off. More...
 
void setOutFilePrefix (const std::string &outFilePrefix_)
 Sets the prefix of the output-files named <prefix>nnn.vtu, where n denotes a decimal digit. The default-prefix is iter_ . More...
 
void setScalingVector (std::vector< double > *scale_)
 Sets a user-defined scaling-threshold vector. More...
 
struct NleqInfo getInfo ()
 After calling giantGbit, getInfo returns the info structure contents. More...
 
void giantGbit (GridManager< Grid > &gridManager, Equation &eq, VariableSet const &variableSet, typename VariableSet::VariableSet *x, Spaces const &spaces, Timings &timer=Timings::instance())
 Calls the giantGbit inexact damped Newton-iteration solver. More...
 

Member Enumeration Documentation

◆ AdaptMode

template<class Grid , class Equation , class VariableSet , class Spaces >
enum Kaskade::Giant::AdaptMode

The mode of controlling the required precision of the iterative linear solver.

Enumerator
standardMode 

standard precision control strategy

quadraticMode 

quadratic mode precision control strategy

Definition at line 329 of file giant_gbit.hh.

◆ NonlinProblemType

template<class Grid , class Equation , class VariableSet , class Spaces >
enum Kaskade::Giant::NonlinProblemType

The nonlinearity-level of the problem to be solved.

Enumerator
mildlyNonlinear 

problem is mildly nonlinear

highlyNonlinear 

problem is highly nonlinear

extremelyNonlinear 

problem is extremely nonlinear

Definition at line 319 of file giant_gbit.hh.

◆ PrintLevel

template<class Grid , class Equation , class VariableSet , class Spaces >
enum Kaskade::Giant::PrintLevel

The level of error-, monitor- and data-output.

Enumerator
none 

no output

minimum 

summary output

verbose 

detailed output - info about each iterate

debug 

additional debug output - reserved for future use

Definition at line 308 of file giant_gbit.hh.

Constructor & Destructor Documentation

◆ Giant()

template<class Grid , class Equation , class VariableSet , class Spaces >
Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::Giant ( )
inline

Definition at line 396 of file giant_gbit.hh.

Member Function Documentation

◆ getInfo()

template<class Grid , class Equation , class VariableSet , class Spaces >
struct NleqInfo Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::getInfo ( )
inline

After calling giantGbit, getInfo returns the info structure contents.

Definition at line 542 of file giant_gbit.hh.

◆ giantGbit()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::giantGbit ( GridManager< Grid > &  gridManager,
Equation &  eq,
VariableSet const &  variableSet,
typename VariableSet::VariableSet x,
Spaces const &  spaces,
Timings timer = Timings::instance() 
)
inline

Calls the giantGbit inexact damped Newton-iteration solver.

Parameters
gridManagerThe GridManager where the Grid is associated to.
eqThe weak formulation class instance with the problem- and Jacobian functions.
variableSetThe underlying VariableSet.
xOn input, the start-vector for the damped Newton-iteration.
On output, the approximate solution vector \( x_k \), which fits the error condition \( \parallel x_k - x\star \parallel <= tol \) , where \( x\star \) denotes the exact solution, and \( \parallel \ldots \parallel \) is a scaled Euclidian norm.
spacesThe underlying problem spaces.

Definition at line 556 of file giant_gbit.hh.

◆ setAdaptMode()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setAdaptMode ( AdaptMode  adaptMode_)
inline

Sets the adapt-mode (linear solver precision control). The default adapt-mode is standardMode.

Parameters
adaptMode_The desired adapt-mode. Valid values are standardMode and quadraticMode.

Definition at line 478 of file giant_gbit.hh.

◆ setDataLevel()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setDataLevel ( PrintLevel  dataLevel_)
inline

Sets the plot-data-output level. The default plot-data-output level is none.

Parameters
dataLevel_The desired plot-data-output level.

Definition at line 513 of file giant_gbit.hh.

◆ setErrorLevel()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setErrorLevel ( PrintLevel  errorLevel_)
inline

Sets the error-output level. The default error-output level is verbose.

Parameters
errorLevel_The desired error-output level.

Definition at line 499 of file giant_gbit.hh.

◆ setErrorStream()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setErrorStream ( std::ostream &  errorStream_)
inline

Sets the error-output stream. The default error-output stream is std::cerr.

Parameters
errorStream_The desired error-output stream.

Definition at line 485 of file giant_gbit.hh.

◆ setMaximumNoIterations()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setMaximumNoIterations ( int  maximumIter_)
inline

Sets the maximum allowed number of Newton-iterations. The default value is 50.

Parameters
maximumIter_The desired maximum number of Newton-iterations.

Definition at line 447 of file giant_gbit.hh.

◆ setMonitorLevel()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setMonitorLevel ( PrintLevel  monitorLevel_)
inline

Sets the monitor-output level. The default monitor-output level is none.

Parameters
monitorLevel_The desired monitor-output level.

Definition at line 506 of file giant_gbit.hh.

◆ setMonitorStream()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setMonitorStream ( std::ostream &  monitorStream_)
inline

Sets the monitor-output stream. The default monitor-output stream is std::cout.

Parameters
monitorStream_The desired monitor-output stream.

Definition at line 492 of file giant_gbit.hh.

◆ setNonlinProblemType()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setNonlinProblemType ( NonlinProblemType  nonlinType_)
inline

Set the classification of the nonlinear problem. The default value is highlyNonlinear.

Parameters
nonlinType_The following classifications may be used:
mildlyNonlinear: The problem is considered to be mildly nonlinear and NleqSolver starts up with dampingfactor=1.
highlyNonlinear: The problem is considered to be highly nonlinear and NleqSolver starts up with dampingfactor=1.0e-4.
extremelyNonlinear: The problem is considered to be extremely nonlinear and NleqSolver starts up with dampingfactor=1.0e-6. Moreover, restricted is set automatically to true.

Definition at line 434 of file giant_gbit.hh.

◆ setOutFilePrefix()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setOutFilePrefix ( const std::string &  outFilePrefix_)
inline

Sets the prefix of the output-files named <prefix>nnn.vtu, where n denotes a decimal digit. The default-prefix is iter_ .

Parameters
outFilePrefix_The desired filename-prefix.

Definition at line 527 of file giant_gbit.hh.

◆ setPreconFillLevel()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setPreconFillLevel ( int  preconFillLevel_)
inline

Sets the fillin-level of the preconditioner PrecondType::ILUK. The default fillin-level is 0.

Parameters
preconFillLevel_The desired PrecondType::ILUK fillin-level.

Definition at line 453 of file giant_gbit.hh.

◆ setRestricted()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setRestricted ( bool  restricted_)
inline

Sets the restricted monotonicity-test flag. The default value depends on the selected NonlinProblemType.

Parameters
restricted_true means the the restricted damping-strategy is applied.
This means, that the restricted monotonicity test will be applied for determination whether the next iterate (and the associate damping factor lambda) will be accepted. With \( \theta = \parallel \overline{\Delta x}_{k+1} \parallel / \parallel \Delta x_{k} \parallel \), (where \( \Delta x_{k} \) denotes the k-th Newton correction, and \( \overline{\Delta x}_{k+1} \) denotes the sucessive simplified Newton correction) the condition \( \theta <= 1 - \lambda / 4 \) must be fit.
If set to false, then the standard monotonicity test will be applied, i.e. the following condition must be fit: \( \theta < 1 \) .

Definition at line 470 of file giant_gbit.hh.

◆ setSafetyFactor()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setSafetyFactor ( double  safetyFactor_)
inline

Sets the safety factor for the precision control within the linear solver Gbit. The default value is 0.25.

Parameters
safetyFactor_The desired safety factor.

Definition at line 441 of file giant_gbit.hh.

◆ setScalingVector()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setScalingVector ( std::vector< double > *  scale_)
inline

Sets a user-defined scaling-threshold vector.

Parameters
*scale_A pointer to the selected scaling-threshold vector.

Definition at line 533 of file giant_gbit.hh.

◆ setStatistics()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setStatistics ( bool  statistics_)
inline

Sets the Timings statistics flag. The default Timings statistics flag level is off.

Parameters
statistics_false=off, true=on.

Definition at line 520 of file giant_gbit.hh.

◆ setTolerance()

template<class Grid , class Equation , class VariableSet , class Spaces >
void Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::setTolerance ( double  tol_)
inline

Sets the error tolerance which the final approximate solution \(x_k\) must fit. The default value is 1.0e-5.

Parameters
tol_The desired error for the solution.

Definition at line 420 of file giant_gbit.hh.


The documentation for this class was generated from the following file: