Page MenuHomec4science

selector.hpp
No OneTemporary

File Metadata

Created
Sat, Nov 16, 04:11

selector.hpp

/*-------------------------------------------------------
- Module : database
- File : selector.hpp
- Author : Fabien Georget
Copyright (c) 2014, Fabien Georget, Princeton University
---------------------------------------------------------*/
#ifndef SPECMICP_DATABASE_SELECTOR_HPP
#define SPECMICP_DATABASE_SELECTOR_HPP
//! \file selector.hpp select species int the database
#include <vector>
#include "module.hpp"
namespace specmicp {
namespace database {
//! \brief Select species in the database
//!
//! This is a special class with the only function is to remove some components from the database
class DatabaseSelector: public DatabaseModule
{
public:
DatabaseSelector(RawDatabasePtr thedata):
DatabaseModule(thedata),
m_is_component_to_remove(thedata->nb_component, false)
{}
//! Remove compoment in the list "id_component_to_remove"
void remove_component(const std::vector<int>& id_component_to_remove);
//! keep only components in the "id_to_keep" list
void keep_only_component(const std::vector<int>& id_to_keep);
private:
//! \brief Analyse wich component should be removed
void analyse_component(const std::vector<int>& id_component_to_remove);
//! \brief Select the correct aqueous species
void select_aqueous(const std::vector<int>& id_component_to_remove);
//! \brief Select the correct minerals
void select_minerals(const std::vector<int>& id_component_to_remove);
//! \brief Select the correct minerals governed by kinetics
void select_minerals_kinetic(const std::vector<int>& id_component_to_remove);
//! \brief Select the gas phases
void select_gas(const std::vector<int>& id_component_to_remove);
//! \brief Select components
//!
//! This should be the last operation
void select_components();
//! \brief Return true if the component must be removed
bool is_component_to_remove(int id) {return m_is_component_to_remove[id];}
int nb_component_to_keep() {return m_nb_component_to_keep;}
std::vector<bool> m_is_component_to_remove;
int m_nb_component_to_keep;
};
} // end namespace database
} // end namespace specmicp
#endif // SPECMICP_DATABASE_SELECTOR_HPP

Event Timeline