Peano
Loading...
Searching...
No Matches
mghype::matrixfree::solvers::Solver Class Referenceabstract

Abstract base class for all solvers. More...

#include <Solver.h>

Collaboration diagram for mghype::matrixfree::solvers::Solver:

Public Member Functions

 Solver (const std::string &name, double tolerance)
 Construct the solver.
 
virtual bool terminationCriterionHolds ()
 
void updateGlobalResidual (double residual, const tarch::la::Vector< Dimensions, double > &h)
 
void updateGlobalSolutionUpdates (double deltaU, const tarch::la::Vector< Dimensions, double > &h)
 
void updateMinMaxMeshSize (const tarch::la::Vector< Dimensions, double > &h)
 
double getGlobalResidualMaxNorm () const
 
virtual std::string toString () const
 
virtual void beginMeshSweep ()=0
 End the traversal.
 
virtual void endMeshSweep ()=0
 Begin the traversal.
 

Protected Member Functions

void clearGlobalResidualAndSolutionUpdate ()
 Clear the global mesh stats.
 
void synchroniseGlobalResidualAndSolutionUpdate ()
 Synchronise the global stats between MPI ranks.
 

Protected Attributes

std::string _name
 Name of solver.
 
const double _tolerance
 
double _minH
 Observed mesh width.
 
double _maxH
 Observed mesh width.
 
double _globalResidualMaxNorm
 
double _globalResidualEukledianNormSquared
 
double _globalResidualHNormSquared
 
double _initialGlobalResidualMaxNorm
 
double _initialGlobalResidualEukledianNormSquared
 
double _initialGlobalResidualHNormSquared
 
double _previousGlobalResidualMaxNorm
 
double _previousGlobalResidualEukledianNormSquared
 
double _previousGlobalResidualHNormSquared
 
double _globalDeltaUMaxNorm
 
double _globalDeltaUEukledianNormSquared
 
double _globalDeltaUHNormSquared
 
tarch::multicore::BooleanSemaphore _semaphore
 Semaphore for global residual values.
 

Static Protected Attributes

static tarch::logging::Log _log
 

Detailed Description

Abstract base class for all solvers.

Definition at line 28 of file Solver.h.

Constructor & Destructor Documentation

◆ Solver()

mghype::matrixfree::solvers::Solver::Solver ( const std::string & name,
double tolerance )

Construct the solver.

Parameters
nameName of solver as used by toString()
toleranceTolerance where solver should terminate. If you pass in 0.1, then the solver will terminate as soon as all residuals have been reduced to 10% of their initial value.

Definition at line 12 of file Solver.cpp.

References _name.

Member Function Documentation

◆ beginMeshSweep()

virtual void mghype::matrixfree::solvers::Solver::beginMeshSweep ( )
pure virtual

End the traversal.

Has to be implemented in subclass. Most solvers synchronise the global statistics, and then print some output.

◆ clearGlobalResidualAndSolutionUpdate()

void mghype::matrixfree::solvers::Solver::clearGlobalResidualAndSolutionUpdate ( )
protected

Clear the global mesh stats.

Most solvers call this one in beginMeshSweep().

Definition at line 83 of file Solver.cpp.

◆ endMeshSweep()

virtual void mghype::matrixfree::solvers::Solver::endMeshSweep ( )
pure virtual

Begin the traversal.

Most solvers invoke clearGlobalResidualAndSolutionUpdate().

◆ getGlobalResidualMaxNorm()

double mghype::matrixfree::solvers::Solver::getGlobalResidualMaxNorm ( ) const

Definition at line 37 of file Solver.cpp.

◆ synchroniseGlobalResidualAndSolutionUpdate()

void mghype::matrixfree::solvers::Solver::synchroniseGlobalResidualAndSolutionUpdate ( )
protected

Synchronise the global stats between MPI ranks.

Becomes nop if there is no MPI. The routine also takes care of the minimum and maximum mesh size tracked.

Definition at line 147 of file Solver.cpp.

References tarch::mpi::Rank::getGlobalMasterRank(), and tarch::mpi::Rank::getInstance().

Here is the call graph for this function:

◆ terminationCriterionHolds()

bool mghype::matrixfree::solvers::Solver::terminationCriterionHolds ( )
virtual

Definition at line 42 of file Solver.cpp.

References tarch::la::equals(), logDebug, logInfo, and logWarning.

Here is the call graph for this function:

◆ toString()

std::string mghype::matrixfree::solvers::Solver::toString ( ) const
virtual

Definition at line 132 of file Solver.cpp.

◆ updateGlobalResidual()

void mghype::matrixfree::solvers::Solver::updateGlobalResidual ( double residual,
const tarch::la::Vector< Dimensions, double > & h )

Definition at line 100 of file Solver.cpp.

References std::abs(), and tarch::la::volume().

Here is the call graph for this function:

◆ updateGlobalSolutionUpdates()

void mghype::matrixfree::solvers::Solver::updateGlobalSolutionUpdates ( double deltaU,
const tarch::la::Vector< Dimensions, double > & h )

Definition at line 112 of file Solver.cpp.

References std::abs(), and tarch::la::volume().

Here is the call graph for this function:

◆ updateMinMaxMeshSize()

void mghype::matrixfree::solvers::Solver::updateMinMaxMeshSize ( const tarch::la::Vector< Dimensions, double > & h)

Definition at line 124 of file Solver.cpp.

References tarch::la::max(), and tarch::la::min().

Here is the call graph for this function:

Field Documentation

◆ _globalDeltaUEukledianNormSquared

double mghype::matrixfree::solvers::Solver::_globalDeltaUEukledianNormSquared
protected

Definition at line 111 of file Solver.h.

◆ _globalDeltaUHNormSquared

double mghype::matrixfree::solvers::Solver::_globalDeltaUHNormSquared
protected

Definition at line 112 of file Solver.h.

◆ _globalDeltaUMaxNorm

double mghype::matrixfree::solvers::Solver::_globalDeltaUMaxNorm
protected

Definition at line 110 of file Solver.h.

◆ _globalResidualEukledianNormSquared

double mghype::matrixfree::solvers::Solver::_globalResidualEukledianNormSquared
protected

Definition at line 99 of file Solver.h.

◆ _globalResidualHNormSquared

double mghype::matrixfree::solvers::Solver::_globalResidualHNormSquared
protected

Definition at line 100 of file Solver.h.

◆ _globalResidualMaxNorm

double mghype::matrixfree::solvers::Solver::_globalResidualMaxNorm
protected

Definition at line 98 of file Solver.h.

◆ _initialGlobalResidualEukledianNormSquared

double mghype::matrixfree::solvers::Solver::_initialGlobalResidualEukledianNormSquared
protected

Definition at line 103 of file Solver.h.

◆ _initialGlobalResidualHNormSquared

double mghype::matrixfree::solvers::Solver::_initialGlobalResidualHNormSquared
protected

Definition at line 104 of file Solver.h.

◆ _initialGlobalResidualMaxNorm

double mghype::matrixfree::solvers::Solver::_initialGlobalResidualMaxNorm
protected

Definition at line 102 of file Solver.h.

◆ _log

tarch::logging::Log mghype::matrixfree::solvers::Solver::_log
staticprotected

Definition at line 74 of file Solver.h.

◆ _maxH

double mghype::matrixfree::solvers::Solver::_maxH
protected

Observed mesh width.

Definition at line 96 of file Solver.h.

◆ _minH

double mghype::matrixfree::solvers::Solver::_minH
protected

Observed mesh width.

Definition at line 91 of file Solver.h.

◆ _name

std::string mghype::matrixfree::solvers::Solver::_name
protected

Name of solver.

Usually only used for debuggin purposes

Definition at line 81 of file Solver.h.

Referenced by exahype2.solvers.aderdg.ADERDG.ADERDG::__str__(), exahype2.solvers.elliptic.AMRMarker.AMRMarker::__str__(), exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells::__str__(), exahype2.solvers.fv.FV.FV::__str__(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::__str__(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::__str__(), solvers.api.Solver.Solver::__str__(), exahype2.solvers.fv.EnclaveTasking.EnclaveTasking::_enclave_task_name(), exahype2.solvers.rkfd.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking::_enclave_task_name(), dastgen2.attributes.Enumeration.Enumeration::_enum_name(), exahype2.solvers.aderdg.ADERDG.ADERDG::_generate_kernels(), exahype2.solvers.aderdg.ADERDG.ADERDG::_init_dictionary_with_default_parameters(), exahype2.solvers.fv.FV.FV::_init_dictionary_with_default_parameters(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_init_dictionary_with_default_parameters(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_init_dictionary_with_default_parameters(), exahype2.solvers.aderdg.ADERDG.ADERDG::_interpolate_face_data_default_guard(), exahype2.solvers.aderdg.SingleSweep.SingleSweep::_interpolate_face_data_default_guard(), SBH.Limiter::_load_cell_data_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_load_cell_data_default_guard(), exahype2.solvers.fv.FV.FV::_load_cell_data_default_guard(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_load_cell_data_default_guard(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_load_cell_data_default_guard(), SBH.Limiter::_load_face_data_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_load_face_data_default_guard(), exahype2.solvers.fv.FV.FV::_load_face_data_default_guard(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_load_face_data_default_guard(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_load_face_data_default_guard(), SBH.Limiter::_provide_cell_data_to_compute_kernels_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_provide_cell_data_to_compute_kernels_default_guard(), exahype2.solvers.fv.FV.FV::_provide_cell_data_to_compute_kernels_default_guard(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_provide_cell_data_to_compute_kernels_default_guard(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_provide_cell_data_to_compute_kernels_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_provide_face_data_to_compute_kernels_default_guard(), exahype2.solvers.fv.FV.FV::_provide_face_data_to_compute_kernels_default_guard(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_provide_face_data_to_compute_kernels_default_guard(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_provide_face_data_to_compute_kernels_default_guard(), exahype2.solvers.aderdg.SingleSweep.SingleSweep::_restrict_face_data_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_store_boundary_data_default_guard(), SBH.Limiter::_store_cell_data_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_store_cell_data_default_guard(), exahype2.solvers.fv.FV.FV::_store_cell_data_default_guard(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_store_cell_data_default_guard(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_store_cell_data_default_guard(), SBH.Limiter::_store_face_data_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_store_face_data_default_guard(), exahype2.solvers.fv.FV.FV::_store_face_data_default_guard(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_store_face_data_default_guard(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_store_face_data_default_guard(), exahype2.solvers.aderdg.ADERDG.ADERDG::_unknown_identifier(), exahype2.solvers.elliptic.AMRMarker.AMRMarker::_unknown_identifier(), exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells::_unknown_identifier(), exahype2.solvers.fv.FV.FV::_unknown_identifier(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::_unknown_identifier(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::_unknown_identifier(), exahype2.solvers.fv.FV.FV::add_actions_to_checkpoint_solution(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::add_actions_to_checkpoint_solution(), exahype2.solvers.fv.EnclaveTasking.EnclaveTasking::add_actions_to_create_grid(), exahype2.solvers.fv.EnclaveTasking.EnclaveTasking::add_actions_to_init_grid(), exahype2.solvers.aderdg.ADERDG.ADERDG::add_actions_to_plot_solution(), exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells::add_actions_to_plot_solution(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::add_actions_to_plot_solution(), exahype2.solvers.fv.FV.FV::add_actions_to_plot_solution(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::add_actions_to_plot_solution(), exahype2.solvers.fv.EnclaveTasking.EnclaveTasking::add_entries_to_text_replacement_dictionary(), exahype2.solvers.rkdg.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking::add_entries_to_text_replacement_dictionary(), exahype2.solvers.rkfd.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking::add_entries_to_text_replacement_dictionary(), exahype2.solvers.aderdg.ADERDG.ADERDG::add_implementation_files_to_project(), exahype2.solvers.elliptic.AMRMarker.AMRMarker::add_to_Peano4_datamodel(), exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells::add_to_Peano4_datamodel(), SBH.Limiter::create_action_sets(), exahype2.solvers.aderdg.SingleSweep.SingleSweep::create_action_sets(), exahype2.solvers.fv.rusanov.LocalTimeStepWithEnclaveTasking.LocalTimeStepWithEnclaveTasking::create_action_sets(), exahype2.solvers.fv.rusanov.SubcyclingAdaptiveTimeStepWithEnclaveTasking.SubcyclingAdaptiveTimeStepWithEnclaveTasking::create_action_sets(), exahype2.solvers.fv.rusanov.SubcyclingFixedTimeStep.SubcyclingFixedTimeStep::create_action_sets(), exahype2.solvers.fv.rusanov.SubcyclingFixedTimeStepWithEnclaveTasking.SubcyclingFixedTimeStepWithEnclaveTasking::create_action_sets(), exahype2.solvers.rkdg.SeparateSweeps.SeparateSweeps::create_action_sets(), exahype2.solvers.fv.SingleSweep.SingleSweep::create_data_structures(), exahype2.solvers.rkfd.OneSweepPerRungeKuttaStep.OneSweepPerRungeKuttaStep::create_data_structures(), exahype2.solvers.rkfd.SeparateSweeps.SeparateSweeps::create_data_structures(), exahype2.solvers.rkfd.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking::create_data_structures(), dastgen2.attributes.Attribute.Attribute::get_accessor_name(), dastgen2.attributes.BooleanArray.BooleanArray::get_constructor_arguments(), peano4.dastgen2.Peano4DoubleArray.Peano4DoubleArray::get_constructor_arguments(), peano4.dastgen2.Peano4IntegerArray.Peano4IntegerArray::get_constructor_arguments(), api.solvers.CollocatedLowOrderDiscretisation.AssemblePetscMatrix::get_constructor_body(), dastgen2.attributes.BooleanArray.BooleanArray::get_first_plain_C_attribute(), dastgen2.attributes.DoubleArray.DoubleArray::get_first_plain_C_attribute(), dastgen2.attributes.IntegerArray.IntegerArray::get_first_plain_C_attribute(), peano4.dastgen2.Peano4DoubleArray.Peano4DoubleArray::get_first_plain_C_attribute(), peano4.dastgen2.Peano4IntegerArray.Peano4IntegerArray::get_first_plain_C_attribute(), dastgen2.attributes.Boolean.Boolean::get_method_body(), dastgen2.attributes.BooleanArray.BooleanArray::get_method_body(), dastgen2.attributes.Double.Double::get_method_body(), dastgen2.attributes.DoubleArray.DoubleArray::get_method_body(), dastgen2.attributes.Enumeration.Enumeration::get_method_body(), dastgen2.attributes.Integer.Integer::get_method_body(), dastgen2.attributes.IntegerArray.IntegerArray::get_method_body(), dastgen2.attributes.String.String::get_method_body(), dastgen2.attributes.UserDefinedType.UserDefinedType::get_method_body(), peano4.dastgen2.Peano4DoubleArray.Peano4DoubleArray::get_method_body(), peano4.dastgen2.Peano4IntegerArray.Peano4IntegerArray::get_method_body(), dastgen2.attributes.BooleanArray.BooleanArray::get_methods(), dastgen2.attributes.DoubleArray.DoubleArray::get_methods(), dastgen2.attributes.IntegerArray.IntegerArray::get_methods(), peano4.dastgen2.Peano4DoubleArray.Peano4DoubleArray::get_methods(), peano4.dastgen2.Peano4IntegerArray.Peano4IntegerArray::get_methods(), exahype2.solvers.aderdg.ADERDG.ADERDG::get_name_of_global_instance(), exahype2.solvers.elliptic.AMRMarker.AMRMarker::get_name_of_global_instance(), exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells::get_name_of_global_instance(), exahype2.solvers.fv.FV.FV::get_name_of_global_instance(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG::get_name_of_global_instance(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::get_name_of_global_instance(), dastgen2.attributes.Boolean.Boolean::get_plain_C_attributes(), dastgen2.attributes.BooleanArray.BooleanArray::get_plain_C_attributes(), dastgen2.attributes.Double.Double::get_plain_C_attributes(), dastgen2.attributes.DoubleArray.DoubleArray::get_plain_C_attributes(), dastgen2.attributes.Integer.Integer::get_plain_C_attributes(), dastgen2.attributes.IntegerArray.IntegerArray::get_plain_C_attributes(), dastgen2.attributes.String.String::get_plain_C_attributes(), dastgen2.attributes.UserDefinedType.UserDefinedType::get_plain_C_attributes(), peano4.dastgen2.Peano4DoubleArray.Peano4DoubleArray::get_plain_C_attributes(), peano4.dastgen2.Peano4IntegerArray.Peano4IntegerArray::get_plain_C_attributes(), dastgen2.attributes.String.String::get_setter_getter_name(), dastgen2.attributes.Boolean.Boolean::get_to_string(), dastgen2.attributes.BooleanArray.BooleanArray::get_to_string(), dastgen2.attributes.Double.Double::get_to_string(), dastgen2.attributes.DoubleArray.DoubleArray::get_to_string(), dastgen2.attributes.Enumeration.Enumeration::get_to_string(), dastgen2.attributes.Integer.Integer::get_to_string(), dastgen2.attributes.IntegerArray.IntegerArray::get_to_string(), dastgen2.attributes.UserDefinedType.UserDefinedType::get_to_string(), peano4.dastgen2.Peano4DoubleArray.Peano4DoubleArray::get_to_string(), peano4.dastgen2.Peano4IntegerArray.Peano4IntegerArray::get_to_string(), dastgen2.attributes.Attribute.Attribute::name(), exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells::name(), exahype2.solvers.fv.FV.FV::name(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences::name(), solvers.api.Solver.Solver::name(), api.solvers.Solver.Solver::name(), Solver(), solvers.api.Solver.Solver::typename(), and api.solvers.Solver.Solver::typename().

◆ _previousGlobalResidualEukledianNormSquared

double mghype::matrixfree::solvers::Solver::_previousGlobalResidualEukledianNormSquared
protected

Definition at line 107 of file Solver.h.

◆ _previousGlobalResidualHNormSquared

double mghype::matrixfree::solvers::Solver::_previousGlobalResidualHNormSquared
protected

Definition at line 108 of file Solver.h.

◆ _previousGlobalResidualMaxNorm

double mghype::matrixfree::solvers::Solver::_previousGlobalResidualMaxNorm
protected

Definition at line 106 of file Solver.h.

◆ _semaphore

tarch::multicore::BooleanSemaphore mghype::matrixfree::solvers::Solver::_semaphore
protected

Semaphore for global residual values.

Definition at line 117 of file Solver.h.

◆ _tolerance

const double mghype::matrixfree::solvers::Solver::_tolerance
protected
See also
terminationCriterionHolds()

Definition at line 86 of file Solver.h.


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