Skip to content

Commit

Permalink
libCellML: upgraded to commit 707e211.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Sep 20, 2024
1 parent 4795fa1 commit 79a1ce0
Show file tree
Hide file tree
Showing 50 changed files with 1,433 additions and 778 deletions.
2 changes: 1 addition & 1 deletion cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function(retrieve_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_REPOSITORY RELEAS
if("${PACKAGE_NAME}" STREQUAL "libCellML")
#---GRY--- THIS IS TEMPORARY UNTIL libCellML HAS AN OFFICIAL RELEASE WITH THE INTERPRETER.

set(PACKAGE_URL "https://github.com/agarny/${PACKAGE_REPOSITORY}/releases/download/4966bad1/${PACKAGE_FILE}")
set(PACKAGE_URL "https://github.com/agarny/${PACKAGE_REPOSITORY}/releases/download/707e211/${PACKAGE_FILE}")
endif()

file(DOWNLOAD ${PACKAGE_URL} ${REAL_PACKAGE_FILE} STATUS STATUS)
Expand Down
14 changes: 7 additions & 7 deletions src/3rdparty/libCellML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@ if(LIBOPENCOR_PREBUILT_LIBCELLML)
if(EMSCRIPTEN)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
fcf641fa72fa59f39038333d3898079b0fe8bbc6)
d1e81de9a8acbf48ef02e22deed6d32337b8b7bc)
else()
if(WIN32)
if(RELEASE_MODE)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
0689a48b5d4c5d77fd0e4b1d8ecd25078eac8282)
0299c00e0e61cd8f4332e094bda6d51b6a648016)
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
ae37bed8fd1e44573c2463d97faab6553f8d4d28)
f9e2e8d8c5e9b6352348c66922b5933cb5ad1b4c)
endif()
elseif(APPLE)
if(INTEL_MODE)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
3d9ca6593556195bb8c7d6d5c61d6f84e0cf26f1)
cc925cf231f231eb0b86e74f4e5327b0ac412ac7)
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
64ff0463bea85404264126b9b1e2cecdd1f96e4a)
92394488b09c6589dcb302eca01a8ad5ee9ca715)
endif()
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
a734b3a37cb2a6a2df45fc4a2c76227f0764f582)
f46b5bb3600f4fed08d8667457d5c0c04be2b7cc)
endif()
endif()
else()
Expand All @@ -68,7 +68,7 @@ else()
build_package(${PACKAGE_NAME}
URL
# https://github.com/opencor/${PACKAGE_REPOSITORY}/archive/refs/tags/${RELEASE_TAG}.tar.gz
https://github.com/agarny/${PACKAGE_REPOSITORY}/archive/refs/tags/4966bad1.tar.gz
https://github.com/agarny/${PACKAGE_REPOSITORY}/archive/refs/tags/707e211.tar.gz
DOWNLOAD_NO_PROGRESS ON
CMAKE_ARGS
-DBINDINGS_PYTHON=OFF
Expand Down
140 changes: 120 additions & 20 deletions src/api/libopencor/sedinstancetask.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,54 +179,154 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
std::string rateUnit(size_t pIndex) const;

/**
* @brief Get the number of variables.
* @brief Get the number of constants.
*
* Get the number of variables.
* Get the number of constants.
*
* @return The number of variables.
* @return The number of constants.
*/

size_t variableCount() const;
size_t constantCount() const;

/**
* @brief Get the values of the variable at the given index.
* @brief Get the values of the constant at the given index.
*
* Get the values of the variable at the given index.
* Get the values of the constant at the given index.
*
* @param pIndex The index of the variable.
* @param pIndex The index of the constant.
*
* @return The values of the variable.
* @return The values of the constant.
*/

Doubles variable(size_t pIndex) const;
Doubles constant(size_t pIndex) const;

#ifdef __EMSCRIPTEN__
emscripten::val variableAsArray(size_t pIndex) const;
emscripten::val constantAsArray(size_t pIndex) const;
#endif

/**
* @brief Get the name of the variable.
* @brief Get the name of the constant.
*
* Get the name of the variable at the given index.
* Get the name of the constant at the given index.
*
* @param pIndex The index of the variable.
* @param pIndex The index of the constant.
*
* @return The name of the variable.
* @return The name of the constant.
*/

std::string variableName(size_t pIndex) const;
std::string constantName(size_t pIndex) const;

/**
* @brief Get the unit of the variable.
* @brief Get the unit of the constant.
*
* Get the unit of the variable at the given index.
* Get the unit of the constant at the given index.
*
* @param pIndex The index of the variable.
* @param pIndex The index of the constant.
*
* @return The unit of the variable.
* @return The unit of the constant.
*/

std::string variableUnit(size_t pIndex) const;
std::string constantUnit(size_t pIndex) const;

/**
* @brief Get the number of computed constants.
*
* Get the number of computed constants.
*
* @return The number of computed constants.
*/

size_t computedConstantCount() const;

/**
* @brief Get the values of the computed constant at the given index.
*
* Get the values of the computed constant at the given index.
*
* @param pIndex The index of the computed constant.
*
* @return The values of the computed constant.
*/

Doubles computedConstant(size_t pIndex) const;

#ifdef __EMSCRIPTEN__
emscripten::val computedConstantAsArray(size_t pIndex) const;
#endif

/**
* @brief Get the name of the computed constant.
*
* Get the name of the computed constant at the given index.
*
* @param pIndex The index of the computed constant.
*
* @return The name of the computed constant.
*/

std::string computedConstantName(size_t pIndex) const;

/**
* @brief Get the unit of the computed constant.
*
* Get the unit of the computed constant at the given index.
*
* @param pIndex The index of the computed constant.
*
* @return The unit of the computed constant.
*/

std::string computedConstantUnit(size_t pIndex) const;

/**
* @brief Get the number of algebraic variables.
*
* Get the number of algebraic variables.
*
* @return The number of algebraic variables.
*/

size_t algebraicCount() const;

/**
* @brief Get the values of the algebraic variable at the given index.
*
* Get the values of the algebraic variable at the given index.
*
* @param pIndex The index of the algebraic variable.
*
* @return The values of the algebraic variable.
*/

Doubles algebraic(size_t pIndex) const;

#ifdef __EMSCRIPTEN__
emscripten::val algebraicAsArray(size_t pIndex) const;
#endif

/**
* @brief Get the name of the algebraic variable.
*
* Get the name of the algebraic variable at the given index.
*
* @param pIndex The index of the algebraic variable.
*
* @return The name of the algebraic variable.
*/

std::string algebraicName(size_t pIndex) const;

/**
* @brief Get the unit of the algebraic variable.
*
* Get the unit of the algebraic variable at the given index.
*
* @param pIndex The index of the algebraic variable.
*
* @return The unit of the algebraic variable.
*/

std::string algebraicUnit(size_t pIndex) const;

private:
class Impl; /**< Forward declaration of the implementation class, @private. */
Expand Down
20 changes: 15 additions & 5 deletions src/bindings/javascript/sed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,21 @@ void sedApi()
.function("rateAsArray", &libOpenCOR::SedInstanceTask::rateAsArray)
.function("rateName", &libOpenCOR::SedInstanceTask::rateName)
.function("rateUnit", &libOpenCOR::SedInstanceTask::rateUnit)
.function("variableCount", &libOpenCOR::SedInstanceTask::variableCount)
.function("variable", &libOpenCOR::SedInstanceTask::variable)
.function("variableAsArray", &libOpenCOR::SedInstanceTask::variableAsArray)
.function("variableName", &libOpenCOR::SedInstanceTask::variableName)
.function("variableUnit", &libOpenCOR::SedInstanceTask::variableUnit);
.function("constantCount", &libOpenCOR::SedInstanceTask::constantCount)
.function("constant", &libOpenCOR::SedInstanceTask::constant)
.function("constantAsArray", &libOpenCOR::SedInstanceTask::constantAsArray)
.function("constantName", &libOpenCOR::SedInstanceTask::constantName)
.function("constantUnit", &libOpenCOR::SedInstanceTask::constantUnit)
.function("computedConstantCount", &libOpenCOR::SedInstanceTask::computedConstantCount)
.function("computedConstant", &libOpenCOR::SedInstanceTask::computedConstant)
.function("computedConstantAsArray", &libOpenCOR::SedInstanceTask::computedConstantAsArray)
.function("computedConstantName", &libOpenCOR::SedInstanceTask::computedConstantName)
.function("computedConstantUnit", &libOpenCOR::SedInstanceTask::computedConstantUnit)
.function("algebraicCount", &libOpenCOR::SedInstanceTask::algebraicCount)
.function("algebraic", &libOpenCOR::SedInstanceTask::algebraic)
.function("algebraicAsArray", &libOpenCOR::SedInstanceTask::algebraicAsArray)
.function("algebraicName", &libOpenCOR::SedInstanceTask::algebraicName)
.function("algebraicUnit", &libOpenCOR::SedInstanceTask::algebraicUnit);

// SedModel API.

Expand Down
16 changes: 12 additions & 4 deletions src/bindings/python/sed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,18 @@ void sedApi(py::module_ &m)
.def("rate", &libOpenCOR::SedInstanceTask::rate, "Return the values of a rate.")
.def("rate_name", &libOpenCOR::SedInstanceTask::rateName, "Return the name of a rate.")
.def("rate_unit", &libOpenCOR::SedInstanceTask::rateUnit, "Return the unit of a rate.")
.def_property_readonly("variable_count", &libOpenCOR::SedInstanceTask::variableCount, "Return the number of variables.")
.def("variable", &libOpenCOR::SedInstanceTask::variable, "Return the values of a variable.")
.def("variable_name", &libOpenCOR::SedInstanceTask::variableName, "Return the name of a variable.")
.def("variable_unit", &libOpenCOR::SedInstanceTask::variableUnit, "Return the unit of a variable.");
.def_property_readonly("constant_count", &libOpenCOR::SedInstanceTask::constantCount, "Return the number of constants.")
.def("constant", &libOpenCOR::SedInstanceTask::constant, "Return the values of a constant.")
.def("constant_name", &libOpenCOR::SedInstanceTask::constantName, "Return the name of a constant.")
.def("constant_unit", &libOpenCOR::SedInstanceTask::constantUnit, "Return the unit of a constant.")
.def_property_readonly("computed_constant_count", &libOpenCOR::SedInstanceTask::computedConstantCount, "Return the number of computed constants.")
.def("computed_constant", &libOpenCOR::SedInstanceTask::computedConstant, "Return the values of a computed constant.")
.def("computed_constant_name", &libOpenCOR::SedInstanceTask::computedConstantName, "Return the name of a computed constant.")
.def("computed_constant_unit", &libOpenCOR::SedInstanceTask::computedConstantUnit, "Return the unit of a computed constant.")
.def_property_readonly("algebraic_count", &libOpenCOR::SedInstanceTask::algebraicCount, "Return the number of algebraic variables.")
.def("algebraic", &libOpenCOR::SedInstanceTask::algebraic, "Return the values of an algebraic variable.")
.def("algebraic_name", &libOpenCOR::SedInstanceTask::algebraicName, "Return the name of an algebraic variable.")
.def("algebraic_unit", &libOpenCOR::SedInstanceTask::algebraicUnit, "Return the unit of an algebraic variable.");

// SedModel API.

Expand Down
Loading

0 comments on commit 79a1ce0

Please sign in to comment.