diff --git a/cython/specmicp/reaction_path.pyx b/cython/specmicp/reaction_path.pyx index 2ad43a3..586cfe0 100644 --- a/cython/specmicp/reaction_path.pyx +++ b/cython/specmicp/reaction_path.pyx @@ -1,6 +1,36 @@ +from libcpp.pair cimport pair +from libcpp.string cimport string from reaction_path cimport ReactionPathModel +from database cimport Database +from database import DatabaseManager + cdef class ReactionPathSimulation: + """The simulation to solve""" cdef ReactionPathModel* thisptr - def __cinit__(self, database): - thisptr = new ReactionPathModel() + def __cinit__(self, thedatabase): + self.thisptr = new ReactionPathModel() + self.thedatabase = thedatabase + def add_aqueous_species(self, + bytes label, + float initial_amount, + float increase_amount): + """Add an aqueous system in the system""" + self.thisptr.amount_aqueous.insert( + pair[string, pair[float, float]]( + label, + pair[float, float](initial_amount, increase_amount))) + def add_mineral(self, + bytes label, + float initial_amount, + float increase_amount): + """Add a mineral in the system""" + self.thisptr.amount_minerals.insert( + pair[string, pair[float, float]]( + label, + pair[float, float](initial_amount, increase_amount))) + def set_list_minerals(self, list_mineral_to_keep): + """Set the list of solid phases at equilibrium in the system""" + self.thisptr.minerals_to_keep.reserve(len(list_mineral_to_keep)) + for mine in list_mineral_to_keep: + self.thisptr.minerals_to_keep.push_back(mine)