Revision d356cbe44521daa5bf05bbb5eba0cf48195f9d46 authored by Dmitry Yu. Naumov on 20 January 2023, 11:57:22 UTC, committed by Dmitry Yu. Naumov on 20 January 2023, 11:57:22 UTC
Slightly relax CTests tolerances Closes #3355 See merge request ogs/ogs!4448
EquationSystem.h
/**
* \file
* \copyright
* Copyright (c) 2012-2023, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include "MathLib/LinAlg/MatrixSpecifications.h"
namespace NumLib
{
//! \addtogroup ODESolver
//! @{
//! Status flags telling the NonlinearSolver if an iteration succeeded.
enum class IterationResult : char
{
SUCCESS,
FAILURE,
REPEAT_ITERATION
};
/*! Collection of basic methods every equation system must provide.
*/
class EquationSystem
{
public:
/*! Check whether this is actually a linear equation system.
*
* \remark
* Depending on its parameters an in general nonlinear equation system
* can be linear in special cases. With this method it is possible to
* detect that at runtime and thus save some computations.
*/
virtual bool isLinear() const = 0;
/*! Prepares a new iteration in the solution process of this equation.
*
* \param iter the current iteration number, starting from 1.
* \param x the current approximate solution of the equation.
*/
virtual void preIteration(const unsigned iter, GlobalVector const& x)
{
(void)iter;
(void)x; // by default do nothing
}
/*! Post-processes an iteration in the solution process of this equation.
*
* \param x the current approximate solution of the equation.
*
* \return A status flag indicating id the current iteration succeeded.
*/
virtual IterationResult postIteration(GlobalVector const& x)
{
(void)x; // by default do nothing
return IterationResult::SUCCESS;
}
virtual MathLib::MatrixSpecifications getMatrixSpecifications(
const int process_id) const = 0;
virtual ~EquationSystem() = default;
};
//! @}
} // namespace NumLib
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...