HermesCommon  3.0
Hermes::Solvers::NewtonMatrixSolver< Scalar > Class Template Reference
+ Inheritance diagram for Hermes::Solvers::NewtonMatrixSolver< Scalar >:

Protected Member Functions

virtual double update_solution_return_change_norm (Scalar *linear_system_solution)
 
virtual NonlinearConvergenceState get_convergence_state ()
 Find out the convergence state.
 
void init_newton ()
 
std::string getClassName () const
 State querying helpers.
 
- Protected Member Functions inherited from Hermes::Solvers::NonlinearMatrixSolver< Scalar >
bool force_reuse_jacobian_values (unsigned int &successful_steps_with_reused_jacobian)
 For deciding if the jacobian is reused at this point.
 
bool jacobian_reused_okay (unsigned int &successful_steps_with_reused_jacobian)
 For deciding if the reused jacobian did not bring residual increase at this point.
 
virtual void assemble_residual (bool store_previous_residual)=0
 
virtual bool assemble_jacobian (bool store_previous_jacobian)=0
 
virtual bool assemble (bool store_previous_jacobian, bool store_previous_residual)=0
 
virtual void on_damping_factor_updated ()
 
virtual void on_reused_jacobian_step_begin ()
 
virtual void on_reused_jacobian_step_end ()
 
virtual bool handle_convergence_state_return_finished (NonlinearConvergenceState state)
 
virtual void init_solving (Scalar *coeff_vec)
 
bool do_initial_step_return_finished ()
 Initial step.
 
virtual void solve_linear_system ()
 Solve the step's linear system.
 
void finalize_solving ()
 Internal.
 
virtual void deinit_solving ()
 Internal.
 
bool calculate_damping_factor (unsigned int &successful_steps)
 Calculates the new_ damping coefficient.
 
virtual bool damping_factor_condition ()
 Returns iff the damping factor condition is fulfilled.
 
int get_current_iteration_number ()
 Shortcut method for getting the current iteration.
 
void step_info ()
 Output info about the step.
 
virtual double calculate_residual_norm ()
 Norm for convergence.
 
virtual bool isOkay () const
 State querying helpers.
 
std::string getClassName () const
 Get class name, for the purpose of messaging.
 
void init_nonlinear ()
 Shared code for constructors.
 
const OutputParameterUnsignedIntiteration () const
 
const OutputParameterDoubleVectorresidual_norms () const
 
const OutputParameterDoubleVectorsolution_norms () const
 
const OutputParameterDoubleVectorsolution_change_norms () const
 
const OutputParameterUnsignedIntsuccessful_steps_damping () const
 
const OutputParameterUnsignedIntsuccessful_steps_jacobian () const
 
const OutputParameterDoubleVectordamping_factors () const
 
const OutputParameterBoolresidual_norm_drop () const
 
const OutputParameterBoolVectoriterations_with_recalculated_jacobian () const
 
- Protected Member Functions inherited from Hermes::Solvers::MatrixSolver< Scalar >
void handle_UMFPACK_reports ()
 This is not used now.
 
- Protected Member Functions inherited from Hermes::Mixins::Loggable
void hermes_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream) const
 
void hermes_fread (void *ptr, size_t size, size_t nitems, FILE *stream) const
 
- Protected Member Functions inherited from Hermes::Mixins::OutputAttachable
template<typename T >
void set_parameter_value (Parameter< T > &parameter, T *value)
 

Additional Inherited Members

- Public Types inherited from Hermes::Solvers::MatrixSolver< Scalar >
enum  UMFPACK_reporting_data_value { FactorizationSize = 0, PeakMemoryUsage = 1, Flops = 2 }
 Data values (types) for UMFPACK reporting.
 
- Public Types inherited from Hermes::Mixins::TimeMeasurable
enum  TimerPeriodTickType { HERMES_ACCUMULATE, HERMES_SKIP }
 Tick type. Used by the class Hermes::TimePeriod. More...
 
- Public Member Functions inherited from Hermes::Solvers::NonlinearMatrixSolver< Scalar >
virtual void solve (Scalar *coeff_vec)
 
void set_max_allowed_iterations (int max_allowed_iterations)
 Set the maximum number of iterations, thus co-determine when to stop iterations.
 
virtual void clear_tolerances ()
 Clear (reset) all tolerances.
 
void set_max_allowed_residual_norm (double max_allowed_residual_norm_to_set)
 
void set_tolerance (double newton_tol, NonlinearConvergenceMeasurementType toleranceType, bool handleMultipleTolerancesAnd=false)
 
int get_num_iters () const
 Get the number of iterations.
 
void set_min_allowed_damping_coeff (double min_allowed_damping_coeff_to_set)
 
void set_manual_damping_coeff (bool onOff, double coeff)
 
void set_initial_auto_damping_coeff (double coeff)
 
void set_auto_damping_ratio (double ratio)
 
void set_sufficient_improvement_factor (double ratio)
 
void set_necessary_successful_steps_to_increase (unsigned int steps)
 
void set_sufficient_improvement_factor_jacobian (double ratio)
 
void set_max_steps_with_reused_jacobian (unsigned int steps)
 
virtual void free ()
 Frees the instances.
 
- Public Member Functions inherited from Hermes::Solvers::MatrixSolver< Scalar >
 MatrixSolver (bool force_use_direct_solver=false)
 
virtual Scalar * get_sln_vector ()
 Return the solution vector.
 
void set_jacobian_constant (bool to_set=true)
 Sets the jacobian to be constant, i.e. reused whenever possible.
 
virtual LinearMatrixSolver
< Scalar > * 
get_linear_matrix_solver ()
 
virtual void set_UMFPACK_output (bool to_set=true, bool with_output=false)
 
virtual double get_UMFPACK_reporting_data (UMFPACK_reporting_data_value data_value)
 
SparseMatrix< Scalar > * get_jacobian ()
 Only a shortcut for algebraic solver (->) get_matrix().
 
Vector< Scalar > * get_residual ()
 Only a shortcut for algebraic solver (->) get_rhs().
 
virtual void set_verbose_output (bool to_set)
 Verbose output.
 
- Public Member Functions inherited from Hermes::Mixins::Loggable
 Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL, bool add_newline=true)
 
void set_file_output_only (bool onOff)
 
void set_timestamps (bool onOff)
 Sets the addition of a time stamp on each line in the log file. By default it is on.
 
void set_erase_on_beginning (bool onOff)
 Sets the logFile being always erased before logging.
 
void set_logFile_name (const char *filename)
 
void set_logFile_name (std::string filename)
 
void info (const char *msg,...) const
 
void info_if (bool cond, const char *msg,...) const
 
void warn (const char *msg,...) const
 
void warn_if (bool cond, const char *msg,...) const
 
void error (const char *msg,...) const
 
void error_if (bool cond, const char *msg,...) const
 
bool get_verbose_output () const
 Returns the current value of verbose_output;.
 
virtual void set_verbose_callback (callbackFn callback)
 
callbackFn get_verbose_callback () const
 Returns the current value of verbose_callback;.
 
- Public Member Functions inherited from Hermes::Mixins::OutputAttachable
virtual bool on_initialization ()
 
virtual bool on_step_begin ()
 
virtual bool on_initial_step_end ()
 
virtual bool on_step_end ()
 
virtual bool on_finish ()
 
template<typename T >
const T & get_parameter_value (const Parameter< T > &parameter)
 
template<typename T >
T & get_parameter_value (Parameter< T > &parameter)
 
- Public Member Functions inherited from Hermes::Mixins::StateQueryable
void check () const
 Method to handle the state.
 
- Public Member Functions inherited from Hermes::Mixins::TimeMeasurable
 TimeMeasurable (const char *name=nullptr)
 Constructs internal structures and starts measuring.
 
const TimeMeasurablereset ()
 Resets accumulated time.
 
const TimeMeasurabletick_reset ()
 Starts a new_ period and resets accumulated time.
 
const TimeMeasurabletick (TimeMeasurable::TimerPeriodTickType type=HERMES_ACCUMULATE)
 Starts/ends a new_ period.
 
const std::string & name () const
 Returns a name of the time period if any.
 
double accumulated () const
 Returns accumulated time (in seconds).
 
std::string accumulated_str () const
 Returns accumulated time in human readable form.
 
double last () const
 Returns last measured period (in seconds). More...
 
std::string last_str () const
 Returns last measured period in human readable form.
 
- Static Public Member Functions inherited from Hermes::Mixins::Loggable
static void set_static_logFile_name (const char *filename)
 
static void set_static_logFile_name (std::string filename)
 
- Public Attributes inherited from Hermes::Solvers::MatrixSolver< Scalar >
Scalar * sln_vector
 The solution vector.
 
- Public Attributes inherited from Hermes::Mixins::Loggable
char * logFileName
 Logfile name.
 
- Static Public Attributes inherited from Hermes::Mixins::Loggable
static char * staticLogFileName = nullptr
 
- Protected Attributes inherited from Hermes::Solvers::NonlinearMatrixSolver< Scalar >
bool manual_damping
 Manual / auto.
 
double manual_damping_factor
 Manual.
 
double auto_damping_ratio
 
double initial_auto_damping_factor
 The initial (and maximum) damping coefficient.
 
double sufficient_improvement_factor
 Sufficient improvement for continuing.
 
unsigned int necessary_successful_steps_to_increase
 necessary number of steps to increase back the damping coeff.
 
double min_allowed_damping_coeff
 Minimum allowed damping coeff.
 
double sufficient_improvement_factor_jacobian
 
unsigned int max_steps_with_reused_jacobian
 
Vector< Scalar > * residual_back
 Backup vector for unsuccessful reuse of Jacobian.
 
double max_allowed_residual_norm
 
int max_allowed_iterations
 Maximum number of iterations allowed.
 
double tolerance [NonlinearConvergenceMeasurementTypeCount]
 Tolerances for all NonlinearConvergenceMeasurementType numbered sequentially as the enum NonlinearConvergenceMeasurementType is.
 
bool tolerance_set [NonlinearConvergenceMeasurementTypeCount]
 info about set tolerances.
 
bool handleMultipleTolerancesAnd
 
int num_iters
 To be filled and returned on demand.
 
SparseMatrix< Scalar > * previous_jacobian
 Previous structures (e.g. in Picard's residual calculation)
 
Vector< Scalar > * previous_residual
 
OutputParameterDoubleVector p_residual_norms
 
OutputParameterDoubleVector p_solution_norms
 
OutputParameterDoubleVector p_solution_change_norms
 
OutputParameterBoolVector p_iterations_with_recalculated_jacobian
 
OutputParameterUnsignedInt p_successful_steps_damping
 
OutputParameterUnsignedInt p_successful_steps_jacobian
 
OutputParameterDoubleVector p_damping_factors
 
OutputParameterBool p_residual_norm_drop
 
OutputParameterUnsignedInt p_iteration
 
Scalar * previous_sln_vector
 
bool use_initial_guess_for_iterative_solvers
 
- Protected Attributes inherited from Hermes::Solvers::MatrixSolver< Scalar >
Hermes::Solvers::LinearMatrixSolver
< Scalar > * 
linear_matrix_solver
 Linear solver.
 
bool constant_jacobian
 Jacobian can be reused if possible.
 
bool jacobian_reusable
 Jacobian is ready to be reused if desirable.
 
int problem_size
 Number of equations.
 
bool do_UMFPACK_reporting
 
double UMFPACK_reporting_data [3]
 

Detailed Description

template<typename Scalar>
class Hermes::Solvers::NewtonMatrixSolver< Scalar >

Definition at line 32 of file newton_matrix_solver.h.

Member Function Documentation

template<typename Scalar >
void Hermes::Solvers::NewtonMatrixSolver< Scalar >::init_newton ( )
protected

Common constructors code. Internal setting of default values (see individual set methods).

Definition at line 35 of file newton_matrix_solver.cpp.

template<typename Scalar >
double Hermes::Solvers::NewtonMatrixSolver< Scalar >::update_solution_return_change_norm ( Scalar *  linear_system_solution)
protectedvirtual

Update the solution. This is a method that serves the purpose of distinguishing methods that solve for increment (Newton), or for solution (Picard).

Implements Hermes::Solvers::NonlinearMatrixSolver< Scalar >.

Definition at line 62 of file newton_matrix_solver.cpp.


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