pyEQL 1.4.0rc9__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyEQL/__init__.py +50 -0
- pyEQL/_phreeqc.cp310-win_amd64.pyd +0 -0
- pyEQL/activity_correction.py +879 -0
- pyEQL/database/geothermal.dat +5693 -0
- pyEQL/database/llnl.dat +19305 -0
- pyEQL/database/phreeqc_license.txt +54 -0
- pyEQL/database/pyeql_db.json +35607 -0
- pyEQL/engines.py +1153 -0
- pyEQL/equilibrium.py +227 -0
- pyEQL/functions.py +281 -0
- pyEQL/phreeqc/__init__.py +5 -0
- pyEQL/phreeqc/bindings.cpp +84 -0
- pyEQL/phreeqc/core.py +239 -0
- pyEQL/phreeqc/database/Amm.dat +1968 -0
- pyEQL/phreeqc/database/CMakeLists.txt +32 -0
- pyEQL/phreeqc/database/ColdChem.dat +267 -0
- pyEQL/phreeqc/database/Concrete_PHR.dat +158 -0
- pyEQL/phreeqc/database/Concrete_PZ.dat +195 -0
- pyEQL/phreeqc/database/Kinec.v2.dat +12039 -0
- pyEQL/phreeqc/database/Kinec_v3.dat +12159 -0
- pyEQL/phreeqc/database/Makefile.am +28 -0
- pyEQL/phreeqc/database/Makefile.in +530 -0
- pyEQL/phreeqc/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
- pyEQL/phreeqc/database/Tipping_Hurley.dat +4137 -0
- pyEQL/phreeqc/database/__init__.py +0 -0
- pyEQL/phreeqc/database/core10.dat +6824 -0
- pyEQL/phreeqc/database/frezchem.dat +634 -0
- pyEQL/phreeqc/database/iso.dat +7235 -0
- pyEQL/phreeqc/database/llnl.dat +19310 -0
- pyEQL/phreeqc/database/minteq.dat +5654 -0
- pyEQL/phreeqc/database/minteq.v4.dat +13212 -0
- pyEQL/phreeqc/database/phreeqc.dat +1972 -0
- pyEQL/phreeqc/database/phreeqc_rates.dat +3158 -0
- pyEQL/phreeqc/database/pitzer.dat +1044 -0
- pyEQL/phreeqc/database/sit.dat +14348 -0
- pyEQL/phreeqc/database/wateq4f.dat +4036 -0
- pyEQL/phreeqc/ext/README.md +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/CMakeLists.txt +476 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/INSTALL +302 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqc.rc +61 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqcConfig.cmake.in +4 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.am +8 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.in +816 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/aclocal.m4 +1217 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/ALL_BUILD.vcxproj +185 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/ALL_BUILD.vcxproj.filters +8 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/generate.stamp +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/generate.stamp.depend +79 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CTestTestfile.cmake +6 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Continuous.vcxproj +240 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Continuous.vcxproj.filters +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/DartConfiguration.tcl +109 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Experimental.vcxproj +240 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Experimental.vcxproj.filters +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/INSTALL.vcxproj +209 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/INSTALL.vcxproj.filters +13 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/CSelectedOutput.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Dictionary.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/ExchComp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Exchange.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/GasComp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/GasPhase.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.lib.recipe +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/CL.command.1.tlog +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/CL.read.1.tlog +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/CL.write.1.tlog +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/Cl.items.tlog +82 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/CustomBuild.command.1.tlog +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/CustomBuild.read.1.tlog +78 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/CustomBuild.write.1.tlog +2 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/IPhreeqc.lastbuildstate +2 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/Lib-link.read.1.tlog +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/Lib-link.write.1.tlog +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc.tlog/Lib.command.1.tlog +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqcLib.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/IPhreeqc_interface_F.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/ISolution.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/ISolutionComp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Keywords.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/KineticsComp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/NameDouble.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/NumKeyword.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/PBasic.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/PHRQ_base.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/PHRQ_io.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/PHRQ_io_output.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/PPassemblage.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/PPassemblageComp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Parser.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Phreeqc.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Pressure.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Reaction.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/ReadClass.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SS.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SSassemblage.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SScomp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SelectedOutput.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Serializer.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Solution.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SolutionIsotope.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/StorageBin.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/StorageBinList.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Surface.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SurfaceCharge.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/SurfaceComp.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/System.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Temperature.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Use.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/UserPunch.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Utils.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/Var.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/advection.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/basicsubs.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/cl1.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/cvdense.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/cvode.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/cxxKinetics.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/cxxMix.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/dense.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/dumper.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/gases.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/input.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/integrate.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/inverse.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/isotopes.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/kinetics.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/mainsubs.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/model.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/nvector.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/nvector_serial.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/parse.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/phqalloc.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/pitzer.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/pitzer_structures.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/prep.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/print.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/read.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/readtr.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/runner.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/sit.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/smalldense.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/spread.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/step.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/structures.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/sundialsmath.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/tally.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/tidy.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/transport.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.dir/Release/utilities.obj +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.sln +116 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.vcxproj +443 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/IPhreeqc.vcxproj.filters +456 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Nightly.vcxproj +240 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Nightly.vcxproj.filters +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/NightlyMemoryCheck.vcxproj +240 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/NightlyMemoryCheck.vcxproj.filters +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/Release/IPhreeqc.lib +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/cmake_install.cmake +40 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ar-lib +270 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/compile +347 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.guess +1441 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.sub +1813 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/depcomp +791 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/install-sh +508 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ltmain.sh +11156 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/missing +215 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/test-driver +148 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure +23867 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure.ac +136 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Amm.dat +1968 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/CMakeLists.txt +32 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/ColdChem.dat +267 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PHR.dat +158 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PZ.dat +195 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec.v2.dat +12039 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec_v3.dat +12159 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.am +28 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.in +530 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Tipping_Hurley.dat +4137 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/core10.dat +6824 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/frezchem.dat +634 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/iso.dat +7235 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/llnl.dat +19310 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.dat +5654 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.v4.dat +13212 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc.dat +1972 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc_rates.dat +3158 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/pitzer.dat +1044 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/sit.dat +14348 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/wateq4f.dat +4036 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/CMakeLists.txt +35 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/IPhreeqc.pdf +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.am +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.in +545 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/NOTICE +51 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_2_1999_manual.pdf +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_3_2013_manual.pdf +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/README +428 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/RELEASE +7294 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h.html +5096 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h_source.html +389 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp.html +83 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp_source.html +478 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h.html +318 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h_source.html +200 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bc_s.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bdwn.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.html +2274 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.html +69 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/closed.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +68 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.css +1440 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dynsections.js +97 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2blank.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2doc.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderclosed.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderopen.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2lastnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2link.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mlastnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2node.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2plastnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2pnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2splitbar.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2vertline.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/index.html +58 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/jquery.js +31 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_f.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_g.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_h.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/open.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/structVAR.html +143 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_off.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_on.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_a.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_b.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_h.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_s.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tabs.css +60 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/phreeqc3.chm +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/CMakeLists.txt +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.am +88 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.in +696 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/CMakeLists.txt +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt +35 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt.in +21 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/README.txt +44 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/advect.c +101 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/ic +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/phreeqc.dat +1579 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/CMakeLists.txt +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/README.txt +3 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/CMakeLists.txt +9 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/phreeqc.dat +1582 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/runphreeqc.xls +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/withcallback.xls +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/CMakeLists.txt +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/Gypsum.py +52 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/parallel_advect.py +465 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/phreeqc.dat +1582 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/pitzer.dat +790 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/wateq4f.dat +3846 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/CMakeLists.txt +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt +35 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt.in +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/README.txt +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/advect.cpp +110 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/ic +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/phreeqc.dat +1579 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/CMakeLists.txt +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt +44 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt.in +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/README.txt +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/advect.F90 +102 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/ic +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/phreeqc.dat +1579 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt +26 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt.in +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/README.txt +37 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/ex2 +26 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/main.cpp +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/phreeqc.dat +1837 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/post-install.cmake.in +7 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/CMakeLists.txt +185 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.cpp +171 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.h +34 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.am +18 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.in +466 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestCVar.cpp +9 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqc.cpp +4901 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqcLib.cpp +4644 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestSelectedOutput.cpp +669 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestVar.cpp +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/conv_fail.in +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/dump +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/iso.dat +7231 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/kinn20140218 +349 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/missing_e.dat +1556 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch +105 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch_no_set +102 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.90a6449 +1935 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.old +1556 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/libtool.m4 +8388 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltoptions.m4 +437 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltsugar.m4 +124 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltversion.m4 +23 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/lt~obsolete.m4 +99 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/resource.h +14 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.cpp +401 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.hxx +77 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CVar.hxx +162 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Debug.h +12 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/ErrorReporter.hxx +70 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.cpp +1889 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f.inc +91 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f90.inc +603 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.h +2182 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.hpp +1027 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcCallbacks.h +19 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcF.f +653 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcLib.cpp +1098 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface.F90 +1283 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.cpp +535 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.h +162 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.am +210 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.in +1294 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/README.Fortran +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.c +84 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.h +152 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Version.h +36 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fimpl.h +282 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.cpp +646 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.h +163 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap1.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap2.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap3.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap4.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap5.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap6.cpp +25 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap7.cpp +25 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap8.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.cpp +225 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.h +59 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.cpp +1382 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.h +444 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.cpp +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.h +79 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.cpp +41 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.h +28 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.cxx +398 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.h +117 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.cxx +466 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.h +74 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.h +1184 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.resX +36 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.cxx +265 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.h +59 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.cxx +659 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.h +103 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.cxx +40 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.h +53 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.cxx +202 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.h +138 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.cxx +318 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.h +81 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NA.h +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.cxx +537 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.h +66 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.cxx +190 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.h +67 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.cpp +8350 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.h +572 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PHRQ_io_output.cpp +411 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.cxx +375 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.h +70 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.cxx +441 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.h +83 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.cpp +2087 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.h +2164 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp +242 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.h +104 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.cxx +417 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.h +43 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.cxx +284 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.h +57 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ReadClass.cxx +1150 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.cxx +609 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.h +128 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.cxx +317 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.h +59 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.cxx +297 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.h +66 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.cpp +115 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.h +209 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.cxx +213 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.h +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.cxx +1795 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.h +154 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.cxx +333 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.h +85 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.cxx +1507 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.h +141 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.cpp +358 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.h +81 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.cxx +837 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.h +108 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.cxx +617 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.h +137 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.cxx +509 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.h +70 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.cxx +103 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.h +89 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.cxx +423 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.h +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.cpp +78 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.h +159 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.cpp +32 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.h +39 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ZedGraph.dll +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/advection.cpp +140 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/basicsubs.cpp +4333 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cl1.cpp +881 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.cxx +117 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.h +48 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_exports.h +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.cpp +914 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.h +207 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.cxx +1331 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.h +310 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.cxx +263 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.h +29 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/phrqtype.h +18 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.cpp +566 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.h +267 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.cpp +3939 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.h +940 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.cxx +617 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.h +78 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.cxx +154 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.h +58 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.cpp +175 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.h +341 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.cpp +277 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.h +60 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/gases.cpp +748 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/global_structures.h +1672 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/input.cpp +133 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/integrate.cpp +1219 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/inverse.cpp +5135 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/isotopes.cpp +1813 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/kinetics.cpp +3180 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/mainsubs.cpp +2320 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/model.cpp +5843 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.cpp +272 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.h +485 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.cpp +1032 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.h +369 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/parse.cpp +1044 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.cpp +316 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.h +47 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer.cpp +2709 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer_structures.cpp +225 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/prep.cpp +6267 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/print.cpp +3673 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/read.cpp +10245 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/readtr.cpp +1495 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.cpp +158 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.h +33 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sit.cpp +1684 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.cpp +324 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.h +261 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/spread.cpp +1309 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/step.cpp +1566 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/structures.cpp +3381 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.cpp +133 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.h +162 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialstypes.h +183 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tally.cpp +1288 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tidy.cpp +5600 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/transport.cpp +6403 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/utilities.cpp +1339 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/thread.h +64 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/CMakeLists.txt +133 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.am +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.in +1128 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/ex2.in +26 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main.f90 +31 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main77.f +6 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main_fortran.cxx +8 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/phreeqc.dat.in +1556 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_c.c +148 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_cxx.cxx +152 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_f90.F90 +328 -0
- pyEQL/phreeqc/iphreeqc_wrapper.cpp +75 -0
- pyEQL/phreeqc/solution.py +74 -0
- pyEQL/phreeqc/var.py +50 -0
- pyEQL/presets/Ringers lactate.yaml +20 -0
- pyEQL/presets/__init__.py +17 -0
- pyEQL/presets/normal saline.yaml +17 -0
- pyEQL/presets/rainwater.yaml +17 -0
- pyEQL/presets/seawater.yaml +29 -0
- pyEQL/presets/urine.yaml +26 -0
- pyEQL/presets/wastewater.yaml +21 -0
- pyEQL/py.typed +0 -0
- pyEQL/salt_ion_match.py +112 -0
- pyEQL/solute.py +163 -0
- pyEQL/solution.py +2714 -0
- pyEQL/utils.py +237 -0
- pyeql-1.4.0rc9.dist-info/METADATA +130 -0
- pyeql-1.4.0rc9.dist-info/RECORD +519 -0
- pyeql-1.4.0rc9.dist-info/WHEEL +5 -0
- pyeql-1.4.0rc9.dist-info/licenses/AUTHORS.md +21 -0
- pyeql-1.4.0rc9.dist-info/licenses/LICENSE.txt +20 -0
|
@@ -0,0 +1,1889 @@
|
|
|
1
|
+
#include <memory> // auto_ptr
|
|
2
|
+
#include <map>
|
|
3
|
+
#include <string.h>
|
|
4
|
+
#include "IPhreeqc.hpp" // IPhreeqc
|
|
5
|
+
#include "Phreeqc.h" // Phreeqc
|
|
6
|
+
#include "thread.h"
|
|
7
|
+
#include "Version.h"
|
|
8
|
+
|
|
9
|
+
#include "Debug.h" // ASSERT
|
|
10
|
+
#include "ErrorReporter.hxx" // CErrorReporter
|
|
11
|
+
#include "CSelectedOutput.hxx" // CSelectedOutput
|
|
12
|
+
#include "SelectedOutput.h" // SelectedOutput
|
|
13
|
+
#include "dumper.h" // dumper
|
|
14
|
+
|
|
15
|
+
// statics
|
|
16
|
+
std::map<size_t, IPhreeqc*> IPhreeqc::Instances;
|
|
17
|
+
size_t IPhreeqc::InstancesIndex = 0;
|
|
18
|
+
|
|
19
|
+
std::string IPhreeqc::Version(VERSION_STRING);
|
|
20
|
+
|
|
21
|
+
static const char empty[] = "";
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
IPhreeqc::IPhreeqc(void)
|
|
25
|
+
: DatabaseLoaded(false)
|
|
26
|
+
, ClearAccumulated(false)
|
|
27
|
+
, UpdateComponents(true)
|
|
28
|
+
, OutputFileOn(false)
|
|
29
|
+
, LogFileOn(false)
|
|
30
|
+
, ErrorFileOn(false)
|
|
31
|
+
, DumpOn(false)
|
|
32
|
+
, DumpStringOn(false)
|
|
33
|
+
, OutputStringOn(false)
|
|
34
|
+
, LogStringOn(false)
|
|
35
|
+
, ErrorStringOn(true)
|
|
36
|
+
, ErrorReporter(0)
|
|
37
|
+
, WarningStringOn(true)
|
|
38
|
+
, WarningReporter(0)
|
|
39
|
+
, CurrentSelectedOutputUserNumber(1)
|
|
40
|
+
, PhreeqcPtr(0)
|
|
41
|
+
, input_file(0)
|
|
42
|
+
, database_file(0)
|
|
43
|
+
{
|
|
44
|
+
this->ErrorReporter = new CErrorReporter<std::ostringstream>;
|
|
45
|
+
this->WarningReporter = new CErrorReporter<std::ostringstream>;
|
|
46
|
+
this->PhreeqcPtr = new Phreeqc(this);
|
|
47
|
+
|
|
48
|
+
ASSERT(this->PhreeqcPtr->phast == 0);
|
|
49
|
+
this->UnLoadDatabase();
|
|
50
|
+
|
|
51
|
+
mutex_lock(&map_lock);
|
|
52
|
+
this->Index = IPhreeqc::InstancesIndex++;
|
|
53
|
+
std::map<size_t, IPhreeqc*>::value_type instance(this->Index, this);
|
|
54
|
+
/*std::pair<std::map<size_t, IPhreeqc*>::iterator, bool> pr = */IPhreeqc::Instances.insert(instance);
|
|
55
|
+
mutex_unlock(&map_lock);
|
|
56
|
+
|
|
57
|
+
this->SelectedOutputStringOn[1] = false;
|
|
58
|
+
|
|
59
|
+
this->SelectedOutputFileOnMap[1] = false;
|
|
60
|
+
this->SelectedOutputFileNameMap[1] = this->sel_file_name(1);
|
|
61
|
+
|
|
62
|
+
this->OutputFileName = create_file_name("phreeqc", "out");
|
|
63
|
+
this->ErrorFileName = create_file_name("phreeqc", "err");
|
|
64
|
+
this->LogFileName = create_file_name("phreeqc", "log");
|
|
65
|
+
|
|
66
|
+
this->DumpFileName = create_file_name("dump", "out");
|
|
67
|
+
this->PhreeqcPtr->dump_info.Set_file_name(this->DumpFileName);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
IPhreeqc::~IPhreeqc(void)
|
|
71
|
+
{
|
|
72
|
+
#if !defined(NDEBUG)
|
|
73
|
+
this->OutputFileOn = false;
|
|
74
|
+
#endif
|
|
75
|
+
delete this->PhreeqcPtr;
|
|
76
|
+
delete this->WarningReporter;
|
|
77
|
+
delete this->ErrorReporter;
|
|
78
|
+
|
|
79
|
+
std::map< int, CSelectedOutput* >::iterator sit = this->SelectedOutputMap.begin();
|
|
80
|
+
for (; sit != this->SelectedOutputMap.end(); ++sit)
|
|
81
|
+
{
|
|
82
|
+
delete (*sit).second;
|
|
83
|
+
}
|
|
84
|
+
this->SelectedOutputMap.clear();
|
|
85
|
+
|
|
86
|
+
mutex_lock(&map_lock);
|
|
87
|
+
std::map<size_t, IPhreeqc*>::iterator it = IPhreeqc::Instances.find(this->Index);
|
|
88
|
+
if (it != IPhreeqc::Instances.end())
|
|
89
|
+
{
|
|
90
|
+
IPhreeqc::Instances.erase(it);
|
|
91
|
+
}
|
|
92
|
+
mutex_unlock(&map_lock);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
VRESULT IPhreeqc::AccumulateLine(const char *line)
|
|
96
|
+
{
|
|
97
|
+
try
|
|
98
|
+
{
|
|
99
|
+
if (this->ClearAccumulated)
|
|
100
|
+
{
|
|
101
|
+
this->ClearAccumulatedLines();
|
|
102
|
+
this->ClearAccumulated = false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
this->ErrorReporter->Clear();
|
|
106
|
+
this->WarningReporter->Clear();
|
|
107
|
+
this->StringInput.append(line);
|
|
108
|
+
this->StringInput.append("\n");
|
|
109
|
+
return VR_OK;
|
|
110
|
+
}
|
|
111
|
+
catch (...)
|
|
112
|
+
{
|
|
113
|
+
this->AddError("AccumulateLine: An unhandled exception occurred.\n");
|
|
114
|
+
throw;
|
|
115
|
+
}
|
|
116
|
+
return VR_OUTOFMEMORY;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
size_t IPhreeqc::AddError(const char* str)
|
|
120
|
+
{
|
|
121
|
+
return this->ErrorReporter->AddError(str);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
size_t IPhreeqc::AddWarning(const char* str)
|
|
125
|
+
{
|
|
126
|
+
return this->WarningReporter->AddError(str);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
void IPhreeqc::ClearAccumulatedLines(void)
|
|
130
|
+
{
|
|
131
|
+
this->StringInput.erase();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const std::string& IPhreeqc::GetAccumulatedLines(void)
|
|
135
|
+
{
|
|
136
|
+
return this->StringInput;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const char* IPhreeqc::GetComponent(int n)
|
|
140
|
+
{
|
|
141
|
+
static const char empty[] = "";
|
|
142
|
+
this->ListComponents();
|
|
143
|
+
if (n < 0 || n >= (int)this->Components.size())
|
|
144
|
+
{
|
|
145
|
+
return empty;
|
|
146
|
+
}
|
|
147
|
+
std::list< std::string >::iterator it = this->Components.begin();
|
|
148
|
+
for(int i = 0; i < n; ++i)
|
|
149
|
+
{
|
|
150
|
+
++it;
|
|
151
|
+
}
|
|
152
|
+
return (*it).c_str();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
size_t IPhreeqc::GetComponentCount(void)
|
|
156
|
+
{
|
|
157
|
+
this->ListComponents();
|
|
158
|
+
return this->Components.size();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
int IPhreeqc::GetCurrentSelectedOutputUserNumber(void)const
|
|
162
|
+
{
|
|
163
|
+
return this->CurrentSelectedOutputUserNumber;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const char* IPhreeqc::GetDumpFileName(void)const
|
|
167
|
+
{
|
|
168
|
+
return this->DumpFileName.c_str();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
bool IPhreeqc::GetDumpFileOn(void)const
|
|
172
|
+
{
|
|
173
|
+
return this->DumpOn;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const char* IPhreeqc::GetDumpString(void)const
|
|
177
|
+
{
|
|
178
|
+
static const char err_msg[] = "GetDumpString: DumpStringOn not set.\n";
|
|
179
|
+
if (!this->DumpStringOn)
|
|
180
|
+
{
|
|
181
|
+
return err_msg;
|
|
182
|
+
}
|
|
183
|
+
return this->DumpString.c_str();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const char* IPhreeqc::GetDumpStringLine(int n)
|
|
187
|
+
{
|
|
188
|
+
static const char empty[] = "";
|
|
189
|
+
if (n < 0 || n >= this->GetDumpStringLineCount())
|
|
190
|
+
{
|
|
191
|
+
return empty;
|
|
192
|
+
}
|
|
193
|
+
return this->DumpLines[n].c_str();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
int IPhreeqc::GetDumpStringLineCount(void)const
|
|
197
|
+
{
|
|
198
|
+
return (int)this->DumpLines.size();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
bool IPhreeqc::GetDumpStringOn(void)const
|
|
202
|
+
{
|
|
203
|
+
return this->DumpStringOn;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const char* IPhreeqc::GetErrorFileName(void)const
|
|
207
|
+
{
|
|
208
|
+
return this->ErrorFileName.c_str();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
bool IPhreeqc::GetErrorFileOn(void)const
|
|
212
|
+
{
|
|
213
|
+
return this->ErrorFileOn;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
bool IPhreeqc::GetErrorOn(void)const
|
|
217
|
+
{
|
|
218
|
+
return this->Get_error_on();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const char* IPhreeqc::GetErrorString(void)
|
|
222
|
+
{
|
|
223
|
+
static const char err_msg[] = "GetErrorString: ErrorStringOn not set.\n";
|
|
224
|
+
static const char err_msg2[] = "GetErrorString: ErrorOn not set.\n";
|
|
225
|
+
if (!this->error_on)
|
|
226
|
+
{
|
|
227
|
+
return err_msg2;
|
|
228
|
+
}
|
|
229
|
+
if (!this->ErrorStringOn)
|
|
230
|
+
{
|
|
231
|
+
return err_msg;
|
|
232
|
+
}
|
|
233
|
+
this->ErrorString = ((CErrorReporter<std::ostringstream>*)this->ErrorReporter)->GetOS()->str();
|
|
234
|
+
return this->ErrorString.c_str();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const char* IPhreeqc::GetErrorStringLine(int n)
|
|
238
|
+
{
|
|
239
|
+
static const char empty[] = "";
|
|
240
|
+
if (n < 0 || n >= this->GetErrorStringLineCount())
|
|
241
|
+
{
|
|
242
|
+
return empty;
|
|
243
|
+
}
|
|
244
|
+
return this->ErrorLines[n].c_str();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
int IPhreeqc::GetErrorStringLineCount(void)const
|
|
248
|
+
{
|
|
249
|
+
return (int)this->ErrorLines.size();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
bool IPhreeqc::GetErrorStringOn(void)const
|
|
253
|
+
{
|
|
254
|
+
return this->ErrorStringOn;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
int IPhreeqc::GetId(void)const
|
|
258
|
+
{
|
|
259
|
+
return (int)this->Index;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const char* IPhreeqc::GetLogFileName(void)const
|
|
263
|
+
{
|
|
264
|
+
return this->LogFileName.c_str();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
bool IPhreeqc::GetLogFileOn(void)const
|
|
268
|
+
{
|
|
269
|
+
return this->LogFileOn;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const char* IPhreeqc::GetLogString(void)const
|
|
273
|
+
{
|
|
274
|
+
static const char err_msg[] = "GetLogString: LogStringOn not set.\n";
|
|
275
|
+
if (!this->LogStringOn)
|
|
276
|
+
{
|
|
277
|
+
return err_msg;
|
|
278
|
+
}
|
|
279
|
+
return this->LogString.c_str();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const char* IPhreeqc::GetLogStringLine(int n)const
|
|
283
|
+
{
|
|
284
|
+
static const char empty[] = "";
|
|
285
|
+
if (n < 0 || n >= this->GetLogStringLineCount())
|
|
286
|
+
{
|
|
287
|
+
return empty;
|
|
288
|
+
}
|
|
289
|
+
return this->LogLines[n].c_str();
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
int IPhreeqc::GetLogStringLineCount(void)const
|
|
293
|
+
{
|
|
294
|
+
return (int)this->LogLines.size();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
bool IPhreeqc::GetLogStringOn(void)const
|
|
298
|
+
{
|
|
299
|
+
return this->LogStringOn;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
int IPhreeqc::GetNthSelectedOutputUserNumber(int n)const
|
|
303
|
+
{
|
|
304
|
+
int nth = VR_INVALIDARG;
|
|
305
|
+
std::map< int, SelectedOutput >::const_iterator ci = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
306
|
+
for (int i = 0; ci != this->PhreeqcPtr->SelectedOutput_map.end(); ++ci, ++i)
|
|
307
|
+
{
|
|
308
|
+
if (i == n)
|
|
309
|
+
{
|
|
310
|
+
nth = (*ci).first;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return nth;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const char* IPhreeqc::GetOutputFileName(void)const
|
|
318
|
+
{
|
|
319
|
+
return this->OutputFileName.c_str();
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
bool IPhreeqc::GetOutputFileOn(void)const
|
|
323
|
+
{
|
|
324
|
+
return this->OutputFileOn;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const char* IPhreeqc::GetOutputString(void)const
|
|
328
|
+
{
|
|
329
|
+
static const char err_msg[] = "GetOutputString: OutputStringOn not set.\n";
|
|
330
|
+
if (!this->OutputStringOn)
|
|
331
|
+
{
|
|
332
|
+
return err_msg;
|
|
333
|
+
}
|
|
334
|
+
return this->OutputString.c_str();
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const char* IPhreeqc::GetOutputStringLine(int n)const
|
|
338
|
+
{
|
|
339
|
+
static const char empty[] = "";
|
|
340
|
+
if (n < 0 || n >= this->GetOutputStringLineCount())
|
|
341
|
+
{
|
|
342
|
+
return empty;
|
|
343
|
+
}
|
|
344
|
+
return this->OutputLines[n].c_str();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
int IPhreeqc::GetOutputStringLineCount(void)const
|
|
348
|
+
{
|
|
349
|
+
return (int)this->OutputLines.size();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
bool IPhreeqc::GetOutputStringOn(void)const
|
|
353
|
+
{
|
|
354
|
+
return this->OutputStringOn;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
int IPhreeqc::GetSelectedOutputColumnCount(void)const
|
|
358
|
+
{
|
|
359
|
+
std::map< int, CSelectedOutput* >::const_iterator ci = this->SelectedOutputMap.find(this->CurrentSelectedOutputUserNumber);
|
|
360
|
+
if (ci != this->SelectedOutputMap.end())
|
|
361
|
+
{
|
|
362
|
+
return (int)(*ci).second->GetColCount();
|
|
363
|
+
}
|
|
364
|
+
return 0;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
int IPhreeqc::GetSelectedOutputCount(void)const
|
|
368
|
+
{
|
|
369
|
+
ASSERT(this->PhreeqcPtr->SelectedOutput_map.size() == this->SelectedOutputMap.size());
|
|
370
|
+
return (int) this->PhreeqcPtr->SelectedOutput_map.size();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const char* IPhreeqc::GetSelectedOutputFileName(void)const
|
|
374
|
+
{
|
|
375
|
+
static const char empty[] = "";
|
|
376
|
+
std::map< int, std::string >::const_iterator ci = this->SelectedOutputFileNameMap.find(this->CurrentSelectedOutputUserNumber);
|
|
377
|
+
if (ci != this->SelectedOutputFileNameMap.end())
|
|
378
|
+
{
|
|
379
|
+
return (*ci).second.c_str();
|
|
380
|
+
}
|
|
381
|
+
return empty;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
bool IPhreeqc::GetSelectedOutputFileOn(void)const
|
|
385
|
+
{
|
|
386
|
+
return this->get_sel_out_file_on(this->CurrentSelectedOutputUserNumber);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
int IPhreeqc::GetSelectedOutputRowCount(void)const
|
|
390
|
+
{
|
|
391
|
+
std::map< int, CSelectedOutput* >::const_iterator ci = this->SelectedOutputMap.find(this->CurrentSelectedOutputUserNumber);
|
|
392
|
+
if (ci != this->SelectedOutputMap.end())
|
|
393
|
+
{
|
|
394
|
+
return (int)(*ci).second->GetRowCount();
|
|
395
|
+
}
|
|
396
|
+
return 0;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const char* IPhreeqc::GetSelectedOutputString(void)const
|
|
400
|
+
{
|
|
401
|
+
static const char err_msg[] = "GetSelectedOutputString: SelectedOutputStringOn not set.\n";
|
|
402
|
+
std::map< int, bool >::const_iterator ci = this->SelectedOutputStringOn.find(this->CurrentSelectedOutputUserNumber);
|
|
403
|
+
if (ci == this->SelectedOutputStringOn.end())
|
|
404
|
+
{
|
|
405
|
+
return err_msg;
|
|
406
|
+
}
|
|
407
|
+
std::map< int, std::string >::const_iterator cit = this->SelectedOutputStringMap.find(this->CurrentSelectedOutputUserNumber);
|
|
408
|
+
if (cit != this->SelectedOutputStringMap.end())
|
|
409
|
+
{
|
|
410
|
+
return (*cit).second.c_str();
|
|
411
|
+
}
|
|
412
|
+
return empty;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const char* IPhreeqc::GetSelectedOutputStringLine(int n)
|
|
416
|
+
{
|
|
417
|
+
static const char empty[] = "";
|
|
418
|
+
if (n < 0 || n >= this->GetSelectedOutputStringLineCount())
|
|
419
|
+
{
|
|
420
|
+
return empty;
|
|
421
|
+
}
|
|
422
|
+
// don't need to check CurrentSelectedOutputUserNumber since
|
|
423
|
+
// GetSelectedOutputStringLineCount will catch
|
|
424
|
+
return this->SelectedOutputLinesMap[this->CurrentSelectedOutputUserNumber][n].c_str();
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
int IPhreeqc::GetSelectedOutputStringLineCount(void)const
|
|
428
|
+
{
|
|
429
|
+
std::map< int, std::vector < std::string > >::const_iterator cit = this->SelectedOutputLinesMap.find(this->CurrentSelectedOutputUserNumber);
|
|
430
|
+
if (cit != this->SelectedOutputLinesMap.end())
|
|
431
|
+
{
|
|
432
|
+
return (int) (*cit).second.size();
|
|
433
|
+
}
|
|
434
|
+
return 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
bool IPhreeqc::GetSelectedOutputStringOn(void)const
|
|
438
|
+
{
|
|
439
|
+
return this->get_sel_out_string_on(this->CurrentSelectedOutputUserNumber);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
|
443
|
+
{
|
|
444
|
+
VRESULT v;
|
|
445
|
+
this->ErrorReporter->Clear();
|
|
446
|
+
if (!pVAR)
|
|
447
|
+
{
|
|
448
|
+
this->AddError("GetSelectedOutputValue: VR_INVALIDARG pVAR is NULL.\n");
|
|
449
|
+
this->update_errors();
|
|
450
|
+
return VR_INVALIDARG;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
std::map< int, CSelectedOutput* >::const_iterator ci = this->SelectedOutputMap.find(this->CurrentSelectedOutputUserNumber);
|
|
454
|
+
if (ci != this->SelectedOutputMap.end())
|
|
455
|
+
{
|
|
456
|
+
v = (*ci).second->Get(row, col, pVAR);
|
|
457
|
+
switch (v)
|
|
458
|
+
{
|
|
459
|
+
case VR_OK:
|
|
460
|
+
break;
|
|
461
|
+
case VR_INVALIDROW:
|
|
462
|
+
this->AddError("GetSelectedOutputValue: VR_INVALIDROW Row index out of range.\n");
|
|
463
|
+
this->update_errors();
|
|
464
|
+
break;
|
|
465
|
+
case VR_INVALIDCOL:
|
|
466
|
+
this->AddError("GetSelectedOutputValue: VR_INVALIDCOL Column index out of range.\n");
|
|
467
|
+
this->update_errors();
|
|
468
|
+
break;
|
|
469
|
+
case VR_OUTOFMEMORY:
|
|
470
|
+
this->AddError("GetSelectedOutputValue: VR_OUTOFMEMORY Out of memory.\n");
|
|
471
|
+
this->update_errors();
|
|
472
|
+
break;
|
|
473
|
+
case VR_BADVARTYPE:
|
|
474
|
+
this->AddError("GetSelectedOutputValue: VR_BADVARTYPE pVar must be initialized(VarInit) and/or cleared(VarClear).\n");
|
|
475
|
+
this->update_errors();
|
|
476
|
+
break;
|
|
477
|
+
case VR_INVALIDARG:
|
|
478
|
+
// not possible
|
|
479
|
+
break;
|
|
480
|
+
default:
|
|
481
|
+
assert(0);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
else
|
|
485
|
+
{
|
|
486
|
+
char buffer[120];
|
|
487
|
+
v = VR_INVALIDARG;
|
|
488
|
+
::snprintf(buffer, sizeof(buffer), "GetSelectedOutputValue: VR_INVALIDARG Invalid selected-output user number %d.\n", this->CurrentSelectedOutputUserNumber);
|
|
489
|
+
this->AddError(buffer);
|
|
490
|
+
this->update_errors();
|
|
491
|
+
}
|
|
492
|
+
return v;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
VRESULT IPhreeqc::GetSelectedOutputValue2(int row, int col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length)
|
|
496
|
+
{
|
|
497
|
+
VRESULT result;
|
|
498
|
+
VAR v;
|
|
499
|
+
VarInit(&v);
|
|
500
|
+
char buffer[100];
|
|
501
|
+
|
|
502
|
+
result = this->GetSelectedOutputValue(row, col, &v);
|
|
503
|
+
|
|
504
|
+
switch (v.type)
|
|
505
|
+
{
|
|
506
|
+
case TT_EMPTY:
|
|
507
|
+
*vtype = v.type;
|
|
508
|
+
break;
|
|
509
|
+
case TT_ERROR:
|
|
510
|
+
*vtype = v.type;
|
|
511
|
+
break;
|
|
512
|
+
case TT_LONG:
|
|
513
|
+
*vtype = TT_DOUBLE;
|
|
514
|
+
*dvalue = (double)v.lVal;
|
|
515
|
+
::snprintf(buffer, sizeof(buffer), "%ld", v.lVal);
|
|
516
|
+
::strncpy(svalue, buffer, svalue_length);
|
|
517
|
+
break;
|
|
518
|
+
case TT_DOUBLE:
|
|
519
|
+
*vtype = v.type;
|
|
520
|
+
*dvalue = v.dVal;
|
|
521
|
+
::snprintf(buffer, sizeof(buffer), "%23.15e", v.dVal);
|
|
522
|
+
::strncpy(svalue, buffer, svalue_length);
|
|
523
|
+
break;
|
|
524
|
+
case TT_STRING:
|
|
525
|
+
*vtype = v.type;
|
|
526
|
+
::strncpy(svalue, v.sVal, svalue_length);
|
|
527
|
+
break;
|
|
528
|
+
default:
|
|
529
|
+
assert(0);
|
|
530
|
+
}
|
|
531
|
+
::VarClear(&v);
|
|
532
|
+
return result;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
const char* IPhreeqc::GetVersionString(void)
|
|
536
|
+
{
|
|
537
|
+
return IPhreeqc::Version.c_str();
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
const char* IPhreeqc::GetWarningString(void)
|
|
541
|
+
{
|
|
542
|
+
this->WarningString = ((CErrorReporter<std::ostringstream>*)this->WarningReporter)->GetOS()->str();
|
|
543
|
+
return this->WarningString.c_str();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
const char* IPhreeqc::GetWarningStringLine(int n)
|
|
547
|
+
{
|
|
548
|
+
static const char empty[] = "";
|
|
549
|
+
if (n < 0 || n >= this->GetWarningStringLineCount())
|
|
550
|
+
{
|
|
551
|
+
return empty;
|
|
552
|
+
}
|
|
553
|
+
return this->WarningLines[n].c_str();
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
int IPhreeqc::GetWarningStringLineCount(void)const
|
|
557
|
+
{
|
|
558
|
+
return (int)this->WarningLines.size();
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
std::list< std::string > IPhreeqc::ListComponents(void)
|
|
562
|
+
{
|
|
563
|
+
if (this->UpdateComponents)
|
|
564
|
+
{
|
|
565
|
+
this->Components.clear();
|
|
566
|
+
this->PhreeqcPtr->list_components(this->Components);
|
|
567
|
+
this->PhreeqcPtr->list_EquilibriumPhases(this->EquilibriumPhasesList);
|
|
568
|
+
this->PhreeqcPtr->list_GasComponents(this->GasComponentsList);
|
|
569
|
+
this->PhreeqcPtr->list_KineticReactions(this->KineticReactionsList);
|
|
570
|
+
this->PhreeqcPtr->list_SolidSolutions(this->SolidSolutionComponentsList,this->SolidSolutionNamesList);
|
|
571
|
+
this->PhreeqcPtr->list_Surfaces(this->SurfaceTypeList, this->SurfaceNamesList);
|
|
572
|
+
this->PhreeqcPtr->list_Exchangers(this->ExchangeNamesList);
|
|
573
|
+
this->UpdateComponents = false;
|
|
574
|
+
}
|
|
575
|
+
return this->Components;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
int IPhreeqc::load_db(const char* filename)
|
|
579
|
+
{
|
|
580
|
+
try
|
|
581
|
+
{
|
|
582
|
+
// cleanup
|
|
583
|
+
//
|
|
584
|
+
this->UnLoadDatabase();
|
|
585
|
+
|
|
586
|
+
// open file
|
|
587
|
+
//
|
|
588
|
+
std::ifstream ifs;
|
|
589
|
+
ifs.open(filename);
|
|
590
|
+
|
|
591
|
+
if (!ifs.is_open())
|
|
592
|
+
{
|
|
593
|
+
std::ostringstream oss;
|
|
594
|
+
oss << "LoadDatabase: Unable to open:" << "\"" << filename << "\".";
|
|
595
|
+
this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// read input
|
|
599
|
+
//
|
|
600
|
+
ASSERT(this->PhreeqcPtr->phrq_io->get_istream() == NULL);
|
|
601
|
+
this->PhreeqcPtr->phrq_io->push_istream(&ifs, false);
|
|
602
|
+
this->PhreeqcPtr->read_database();
|
|
603
|
+
}
|
|
604
|
+
catch (const IPhreeqcStop&)
|
|
605
|
+
{
|
|
606
|
+
this->close_input_files();
|
|
607
|
+
}
|
|
608
|
+
catch (...)
|
|
609
|
+
{
|
|
610
|
+
const char *errmsg = "LoadDatabase: An unhandled exception occurred.\n";
|
|
611
|
+
try
|
|
612
|
+
{
|
|
613
|
+
this->PhreeqcPtr->error_msg(errmsg, STOP); // throws IPhreeqcStop
|
|
614
|
+
}
|
|
615
|
+
catch (const IPhreeqcStop&)
|
|
616
|
+
{
|
|
617
|
+
// do nothing
|
|
618
|
+
}
|
|
619
|
+
throw;
|
|
620
|
+
}
|
|
621
|
+
this->PhreeqcPtr->phrq_io->clear_istream();
|
|
622
|
+
this->DatabaseLoaded = (this->PhreeqcPtr->get_input_errors() == 0);
|
|
623
|
+
return this->PhreeqcPtr->get_input_errors();
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
int IPhreeqc::LoadDatabase(const char* filename)
|
|
627
|
+
{
|
|
628
|
+
// save I/O state
|
|
629
|
+
bool bSaveErrorFileOn = this->ErrorFileOn;
|
|
630
|
+
bool bSaveOutputOn = this->OutputFileOn;
|
|
631
|
+
bool bSaveLogFileOn = this->LogFileOn;
|
|
632
|
+
this->ErrorFileOn = false;
|
|
633
|
+
this->OutputFileOn = false;
|
|
634
|
+
this->LogFileOn = false;
|
|
635
|
+
|
|
636
|
+
int n = this->load_db(filename);
|
|
637
|
+
if (n == 0)
|
|
638
|
+
{
|
|
639
|
+
n = this->test_db();
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// restore I/O state
|
|
643
|
+
this->ErrorFileOn = bSaveErrorFileOn;
|
|
644
|
+
this->OutputFileOn = bSaveOutputOn;
|
|
645
|
+
this->LogFileOn = bSaveLogFileOn;
|
|
646
|
+
|
|
647
|
+
return n;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
int IPhreeqc::load_db_str(const char* input)
|
|
651
|
+
{
|
|
652
|
+
try
|
|
653
|
+
{
|
|
654
|
+
// cleanup
|
|
655
|
+
//
|
|
656
|
+
this->UnLoadDatabase();
|
|
657
|
+
|
|
658
|
+
std::string s(input);
|
|
659
|
+
std::istringstream iss(s);
|
|
660
|
+
|
|
661
|
+
// read input
|
|
662
|
+
//
|
|
663
|
+
ASSERT(this->PhreeqcPtr->phrq_io->get_istream() == NULL);
|
|
664
|
+
this->PhreeqcPtr->phrq_io->push_istream(&iss, false);
|
|
665
|
+
this->PhreeqcPtr->read_database();
|
|
666
|
+
}
|
|
667
|
+
catch (const IPhreeqcStop&)
|
|
668
|
+
{
|
|
669
|
+
this->close_input_files();
|
|
670
|
+
}
|
|
671
|
+
catch(...)
|
|
672
|
+
{
|
|
673
|
+
const char *errmsg = "LoadDatabaseString: An unhandled exception occurred.\n";
|
|
674
|
+
try
|
|
675
|
+
{
|
|
676
|
+
this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop
|
|
677
|
+
}
|
|
678
|
+
catch (const IPhreeqcStop&)
|
|
679
|
+
{
|
|
680
|
+
// do nothing
|
|
681
|
+
}
|
|
682
|
+
throw;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
this->PhreeqcPtr->phrq_io->clear_istream();
|
|
686
|
+
this->DatabaseLoaded = (this->PhreeqcPtr->get_input_errors() == 0);
|
|
687
|
+
return this->PhreeqcPtr->get_input_errors();
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
int IPhreeqc::LoadDatabaseString(const char* input)
|
|
691
|
+
{
|
|
692
|
+
// save I/O state
|
|
693
|
+
bool bSaveErrorFileOn = this->ErrorFileOn;
|
|
694
|
+
bool bSaveOutputOn = this->OutputFileOn;
|
|
695
|
+
bool bSaveLogFileOn = this->LogFileOn;
|
|
696
|
+
this->ErrorFileOn = false;
|
|
697
|
+
this->OutputFileOn = false;
|
|
698
|
+
this->LogFileOn = false;
|
|
699
|
+
|
|
700
|
+
int n = this->load_db_str(input);
|
|
701
|
+
if (n == 0)
|
|
702
|
+
{
|
|
703
|
+
n = this->test_db();
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// restore I/O state
|
|
707
|
+
this->ErrorFileOn = bSaveErrorFileOn;
|
|
708
|
+
this->OutputFileOn = bSaveOutputOn;
|
|
709
|
+
this->LogFileOn = bSaveLogFileOn;
|
|
710
|
+
|
|
711
|
+
return n;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
void IPhreeqc::OutputAccumulatedLines(void)
|
|
715
|
+
{
|
|
716
|
+
#if !defined(R_SO)
|
|
717
|
+
std::cout << this->StringInput.c_str() << std::endl;
|
|
718
|
+
#endif
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
void IPhreeqc::OutputErrorString(void)
|
|
722
|
+
{
|
|
723
|
+
#if !defined(R_SO)
|
|
724
|
+
std::cout << this->GetErrorString() << std::endl;
|
|
725
|
+
#endif
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
void IPhreeqc::OutputWarningString(void)
|
|
729
|
+
{
|
|
730
|
+
#if !defined(R_SO)
|
|
731
|
+
std::cout << this->GetWarningString() << std::endl;
|
|
732
|
+
#endif
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
int IPhreeqc::RunAccumulated(void)
|
|
736
|
+
{
|
|
737
|
+
static const char *sz_routine = "RunAccumulated";
|
|
738
|
+
try
|
|
739
|
+
{
|
|
740
|
+
// DON'T clear accumulated (just set
|
|
741
|
+
// flag to on next AccumulateLine)
|
|
742
|
+
|
|
743
|
+
// these may throw
|
|
744
|
+
this->open_output_files(sz_routine);
|
|
745
|
+
this->check_database(sz_routine);
|
|
746
|
+
|
|
747
|
+
this->PhreeqcPtr->input_error = 0;
|
|
748
|
+
this->io_error_count = 0;
|
|
749
|
+
|
|
750
|
+
// create input stream
|
|
751
|
+
std::istringstream iss(this->GetAccumulatedLines());
|
|
752
|
+
|
|
753
|
+
// this may throw
|
|
754
|
+
this->do_run(sz_routine, &iss, NULL, NULL, NULL);
|
|
755
|
+
}
|
|
756
|
+
catch (const IPhreeqcStop&)
|
|
757
|
+
{
|
|
758
|
+
// do nothing
|
|
759
|
+
}
|
|
760
|
+
catch(std::exception &e)
|
|
761
|
+
{
|
|
762
|
+
std::string errmsg("RunAccumulated: ");
|
|
763
|
+
errmsg += e.what();
|
|
764
|
+
try
|
|
765
|
+
{
|
|
766
|
+
this->PhreeqcPtr->error_msg(errmsg.c_str(), STOP); // throws PhreeqcStop
|
|
767
|
+
}
|
|
768
|
+
catch (const IPhreeqcStop&)
|
|
769
|
+
{
|
|
770
|
+
// do nothing
|
|
771
|
+
}
|
|
772
|
+
throw;
|
|
773
|
+
}
|
|
774
|
+
catch(...)
|
|
775
|
+
{
|
|
776
|
+
const char *errmsg = "RunAccumulated: An unhandled exception occurred.\n";
|
|
777
|
+
try
|
|
778
|
+
{
|
|
779
|
+
this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop
|
|
780
|
+
}
|
|
781
|
+
catch (const IPhreeqcStop&)
|
|
782
|
+
{
|
|
783
|
+
// do nothing
|
|
784
|
+
}
|
|
785
|
+
throw;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
this->ClearAccumulated = true;
|
|
789
|
+
this->close_output_files();
|
|
790
|
+
this->update_errors();
|
|
791
|
+
this->PhreeqcPtr->phrq_io->clear_istream();
|
|
792
|
+
|
|
793
|
+
return this->PhreeqcPtr->get_input_errors();
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
int IPhreeqc::RunFile(const char* filename)
|
|
797
|
+
{
|
|
798
|
+
static const char *sz_routine = "RunFile";
|
|
799
|
+
try
|
|
800
|
+
{
|
|
801
|
+
// clear accumulated
|
|
802
|
+
//
|
|
803
|
+
this->ClearAccumulatedLines();
|
|
804
|
+
this->ClearAccumulated = false;
|
|
805
|
+
|
|
806
|
+
// these may throw
|
|
807
|
+
this->open_output_files(sz_routine);
|
|
808
|
+
this->check_database(sz_routine);
|
|
809
|
+
|
|
810
|
+
this->PhreeqcPtr->input_error = 0;
|
|
811
|
+
this->io_error_count = 0;
|
|
812
|
+
|
|
813
|
+
// open file
|
|
814
|
+
//
|
|
815
|
+
std::ifstream ifs;
|
|
816
|
+
ifs.open(filename);
|
|
817
|
+
if (!ifs.is_open())
|
|
818
|
+
{
|
|
819
|
+
std::ostringstream oss;
|
|
820
|
+
oss << "RunFile: Unable to open:" << "\"" << filename << "\".";
|
|
821
|
+
this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// this may throw
|
|
825
|
+
this->do_run(sz_routine, &ifs, NULL, NULL, NULL);
|
|
826
|
+
}
|
|
827
|
+
catch (const IPhreeqcStop&)
|
|
828
|
+
{
|
|
829
|
+
this->close_input_files();
|
|
830
|
+
}
|
|
831
|
+
catch(std::exception &e)
|
|
832
|
+
{
|
|
833
|
+
std::string errmsg("RunFile: ");
|
|
834
|
+
errmsg += e.what();
|
|
835
|
+
try
|
|
836
|
+
{
|
|
837
|
+
this->PhreeqcPtr->error_msg(errmsg.c_str(), STOP); // throws PhreeqcStop
|
|
838
|
+
}
|
|
839
|
+
catch (const IPhreeqcStop&)
|
|
840
|
+
{
|
|
841
|
+
// do nothing
|
|
842
|
+
}
|
|
843
|
+
throw;
|
|
844
|
+
}
|
|
845
|
+
catch(...)
|
|
846
|
+
{
|
|
847
|
+
const char *errmsg = "RunFile: An unhandled exception occurred.\n";
|
|
848
|
+
try
|
|
849
|
+
{
|
|
850
|
+
this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop
|
|
851
|
+
}
|
|
852
|
+
catch (const IPhreeqcStop&)
|
|
853
|
+
{
|
|
854
|
+
// do nothing
|
|
855
|
+
}
|
|
856
|
+
throw;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
this->close_output_files();
|
|
860
|
+
this->update_errors();
|
|
861
|
+
this->PhreeqcPtr->phrq_io->clear_istream();
|
|
862
|
+
|
|
863
|
+
return this->PhreeqcPtr->get_input_errors();
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
int IPhreeqc::RunString(const char* input)
|
|
867
|
+
{
|
|
868
|
+
static const char *sz_routine = "RunString";
|
|
869
|
+
try
|
|
870
|
+
{
|
|
871
|
+
// clear accumulated
|
|
872
|
+
//
|
|
873
|
+
this->ClearAccumulatedLines();
|
|
874
|
+
this->ClearAccumulated = false;
|
|
875
|
+
|
|
876
|
+
// these may throw
|
|
877
|
+
this->open_output_files(sz_routine);
|
|
878
|
+
this->check_database(sz_routine);
|
|
879
|
+
|
|
880
|
+
this->PhreeqcPtr->input_error = 0;
|
|
881
|
+
this->io_error_count = 0;
|
|
882
|
+
|
|
883
|
+
// create input stream
|
|
884
|
+
std::string s(input);
|
|
885
|
+
std::istringstream iss(s);
|
|
886
|
+
|
|
887
|
+
// this may throw
|
|
888
|
+
this->do_run(sz_routine, &iss, NULL, NULL, NULL);
|
|
889
|
+
}
|
|
890
|
+
catch (const IPhreeqcStop&)
|
|
891
|
+
{
|
|
892
|
+
this->close_input_files();
|
|
893
|
+
}
|
|
894
|
+
catch(std::exception &e)
|
|
895
|
+
{
|
|
896
|
+
std::string errmsg("RunString: ");
|
|
897
|
+
errmsg += e.what();
|
|
898
|
+
try
|
|
899
|
+
{
|
|
900
|
+
this->PhreeqcPtr->error_msg(errmsg.c_str(), STOP); // throws PhreeqcStop
|
|
901
|
+
}
|
|
902
|
+
catch (const IPhreeqcStop&)
|
|
903
|
+
{
|
|
904
|
+
// do nothing
|
|
905
|
+
}
|
|
906
|
+
throw;
|
|
907
|
+
}
|
|
908
|
+
catch(...)
|
|
909
|
+
{
|
|
910
|
+
const char *errmsg = "RunString: An unhandled exception occurred.\n";
|
|
911
|
+
try
|
|
912
|
+
{
|
|
913
|
+
this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop
|
|
914
|
+
}
|
|
915
|
+
catch (const IPhreeqcStop&)
|
|
916
|
+
{
|
|
917
|
+
// do nothing
|
|
918
|
+
}
|
|
919
|
+
throw;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
this->close_output_files();
|
|
923
|
+
this->update_errors();
|
|
924
|
+
this->PhreeqcPtr->phrq_io->clear_istream();
|
|
925
|
+
|
|
926
|
+
return this->PhreeqcPtr->get_input_errors();
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
void IPhreeqc::SetBasicCallback(double (*fcn)(double x1, double x2, const char *str, void *cookie), void *cookie1)
|
|
930
|
+
{
|
|
931
|
+
this->PhreeqcPtr->register_basic_callback(fcn, cookie1);
|
|
932
|
+
}
|
|
933
|
+
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
|
934
|
+
void IPhreeqc::SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, size_t l))
|
|
935
|
+
{
|
|
936
|
+
this->PhreeqcPtr->register_fortran_basic_callback(fcn);
|
|
937
|
+
}
|
|
938
|
+
#else
|
|
939
|
+
void IPhreeqc::SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, int l))
|
|
940
|
+
{
|
|
941
|
+
this->PhreeqcPtr->register_fortran_basic_callback(fcn);
|
|
942
|
+
}
|
|
943
|
+
#endif
|
|
944
|
+
VRESULT IPhreeqc::SetCurrentSelectedOutputUserNumber(int n)
|
|
945
|
+
{
|
|
946
|
+
if (0 <= n)
|
|
947
|
+
{
|
|
948
|
+
this->CurrentSelectedOutputUserNumber = n;
|
|
949
|
+
return VR_OK;
|
|
950
|
+
}
|
|
951
|
+
return VR_INVALIDARG;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
void IPhreeqc::SetDumpFileName(const char *filename)
|
|
955
|
+
{
|
|
956
|
+
if (filename && ::strlen(filename))
|
|
957
|
+
{
|
|
958
|
+
this->DumpFileName = filename;
|
|
959
|
+
this->PhreeqcPtr->dump_info.Set_file_name(this->DumpFileName);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
void IPhreeqc::SetDumpFileOn(bool bValue)
|
|
964
|
+
{
|
|
965
|
+
this->DumpOn = bValue;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
void IPhreeqc::SetDumpStringOn(bool bValue)
|
|
969
|
+
{
|
|
970
|
+
this->DumpStringOn = bValue;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
void IPhreeqc::SetErrorFileName(const char *filename)
|
|
974
|
+
{
|
|
975
|
+
if (filename && ::strlen(filename))
|
|
976
|
+
{
|
|
977
|
+
this->ErrorFileName = filename;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
void IPhreeqc::SetErrorFileOn(bool bValue)
|
|
982
|
+
{
|
|
983
|
+
this->ErrorFileOn = bValue;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
void IPhreeqc::SetErrorOn(bool bValue)
|
|
987
|
+
{
|
|
988
|
+
this->Set_error_on(bValue);
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
void IPhreeqc::SetErrorStringOn(bool bValue)
|
|
992
|
+
{
|
|
993
|
+
this->ErrorStringOn = bValue;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
void IPhreeqc::SetLogFileName(const char *filename)
|
|
997
|
+
{
|
|
998
|
+
if (filename && ::strlen(filename))
|
|
999
|
+
{
|
|
1000
|
+
this->LogFileName = filename;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
void IPhreeqc::SetLogFileOn(bool bValue)
|
|
1005
|
+
{
|
|
1006
|
+
this->LogFileOn = bValue;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
void IPhreeqc::SetLogStringOn(bool bValue)
|
|
1010
|
+
{
|
|
1011
|
+
this->LogStringOn = bValue;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
void IPhreeqc::SetOutputFileName(const char *filename)
|
|
1015
|
+
{
|
|
1016
|
+
if (filename && ::strlen(filename))
|
|
1017
|
+
{
|
|
1018
|
+
this->OutputFileName = filename;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
void IPhreeqc::SetOutputStringOn(bool bValue)
|
|
1023
|
+
{
|
|
1024
|
+
this->OutputStringOn = bValue;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
void IPhreeqc::SetOutputFileOn(bool bValue)
|
|
1028
|
+
{
|
|
1029
|
+
this->OutputFileOn = bValue;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
void IPhreeqc::SetSelectedOutputFileName(const char *filename)
|
|
1033
|
+
{
|
|
1034
|
+
if (filename && ::strlen(filename))
|
|
1035
|
+
{
|
|
1036
|
+
// Can't use this->PhreeqcPtr->SelectedOutput_map since it's necessary
|
|
1037
|
+
// to override the default filename "selected_output_%d.%d.sel"
|
|
1038
|
+
this->SelectedOutputFileNameMap[this->CurrentSelectedOutputUserNumber] = std::string(filename);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
void IPhreeqc::SetSelectedOutputFileOn(bool bValue)
|
|
1043
|
+
{
|
|
1044
|
+
if (0 <= this->CurrentSelectedOutputUserNumber)
|
|
1045
|
+
{
|
|
1046
|
+
this->SelectedOutputFileOnMap[this->CurrentSelectedOutputUserNumber] = bValue;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
void IPhreeqc::SetSelectedOutputStringOn(bool bValue)
|
|
1051
|
+
{
|
|
1052
|
+
this->SelectedOutputStringOn[this->CurrentSelectedOutputUserNumber] = bValue;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
int IPhreeqc::test_db(void)
|
|
1056
|
+
{
|
|
1057
|
+
std::ostringstream oss;
|
|
1058
|
+
int sn = this->PhreeqcPtr->next_user_number(Keywords::KEY_SOLUTION);
|
|
1059
|
+
//oss << "SOLUTION " << sn <<"; DELETE; -solution " << sn;
|
|
1060
|
+
oss << "SOLUTION " << sn << ";";
|
|
1061
|
+
if (this->PhreeqcPtr->llnl_temp.size() > 0)
|
|
1062
|
+
{
|
|
1063
|
+
oss << "-temp " << this->PhreeqcPtr->llnl_temp[0] << ";";
|
|
1064
|
+
}
|
|
1065
|
+
oss << "DELETE; -solution " << sn;
|
|
1066
|
+
this->PhreeqcPtr->set_reading_database(TRUE);
|
|
1067
|
+
int n = this->RunString(oss.str().c_str());
|
|
1068
|
+
this->PhreeqcPtr->set_reading_database(FALSE);
|
|
1069
|
+
return n;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
void IPhreeqc::UnLoadDatabase(void)
|
|
1073
|
+
{
|
|
1074
|
+
// init IPhreeqc
|
|
1075
|
+
//
|
|
1076
|
+
this->DatabaseLoaded = false;
|
|
1077
|
+
this->UpdateComponents = true;
|
|
1078
|
+
this->Components.clear();
|
|
1079
|
+
|
|
1080
|
+
// clear accumulated
|
|
1081
|
+
//
|
|
1082
|
+
this->ClearAccumulatedLines();
|
|
1083
|
+
this->ClearAccumulated = false;
|
|
1084
|
+
|
|
1085
|
+
// clear error state
|
|
1086
|
+
//
|
|
1087
|
+
ASSERT(this->ErrorReporter);
|
|
1088
|
+
this->ErrorReporter->Clear();
|
|
1089
|
+
this->ErrorString.clear();
|
|
1090
|
+
|
|
1091
|
+
// clear warning state
|
|
1092
|
+
//
|
|
1093
|
+
ASSERT(this->WarningReporter);
|
|
1094
|
+
this->WarningReporter->Clear();
|
|
1095
|
+
this->WarningString.clear();
|
|
1096
|
+
|
|
1097
|
+
// clear selectedoutput
|
|
1098
|
+
//
|
|
1099
|
+
this->CurrentSelectedOutputUserNumber = 1;
|
|
1100
|
+
this->SelectedOutputFileOnMap.clear();
|
|
1101
|
+
this->SelectedOutputFileOnMap[1] = false;
|
|
1102
|
+
this->SelectedOutputStringOn.clear();
|
|
1103
|
+
this->SelectedOutputStringOn[1] = false;
|
|
1104
|
+
|
|
1105
|
+
std::map< int, CSelectedOutput* >::iterator itt = this->SelectedOutputMap.begin();
|
|
1106
|
+
for (; itt != this->SelectedOutputMap.end(); ++itt)
|
|
1107
|
+
{
|
|
1108
|
+
delete (*itt).second;
|
|
1109
|
+
}
|
|
1110
|
+
this->SelectedOutputMap.clear();
|
|
1111
|
+
this->SelectedOutputStringMap.clear();
|
|
1112
|
+
this->SelectedOutputLinesMap.clear();
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
// clear dump string
|
|
1116
|
+
//
|
|
1117
|
+
this->DumpString.clear();
|
|
1118
|
+
this->DumpLines.clear();
|
|
1119
|
+
|
|
1120
|
+
// initialize phreeqc
|
|
1121
|
+
//
|
|
1122
|
+
this->PhreeqcPtr->clean_up();
|
|
1123
|
+
this->PhreeqcPtr->init();
|
|
1124
|
+
this->PhreeqcPtr->do_initialize();
|
|
1125
|
+
this->PhreeqcPtr->input_error = 0;
|
|
1126
|
+
this->io_error_count = 0;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
int IPhreeqc::EndRow(void)
|
|
1130
|
+
{
|
|
1131
|
+
if (this->PhreeqcPtr->current_selected_output)
|
|
1132
|
+
{
|
|
1133
|
+
std::map< int, CSelectedOutput* >::iterator it =
|
|
1134
|
+
this->SelectedOutputMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user());
|
|
1135
|
+
|
|
1136
|
+
if (it != this->SelectedOutputMap.end())
|
|
1137
|
+
{
|
|
1138
|
+
// ensure all user_punch headings are included
|
|
1139
|
+
ASSERT(this->PhreeqcPtr->n_user_punch_index >= 0);
|
|
1140
|
+
if (this->PhreeqcPtr->current_user_punch)
|
|
1141
|
+
{
|
|
1142
|
+
for (size_t i = this->PhreeqcPtr->n_user_punch_index; i < this->PhreeqcPtr->current_user_punch->Get_headings().size(); ++i)
|
|
1143
|
+
{
|
|
1144
|
+
(*it).second->PushBackEmpty(this->PhreeqcPtr->current_user_punch->Get_headings()[i].c_str());
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return (*it).second->EndRow();
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return 0;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
void IPhreeqc::check_database(const char* sz_routine)
|
|
1154
|
+
{
|
|
1155
|
+
this->ErrorReporter->Clear();
|
|
1156
|
+
this->WarningReporter->Clear();
|
|
1157
|
+
std::map< int, CSelectedOutput* >::iterator it = this->SelectedOutputMap.begin();
|
|
1158
|
+
for (; it != this->SelectedOutputMap.end(); ++it)
|
|
1159
|
+
{
|
|
1160
|
+
delete (*it).second;
|
|
1161
|
+
}
|
|
1162
|
+
this->SelectedOutputMap.clear();
|
|
1163
|
+
this->SelectedOutputStringMap.clear();
|
|
1164
|
+
this->SelectedOutputLinesMap.clear();
|
|
1165
|
+
|
|
1166
|
+
// release
|
|
1167
|
+
this->LogString.clear();
|
|
1168
|
+
this->LogLines.clear();
|
|
1169
|
+
this->OutputString.clear();
|
|
1170
|
+
this->OutputLines.clear();
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
if (!this->DatabaseLoaded)
|
|
1174
|
+
{
|
|
1175
|
+
std::ostringstream oss;
|
|
1176
|
+
oss << sz_routine << ": No database is loaded";
|
|
1177
|
+
this->PhreeqcPtr->input_error = 1;
|
|
1178
|
+
this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALLBACK pfn_pre, PFN_POSTRUN_CALLBACK pfn_post, void *cookie)
|
|
1183
|
+
{
|
|
1184
|
+
char token[MAX_LENGTH];
|
|
1185
|
+
|
|
1186
|
+
/*
|
|
1187
|
+
* Maybe should be in read_input
|
|
1188
|
+
*/
|
|
1189
|
+
this->PhreeqcPtr->first_read_input = TRUE;
|
|
1190
|
+
|
|
1191
|
+
/*
|
|
1192
|
+
* call pre-run callback
|
|
1193
|
+
*/
|
|
1194
|
+
if (pfn_pre)
|
|
1195
|
+
{
|
|
1196
|
+
pfn_pre(cookie);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/*
|
|
1200
|
+
* set read callback
|
|
1201
|
+
*/
|
|
1202
|
+
#if (__GNUC__ && (__cplusplus >= 201103L)) || (_MSC_VER >= 1600)
|
|
1203
|
+
std::unique_ptr<std::istringstream> auto_iss=NULL;
|
|
1204
|
+
#else
|
|
1205
|
+
std::auto_ptr<std::istringstream> auto_iss(0);
|
|
1206
|
+
#endif
|
|
1207
|
+
if (!pis)
|
|
1208
|
+
{
|
|
1209
|
+
auto_iss.reset(new std::istringstream(this->GetAccumulatedLines()));
|
|
1210
|
+
this->PhreeqcPtr->phrq_io->push_istream(auto_iss.get(), false);
|
|
1211
|
+
}
|
|
1212
|
+
else
|
|
1213
|
+
{
|
|
1214
|
+
ASSERT(this->PhreeqcPtr->phrq_io->get_istream() == NULL);
|
|
1215
|
+
this->PhreeqcPtr->phrq_io->push_istream(pis, false);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
/*
|
|
1220
|
+
* Read input data for simulation
|
|
1221
|
+
*/
|
|
1222
|
+
for (this->PhreeqcPtr->simulation = 1; ; this->PhreeqcPtr->simulation++)
|
|
1223
|
+
{
|
|
1224
|
+
|
|
1225
|
+
#ifdef PHREEQ98
|
|
1226
|
+
AddSeries = !connect_simulations;
|
|
1227
|
+
#endif
|
|
1228
|
+
::snprintf(token, sizeof(token), "Reading input data for simulation %d.", this->PhreeqcPtr->simulation);
|
|
1229
|
+
|
|
1230
|
+
// bool save_punch_in = this->PhreeqcPtr->SelectedOutput_map.size() > 0;
|
|
1231
|
+
|
|
1232
|
+
this->PhreeqcPtr->dup_print(token, TRUE);
|
|
1233
|
+
if (this->PhreeqcPtr->read_input() == EOF)
|
|
1234
|
+
break;
|
|
1235
|
+
|
|
1236
|
+
if (this->PhreeqcPtr->simulation == 1)
|
|
1237
|
+
{
|
|
1238
|
+
// force headings for selected output (on every call to do_run)
|
|
1239
|
+
// might want to split tidy_punch to avoid duplicate searches like master_bsearch
|
|
1240
|
+
std::map< int, SelectedOutput >::iterator pit = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
1241
|
+
for (; pit != this->PhreeqcPtr->SelectedOutput_map.end(); ++pit)
|
|
1242
|
+
{
|
|
1243
|
+
(*pit).second.Set_new_def(true);
|
|
1244
|
+
this->PhreeqcPtr->keycount[Keywords::KEY_SELECTED_OUTPUT] = 1;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
// bool bWarning = false;
|
|
1249
|
+
std::map< int, SelectedOutput >::iterator mit = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
1250
|
+
for (; mit != this->PhreeqcPtr->SelectedOutput_map.end(); ++mit)
|
|
1251
|
+
{
|
|
1252
|
+
if (this->SelectedOutputMap.find(mit->first) == this->SelectedOutputMap.end())
|
|
1253
|
+
{
|
|
1254
|
+
// int -> CSelectedOutput*
|
|
1255
|
+
std::map< int, CSelectedOutput* >::value_type item((*mit).first, new CSelectedOutput());
|
|
1256
|
+
this->SelectedOutputMap.insert(item);
|
|
1257
|
+
|
|
1258
|
+
// int -> std::string
|
|
1259
|
+
this->SelectedOutputStringMap.insert(
|
|
1260
|
+
std::map< int, std::string >::value_type((*mit).first, std::string()));
|
|
1261
|
+
}
|
|
1262
|
+
else
|
|
1263
|
+
{
|
|
1264
|
+
ASSERT(this->SelectedOutputMap.find((*mit).first) != this->SelectedOutputMap.end());
|
|
1265
|
+
ASSERT(this->SelectedOutputStringMap.find((*mit).first) != this->SelectedOutputStringMap.end());
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
ASSERT(this->PhreeqcPtr->SelectedOutput_map.size() == this->SelectedOutputMap.size());
|
|
1269
|
+
ASSERT(this->PhreeqcPtr->SelectedOutput_map.size() == this->SelectedOutputStringMap.size());
|
|
1270
|
+
if (!this->PhreeqcPtr->title_x.empty())
|
|
1271
|
+
{
|
|
1272
|
+
::snprintf(token, sizeof(token), "TITLE");
|
|
1273
|
+
this->PhreeqcPtr->dup_print(token, TRUE);
|
|
1274
|
+
if (this->PhreeqcPtr->pr.headings == TRUE)
|
|
1275
|
+
{
|
|
1276
|
+
this->PhreeqcPtr->output_msg(this->PhreeqcPtr->title_x.c_str());
|
|
1277
|
+
this->PhreeqcPtr->output_msg("\n\n");
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
#ifdef SWIG_SHARED_OBJ
|
|
1282
|
+
if (this->PhreeqcPtr->SelectedOutput_map.size() > 0)
|
|
1283
|
+
{
|
|
1284
|
+
//
|
|
1285
|
+
// (punch.in == TRUE) when any "RUN" has contained
|
|
1286
|
+
// a SELECTED_OUTPUT block since the last LoadDatabase call.
|
|
1287
|
+
//
|
|
1288
|
+
// Since LoadDatabase initializes punch.in to FALSE
|
|
1289
|
+
// (via UnLoadDatabase...do_initialize)
|
|
1290
|
+
// and punch.in is set to TRUE in read_selected_output
|
|
1291
|
+
//
|
|
1292
|
+
// This causes the SELECTED_OUTPUT to contain the same headings
|
|
1293
|
+
// until another SELECTED_OUTPUT is defined which sets the variable
|
|
1294
|
+
// punch.new_def to TRUE
|
|
1295
|
+
//
|
|
1296
|
+
// WHAT IF A USER_PUNCH IS DEFINED?? IS punch.new_def SET TO
|
|
1297
|
+
// TRUE ???
|
|
1298
|
+
//
|
|
1299
|
+
//
|
|
1300
|
+
std::map< int, SelectedOutput >::iterator ai = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
1301
|
+
for (; ai != this->PhreeqcPtr->SelectedOutput_map.end(); ++ai)
|
|
1302
|
+
{
|
|
1303
|
+
if (!this->SelectedOutputFileOnMap[(*ai).first])
|
|
1304
|
+
{
|
|
1305
|
+
ASSERT((*ai).second.Get_punch_ostream() == 0);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
if (this->PhreeqcPtr->pr.punch == FALSE)
|
|
1310
|
+
{
|
|
1311
|
+
// No selected_output for this simulation
|
|
1312
|
+
// this happens when
|
|
1313
|
+
// PRINT; -selected_output false
|
|
1314
|
+
// is given as input
|
|
1315
|
+
// Note: this also disables the CSelectedOutput object
|
|
1316
|
+
ASSERT(TRUE);
|
|
1317
|
+
}
|
|
1318
|
+
else
|
|
1319
|
+
{
|
|
1320
|
+
std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
1321
|
+
for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it)
|
|
1322
|
+
{
|
|
1323
|
+
if (this->SelectedOutputFileOnMap[(*it).first] && !(*it).second.Get_punch_ostream())
|
|
1324
|
+
{
|
|
1325
|
+
//
|
|
1326
|
+
// LoadDatabase
|
|
1327
|
+
// do_run -- containing SELECTED_OUTPUT ****TODO**** check -file option
|
|
1328
|
+
// another do_run without SELECTED_OUTPUT
|
|
1329
|
+
//
|
|
1330
|
+
ASSERT(!this->SelectedOutputFileNameMap[(*it).first].empty());
|
|
1331
|
+
std::string filename = this->SelectedOutputFileNameMap[(*it).first];
|
|
1332
|
+
if (!punch_open(filename.c_str(), std::ios_base::out, (*it).first))
|
|
1333
|
+
{
|
|
1334
|
+
std::ostringstream oss;
|
|
1335
|
+
oss << sz_routine << ": Unable to open:" << "\"" << filename << "\".\n";
|
|
1336
|
+
this->PhreeqcPtr->warning_msg(oss.str().c_str());
|
|
1337
|
+
}
|
|
1338
|
+
else
|
|
1339
|
+
{
|
|
1340
|
+
ASSERT(this->Get_punch_ostream() != NULL);
|
|
1341
|
+
ASSERT((*it).second.Get_punch_ostream() == NULL);
|
|
1342
|
+
|
|
1343
|
+
int n_user = (*it).first;
|
|
1344
|
+
this->PhreeqcPtr->SelectedOutput_map[n_user].Set_punch_ostream(this->Get_punch_ostream());
|
|
1345
|
+
this->Set_punch_ostream(NULL);
|
|
1346
|
+
|
|
1347
|
+
// output selected_output headings
|
|
1348
|
+
(*it).second.Set_new_def(TRUE);
|
|
1349
|
+
this->PhreeqcPtr->tidy_punch();
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
else
|
|
1356
|
+
{
|
|
1357
|
+
ASSERT(TRUE);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
1362
|
+
for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it)
|
|
1363
|
+
{
|
|
1364
|
+
if (this->SelectedOutputFileOnMap[(*it).first])
|
|
1365
|
+
{
|
|
1366
|
+
ASSERT((*it).second.Get_punch_ostream());
|
|
1367
|
+
}
|
|
1368
|
+
else
|
|
1369
|
+
{
|
|
1370
|
+
ASSERT(!(*it).second.Get_punch_ostream());
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// Consider this addition
|
|
1375
|
+
{
|
|
1376
|
+
this->PhreeqcPtr->pr.all = (this->OutputFileOn || this->OutputStringOn) ? TRUE : FALSE;
|
|
1377
|
+
//this->PhreeqcPtr->pr.punch = (this->SelectedOutputFileOn || this->SelectedOutputStringOn) ? TRUE : FALSE;
|
|
1378
|
+
}
|
|
1379
|
+
/* the converse is not necessarily true */
|
|
1380
|
+
|
|
1381
|
+
this->PhreeqcPtr->n_user_punch_index = -1;
|
|
1382
|
+
#endif // SWIG_SHARED_OBJ
|
|
1383
|
+
{
|
|
1384
|
+
this->PhreeqcPtr->pr.all = (this->OutputFileOn || this->OutputStringOn) ? TRUE : FALSE;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
this->PhreeqcPtr->tidy_model();
|
|
1388
|
+
#ifdef PHREEQ98
|
|
1389
|
+
if (!phreeq98_debug)
|
|
1390
|
+
{
|
|
1391
|
+
#endif
|
|
1392
|
+
|
|
1393
|
+
/*
|
|
1394
|
+
* Calculate distribution of species for initial solutions
|
|
1395
|
+
*/
|
|
1396
|
+
if (this->PhreeqcPtr->new_solution)
|
|
1397
|
+
this->PhreeqcPtr->initial_solutions(TRUE);
|
|
1398
|
+
/*
|
|
1399
|
+
* Calculate distribution for exchangers
|
|
1400
|
+
*/
|
|
1401
|
+
if (this->PhreeqcPtr->new_exchange)
|
|
1402
|
+
this->PhreeqcPtr->initial_exchangers(TRUE);
|
|
1403
|
+
/*
|
|
1404
|
+
* Calculate distribution for surfaces
|
|
1405
|
+
*/
|
|
1406
|
+
if (this->PhreeqcPtr->new_surface)
|
|
1407
|
+
this->PhreeqcPtr->initial_surfaces(TRUE);
|
|
1408
|
+
/*
|
|
1409
|
+
* Calculate initial gas composition
|
|
1410
|
+
*/
|
|
1411
|
+
if (this->PhreeqcPtr->new_gas_phase)
|
|
1412
|
+
this->PhreeqcPtr->initial_gas_phases(TRUE);
|
|
1413
|
+
/*
|
|
1414
|
+
* Calculate reactions
|
|
1415
|
+
*/
|
|
1416
|
+
this->PhreeqcPtr->reactions();
|
|
1417
|
+
/*
|
|
1418
|
+
* Calculate inverse models
|
|
1419
|
+
*/
|
|
1420
|
+
this->PhreeqcPtr->inverse_models();
|
|
1421
|
+
/*
|
|
1422
|
+
* Calculate advection
|
|
1423
|
+
*/
|
|
1424
|
+
if (this->PhreeqcPtr->use.Get_advect_in())
|
|
1425
|
+
{
|
|
1426
|
+
this->PhreeqcPtr->dup_print("Beginning of advection calculations.", TRUE);
|
|
1427
|
+
this->PhreeqcPtr->advection();
|
|
1428
|
+
}
|
|
1429
|
+
/*
|
|
1430
|
+
* Calculate transport
|
|
1431
|
+
*/
|
|
1432
|
+
if (this->PhreeqcPtr->use.Get_trans_in())
|
|
1433
|
+
{
|
|
1434
|
+
this->PhreeqcPtr->dup_print("Beginning of transport calculations.", TRUE);
|
|
1435
|
+
this->PhreeqcPtr->transport();
|
|
1436
|
+
}
|
|
1437
|
+
/*
|
|
1438
|
+
* run
|
|
1439
|
+
*/
|
|
1440
|
+
this->PhreeqcPtr->run_as_cells();
|
|
1441
|
+
/*
|
|
1442
|
+
* Calculate mixes
|
|
1443
|
+
*/
|
|
1444
|
+
this->PhreeqcPtr->do_mixes();
|
|
1445
|
+
/*
|
|
1446
|
+
* Copy
|
|
1447
|
+
*/
|
|
1448
|
+
if (this->PhreeqcPtr->new_copy) this->PhreeqcPtr->copy_entities();
|
|
1449
|
+
/*
|
|
1450
|
+
* dump
|
|
1451
|
+
*/
|
|
1452
|
+
dumper dump_info_save(this->PhreeqcPtr->dump_info);
|
|
1453
|
+
if (this->DumpOn)
|
|
1454
|
+
{
|
|
1455
|
+
this->PhreeqcPtr->dump_entities();
|
|
1456
|
+
this->DumpFileName = this->PhreeqcPtr->dump_info.Get_file_name();
|
|
1457
|
+
}
|
|
1458
|
+
if (this->DumpStringOn)
|
|
1459
|
+
{
|
|
1460
|
+
this->PhreeqcPtr->dump_info = dump_info_save;
|
|
1461
|
+
if (this->PhreeqcPtr->dump_info.Get_bool_any())
|
|
1462
|
+
{
|
|
1463
|
+
std::ostringstream oss;
|
|
1464
|
+
this->PhreeqcPtr->dump_ostream(oss);
|
|
1465
|
+
if (this->PhreeqcPtr->dump_info.Get_append())
|
|
1466
|
+
{
|
|
1467
|
+
this->DumpString += oss.str();
|
|
1468
|
+
}
|
|
1469
|
+
else
|
|
1470
|
+
{
|
|
1471
|
+
this->DumpString = oss.str();
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
/* Fill dump lines */
|
|
1475
|
+
this->DumpLines.clear();
|
|
1476
|
+
std::istringstream iss(this->DumpString);
|
|
1477
|
+
std::string line;
|
|
1478
|
+
while (std::getline(iss, line))
|
|
1479
|
+
{
|
|
1480
|
+
this->DumpLines.push_back(line);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
/*
|
|
1485
|
+
* delete
|
|
1486
|
+
*/
|
|
1487
|
+
this->PhreeqcPtr->delete_entities();
|
|
1488
|
+
|
|
1489
|
+
/*
|
|
1490
|
+
* End of simulation
|
|
1491
|
+
*/
|
|
1492
|
+
this->PhreeqcPtr->dup_print( "End of simulation.", TRUE);
|
|
1493
|
+
#ifdef PHREEQ98
|
|
1494
|
+
} /* if (!phreeq98_debug) */
|
|
1495
|
+
#endif
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
/*
|
|
1499
|
+
* Display successful status
|
|
1500
|
+
*/
|
|
1501
|
+
this->PhreeqcPtr->do_status();
|
|
1502
|
+
|
|
1503
|
+
/*
|
|
1504
|
+
* call post-run callback
|
|
1505
|
+
*/
|
|
1506
|
+
if (pfn_post)
|
|
1507
|
+
{
|
|
1508
|
+
pfn_post(cookie);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
this->UpdateComponents = true;
|
|
1512
|
+
this->update_errors();
|
|
1513
|
+
|
|
1514
|
+
// update lines
|
|
1515
|
+
//
|
|
1516
|
+
|
|
1517
|
+
if (this->LogStringOn)
|
|
1518
|
+
{
|
|
1519
|
+
// output lines
|
|
1520
|
+
std::istringstream iss(this->LogString);
|
|
1521
|
+
std::string line;
|
|
1522
|
+
while (std::getline(iss, line))
|
|
1523
|
+
{
|
|
1524
|
+
this->LogLines.push_back(line);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
if (this->OutputStringOn)
|
|
1529
|
+
{
|
|
1530
|
+
// output lines
|
|
1531
|
+
std::istringstream iss(this->OutputString);
|
|
1532
|
+
std::string line;
|
|
1533
|
+
while (std::getline(iss, line))
|
|
1534
|
+
{
|
|
1535
|
+
this->OutputLines.push_back(line);
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
for (int i = 0; i < this->GetSelectedOutputCount(); ++i)
|
|
1540
|
+
{
|
|
1541
|
+
int n = this->GetNthSelectedOutputUserNumber(i);
|
|
1542
|
+
if (this->get_sel_out_string_on(n))
|
|
1543
|
+
{
|
|
1544
|
+
std::map< int, std::string >::iterator mit = this->SelectedOutputStringMap.find(n);
|
|
1545
|
+
ASSERT(mit != this->SelectedOutputStringMap.end());
|
|
1546
|
+
if (mit != this->SelectedOutputStringMap.end())
|
|
1547
|
+
{
|
|
1548
|
+
// output lines
|
|
1549
|
+
std::istringstream iss((*mit).second);
|
|
1550
|
+
std::string line;
|
|
1551
|
+
while (std::getline(iss, line))
|
|
1552
|
+
{
|
|
1553
|
+
this->SelectedOutputLinesMap[(*mit).first].push_back(line);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
void IPhreeqc::update_errors(void)
|
|
1561
|
+
{
|
|
1562
|
+
this->ErrorLines.clear();
|
|
1563
|
+
this->ErrorString = ((CErrorReporter<std::ostringstream>*)this->ErrorReporter)->GetOS()->str();
|
|
1564
|
+
if (this->ErrorString.size())
|
|
1565
|
+
{
|
|
1566
|
+
std::istringstream iss(this->ErrorString);
|
|
1567
|
+
std::string line;
|
|
1568
|
+
while (std::getline(iss, line))
|
|
1569
|
+
{
|
|
1570
|
+
this->ErrorLines.push_back(line);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
this->WarningLines.clear();
|
|
1575
|
+
this->WarningString = ((CErrorReporter<std::ostringstream>*)this->WarningReporter)->GetOS()->str();
|
|
1576
|
+
if (this->WarningString.size())
|
|
1577
|
+
{
|
|
1578
|
+
std::istringstream iss(this->WarningString);
|
|
1579
|
+
std::string line;
|
|
1580
|
+
while (std::getline(iss, line))
|
|
1581
|
+
{
|
|
1582
|
+
this->WarningLines.push_back(line);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
void IPhreeqc::log_msg(const char * str)
|
|
1588
|
+
{
|
|
1589
|
+
if (this->LogStringOn && this->log_on)
|
|
1590
|
+
{
|
|
1591
|
+
this->LogString += str;
|
|
1592
|
+
}
|
|
1593
|
+
ASSERT(!(this->LogFileOn != (this->log_ostream != 0)));
|
|
1594
|
+
this->PHRQ_io::log_msg(str);
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
void IPhreeqc::error_msg(const char *str, bool stop)
|
|
1598
|
+
{
|
|
1599
|
+
ASSERT(this->error_ostream == &std::cerr || (!(this->ErrorFileOn != (this->error_ostream != 0))));
|
|
1600
|
+
|
|
1601
|
+
if (this->error_ostream != NULL && this->error_on)
|
|
1602
|
+
{
|
|
1603
|
+
(*this->error_ostream) << str;
|
|
1604
|
+
}
|
|
1605
|
+
bool save_error_on = this->error_on;
|
|
1606
|
+
this->error_on = false;
|
|
1607
|
+
this->PHRQ_io::error_msg(str);
|
|
1608
|
+
this->error_on = save_error_on;
|
|
1609
|
+
|
|
1610
|
+
if (this->ErrorStringOn && this->error_on)
|
|
1611
|
+
{
|
|
1612
|
+
this->AddError(str);
|
|
1613
|
+
}
|
|
1614
|
+
if (stop)
|
|
1615
|
+
{
|
|
1616
|
+
if (this->error_ostream && this->error_on)
|
|
1617
|
+
{
|
|
1618
|
+
(*this->error_ostream) << "Stopping.\n";
|
|
1619
|
+
this->error_ostream->flush();
|
|
1620
|
+
}
|
|
1621
|
+
throw IPhreeqcStop();
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
void IPhreeqc::warning_msg(const char *str)
|
|
1626
|
+
{
|
|
1627
|
+
ASSERT(this->error_ostream == &std::cerr || (!(this->ErrorFileOn != (this->error_ostream != 0))));
|
|
1628
|
+
|
|
1629
|
+
if (this->error_ostream != NULL && this->error_on)
|
|
1630
|
+
{
|
|
1631
|
+
(*this->error_ostream) << str << "\n";
|
|
1632
|
+
}
|
|
1633
|
+
bool save_error_on = this->error_on;
|
|
1634
|
+
this->error_on = false;
|
|
1635
|
+
this->PHRQ_io::warning_msg(str);
|
|
1636
|
+
this->error_on = save_error_on;
|
|
1637
|
+
|
|
1638
|
+
std::ostringstream oss;
|
|
1639
|
+
oss << str << std::endl;
|
|
1640
|
+
if (this->WarningStringOn)
|
|
1641
|
+
{
|
|
1642
|
+
this->AddWarning(oss.str().c_str());
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
void IPhreeqc::output_msg(const char * str)
|
|
1647
|
+
{
|
|
1648
|
+
if (this->OutputStringOn && this->output_on)
|
|
1649
|
+
{
|
|
1650
|
+
this->OutputString += str;
|
|
1651
|
+
}
|
|
1652
|
+
ASSERT(!(this->OutputFileOn != (this->output_ostream != 0)));
|
|
1653
|
+
this->PHRQ_io::output_msg(str);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
void IPhreeqc::screen_msg(const char *err_str)
|
|
1657
|
+
{
|
|
1658
|
+
// no-op
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
void IPhreeqc::punch_msg(const char *str)
|
|
1662
|
+
{
|
|
1663
|
+
if (this->get_sel_out_string_on(this->PhreeqcPtr->current_selected_output->Get_n_user()) && this->punch_on)
|
|
1664
|
+
{
|
|
1665
|
+
ASSERT(this->PhreeqcPtr->current_selected_output);
|
|
1666
|
+
if (this->PhreeqcPtr->current_selected_output)
|
|
1667
|
+
{
|
|
1668
|
+
this->SelectedOutputStringMap[this->PhreeqcPtr->current_selected_output->Get_n_user()] += str;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
ASSERT(!(this->SelectedOutputFileOnMap[this->PhreeqcPtr->current_selected_output->Get_n_user()] != (this->PhreeqcPtr->current_selected_output->Get_punch_ostream() != 0)));
|
|
1672
|
+
this->PHRQ_io::punch_msg(str);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
void IPhreeqc::open_output_files(const char* sz_routine)
|
|
1676
|
+
{
|
|
1677
|
+
if (this->OutputFileOn)
|
|
1678
|
+
{
|
|
1679
|
+
if (this->output_ostream != NULL)
|
|
1680
|
+
{
|
|
1681
|
+
safe_close(&this->output_ostream);
|
|
1682
|
+
}
|
|
1683
|
+
if (!this->output_ostream)
|
|
1684
|
+
{
|
|
1685
|
+
if ( (this->output_ostream = new std::ofstream(this->OutputFileName.c_str())) == NULL)
|
|
1686
|
+
{
|
|
1687
|
+
std::ostringstream oss;
|
|
1688
|
+
oss << sz_routine << ": Unable to open:" << "\"" << this->OutputFileName << "\".\n";
|
|
1689
|
+
this->warning_msg(oss.str().c_str());
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
if (this->ErrorFileOn)
|
|
1694
|
+
{
|
|
1695
|
+
if (this->error_ostream != NULL)
|
|
1696
|
+
{
|
|
1697
|
+
safe_close(&this->error_ostream);
|
|
1698
|
+
}
|
|
1699
|
+
if (!this->error_ostream)
|
|
1700
|
+
{
|
|
1701
|
+
if ( (this->error_ostream = new std::ofstream(this->ErrorFileName.c_str())) == NULL)
|
|
1702
|
+
{
|
|
1703
|
+
std::ostringstream oss;
|
|
1704
|
+
oss << sz_routine << ": Unable to open:" << "\"" << this->ErrorFileName << "\".\n";
|
|
1705
|
+
this->warning_msg(oss.str().c_str());
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
if (this->LogFileOn)
|
|
1710
|
+
{
|
|
1711
|
+
if (this->log_ostream != NULL)
|
|
1712
|
+
{
|
|
1713
|
+
safe_close(&this->log_ostream);
|
|
1714
|
+
}
|
|
1715
|
+
if (!this->log_ostream)
|
|
1716
|
+
{
|
|
1717
|
+
if ( (this->log_ostream = new std::ofstream(this->LogFileName.c_str())) == NULL)
|
|
1718
|
+
{
|
|
1719
|
+
std::ostringstream oss;
|
|
1720
|
+
oss << sz_routine << ": Unable to open:" << "\"" << this->LogFileName << "\".\n";
|
|
1721
|
+
this->warning_msg(oss.str().c_str());
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
int IPhreeqc::close_input_files(void)
|
|
1728
|
+
{
|
|
1729
|
+
int i = 0;
|
|
1730
|
+
if (this->database_file)
|
|
1731
|
+
{
|
|
1732
|
+
i |= fclose(this->database_file);
|
|
1733
|
+
}
|
|
1734
|
+
if (this->input_file)
|
|
1735
|
+
{
|
|
1736
|
+
i |= fclose(this->input_file);
|
|
1737
|
+
}
|
|
1738
|
+
this->input_file = this->database_file = NULL;
|
|
1739
|
+
return (i);
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
int IPhreeqc::close_output_files(void)
|
|
1743
|
+
{
|
|
1744
|
+
int ret = 0;
|
|
1745
|
+
|
|
1746
|
+
safe_close(&this->output_ostream);
|
|
1747
|
+
safe_close(&this->log_ostream);
|
|
1748
|
+
safe_close(&this->dump_ostream);
|
|
1749
|
+
safe_close(&this->error_ostream);
|
|
1750
|
+
|
|
1751
|
+
std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin();
|
|
1752
|
+
for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it)
|
|
1753
|
+
{
|
|
1754
|
+
std::ostream *ptr = (*it).second.Get_punch_ostream();
|
|
1755
|
+
safe_close(&ptr);
|
|
1756
|
+
(*it).second.Set_punch_ostream(NULL);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
this->punch_ostream = 0;
|
|
1760
|
+
|
|
1761
|
+
return ret;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
void IPhreeqc::fpunchf(const char *name, const char *format, double d)
|
|
1765
|
+
{
|
|
1766
|
+
try
|
|
1767
|
+
{
|
|
1768
|
+
this->PHRQ_io::fpunchf(name, format, d);
|
|
1769
|
+
if (this->get_sel_out_string_on(this->PhreeqcPtr->current_selected_output->Get_n_user()) && this->punch_on)
|
|
1770
|
+
{
|
|
1771
|
+
ASSERT(this->SelectedOutputStringMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user()) != this->SelectedOutputStringMap.end());
|
|
1772
|
+
PHRQ_io::fpunchf_helper(&(this->SelectedOutputStringMap[this->PhreeqcPtr->current_selected_output->Get_n_user()]), format, d);
|
|
1773
|
+
}
|
|
1774
|
+
ASSERT(this->SelectedOutputMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user()) != this->SelectedOutputMap.end());
|
|
1775
|
+
this->SelectedOutputMap[this->PhreeqcPtr->current_selected_output->Get_n_user()]->PushBackDouble(name, d);
|
|
1776
|
+
}
|
|
1777
|
+
catch (const std::bad_alloc&)
|
|
1778
|
+
{
|
|
1779
|
+
this->PhreeqcPtr->malloc_error();
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
void IPhreeqc::fpunchf(const char *name, const char *format, char *s)
|
|
1784
|
+
{
|
|
1785
|
+
try
|
|
1786
|
+
{
|
|
1787
|
+
this->PHRQ_io::fpunchf(name, format, s);
|
|
1788
|
+
if (this->get_sel_out_string_on(this->PhreeqcPtr->current_selected_output->Get_n_user()) && this->punch_on)
|
|
1789
|
+
{
|
|
1790
|
+
ASSERT(this->SelectedOutputStringMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user()) != this->SelectedOutputStringMap.end());
|
|
1791
|
+
PHRQ_io::fpunchf_helper(&(this->SelectedOutputStringMap[this->PhreeqcPtr->current_selected_output->Get_n_user()]), format, s);
|
|
1792
|
+
}
|
|
1793
|
+
ASSERT(this->SelectedOutputMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user()) != this->SelectedOutputMap.end());
|
|
1794
|
+
this->SelectedOutputMap[this->PhreeqcPtr->current_selected_output->Get_n_user()]->PushBackString(name, s);
|
|
1795
|
+
}
|
|
1796
|
+
catch (const std::bad_alloc&)
|
|
1797
|
+
{
|
|
1798
|
+
this->PhreeqcPtr->malloc_error();
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
void IPhreeqc::fpunchf(const char *name, const char *format, int i)
|
|
1803
|
+
{
|
|
1804
|
+
try
|
|
1805
|
+
{
|
|
1806
|
+
this->PHRQ_io::fpunchf(name, format, i);
|
|
1807
|
+
if (this->get_sel_out_string_on(this->PhreeqcPtr->current_selected_output->Get_n_user()) && this->punch_on)
|
|
1808
|
+
{
|
|
1809
|
+
ASSERT(this->SelectedOutputStringMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user()) != this->SelectedOutputStringMap.end());
|
|
1810
|
+
PHRQ_io::fpunchf_helper(&(this->SelectedOutputStringMap[this->PhreeqcPtr->current_selected_output->Get_n_user()]), format, i);
|
|
1811
|
+
}
|
|
1812
|
+
ASSERT(this->SelectedOutputMap.find(this->PhreeqcPtr->current_selected_output->Get_n_user()) != this->SelectedOutputMap.end());
|
|
1813
|
+
this->SelectedOutputMap[this->PhreeqcPtr->current_selected_output->Get_n_user()]->PushBackLong(name, (long)i);
|
|
1814
|
+
}
|
|
1815
|
+
catch (const std::bad_alloc&)
|
|
1816
|
+
{
|
|
1817
|
+
this->PhreeqcPtr->malloc_error();
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
void IPhreeqc::fpunchf_end_row(const char *format)
|
|
1822
|
+
{
|
|
1823
|
+
this->EndRow();
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
bool IPhreeqc::get_sel_out_file_on(int n)const
|
|
1827
|
+
{
|
|
1828
|
+
// if not found in list SelectedOutputFileOn is false
|
|
1829
|
+
std::map< int, bool >::const_iterator ci = this->SelectedOutputFileOnMap.find(n);
|
|
1830
|
+
if (ci != this->SelectedOutputFileOnMap.end())
|
|
1831
|
+
{
|
|
1832
|
+
return (*ci).second;
|
|
1833
|
+
}
|
|
1834
|
+
return false;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
bool IPhreeqc::get_sel_out_string_on(int n)const
|
|
1838
|
+
{
|
|
1839
|
+
// if not found in list SelectedOutputStringOn is false
|
|
1840
|
+
std::map< int, bool >::const_iterator ci = this->SelectedOutputStringOn.find(this->CurrentSelectedOutputUserNumber);
|
|
1841
|
+
if (ci != this->SelectedOutputStringOn.end())
|
|
1842
|
+
{
|
|
1843
|
+
return (*ci).second;
|
|
1844
|
+
}
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
bool IPhreeqc::punch_open(const char *file_name, std::ios_base::openmode mode, int n_user)
|
|
1849
|
+
{
|
|
1850
|
+
if (this->PhreeqcPtr->SelectedOutput_map[n_user].Get_have_punch_name() &&
|
|
1851
|
+
!this->PhreeqcPtr->SelectedOutput_map[n_user].Get_file_name().empty())
|
|
1852
|
+
{
|
|
1853
|
+
this->SelectedOutputFileNameMap[n_user] = this->PhreeqcPtr->SelectedOutput_map[n_user].Get_file_name();
|
|
1854
|
+
}
|
|
1855
|
+
else if (this->SelectedOutputFileNameMap[n_user].empty())
|
|
1856
|
+
{
|
|
1857
|
+
this->SelectedOutputFileNameMap[n_user] = this->sel_file_name(n_user);
|
|
1858
|
+
}
|
|
1859
|
+
if (this->get_sel_out_file_on(n_user))
|
|
1860
|
+
{
|
|
1861
|
+
ASSERT(!this->SelectedOutputFileNameMap[n_user].empty());
|
|
1862
|
+
this->PhreeqcPtr->SelectedOutput_map[n_user].Set_file_name(this->SelectedOutputFileNameMap[n_user]);
|
|
1863
|
+
return this->ofstream_open(&punch_ostream, this->SelectedOutputFileNameMap[n_user].c_str(), mode);
|
|
1864
|
+
}
|
|
1865
|
+
return true;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
bool IPhreeqc::output_open(const char *file_name, std::ios_base::openmode mode)
|
|
1869
|
+
{
|
|
1870
|
+
if (this->OutputFileOn)
|
|
1871
|
+
{
|
|
1872
|
+
return this->PHRQ_io::output_open(file_name, mode);
|
|
1873
|
+
}
|
|
1874
|
+
return true;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
std::string IPhreeqc::sel_file_name(int n_user)
|
|
1878
|
+
{
|
|
1879
|
+
std::ostringstream oss;
|
|
1880
|
+
oss << "selected_" << n_user << "." << this->Index << ".out";
|
|
1881
|
+
return oss.str();
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
std::string IPhreeqc::create_file_name(const char *prefix, const char *suffix)
|
|
1885
|
+
{
|
|
1886
|
+
std::ostringstream oss;
|
|
1887
|
+
oss << prefix << "." << this->Index << "." << suffix;
|
|
1888
|
+
return oss.str();
|
|
1889
|
+
}
|