diff --git a/src/reactmicp/solver/reactive_transport_solver.hpp b/src/reactmicp/solver/reactive_transport_solver.hpp index ad21634..7af18ab 100644 --- a/src/reactmicp/solver/reactive_transport_solver.hpp +++ b/src/reactmicp/solver/reactive_transport_solver.hpp @@ -1,126 +1,126 @@ #ifndef SPECMICP_REACTMICP_SOLVER_REACTIVETRANSPORTSOLVER_HPP #define SPECMICP_REACTMICP_SOLVER_REACTIVETRANSPORTSOLVER_HPP //! \file reactive_transport_solver.hpp The reactive transport solver //! \namespace specmicp::reactmicp::solver Namespace containing the algorithms for the reactive transport solver #include "common.hpp" #include #include "reactive_transport_solver_structs.hpp" #include "utils/options_handler.hpp" #include "utils/perfs_handler.hpp" // forward declarations // ==================== namespace specmicp { namespace reactmicp { namespace solver { class VariablesBase; using VariablesBasePtr = std::shared_ptr; class TransportStaggerBase; class ChemistryStaggerBase; class UpscalingStaggerBase; using TransportStaggerPtr = std::shared_ptr; using ChemistryStaggerPtr = std::shared_ptr; using UpscalingStaggerPtr = std::shared_ptr; namespace internal { struct ReactiveTransportResiduals; } // end namespace internal } // end namespace solver } // end namespace reactmicp } // end namespace specmicp // Reactive Transport Solver // ========================= namespace specmicp { namespace reactmicp { namespace solver { //! \brief The reactive transport solver //! //! This class solves a reactive transport problem. //! The details of the problem are implemented in the staggers. //! //! There is three staggers : //! - The transport stagger //! - The chemistry stagger //! - The upscaling stagger //! //! The transport stagger also implements the residuals used to checked the convergence. //! //! This algorithm do not update, modify the variables. //! The details must be implemented in the staggers. //! The variables shared by the algorithm is a shared_ptr to the abstract base class specmicp::reactmicp::solver::VariablesBase //! To be useful, this variable must be casted to the true class in the staggers. class ReactiveTransportSolver: public OptionsHandler, public PerformanceHandler { public: //! \brief Build a reactive transport //! //! \param transport_stagger shared_ptr to a transport stagger //! \param chemistry_stagger shared_ptr to a chemistry stagger //! \param upscaling_stagger shared_ptr to an upscaling stagger ReactiveTransportSolver( TransportStaggerPtr transport_stagger, ChemistryStaggerPtr chemistry_stagger, UpscalingStaggerPtr upscaling_stagger ): m_transport_stagger(transport_stagger), m_chemistry_stagger(chemistry_stagger), m_upscaling_stagger(upscaling_stagger) {} //! \brief Solve a timestep //! //! \param timestep The duration of the timestep //! \param variables shared_ptr to the variables ReactiveTransportReturnCode solve_timestep( scalar_t timestep, VariablesBasePtr variables ); //! \brief Return the timer - ReactiveTransportTimer get_timer() {return m_timer;} + ReactiveTransportTimer& get_timer() {return m_timer;} private: // members //! \brief One iteration inside the timestep //! //! \param variables shared_ptr to the variables //! \param residuals struct containing the residuals information ReactiveTransportReturnCode one_iteration( VariablesBasePtr variables, internal::ReactiveTransportResiduals& residuals ); //! \brief Check the convergence //! //! \param variables shared_ptr to the variables //! \param residuals struct containing the residuals information ReactiveTransportReturnCode check_convergence( VariablesBasePtr variables, const internal::ReactiveTransportResiduals& residuals, bool bypass ); private: // attributes TransportStaggerPtr m_transport_stagger; //!< The transport stagger ChemistryStaggerPtr m_chemistry_stagger; //!< The chemistry stagger UpscalingStaggerPtr m_upscaling_stagger; //!< The upscaling stagger ReactiveTransportTimer m_timer; }; } // end namespace solver } // end namespace reactmicp } // end namespace specmicp #endif // SPECMICP_REACTMICP_SOLVER_REACTIVETRANSPORTSOLVER_HPP