From a6e98b13ffe22fc48c0010a5ca29d92ab3ed5615 Mon Sep 17 00:00:00 2001 From: renchao_lu <renchao.lu@gmail.com> Date: Fri, 12 Mar 2021 01:15:30 +0100 Subject: [PATCH] [CL] Drop function executeInitialCalculation(). --- ChemistryLib/ChemicalSolverInterface.h | 2 -- ChemistryLib/PhreeqcIO.cpp | 13 ++----------- ChemistryLib/PhreeqcIO.h | 2 -- ChemistryLib/PhreeqcKernel.cpp | 14 -------------- ChemistryLib/PhreeqcKernel.h | 2 -- .../ComponentTransportProcess.cpp | 2 +- 6 files changed, 3 insertions(+), 32 deletions(-) diff --git a/ChemistryLib/ChemicalSolverInterface.h b/ChemistryLib/ChemicalSolverInterface.h index ef6c1bbebfb..728f24b8872 100644 --- a/ChemistryLib/ChemicalSolverInterface.h +++ b/ChemistryLib/ChemicalSolverInterface.h @@ -50,8 +50,6 @@ public: virtual void setAqueousSolutionsPrevFromDumpFile() {} - virtual void executeInitialCalculation() = 0; - virtual void executeSpeciationCalculation(double const dt) = 0; virtual std::vector<GlobalVector*> getIntPtProcessSolutions() const = 0; diff --git a/ChemistryLib/PhreeqcIO.cpp b/ChemistryLib/PhreeqcIO.cpp index f021763254c..b8bb8f797d9 100644 --- a/ChemistryLib/PhreeqcIO.cpp +++ b/ChemistryLib/PhreeqcIO.cpp @@ -275,9 +275,9 @@ void PhreeqcIO::setChemicalSystemConcrete( } } -void PhreeqcIO::executeInitialCalculation() +void PhreeqcIO::executeSpeciationCalculation(double const dt) { - writeInputsToFile(); + writeInputsToFile(dt); execute(); @@ -300,15 +300,6 @@ std::vector<GlobalVector*> PhreeqcIO::getIntPtProcessSolutions() const return int_pt_process_solutions; } -void PhreeqcIO::executeSpeciationCalculation(double const dt) -{ - writeInputsToFile(dt); - - execute(); - - readOutputsFromFile(); -} - void PhreeqcIO::setAqueousSolutionsPrevFromDumpFile() { if (!_dump) diff --git a/ChemistryLib/PhreeqcIO.h b/ChemistryLib/PhreeqcIO.h index 168b6588935..f6f31d9c3c9 100644 --- a/ChemistryLib/PhreeqcIO.h +++ b/ChemistryLib/PhreeqcIO.h @@ -63,8 +63,6 @@ public: void setAqueousSolutionsPrevFromDumpFile() override; - void executeInitialCalculation() override; - void executeSpeciationCalculation(double const dt) override; void writeInputsToFile(double const dt = 0); diff --git a/ChemistryLib/PhreeqcKernel.cpp b/ChemistryLib/PhreeqcKernel.cpp index 473a47290fe..81d84c6dcb2 100644 --- a/ChemistryLib/PhreeqcKernel.cpp +++ b/ChemistryLib/PhreeqcKernel.cpp @@ -324,20 +324,6 @@ void PhreeqcKernel::reset(std::size_t const chemical_system_id) } } -void PhreeqcKernel::executeInitialCalculation() -{ - // TODO (Renchao): This function could be replaced with - // PhreeqcKernel::executeSpeciationCalculation(std::vector<GlobalVector*>& - // process_solutions, double const dt). - std::vector<GlobalVector*> process_solutions; - - setAqueousSolutions(process_solutions); - - setTimeStepSize(0); - - execute(process_solutions); -} - void PhreeqcKernel::updateNodalProcessSolutions( std::vector<GlobalVector*> const& process_solutions, std::size_t const node_id) diff --git a/ChemistryLib/PhreeqcKernel.h b/ChemistryLib/PhreeqcKernel.h index e8fe4f6b248..08819d370d2 100644 --- a/ChemistryLib/PhreeqcKernel.h +++ b/ChemistryLib/PhreeqcKernel.h @@ -41,8 +41,6 @@ public: std::unique_ptr<Kinetics>&& kinetic_reactants, std::vector<ReactionRate>&& reaction_rates); - void executeInitialCalculation() override; - void executeSpeciationCalculation(double const dt) override; void setAqueousSolutions( diff --git a/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp index 02bb574341b..813e5d9494f 100644 --- a/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp +++ b/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp @@ -127,7 +127,7 @@ void ComponentTransportProcess::setInitialConditionsConcreteProcess( BaseLib::RunTime time_phreeqc; time_phreeqc.start(); - _chemical_solver_interface->executeInitialCalculation(); + _chemical_solver_interface->executeSpeciationCalculation(0. /*dt*/); extrapolateIntegrationPointValuesToNodes( t, _chemical_solver_interface->getIntPtProcessSolutions(), x); -- GitLab