Page MenuHomec4science

options.hpp
No OneTemporary

File Metadata

Created
Sun, Nov 10, 06:56

options.hpp

#ifndef SPECMICP_REACTMICP_SATURATED_DIFFUSION_OPTIONS_HPP
#define SPECMICP_REACTMICP_SATURATED_DIFFUSION_OPTIONS_HPP
#include "common.hpp"
namespace specmicp {
namespace reactmicp {
namespace systems {
namespace siasaturated {
//! \brief Return codes for the SIASaturatedReactiveTransportSolver
enum class SIASaturatedReactiveTransportSolverReturnCode {
LolThatsNotSuposedToHappen = -30, //!< Well, have fun debugging that...
// Transport error codes
ErrorInTransport = -20, //!< Error in the transport solver
MaxIterationsInTransport = -21, //!< Maximum iterations reached in the transport solver
StationaryPointsInTransport = -22, //!< Stationnary points in the transport solver
// Speciation error codes
ErrorInSpeciation = -10, //!< Error in the speciation solver
MaxIterationsInSpeciation = -11, //!< Maximum iterations reached in the speciation solver
StationaryPointsInSpeciation = -12, //!< Stationnary points in the speciation solver
// Coupling algorithm
MaxIterations = -1, //!< Maximum iterations of the coupling solver
StationaryPoints = -2, //!< Stationary points reached in the coupling solver
// The good ones
NotConvergedYet = 0, //!< Problem is not converged yet
Success = 1 //!< The problem is succesfully solved
};
//! \brief Options for the SIASaturatedReactiveTransportSolver
struct SIASaturatedReactiveTransportSolverOptions
{
int max_iterations; //!< Maximum number of fixed-point iterations
scalar_t residual_tolerance; //!< The tolerance for fixed-point convergence
scalar_t good_enough_transport_residual_tolerance; //!< If transport failed, this value is used to check if it is 'good' enough
scalar_t threshold_update_transport; //!< Threshold to accept a step if the update is too small
scalar_t threshold_update_disable_speciation; //!< Threshold to disable next computation of speciation at a node
SIASaturatedReactiveTransportSolverOptions():
max_iterations(50),
residual_tolerance(1e-3),
good_enough_transport_residual_tolerance(1e-2),
threshold_update_transport(1e-10),
threshold_update_disable_speciation(1e-10)
{}
//! \brief Use a sequential non-iterative algorithm
void use_snia() {max_iterations=1;}
//! \brief Use a sequential iterative algorithm
void use_sia(int nb_iter=50) {max_iterations=nb_iter;}
//! \brief Set the tolerance
void set_tolerance(scalar_t tol) {residual_tolerance = tol;}
};
} // end namespace siasaturated
} // end namespace systems
} // end namespace reactmicp
} // end namespace specmicp
#endif // SPECMICP_REACTMICP_SATURATED_DIFFUSION_OPTIONS_HPP

Event Timeline