Page MenuHomec4science

dissolver.hpp
No OneTemporary

File Metadata

Created
Thu, Jul 11, 12:01

dissolver.hpp

#ifndef SPECMICP_SPECMICP_PROBLEMSOLVER_DISSOLVER_HPP
#define SPECMICP_SPECMICP_PROBLEMSOLVER_DISSOLVER_HPP
#include "common.hpp"
#include "database.hpp"
#include "physics/units.hpp"
namespace specmicp {
class Formulation;
//! \brief Return the total concentration of a given formulation
class Dissolver: public units::UnitBaseClass
{
public:
Dissolver(RawDatabasePtr the_database):
m_database(the_database),
m_database_hl(m_database),
m_total_concentration(the_database->nb_component),
m_components_to_keep(the_database->nb_component)
{
m_total_concentration.setZero();
}
//! \brief Dissolve the problem into the components
//!
//! Also simplify the database
Vector dissolve(const Formulation& the_problem);
//! \brief Return the total concentration vector
Vector get_total_concentration() {return m_total_concentration;}
private:
void set_solvent(scalar_t amount);
void dissolve_aqueous(std::string label, scalar_t concentration, scalar_t mass_solution);
void dissolve_mineral(std::string label, scalar_t amount);
void keep_extra_components(const std::vector<std::string>& list_component_to_keep);
void reduce_problem();
private:
RawDatabasePtr m_database;
Database m_database_hl;
Vector m_total_concentration;
std::vector<bool> m_components_to_keep;
};
} // end namespace specmicp
#endif //SPECMICP_SPECMICP_PROBLEMSOLVER_DISSOLVER_HPP

Event Timeline