Page MenuHomec4science

adimensional_system_pcfm.hpp
No OneTemporary

File Metadata

Created
Mon, Jun 24, 14:13

adimensional_system_pcfm.hpp

#ifndef SPECMICP_ADIMENSIONALSYSTEM_PCFM_HPP
#define SPECMICP_ADIMENSIONALSYSTEM_PCFM_HPP
#include "database.hpp"
#include "adimensional_system_pcfm_structs.hpp"
#include "utils/options_handler.hpp"
//! \file adimensional_system_pcfm.hpp The positive continuous fraction method
namespace specmicp {
// forward declaration
class AdimensionalSystem;
//! \brief The positive continuous fraction method
//!
//! It is particularly well adapted for aqueous only systems
//!
//! References :
//! - Carrayrou (2002)
class AdimensionalSystemPCFM:
public OptionsHandler<PCFMOptions>
{
public:
AdimensionalSystemPCFM(std::shared_ptr<AdimensionalSystem> program);
AdimensionalSystemPCFM(
std::shared_ptr<AdimensionalSystem> program,
const PCFMOptions& options);
PCFMReturnCode solve(Vector& x);
//! \brief Run one iteration of the PCFM method
void one_iteration(Vector& x);
//! \brief Run the PCFM method for one component
void solve_component(index_t component, Vector& x);
//! \brief Run the PCFM method for the surface equation
void solve_surface(Vector& x);
private:
RawDatabasePtr m_data;
std::shared_ptr<AdimensionalSystem> m_program;
Vector m_errors;
};
//! \brief Initialize a system using the positive continuous fraction method
//!
//! \sa AdimensionalSystemPCFM
inline PCFMReturnCode positive_continuous_fraction_method(
std::shared_ptr<AdimensionalSystem> program,
Vector& x
)
{
return AdimensionalSystemPCFM(program).solve(x);
}
} // end namespace specmicp
#endif // SPECMICP_ADIMENSIONALSYSTEM_PCFM_HPP

Event Timeline