14 #include <libmesh/dense_vector.h> 50 const std::string & replace_this,
51 const std::string & with_this);
67 unsigned basis_index_to_replace,
68 unsigned eqm_index_to_insert);
82 const std::string & replace_this,
83 const std::string & with_this);
97 unsigned basis_index_to_replace,
98 unsigned eqm_index_to_insert);
115 DenseVector<Real> & bulk_composition,
116 const std::string & replace_this,
117 const std::string & with_this);
134 DenseVector<Real> & bulk_composition,
135 unsigned basis_index_to_replace,
136 unsigned eqm_index_to_insert);
156 const std::vector<Real> & eqm_molality,
157 bool minerals_allowed,
159 bool sorption_allowed,
160 unsigned & best_eqm_species)
const;
176 unsigned basis_index_to_replace,
177 unsigned eqm_index_to_insert);
190 unsigned basis_index_to_replace,
191 unsigned eqm_index_to_insert);
GeochemistrySpeciesSwapper(unsigned basis_size, Real stoi_tol)
DenseVector< Real > _swap_sigma
used in SVD decomposition of swap matrix
void alterMGD(ModelGeochemicalDatabase &mgd, unsigned basis_index_to_replace, unsigned eqm_index_to_insert)
Modify the ModelGeochemicalDatabase mgd to swap the indexed basis species and the indexed equilibrium...
DenseMatrix< Real > _swap_VT
used in SVD decomposition of swap matrix
DenseMatrix< Real > _inv_swap_matrix
inverse of swap matrix
DenseMatrix< Real > _swap_U
used in SVD decomposition of swap matrix
const ModelGeochemicalDatabase mgd
bool operator==(const GeochemistrySpeciesSwapper &rhs) const
void constructInverseMatrix(const ModelGeochemicalDatabase &mgd, unsigned basis_index_to_replace, unsigned eqm_index_to_insert)
Construct the swap matrix, and its inverse, that describes the swap between the indexed basis species...
Class to swap basis species with equilibrium species.
DenseMatrix< Real > _true_swap_matrix
Before _swap_matrix.svd (a non-const method) is called, we copy _true_swap_matrix = _swap_matrix...
bool findBestEqmSwap(unsigned basis_ind, const ModelGeochemicalDatabase &mgd, const std::vector< Real > &eqm_molality, bool minerals_allowed, bool gas_allowed, bool sorption_allowed, unsigned &best_eqm_species) const
For the the given basis index, find the equilibrium index that it should be swapped with...
Real _stoi_tol
tolerance for matrix inversion and stoichiometric coefficients
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void performSwap(ModelGeochemicalDatabase &mgd, const std::string &replace_this, const std::string &with_this)
Check that replacing the named basis species with the named equilibrium species is valid...
DenseMatrix< Real > _swap_matrix
swap matrix
Data structure to hold all relevant information from the database file.
void alterBulkComposition(unsigned basis_size, DenseVector< Real > &bulk_composition) const
Calculate the bulk composition in the new basis based on the bulk composition in the original basis...
void checkSwap(const ModelGeochemicalDatabase &mgd, const std::string &replace_this, const std::string &with_this)
Check that replacing the named basis species with the named equilibrium species is valid...