Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91961492
selector.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 16, 04:11
Size
2 KB
Mime Type
text/x-c++
Expires
Mon, Nov 18, 04:11 (2 d)
Engine
blob
Format
Raw Data
Handle
22354864
Attached To
rSPECMICP SpecMiCP / ReactMiCP
selector.hpp
View Options
/*-------------------------------------------------------
- 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
Log In to Comment