ug4
|
Newton solver for assembling based discretizations. More...
#include <newton.h>
Public Types | |
typedef TAlgebra | algebra_type |
Algebra type. More... | |
typedef TAlgebra::matrix_type | matrix_type |
Matrix type. More... | |
typedef TAlgebra::vector_type | vector_type |
Vector type. More... | |
Public Types inherited from ug::IOperatorInverse< TAlgebra::vector_type > | |
typedef TAlgebra::vector_type | codomain_function_type |
Range space. More... | |
typedef TAlgebra::vector_type | domain_function_type |
Domain space. More... | |
Public Types inherited from ug::DebugWritingObject< TAlgebra > | |
typedef TAlgebra | algebra_type |
type of algebra More... | |
typedef TAlgebra::matrix_type | matrix_type |
type of matrix More... | |
typedef TAlgebra::vector_type | vector_type |
type of vector More... | |
Public Types inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
typedef TAlgebra::vector_type | vector_type |
type of vector More... | |
Public Member Functions | |
void | add_inner_step_update (SmartPtr< INewtonUpdate > NU) |
add inner step update (applied before every linear solver step) More... | |
void | add_step_update (SmartPtr< INewtonUpdate > NU) |
add outer step update (applied before every Newton step) More... | |
virtual bool | apply (vector_type &u) |
apply Operator, i.e. N^{-1}(0) = u More... | |
void | clear_average_convergence () |
resets average linear solver convergence More... | |
void | clear_inner_step_update (SmartPtr< INewtonUpdate > NU) |
clears inner step update More... | |
void | clear_step_update (SmartPtr< INewtonUpdate > NU) |
clears outer step update More... | |
virtual std::string | config_string () const |
returns information about configuration parameters More... | |
void | disable_line_search () |
virtual bool | init (SmartPtr< IOperator< vector_type > > N) |
This operator inverts the Operator N: Y -> X. More... | |
SmartPtr< ILineSearch< vector_type > > | line_search () |
NewtonSolver () | |
default constructor More... | |
NewtonSolver (SmartPtr< IAssemble< TAlgebra > > spAss) | |
constructor using assembling More... | |
NewtonSolver (SmartPtr< ILinearOperatorInverse< vector_type > > LinearSolver, SmartPtr< IConvergenceCheck< vector_type > > spConvCheck, SmartPtr< ILineSearch< vector_type > > spLineSearch) | |
constructor More... | |
NewtonSolver (SmartPtr< IOperator< vector_type > > N) | |
constructor setting operator More... | |
virtual bool | prepare (vector_type &u) |
prepare Operator More... | |
void | print_average_convergence () const |
prints average linear solver convergence More... | |
void | set_convergence_check (SmartPtr< IConvergenceCheck< vector_type > > spConvCheck) |
sets the convergence check More... | |
void | set_line_search (SmartPtr< ILineSearch< vector_type > > spLineSearch) |
sets the line search More... | |
void | set_linear_solver (SmartPtr< ILinearOperatorInverse< vector_type > > LinearSolver) |
sets the linear solver More... | |
void | set_reassemble_J_freq (int freq) |
sets the frequency of reassembling of the Jacobian (0 == 1 == in every step, i.e. classically) More... | |
size_t | num_newton_steps () const |
int | num_linsolver_calls (size_t call) const |
int | num_linsolver_steps (size_t call) const |
double | average_linear_steps (size_t call) const |
int | total_linsolver_calls () const |
int | total_linsolver_steps () const |
double | total_average_linear_steps () const |
int | last_num_newton_steps () const |
Public Member Functions inherited from ug::IOperatorInverse< TAlgebra::vector_type > | |
virtual bool | init (SmartPtr< IOperator< TAlgebra::vector_type, TAlgebra::vector_type > > N)=0 |
initializes the operator for the inversion of the operator N: Y -> X More... | |
virtual | ~IOperatorInverse () |
virtual destructor More... | |
Public Member Functions inherited from ug::DebugWritingObject< TAlgebra > | |
SmartPtr< IDebugWriter< algebra_type > > | debug_writer () |
returns the debug writer More... | |
ConstSmartPtr< IDebugWriter< algebra_type > > | debug_writer () const |
bool | debug_writer_valid () const |
returns true if the debug writer is set More... | |
DebugWritingObject () | |
DebugWritingObject (const DebugWritingObject< algebra_type > &parent) | |
clone constructor More... | |
DebugWritingObject (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter) | |
virtual void | set_debug (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter) |
set debug writer More... | |
virtual | ~DebugWritingObject () |
virtual destructor More... | |
Public Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
virtual void | set_debug (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter) |
set debug writer More... | |
SmartPtr< IVectorDebugWriter< vector_type > > | vector_debug_writer () |
returns the debug writer More... | |
ConstSmartPtr< IVectorDebugWriter< vector_type > > | vector_debug_writer () const |
bool | vector_debug_writer_valid () const |
returns true if the debug writer is set More... | |
VectorDebugWritingObject () | |
VectorDebugWritingObject (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter) | |
void | write_debug (const vector_type &vec, const char *filename) |
writing debug output for a vector (if debug writer set) More... | |
virtual | ~VectorDebugWritingObject () |
virtual destructor More... | |
Private Member Functions | |
void | write_debug (const vector_type &vec, std::string filename) |
void | write_debug (const matrix_type &mat, std::string filename) |
Private Attributes | |
int | m_dgbCall |
call counter More... | |
std::vector< SmartPtr< INewtonUpdate > > | m_innerStepUpdate |
Update. More... | |
SmartPtr< AssembledLinearOperator< algebra_type > > | m_J |
jacobi operator More... | |
int | m_lastNumSteps |
SmartPtr< AssembledOperator< algebra_type > > | m_N |
assembling routine More... | |
int | m_reassembe_J_freq |
how often to reassemble the Jacobian (0 == 1 == in every step, i.e. classically) More... | |
SmartPtr< IAssemble< TAlgebra > > | m_spAss |
assembling More... | |
SmartPtr< IConvergenceCheck< vector_type > > | m_spConvCheck |
Convergence Check. More... | |
SmartPtr< ILinearOperatorInverse< vector_type > > | m_spLinearSolver |
linear solver More... | |
SmartPtr< ILineSearch< vector_type > > | m_spLineSearch |
LineSearch. More... | |
std::vector< SmartPtr< INewtonUpdate > > | m_stepUpdate |
std::vector< int > | m_vTotalLinSolverSteps |
std::vector< int > | m_vLinSolverCalls |
std::vector< number > | m_vNonLinSolverRates |
std::vector< number > | m_vLinSolverRates |
Additional Inherited Members | |
Protected Member Functions inherited from ug::DebugWritingObject< TAlgebra > | |
void | enter_debug_writer_section (const char *secDir) |
enters a debugging section More... | |
void | enter_debug_writer_section (std::string secDir) |
enters a debugging section More... | |
void | leave_debug_writer_section () |
leaves a debugging section More... | |
void | write_debug (const matrix_type &mat, const char *filename) |
write debug output for a matrix (if debug writer set) More... | |
void | write_debug (const matrix_type &mat, std::string name) |
write debug output for a matrix (if debug writer set) More... | |
Protected Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
void | enter_vector_debug_writer_section (const char *secDir) |
enters a debugging section More... | |
void | enter_vector_debug_writer_section (std::string secDir) |
enters a debugging section More... | |
void | leave_vector_debug_writer_section () |
leaves a debugging section More... | |
void | print_debugger_message (const char *msg) |
prints a debugger message (listing all the sections) More... | |
void | print_debugger_message (std::string msg) |
prints a debugger message (listing all the sections) More... | |
Protected Attributes inherited from ug::DebugWritingObject< TAlgebra > | |
SmartPtr< IDebugWriter< algebra_type > > | m_spDebugWriter |
Debug Writer. More... | |
Protected Attributes inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
SmartPtr< IVectorDebugWriter< vector_type > > | m_spVectorDebugWriter |
Debug Writer. More... | |
Newton solver for assembling based discretizations.
typedef TAlgebra ug::NewtonSolver< TAlgebra >::algebra_type |
Algebra type.
typedef TAlgebra::matrix_type ug::NewtonSolver< TAlgebra >::matrix_type |
Matrix type.
typedef TAlgebra::vector_type ug::NewtonSolver< TAlgebra >::vector_type |
Vector type.
ug::NewtonSolver< TAlgebra >::NewtonSolver | ( | SmartPtr< IOperator< vector_type > > | N | ) |
constructor setting operator
References ug::NewtonSolver< TAlgebra >::init(), and new().
ug::NewtonSolver< TAlgebra >::NewtonSolver | ( | SmartPtr< IAssemble< TAlgebra > > | spAss | ) |
constructor using assembling
References ug::NewtonSolver< TAlgebra >::m_N, ug::NewtonSolver< TAlgebra >::m_spAss, and new().
ug::NewtonSolver< TAlgebra >::NewtonSolver |
default constructor
References new().
ug::NewtonSolver< TAlgebra >::NewtonSolver | ( | SmartPtr< ILinearOperatorInverse< vector_type > > | LinearSolver, |
SmartPtr< IConvergenceCheck< vector_type > > | spConvCheck, | ||
SmartPtr< ILineSearch< vector_type > > | spLineSearch | ||
) |
constructor
|
inline |
add inner step update (applied before every linear solver step)
References ug::NewtonSolver< TAlgebra >::m_innerStepUpdate.
|
inline |
add outer step update (applied before every Newton step)
References ug::NewtonSolver< TAlgebra >::m_stepUpdate.
|
virtual |
apply Operator, i.e. N^{-1}(0) = u
Implements ug::IOperatorInverse< TAlgebra::vector_type >.
References make_sp(), NEWTON_PROFILE_BEGIN, NEWTON_PROFILE_END, UG_CATCH_THROW, UG_LOG, and UG_THROW.
double ug::NewtonSolver< TAlgebra >::average_linear_steps | ( | size_t | call | ) | const |
information on convergence history
void ug::NewtonSolver< TAlgebra >::clear_average_convergence |
resets average linear solver convergence
|
inline |
clears inner step update
References ug::NewtonSolver< TAlgebra >::m_innerStepUpdate.
|
inline |
clears outer step update
References ug::NewtonSolver< TAlgebra >::m_stepUpdate.
|
virtual |
returns information about configuration parameters
this should return necessary information about parameters and possibly calling config_string of subcomponents.
Implements ug::IOperatorInverse< TAlgebra::vector_type >.
References ug::ConfigShift().
|
inline |
References ug::NewtonSolver< TAlgebra >::m_spLineSearch, and SPNULL.
|
virtual |
This operator inverts the Operator N: Y -> X.
References NEWTON_PROFILE_BEGIN, and UG_THROW.
Referenced by ug::NewtonSolver< TAlgebra >::NewtonSolver().
|
inline |
information on convergence history
References ug::NewtonSolver< TAlgebra >::m_lastNumSteps.
|
inline |
References ug::NewtonSolver< TAlgebra >::m_spLineSearch.
int ug::NewtonSolver< TAlgebra >::num_linsolver_calls | ( | size_t | call | ) | const |
information on convergence history
int ug::NewtonSolver< TAlgebra >::num_linsolver_steps | ( | size_t | call | ) | const |
information on convergence history
size_t ug::NewtonSolver< TAlgebra >::num_newton_steps |
information on convergence history
|
virtual |
prepare Operator
Implements ug::IOperatorInverse< TAlgebra::vector_type >.
void ug::NewtonSolver< TAlgebra >::print_average_convergence |
prints average linear solver convergence
References UG_LOG.
void ug::NewtonSolver< TAlgebra >::set_convergence_check | ( | SmartPtr< IConvergenceCheck< vector_type > > | spConvCheck | ) |
sets the convergence check
|
inline |
sets the line search
References ug::NewtonSolver< TAlgebra >::m_spLineSearch.
|
inline |
sets the linear solver
References ug::NewtonSolver< TAlgebra >::m_spLinearSolver.
|
inline |
sets the frequency of reassembling of the Jacobian (0 == 1 == in every step, i.e. classically)
References ug::NewtonSolver< TAlgebra >::m_reassembe_J_freq.
double ug::NewtonSolver< TAlgebra >::total_average_linear_steps |
information on convergence history
int ug::NewtonSolver< TAlgebra >::total_linsolver_calls |
information on convergence history
int ug::NewtonSolver< TAlgebra >::total_linsolver_steps |
information on convergence history
|
private |
help functions for debug output
References name.
|
privatevirtual |
help functions for debug output
Reimplemented from ug::VectorDebugWritingObject< TAlgebra::vector_type >.
References name.
|
private |
call counter
|
private |
Update.
Referenced by ug::NewtonSolver< TAlgebra >::add_inner_step_update(), and ug::NewtonSolver< TAlgebra >::clear_inner_step_update().
|
private |
jacobi operator
|
private |
Referenced by ug::NewtonSolver< TAlgebra >::last_num_newton_steps().
|
private |
assembling routine
Referenced by ug::NewtonSolver< TAlgebra >::NewtonSolver().
|
private |
how often to reassemble the Jacobian (0 == 1 == in every step, i.e. classically)
Referenced by ug::NewtonSolver< TAlgebra >::set_reassemble_J_freq().
|
private |
assembling
Referenced by ug::NewtonSolver< TAlgebra >::NewtonSolver().
|
private |
Convergence Check.
|
private |
linear solver
Referenced by ug::NewtonSolver< TAlgebra >::set_linear_solver().
|
private |
|
private |
|
private |
convergence history of linear solver
|
private |
convergence history of linear solver
|
private |
convergence history of linear solver
|
private |
convergence history of linear solver