Skip to content

Commit

Permalink
Release 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
reiher-research-group committed Aug 26, 2024
1 parent 4939902 commit 24d8b83
Show file tree
Hide file tree
Showing 42 changed files with 615 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .conan_test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__copyright__ = """This file is part of SCINE Kinetx.
This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.
Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.
See LICENSE.txt for details.
"""

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

Release 3.0.0
-------------

- Update address in license
- Interface Sundials and add CVODE-BDF integrator

Release 2.0.0
-------------

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.9)
# tree must then provide a properly namespaced target with the same name as
# your project.
project(Kinetx
VERSION 2.0.0
VERSION 3.0.0
DESCRIPTION "Kinetic models for reaction networks."
)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group
Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Expand Down
9 changes: 8 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ release as archived on Zenodo (please use the DOI of the respective release).
In addition, we kindly request you to cite the following articles when using KiNetX:

- \J. Proppe, M. Reiher, "Mechanism Deduction from Noisy Chemical Reaction Networks", *J. Chem. Theory Comput.*, **2019**, *15*, 357.
- \M. Bensberg, M. Reiher, "Concentration-Flux-Steered Mechanism Exploration with an Organocatalysis Application", *arXiv:2212.14135 [physics.chem-ph]*, **2022**.
- \M. Bensberg, M. Reiher, "Concentration-Flux-Steered Mechanism Exploration with an Organocatalysis Application", *Isr. J. Chem.*, **2022**, *63*, e202200123.

Furthermore, when publishing results obtained with any SCINE module, please cite the following paper:

T. Weymuth, J. P. Unsleber, P. L. Türtscher, M. Steiner, J.-G. Sobez, C. H. Müller, M. Mörchen,
V. Klasovita, S. A. Grimmel, M. Eckhoff, K.-S. Csizi, F. Bosia, M. Bensberg, M. Reiher,
"SCINE—Software for chemical interaction networks", *J. Chem. Phys.*, **2024**, *160*, 222501
(DOI `10.1063/5.0206974 <https://doi.org/10.1063/5.0206974>`_).

Support and Contact
-------------------
Expand Down
6 changes: 3 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__copyright__ = """This file is part of SCINE Kinetx.
This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.
Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.
See LICENSE.txt for details.
"""

Expand All @@ -9,7 +9,7 @@

class ScineKinetxConan(ScineConan):
name = "scine_kinetx"
version = "2.0.0"
version = "3.0.0"
url = "https://github.com/qcscine/kinetx"
description = """ """
options = {
Expand All @@ -29,7 +29,7 @@ class ScineKinetxConan(ScineConan):
requires = ["eigen/[~=3.3.7]"]
cmake_name = "Kinetx"
cmake_definitions = {
"CMAKE_UNITY_BUILD": "ON",
"CMAKE_UNITY_BUILD": "OFF",
"CMAKE_UNITY_BUILD_BATCH_SIZE": 16
}

Expand Down
2 changes: 1 addition & 1 deletion dev
Submodule dev updated 47 files
+15 −0 CHANGELOG.rst
+1 −1 CONTRIBUTING.rst
+1 −1 LICENSE.txt
+11 −0 README.rst
+1 −1 cmake/AddEigen.cmake
+1 −1 cmake/CMakeBackports.cmake
+1 −1 cmake/ColorMessages.cmake
+1 −1 cmake/ComponentSetup.cmake
+1 −1 cmake/DownloadFileHelper.cmake
+1 −1 cmake/DoxygenDocumentation.cmake
+1 −1 cmake/FindGMock.cmake
+1 −1 cmake/FindLAPACKE.cmake
+1 −1 cmake/FindMKL.cmake
+3 −3 cmake/FindPythonInterpreter.cmake
+1 −1 cmake/FindPythonModule.cmake
+3 −3 cmake/ImportCereal.cmake
+4 −4 cmake/ImportCore.cmake
+4 −4 cmake/ImportDatabase.cmake
+44 −0 cmake/ImportDftbplus.cmake
+7 −6 cmake/ImportGTest.cmake
+3 −3 cmake/ImportIRC.cmake
+1 −1 cmake/ImportIntegralEvaluator.cmake
+1 −1 cmake/ImportJSON.cmake
+1 −1 cmake/ImportLBFGSB.cmake
+3 −3 cmake/ImportLibint.cmake
+4 −4 cmake/ImportMolassembler.cmake
+1 −1 cmake/ImportMongoCxx.cmake
+42 −0 cmake/ImportPugiXML.cmake
+3 −3 cmake/ImportPybind11.cmake
+4 −4 cmake/ImportSparrow.cmake
+1 −1 cmake/ImportSpgLib.cmake
+41 −0 cmake/ImportSundials.cmake
+44 −0 cmake/ImportSwoose.cmake
+4 −4 cmake/ImportUtilsOS.cmake
+4 −4 cmake/ImportXtb.cmake
+3 −3 cmake/ImportYamlCpp.cmake
+9 −1 cmake/Licenses.cmake
+1 −1 cmake/SphinxDocumentation.cmake
+27 −4 cmake/TargetLibName.cmake
+1 −1 cmake/Utils.cmake
+1 −1 cmake/doctest_pybind_module.py
+24 −0 cmake/licenses/pugixml.txt
+29 −0 cmake/licenses/sundials.txt
+3 −3 conan/base.py
+1 −1 conan/glue/gtest.cmake
+1 −1 conan/hook.cmake
+2 −2 conan/utils.py
108 changes: 14 additions & 94 deletions src/Kinetx/App/main.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/**
* @file
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.\n
* Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.\n
* See LICENSE.txt for details.
*/

#include "Kinetx/Integrator/CashKarp5.h"
#include "Kinetx/Integrator/Cvode.h"
#include "Kinetx/Integrator/ExplicitEuler.h"
#include "Kinetx/Integrator/ImplicitEuler.h"
#include "Kinetx/Network.h"
#include "Kinetx/RandomNetworkFactory.h"
#include "Kinetx/ReferenceNetworks.h"
#include "Kinetx/RungeKutta/CashKarp5.h"
#include "Kinetx/RungeKutta/ExplicitEuler.h"
#include "Kinetx/RungeKutta/ImplicitEuler.h"
#include <cmath>
#include <iomanip>
#include <iostream>
Expand All @@ -22,107 +23,26 @@ int main() {
auto net = ret.first;
auto concentrations = ret.second;

// Minimal Bromate Oscillator
// https://pubs.acs.org/doi/pdf/10.1021/j100259a030
// Eigen::VectorXd masses(10);
// masses << 127.90, 79.90, 1.01, 112.91, 96.91, 159.81, 18.02, 111.90, 140.12, 140.12;
// Eigen::SparseMatrix<double> rf(7, 1);
// rf.insert(0, 0) = 2.1;
// rf.insert(1, 0) = 2.0e9;
// rf.insert(2, 0) = 8.0e9;
// rf.insert(3, 0) = 1.0e4;
// rf.insert(4, 0) = 6.5e5;
// rf.insert(5, 0) = 9.6;
// rf.insert(6, 0) = 4.0e7;
// Eigen::SparseMatrix<double> rb(7, 1);
// rb.insert(0, 0) = 1.0e4;
// rb.insert(1, 0) = 5.0e-5;
// rb.insert(2, 0) = 110.0;
// rb.insert(3, 0) = 2.0e7;
// rb.insert(4, 0) = 2.4e7;
// rb.insert(5, 0) = 1.3e-4;
// rb.insert(6, 0) = 2.1e-10;
// Eigen::SparseMatrix<int> sf(7, 10);
// sf.insert(0, 0) = 1;
// sf.insert(0, 1) = 1;
// sf.insert(0, 2) = 2;
// sf.insert(1, 1) = 1;
// sf.insert(1, 2) = 1;
// sf.insert(1, 3) = 1;
// sf.insert(2, 1) = 1;
// sf.insert(2, 2) = 1;
// sf.insert(2, 4) = 1;
// sf.insert(3, 0) = 1;
// sf.insert(3, 2) = 1;
// sf.insert(3, 3) = 1;
// sf.insert(4, 2) = 1;
// sf.insert(4, 7) = 1;
// sf.insert(4, 8) = 1;
// sf.insert(5, 6) = 1;
// sf.insert(5, 7) = 1;
// sf.insert(5, 9) = 1;
// sf.insert(6, 3) = 2;
// Eigen::SparseMatrix<int> sb(7, 10);
// sb.insert(0, 3) = 1;
// sb.insert(0, 4) = 1;
// sb.insert(1, 4) = 2;
// sb.insert(2, 5) = 1;
// sb.insert(2, 6) = 1;
// sb.insert(3, 6) = 1;
// sb.insert(3, 7) = 2;
// sb.insert(4, 3) = 1;
// sb.insert(4, 9) = 1;
// sb.insert(5, 8) = 1;
// sb.insert(5, 0) = 1;
// sb.insert(5, 2) = 2;
// sb.insert(6, 0) = 1;
// sb.insert(6, 2) = 1;
// sb.insert(6, 4) = 1;
// Network net(masses, {rf, rb}, {sf, sb, sb - sf});
// Eigen::VectorXd concentrations = Eigen::VectorXd::Zero(net.nCompounds);
// concentrations[0] = 6.0e-2;
// concentrations[1] = 3.0e-4;
// concentrations[2] = 1.5;
// concentrations[6] = 22.0;
// concentrations[8] = 1.5e-4;
// concentrations[0] = 0.1999e-1;
// concentrations[1] = 0.3347e-6;
// concentrations[2] = 0.1500e+1;
// concentrations[3] = 0.4606e-10;
// concentrations[4] = 0.8271e-6;
// concentrations[5] = 0.3020e-4;
// concentrations[6] = 0.0;
// concentrations[7] = 0.2627e-9;
// concentrations[8] = 0.1427e-3;
// concentrations[9] = 0.7321e-5;

// Random Network
// auto net = NetworkFactory::random();
// Eigen::VectorXd concentrations(net.nCompounds);
// concentrations.setZero();
// concentrations[0] = 0.3;

// Explicit Euler
// ExplicitEuler solver(net);
// Cash-Karp
CashKarp5 solver(net);
// Implicit Euler
// ImplicitEuler solver(net);
// Cash-Karp
// CashKarp5 solver(net);
// Cvode
Cvode solver(net);
double t = 0.0;
double dt = 1e-8;
// for (unsigned int i=0;i<1e5;i++){
std::cout << std::scientific << std::setprecision(6) << t << " " << dt << " " << concentrations.transpose() << " "
<< concentrations.dot(net.masses) << std::endl;
Eigen::VectorXd concentrationFlux = Eigen::VectorXd::Zero(concentrations.size());
double dt = 1e-1;
Eigen::VectorXd edgeFlux = Eigen::VectorXd::Zero(net.nReactions);
Eigen::VectorXd forwardEdgeFlux = Eigen::VectorXd::Zero(net.nReactions);
Eigen::VectorXd backwardEdgeFlux = Eigen::VectorXd::Zero(net.nReactions);
for (unsigned int i = 0; i < 2e8; i++) {
for (unsigned int i = 0; i < 2e6; i++) {
double told = t;
Eigen::VectorXd concentrationFlux = Eigen::VectorXd::Zero(concentrations.size());
solver.propagate(concentrations, concentrationFlux, edgeFlux, forwardEdgeFlux, backwardEdgeFlux, t, dt);
if (t != told && i % 1000 == 0)
std::cout << std::scientific << std::setprecision(6) << t << " " << dt << " " << concentrations.transpose()
<< " " << concentrations.dot(net.masses) << std::endl;
std::cout << std::scientific << std::setprecision(6) << t << " " << dt << " | " << concentrations.transpose()
<< " | " << concentrations.dot(net.masses) << " | " << (concentrationFlux / dt).transpose() << std::endl;
}

return 1;
Expand Down
46 changes: 29 additions & 17 deletions src/Kinetx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,35 @@ target_compile_definitions(Kinetx
)
include(AddEigen)
add_eigen(Kinetx PUBLIC)
target_link_libraries(Kinetx
PRIVATE
$<$<BOOL:${OpenMP_CXX_FOUND}>:OpenMP::OpenMP_CXX>
include(ImportSundials)
import_sundials()

target_link_libraries(Kinetx PRIVATE
$<$<BOOL:${OpenMP_CXX_FOUND}>:OpenMP::OpenMP_CXX>
sundials_cvode
sundials_sunmatrixdense
sundials_sunmatrixsparse
sundials_sunnonlinsolnewton
sundials_sunnonlinsolfixedpoint
)
target_include_directories(Kinetx PRIVATE
${sundials_SOURCE_DIR}/include
)
if(SCINE_PARALLELIZE)
target_link_libraries(Kinetx PRIVATE
sundials_nvecopenmp
)
target_include_directories(Kinetx PRIVATE
sundials_nvecopenmp
)
else()
target_link_libraries(Kinetx PRIVATE
sundials_nvecserial
)
target_include_directories(Kinetx PRIVATE
sundials_nvecserial
)
endif()

# Add namespaced aliases
add_library(Scine::Kinetx ALIAS Kinetx)
Expand Down Expand Up @@ -68,19 +93,6 @@ if(SCINE_BUILD_TESTS)
${CMAKE_DL_LIBS}
)
add_test(NAME Kinetx COMMAND Kinetx_tests)

# # App tests
# find_package(PythonInterp REQUIRED)
# add_test(
# NAME Sparrow_App
# COMMAND ${PYTHON_EXECUTABLE} -B -m pytest test_sparrow.py${TEST_SELECTION} --junitxml=${CMAKE_CURRENT_BINARY_DIR}/app_report.xml
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Tests/AppTests
# )
# set_tests_properties(Sparrow_App PROPERTIES
# ENVIRONMENT SCINE_MODULE_PATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{SCINE_MODULE_PATH}
# ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PYTHONPATH}
# ENVIRONMENT PATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PATH}
# )
endif()

# Set the RPATH to be used when installing.
Expand Down Expand Up @@ -166,7 +178,7 @@ if(SCINE_BUILD_PYTHON_BINDINGS)
if(SCINE_BUILD_TESTS)
add_test(
NAME Kinetx_Python_Bindings
COMMAND ${PYTHON_EXECUTABLE} -B -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/Python/Tests --junitxml=${CMAKE_CURRENT_BINARY_DIR}/pytest_report.xml
COMMAND ${PYTHON_EXECUTABLE} -B -m pytest -s ${CMAKE_CURRENT_SOURCE_DIR}/Python/Tests --junitxml=${CMAKE_CURRENT_BINARY_DIR}/pytest_report.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
set_tests_properties(Kinetx_Python_Bindings PROPERTIES
Expand Down
22 changes: 13 additions & 9 deletions src/Kinetx/Files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ set(KINETX_LIB_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RandomNetworkFactory.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/ReferenceNetworks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/ReferenceNetworks.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/CashKarp5.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/CashKarp5.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/ExplicitEuler.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/ExplicitEuler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/ImplicitEuler.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/ImplicitEuler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/RungeKutta.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/RungeKutta/RungeKutta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/CashKarp5.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/CashKarp5.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/Cvode.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/Cvode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/ExplicitEuler.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/ExplicitEuler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/Integrator.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/Integrator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/ImplicitEuler.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/ImplicitEuler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/RungeKutta.h
${CMAKE_CURRENT_SOURCE_DIR}/Kinetx/Integrator/RungeKutta.cpp
)

set(KINETX_TEST_FILES
Expand All @@ -32,5 +36,5 @@ set(KINETX_PYTHON_CPPS
${CMAKE_CURRENT_SOURCE_DIR}/Python/NetworkBuilderPython.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Python/ReferenceNetworksPython.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Python/RandomNetworkFactoryPython.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Python/RungeKuttaPython.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Python/IntegratorsPython.cpp
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* @file
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.\n
* Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.\n
* See LICENSE.txt for details.
*/

#include "Kinetx/RungeKutta/CashKarp5.h"
#include "Kinetx/Integrator/CashKarp5.h"
#include <Eigen/Dense>

namespace Scine {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @file
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.\n
* Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.\n
* See LICENSE.txt for details.
*/
#ifndef KINETX_CASHKARP5_H_
#define KINETX_CASHKARP5_H_

#include "Kinetx/RungeKutta/RungeKutta.h"
#include "Kinetx/Integrator/RungeKutta.h"

namespace Scine {
namespace Kinetx {
Expand Down
Loading

0 comments on commit 24d8b83

Please sign in to comment.