From 157f90a577be144dc8343eadcc2d5426432f7e9d Mon Sep 17 00:00:00 2001
From: renchao_lu <renchao.lu@gmail.com>
Date: Sat, 2 Jan 2021 20:05:08 +0100
Subject: [PATCH] [CL] Drop interpolated solution.

---
 ChemistryLib/ChemicalSolverInterface.h                    | 7 ++-----
 ChemistryLib/PhreeqcIO.cpp                                | 8 +++-----
 ChemistryLib/PhreeqcIO.h                                  | 7 ++-----
 ChemistryLib/PhreeqcKernel.cpp                            | 7 ++-----
 ChemistryLib/PhreeqcKernel.h                              | 7 ++-----
 .../ComponentTransport/ComponentTransportProcess.cpp      | 6 ++----
 6 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/ChemistryLib/ChemicalSolverInterface.h b/ChemistryLib/ChemicalSolverInterface.h
index 2a50dc04b59..a1a6eb1f66e 100644
--- a/ChemistryLib/ChemicalSolverInterface.h
+++ b/ChemistryLib/ChemicalSolverInterface.h
@@ -37,12 +37,9 @@ public:
     {
     }
 
-    virtual void executeInitialCalculation(
-        std::vector<GlobalVector> const& interpolated_process_solutions) = 0;
+    virtual void executeInitialCalculation() = 0;
 
-    virtual void doWaterChemistryCalculation(
-        std::vector<GlobalVector> const& interpolated_process_solutions,
-        double const dt) = 0;
+    virtual void doWaterChemistryCalculation(double const dt) = 0;
 
     virtual std::vector<GlobalVector*> getIntPtProcessSolutions() const = 0;
 
diff --git a/ChemistryLib/PhreeqcIO.cpp b/ChemistryLib/PhreeqcIO.cpp
index d1515e5d244..13d4116cd37 100644
--- a/ChemistryLib/PhreeqcIO.cpp
+++ b/ChemistryLib/PhreeqcIO.cpp
@@ -163,11 +163,11 @@ void PhreeqcIO::initializeChemicalSystemConcrete(
     }
 }
 
-void PhreeqcIO::executeInitialCalculation(
-    std::vector<GlobalVector> const& interpolated_process_solutions)
 {
     setAqueousSolution(interpolated_process_solutions);
 
+void PhreeqcIO::executeInitialCalculation()
+{
     writeInputsToFile();
 
     execute();
@@ -191,9 +191,7 @@ std::vector<GlobalVector*> PhreeqcIO::getIntPtProcessSolutions() const
     return int_pt_process_solutions;
 }
 
-void PhreeqcIO::doWaterChemistryCalculation(
-    std::vector<GlobalVector> const& interpolated_process_solutions,
-    double const dt)
+void PhreeqcIO::doWaterChemistryCalculation(double const dt)
 {
     setAqueousSolution(interpolated_process_solutions);
 
diff --git a/ChemistryLib/PhreeqcIO.h b/ChemistryLib/PhreeqcIO.h
index f0eacf1b730..cd9ae0e6f97 100644
--- a/ChemistryLib/PhreeqcIO.h
+++ b/ChemistryLib/PhreeqcIO.h
@@ -52,13 +52,10 @@ public:
         ParameterLib::SpatialPosition const& pos,
         double const t) override;
 
-    void executeInitialCalculation(std::vector<GlobalVector> const&
-                                       interpolated_process_solutions) override;
 
-    void doWaterChemistryCalculation(
-        std::vector<GlobalVector> const& interpolated_process_solutions,
-        double const dt) override;
+    void executeInitialCalculation() override;
 
+    void doWaterChemistryCalculation(double const dt) override;
     void setAqueousSolution(
         std::vector<GlobalVector> const& interpolated_process_solutions);
 
diff --git a/ChemistryLib/PhreeqcKernel.cpp b/ChemistryLib/PhreeqcKernel.cpp
index 9dfdc88ecfe..8091d800c8a 100644
--- a/ChemistryLib/PhreeqcKernel.cpp
+++ b/ChemistryLib/PhreeqcKernel.cpp
@@ -169,9 +169,7 @@ void PhreeqcKernel::reinitializeRates()
     };
 }
 
-void PhreeqcKernel::doWaterChemistryCalculation(
-    std::vector<GlobalVector> const& /*interpolated_process_solutions*/,
-    double const dt)
+void PhreeqcKernel::doWaterChemistryCalculation(double const dt)
 {
     std::vector<GlobalVector*> process_solutions;
 
@@ -325,8 +323,7 @@ void PhreeqcKernel::reset(std::size_t const chemical_system_id)
     }
 }
 
-void PhreeqcKernel::executeInitialCalculation(
-    std::vector<GlobalVector> const& /*interpolated_process_solutions*/)
+void PhreeqcKernel::executeInitialCalculation()
 {
     // TODO (Renchao): This function could be replaced with
     // PhreeqcKernel::doWaterChemistryCalculation(std::vector<GlobalVector*>&
diff --git a/ChemistryLib/PhreeqcKernel.h b/ChemistryLib/PhreeqcKernel.h
index edd232a07f1..54ad8427094 100644
--- a/ChemistryLib/PhreeqcKernel.h
+++ b/ChemistryLib/PhreeqcKernel.h
@@ -41,12 +41,9 @@ public:
                   std::unique_ptr<Kinetics>&& kinetic_reactants,
                   std::vector<ReactionRate>&& reaction_rates);
 
-    void executeInitialCalculation(std::vector<GlobalVector> const&
-                                       interpolated_process_solutions) override;
+    void executeInitialCalculation() override;
 
-    void doWaterChemistryCalculation(
-        std::vector<GlobalVector> const& interpolated_process_solutions,
-        double const dt) override;
+    void doWaterChemistryCalculation(double const dt) override;
 
     void setAqueousSolutions(
         std::vector<GlobalVector*> const& process_solutions);
diff --git a/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp
index 26dc5200921..5037f7a70b0 100644
--- a/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp
+++ b/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp
@@ -127,8 +127,7 @@ void ComponentTransportProcess::setInitialConditionsConcreteProcess(
     BaseLib::RunTime time_phreeqc;
     time_phreeqc.start();
 
-    _chemical_solver_interface->executeInitialCalculation(
-        interpolateNodalValuesToIntegrationPoints(x));
+    _chemical_solver_interface->executeInitialCalculation();
 
     extrapolateIntegrationPointValuesToNodes(
         t, _chemical_solver_interface->getIntPtProcessSolutions(), x);
@@ -228,8 +227,7 @@ void ComponentTransportProcess::solveReactionEquation(
     BaseLib::RunTime time_phreeqc;
     time_phreeqc.start();
 
-    _chemical_solver_interface->doWaterChemistryCalculation(
-        interpolateNodalValuesToIntegrationPoints(x), dt);
+    _chemical_solver_interface->doWaterChemistryCalculation(dt);
 
     extrapolateIntegrationPointValuesToNodes(
         t, _chemical_solver_interface->getIntPtProcessSolutions(), x);
-- 
GitLab