diff --git a/ChemistryLib/PhreeqcIO.cpp b/ChemistryLib/PhreeqcIO.cpp index 75ed46671e957152cddfbeb614c08ffca742dc2c..55f851851cc07cbae28b218fe0de2854f4903b2d 100644 --- a/ChemistryLib/PhreeqcIO.cpp +++ b/ChemistryLib/PhreeqcIO.cpp @@ -195,19 +195,6 @@ std::ostream& operator<<(std::ostream& os, PhreeqcIO const& phreeqc_io) void PhreeqcIO::execute() { INFO("Phreeqc: Executing chemical calculation."); - // initialize phreeqc configurations - auto const instance_id = CreateIPhreeqc(); - - // load a specific database in the working directory - if (LoadDatabase(instance_id, _database.c_str()) != 0) - { - OGS_FATAL( - "Failed in loading the specified thermodynamic database file: %s.", - _database.c_str()); - } - - SetSelectedOutputFileOn(instance_id, 1); - if (RunFile(instance_id, _phreeqc_input_file.c_str()) > 0) { OutputErrorString(instance_id); diff --git a/ChemistryLib/PhreeqcIO.h b/ChemistryLib/PhreeqcIO.h index 8a856afcfc401ed8446e47b8e0fff46402fcf354..71774eeabd2511a6c9abc4ee4221080dbae84a36 100644 --- a/ChemistryLib/PhreeqcIO.h +++ b/ChemistryLib/PhreeqcIO.h @@ -47,6 +47,19 @@ public: _output(std::move(output)), _process_id_to_component_name_map(process_id_to_component_name_map) { + // initialize phreeqc configurations + auto const instance_id = CreateIPhreeqc(); + + // load a specific database in the working directory + if (LoadDatabase(instance_id, _database.c_str()) != 0) + { + OGS_FATAL( + "Failed in loading the specified thermodynamic database file: " + "%s.", + _database.c_str()); + } + + SetSelectedOutputFileOn(instance_id, 1); } void doWaterChemistryCalculation(