diff --git a/.gitmodules b/.gitmodules index 20187dedb45401d1982c2fc6b6af995beb2d343d..1cc94fa678b985b8d4d6f5b8f74d07302a10cfe0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "ThirdParty/SwmmInterface"] path = ThirdParty/SwmmInterface url = https://github.com/ufz/SwmmInterface.git -[submodule "ThirdParty/iphreeqc/src"] - path = ThirdParty/iphreeqc/src - url = https://github.com/ufz/iphreeqc.git [submodule "ThirdParty/MGIS"] path = ThirdParty/MGIS url = https://github.com/ufz/MFrontGenericInterfaceSupport.git diff --git a/ChemistryLib/CreateChemicalSolverInterface.cpp b/ChemistryLib/CreateChemicalSolverInterface.cpp index 75d4c6a646c7a43488e55c89df7b77f891f80664..437eb979a3bc902ac08a15a21635b9422f14c9bb 100644 --- a/ChemistryLib/CreateChemicalSolverInterface.cpp +++ b/ChemistryLib/CreateChemicalSolverInterface.cpp @@ -10,7 +10,7 @@ #include "CreateChemicalSolverInterface.h" -#include <iphreeqc/src/src/phreeqcpp/cxxKinetics.h> +#include <phreeqcpp/cxxKinetics.h> #include "BaseLib/ConfigTree.h" #include "BaseLib/FileTools.h" diff --git a/ChemistryLib/PhreeqcIO.cpp b/ChemistryLib/PhreeqcIO.cpp index 2cba14a75706ab8a212a353370106c18daead5dd..42d4ec00fc2840d34925909de9b04d742f65fcba 100644 --- a/ChemistryLib/PhreeqcIO.cpp +++ b/ChemistryLib/PhreeqcIO.cpp @@ -10,7 +10,7 @@ #include "PhreeqcIO.h" -#include <iphreeqc/src/src/IPhreeqc.h> +#include <IPhreeqc.h> #include <boost/algorithm/string.hpp> #include <cmath> diff --git a/ChemistryLib/PhreeqcKernel.cpp b/ChemistryLib/PhreeqcKernel.cpp index 8091d800c8a13b8f09b8ba0e1757e88760c094fc..1c8a3c2f077ae95f1d2477e4993faaff84aa4c0b 100644 --- a/ChemistryLib/PhreeqcKernel.cpp +++ b/ChemistryLib/PhreeqcKernel.cpp @@ -8,16 +8,17 @@ * */ +#include "PhreeqcKernel.h" + +#include <phreeqcpp/cxxKinetics.h> + #include <cmath> #include <cstdlib> #include "BaseLib/Error.h" -#include "PhreeqcKernel.h" #include "PhreeqcKernelData/AqueousSolution.h" #include "PhreeqcKernelData/ReactionRate.h" -#include <iphreeqc/src/src/phreeqcpp/cxxKinetics.h> - namespace ChemistryLib { namespace PhreeqcKernelData diff --git a/ChemistryLib/PhreeqcKernel.h b/ChemistryLib/PhreeqcKernel.h index 54ad842709430fcbdfc36d041c92ab8a8842b44b..b77c3cebc22ae13ce0ac2bdddffaa91d3468d846 100644 --- a/ChemistryLib/PhreeqcKernel.h +++ b/ChemistryLib/PhreeqcKernel.h @@ -10,6 +10,8 @@ #pragma once +#include <phreeqcpp/Phreeqc.h> + #include <map> #include <vector> @@ -17,8 +19,6 @@ #include "PhreeqcKernelData/EquilibriumReactants.h" #include "PhreeqcKernelData/KineticReactant.h" -#include <iphreeqc/src/src/phreeqcpp/Phreeqc.h> - class cxxSolution; class cxxISolution; diff --git a/ChemistryLib/PhreeqcKernelData/AqueousSolution.h b/ChemistryLib/PhreeqcKernelData/AqueousSolution.h index 4ecedaee2f4e87004b46d68d90efa037e0e1405c..89b795df01588f48132436758db4715380164934 100644 --- a/ChemistryLib/PhreeqcKernelData/AqueousSolution.h +++ b/ChemistryLib/PhreeqcKernelData/AqueousSolution.h @@ -10,10 +10,10 @@ #pragma once -#include <memory> +#include <phreeqcpp/Solution.h> +#include <phreeqcpp/common/phrqtype.h> -#include <iphreeqc/src/src/phreeqcpp/common/phrqtype.h> -#include <iphreeqc/src/src/phreeqcpp/Solution.h> +#include <memory> namespace ChemistryLib { diff --git a/ChemistryLib/PhreeqcKernelData/EquilibriumReactants.h b/ChemistryLib/PhreeqcKernelData/EquilibriumReactants.h index 65c125c20cfd7e1eddd6df876bd23c8fd67a7d06..34ad8539dbf60449918c43027e1f73c6a651c5e7 100644 --- a/ChemistryLib/PhreeqcKernelData/EquilibriumReactants.h +++ b/ChemistryLib/PhreeqcKernelData/EquilibriumReactants.h @@ -10,12 +10,12 @@ #pragma once +#include <phreeqcpp/PPassemblage.h> + #include <set> #include <string> #include <vector> -#include <iphreeqc/src/src/phreeqcpp/PPassemblage.h> - namespace ChemistryLib { namespace PhreeqcKernelData diff --git a/ChemistryLib/PhreeqcKernelData/InitialAqueousSolution.h b/ChemistryLib/PhreeqcKernelData/InitialAqueousSolution.h index 3cb1f3bab3b9f3777e63a4590f1f7dd43504b234..e1df7c643d56560d54fb19617cae705994ad179a 100644 --- a/ChemistryLib/PhreeqcKernelData/InitialAqueousSolution.h +++ b/ChemistryLib/PhreeqcKernelData/InitialAqueousSolution.h @@ -10,11 +10,11 @@ #pragma once +#include <phreeqcpp/ISolution.h> + #include <map> #include <string> -#include <iphreeqc/src/src/phreeqcpp/ISolution.h> - namespace ChemistryLib { namespace PhreeqcKernelData diff --git a/ChemistryLib/PhreeqcKernelData/KineticReactant.h b/ChemistryLib/PhreeqcKernelData/KineticReactant.h index 5f5fc4359dfc126a1d7a12a5177d0c81015eed9a..df82bd8463aa528b7bf98475b5cf9057a0ba31d9 100644 --- a/ChemistryLib/PhreeqcKernelData/KineticReactant.h +++ b/ChemistryLib/PhreeqcKernelData/KineticReactant.h @@ -10,11 +10,11 @@ #pragma once +#include <phreeqcpp/cxxKinetics.h> + #include <string> #include <vector> -#include <iphreeqc/src/src/phreeqcpp/cxxKinetics.h> - namespace ChemistryLib { namespace PhreeqcKernelData diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt index 32bec04c0f1a5593e01e9b057ca466c55338e586..b3080d6eab3395ea87e38a20687f343d26a12e77 100644 --- a/ThirdParty/CMakeLists.txt +++ b/ThirdParty/CMakeLists.txt @@ -1,10 +1,3 @@ -# iphreeqc -if (OGS_BUILD_PROCESS_ComponentTransport - OR OGS_BUILD_PROCESS_RichardsComponentTransport) - add_subdirectory(iphreeqc) - list(APPEND DISABLE_WARNINGS_TARGETS iphreeqc) -endif() - # MFrontGenericInterfaceSupport if (OGS_USE_MFRONT) set(enable-doxygen-doc OFF CACHE INTERNAL "") diff --git a/ThirdParty/iphreeqc/CMakeLists.txt b/ThirdParty/iphreeqc/CMakeLists.txt deleted file mode 100644 index 7b1e61d53c418f782adb66cac7581d17198a3c99..0000000000000000000000000000000000000000 --- a/ThirdParty/iphreeqc/CMakeLists.txt +++ /dev/null @@ -1,104 +0,0 @@ -project(IPhreeqc CXX C) -set(IPHREEQC_VERSION 3.5.0) - -set(SOURCES - src/src/CSelectedOutput.cpp - src/src/fwrap.cpp - src/src/IPhreeqc.cpp - src/src/IPhreeqc_interface_F.cpp - src/src/IPhreeqcLib.cpp - src/src/Var.c - src/src/phreeqcpp/advection.cpp - src/src/phreeqcpp/basicsubs.cpp - src/src/phreeqcpp/cl1.cpp - src/src/phreeqcpp/cvdense.cpp - src/src/phreeqcpp/cvode.cpp - src/src/phreeqcpp/cxxKinetics.cxx - src/src/phreeqcpp/cxxMix.cxx - src/src/phreeqcpp/dense.cpp - src/src/phreeqcpp/Dictionary.cpp - src/src/phreeqcpp/dumper.cpp - src/src/phreeqcpp/Exchange.cxx - src/src/phreeqcpp/ExchComp.cxx - src/src/phreeqcpp/GasComp.cxx - src/src/phreeqcpp/gases.cpp - src/src/phreeqcpp/GasPhase.cxx - src/src/phreeqcpp/input.cpp - src/src/phreeqcpp/integrate.cpp - src/src/phreeqcpp/inverse.cpp - src/src/phreeqcpp/ISolution.cxx - src/src/phreeqcpp/ISolutionComp.cxx - src/src/phreeqcpp/isotopes.cpp - src/src/phreeqcpp/kinetics.cpp - src/src/phreeqcpp/KineticsComp.cxx - src/src/phreeqcpp/mainsubs.cpp - src/src/phreeqcpp/model.cpp - src/src/phreeqcpp/NameDouble.cxx - src/src/phreeqcpp/NumKeyword.cxx - src/src/phreeqcpp/nvector.cpp - src/src/phreeqcpp/nvector_serial.cpp - src/src/phreeqcpp/parse.cpp - src/src/phreeqcpp/PBasic.cpp - src/src/phreeqcpp/phqalloc.cpp - src/src/phreeqcpp/Phreeqc.cpp - src/src/phreeqcpp/PHRQ_io_output.cpp - src/src/phreeqcpp/pitzer.cpp - src/src/phreeqcpp/pitzer_structures.cpp - src/src/phreeqcpp/PPassemblage.cxx - src/src/phreeqcpp/PPassemblageComp.cxx - src/src/phreeqcpp/prep.cpp - src/src/phreeqcpp/Pressure.cxx - src/src/phreeqcpp/print.cpp - src/src/phreeqcpp/Reaction.cxx - src/src/phreeqcpp/read.cpp - src/src/phreeqcpp/ReadClass.cxx - src/src/phreeqcpp/readtr.cpp - src/src/phreeqcpp/runner.cpp - src/src/phreeqcpp/SelectedOutput.cpp - src/src/phreeqcpp/Serializer.cxx - src/src/phreeqcpp/sit.cpp - src/src/phreeqcpp/smalldense.cpp - src/src/phreeqcpp/Solution.cxx - src/src/phreeqcpp/SolutionIsotope.cxx - src/src/phreeqcpp/spread.cpp - src/src/phreeqcpp/SS.cxx - src/src/phreeqcpp/SSassemblage.cxx - src/src/phreeqcpp/SScomp.cxx - src/src/phreeqcpp/step.cpp - src/src/phreeqcpp/StorageBin.cxx - src/src/phreeqcpp/StorageBinList.cpp - src/src/phreeqcpp/structures.cpp - src/src/phreeqcpp/sundialsmath.cpp - src/src/phreeqcpp/Surface.cxx - src/src/phreeqcpp/SurfaceCharge.cxx - src/src/phreeqcpp/SurfaceComp.cxx - src/src/phreeqcpp/System.cxx - src/src/phreeqcpp/tally.cpp - src/src/phreeqcpp/Temperature.cxx - src/src/phreeqcpp/tidy.cpp - src/src/phreeqcpp/transport.cpp - src/src/phreeqcpp/Use.cpp - src/src/phreeqcpp/UserPunch.cpp - src/src/phreeqcpp/utilities.cpp - src/src/phreeqcpp/common/Parser.cxx - src/src/phreeqcpp/common/PHRQ_base.cxx - src/src/phreeqcpp/common/PHRQ_io.cpp - src/src/phreeqcpp/common/Utils.cxx - src/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp -) - -# compile Var.c as c++ -SET_SOURCE_FILES_PROPERTIES(src/src/Var.c PROPERTIES LANGUAGE CXX) - -add_library(iphreeqc STATIC ${SOURCES}) -target_include_directories(iphreeqc BEFORE - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/src/src/phreeqcpp/common - ${CMAKE_CURRENT_SOURCE_DIR}/src/src/phreeqcpp/PhreeqcKeywords - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src/src - ${CMAKE_CURRENT_SOURCE_DIR}/src/src/phreeqcpp -) -# Exclude iphreeqc target from clang-tidy tests because it handles the above -# mentioned 'src/src/Var.c' file as c, not c++. -set_target_properties(iphreeqc PROPERTIES CXX_CLANG_TIDY "") diff --git a/ThirdParty/iphreeqc/src b/ThirdParty/iphreeqc/src deleted file mode 160000 index 091c216d69ef3947549ba230cece35215a79699c..0000000000000000000000000000000000000000 --- a/ThirdParty/iphreeqc/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 091c216d69ef3947549ba230cece35215a79699c diff --git a/scripts/cmake/Dependencies.cmake b/scripts/cmake/Dependencies.cmake index c2b9e2d7a7562cebd4641027ab560d9e2c980dc0..9241876be3de1b2b72116b676a7bd81f93c2de80 100644 --- a/scripts/cmake/Dependencies.cmake +++ b/scripts/cmake/Dependencies.cmake @@ -82,3 +82,16 @@ if(OGS_USE_PYTHON) "PYBIND11_PYTHON_VERSION ${Python3_VERSION}" ) endif() + +if (OGS_BUILD_PROCESS_ComponentTransport + OR OGS_BUILD_PROCESS_RichardsComponentTransport) + CPMAddPackage( + NAME iphreeqc + GITHUB_REPOSITORY ufz/iphreeqc + GIT_TAG b1047d3eb03e7ef1b850231be35acb9c6a2cf345 + DOWNLOAD_ONLY YES + ) + if(iphreeqc_ADDED) + include(scripts/cmake/iphreeqc.cmake) + endif() +endif() diff --git a/scripts/cmake/SubmoduleSetup.cmake b/scripts/cmake/SubmoduleSetup.cmake index 5d3737ebe2b6aa3405c15e80a5670c111eaf1b90..cd7c41079e1ca41c6c0f3aac80edd271433ab4a4 100644 --- a/scripts/cmake/SubmoduleSetup.cmake +++ b/scripts/cmake/SubmoduleSetup.cmake @@ -3,9 +3,6 @@ if(NOT IS_GIT_REPO) endif() # This file initializes the required submodules -set(REQUIRED_SUBMODULES - ThirdParty/iphreeqc/src -) if(OGS_USE_XDMF) list(APPEND REQUIRED_SUBMODULES ThirdParty/xdmf) endif() diff --git a/scripts/cmake/iphreeqc.cmake b/scripts/cmake/iphreeqc.cmake new file mode 100644 index 0000000000000000000000000000000000000000..97912b59957d6dd93729ac7e56db3947ada10e4d --- /dev/null +++ b/scripts/cmake/iphreeqc.cmake @@ -0,0 +1,106 @@ +project(IPhreeqc CXX C) +set(IPHREEQC_VERSION 3.5.0) + +set(SOURCES + ${iphreeqc_SOURCE_DIR}/src/CSelectedOutput.cpp + ${iphreeqc_SOURCE_DIR}/src/fwrap.cpp + ${iphreeqc_SOURCE_DIR}/src/IPhreeqc.cpp + ${iphreeqc_SOURCE_DIR}/src/IPhreeqc_interface_F.cpp + ${iphreeqc_SOURCE_DIR}/src/IPhreeqcLib.cpp + ${iphreeqc_SOURCE_DIR}/src/Var.c + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/advection.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/basicsubs.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/cl1.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/cvdense.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/cvode.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/cxxKinetics.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/cxxMix.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/dense.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Dictionary.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/dumper.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Exchange.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/ExchComp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/GasComp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/gases.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/GasPhase.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/input.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/integrate.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/inverse.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/ISolution.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/ISolutionComp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/isotopes.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/kinetics.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/KineticsComp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/mainsubs.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/model.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/NameDouble.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/NumKeyword.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/nvector.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/nvector_serial.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/parse.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/PBasic.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/phqalloc.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Phreeqc.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/PHRQ_io_output.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/pitzer.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/pitzer_structures.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/PPassemblage.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/PPassemblageComp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/prep.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Pressure.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/print.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Reaction.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/read.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/ReadClass.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/readtr.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/runner.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SelectedOutput.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Serializer.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/sit.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/smalldense.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Solution.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SolutionIsotope.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/spread.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SS.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SSassemblage.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SScomp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/step.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/StorageBin.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/StorageBinList.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/structures.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/sundialsmath.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Surface.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SurfaceCharge.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/SurfaceComp.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/System.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/tally.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Temperature.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/tidy.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/transport.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/Use.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/UserPunch.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/utilities.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/common/Parser.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_base.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_io.cpp + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/common/Utils.cxx + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp +) + +# compile Var.c as c++ +SET_SOURCE_FILES_PROPERTIES(${iphreeqc_SOURCE_DIR}/src/Var.c PROPERTIES LANGUAGE CXX) + +add_library(iphreeqc STATIC ${SOURCES}) +target_include_directories(iphreeqc + PUBLIC + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/common + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords + ${iphreeqc_SOURCE_DIR}/src/phreeqcpp + ${iphreeqc_SOURCE_DIR}/src +) +target_compile_definitions(iphreeqc + PUBLIC LDBLE=double +) +# Exclude iphreeqc target from clang-tidy tests because it handles the above +# mentioned 'src/src/Var.c' file as c, not c++. +set_target_properties(iphreeqc PROPERTIES CXX_CLANG_TIDY "")