OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
AppFrame::NewtonLineSearch Class Reference

Application class performing Newton's iteration. More...

#include <newton_w_line_search.h>

Inheritance diagram for AppFrame::NewtonLineSearch:
Inheritance graph
[legend]
Collaboration diagram for AppFrame::NewtonLineSearch:
Collaboration graph
[legend]

Public Member Functions

 NewtonLineSearch (ApplicationBase &app)
 Constructor, receiving the application computing the residual and solving the linear problem.
 
virtual void declare_parameters (ParameterHandler &param)
 Declare the input parameters.
 
void _initialize (ParameterHandler &param)
 Read the parameters local to NewtonLineSearch.
 
virtual void initialize (ParameterHandler &param)
 Read the parameters.
 
virtual void solve (AppFrame::FEVector &u, const AppFrame::FEVectors &in_vectors)
 The actual Newton solver.
 
- Public Member Functions inherited from AppFrame::newtonBase
 newtonBase (ApplicationBase &app)
 Constructor, receiving the application computing the residual and solving the linear problem.
 
virtual void assemble ()
 Instead of assembling, this function only sets a flag, such that the inner application will be required to assemble a new derivative matrix next time solve() is called.
 
virtual double residual (AppFrame::FEVector &dst, const AppFrame::FEVectors &rhs)
 
void _initialize (ParameterHandler &param)
 Read the parameters local to newtonBase.
 
double threshold (double new_value)
 Set the maximal residual reduction allowed without triggering assembling in the next step.
 
void initialize_initial_guess (BlockVector< double > &dst)
 Control object for the Newton iteration.
 
- Public Member Functions inherited from AppFrame::ApplicationCopy
 ApplicationCopy (ApplicationBase &ex_app)
 Constructor for a derived application.
 
 ~ApplicationCopy ()
 
virtual void remesh ()
 Generates the next mesh depending on the mesh generation parameters.
 
virtual void init_vector (FEVector &dst) const
 Initialize vector to problem size.
 
virtual void start_vector (FEVector &dst, std::string caller) const
 Initialize vector to problem size.
 
virtual void Tsolve (FEVector &start, const FEVectors &rhs)
 Solve the dual system assembled with right hand side rhs and return the result in start.
 
virtual double estimate (const FEVectors &src)
 Error estimation.
 
virtual double evaluate (const FEVectors &src)
 Evaluate whatever the simulation was made for.
 
virtual void grid_out (const std::string &filename) const
 Write the mesh in the format specified by the ParameterHandler.
 
virtual void data_out (const std::string &filename, const FEVectors &src)
 Write data in the format specified by the ParameterHandler.
 
virtual std::string id () const
 Return a unique identification string for this application.
 
virtual void notify (const Event &reason)
 Add a reason for assembling.
 
- Public Member Functions inherited from AppFrame::ApplicationBase
 ApplicationBase (boost::shared_ptr< ApplicationData > ex_data=boost::shared_ptr< ApplicationData >())
 Constructor for an application.
 
 ApplicationBase (const ApplicationBase &other)
 Copy constructor.
 
virtual ~ApplicationBase ()
 Virtual destructor.
 
void print_parameters_to_file (ParameterHandler &param, const std::string &file_name, const ParameterHandler::OutputStyle &style)
 Print default parameters for the application to a file.
 
virtual double residual (FEVector &dst, const FEVectors &src, bool apply_boundaries=true)
 Compute residual of src and store it into dst.
 
virtual void data_out (const std::string &filename, const FEVectors &src, const std::vector< std::string >)
 
boost::shared_ptr
< ApplicationData
get_data ()
 Get access to the protected variable data.
 
const boost::shared_ptr
< ApplicationData
get_data () const
 Get read-only access to the protected variable data.
 
virtual void clear ()
 Reset the application class such that a call to initialize() is possible again and will produce the same result as if the object was fresh.
 
void clear_events ()
 Clear all notifications.
 

Static Public Attributes

static const AppFrame::Event bad_derivative
 The Event set by NewtonLineSearch if convergence is becoming bad and a new matrix should be assembled.
 
- Static Public Attributes inherited from AppFrame::newtonBase
static const AppFrame::Event bad_derivative
 The Event set by Jason if convergence is becoming bad and a new matrix should be assembled.
 

Private Attributes

double overrelax
 Value used to multiply \(\delta u\), the solution update, from the Newton algorithm during the first overrelax_steps iterations.
 
unsigned int overrelax_steps
 Number of iterations to which we apply overrelax.
 
bool line_search
 Do you want to use a line search at each step?
 

Additional Inherited Members

- Public Attributes inherited from AppFrame::newtonBase
ReductionControl control
 Control object for the Newton iteration.
 
double numIter
 
- Protected Member Functions inherited from AppFrame::ApplicationBase
void print_caller_name (const std::string &caller_name) const
 Print caller name.
 
- Protected Attributes inherited from AppFrame::newtonBase
ApplicationResidual default_residual
 Default residual object if the function ApplicationBase::residual() shoud be used.
 
SmartPointer< const Residualcompute_residual
 The Residual object.
 
bool assemble_now
 This flag is set by the function assemble(), indicating that the matrix must be assembled anew upon start.
 
double assemble_threshold
 Threshold for re-assembling matrix.
 
bool debug_solution
 Print updated solution after each step into file Newton_uNNN?
 
bool debug_update
 Print Newton update after each step into file Newton_dNNN?
 
bool debug_residual
 Print Newton residual after each step into file Newton_rNNN?
 
unsigned int debug
 Write debug output to #deallog; the higher the number, the more output.
 

Detailed Description

Application class performing Newton's iteration.

At each iteration a line search is performed using XX algorithm to enhance robustness of the algorithm and to improve convergence to a global solution. This class is based on the class Newton on AppFrame developed by Guido Kanschat

Author
Marc Secanell, 2007

Constructor & Destructor Documentation

AppFrame::NewtonLineSearch::NewtonLineSearch ( ApplicationBase app)

Constructor, receiving the application computing the residual and solving the linear problem.

Member Function Documentation

void AppFrame::NewtonLineSearch::_initialize ( ParameterHandler &  param)

Read the parameters local to NewtonLineSearch.

virtual void AppFrame::NewtonLineSearch::declare_parameters ( ParameterHandler &  param)
virtual

Declare the input parameters.

Reimplemented from AppFrame::newtonBase.

virtual void AppFrame::NewtonLineSearch::initialize ( ParameterHandler &  param)
virtual

Read the parameters.

Reimplemented from AppFrame::newtonBase.

virtual void AppFrame::NewtonLineSearch::solve ( AppFrame::FEVector u,
const AppFrame::FEVectors in_vectors 
)
virtual

The actual Newton solver.

Reimplemented from AppFrame::newtonBase.

Member Data Documentation

const AppFrame::Event AppFrame::NewtonLineSearch::bad_derivative
static

The Event set by NewtonLineSearch if convergence is becoming bad and a new matrix should be assembled.

bool AppFrame::NewtonLineSearch::line_search
private

Do you want to use a line search at each step?

double AppFrame::NewtonLineSearch::overrelax
private

Value used to multiply \(\delta u\), the solution update, from the Newton algorithm during the first overrelax_steps iterations.

We will multiply the first iteration by \(\alpha \delta u\), where \( \alpha \) is the value of overrelax and then the following iterations by \(it \alpha \delta u\) where \( it \) is the iteration number

unsigned int AppFrame::NewtonLineSearch::overrelax_steps
private

Number of iterations to which we apply overrelax.


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