Skip to content

Commit 623fbec

Browse files
committed
libCellML: upgraded to commit 7cc5bea.
1 parent 4bcc8c5 commit 623fbec

31 files changed

+210
-206
lines changed

cmake/packages.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function(retrieve_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_REPOSITORY RELEAS
195195
if("${PACKAGE_NAME}" STREQUAL "libCellML")
196196
#---GRY--- USE THIS VERSION OF libCellML WHICH CORRESPONDS TO PR #1256 UNTIL IT GETS MERGED IN.
197197

198-
set(PACKAGE_URL "https://github.com/agarny/${PACKAGE_REPOSITORY}/releases/download/6d27883/${PACKAGE_FILE}")
198+
set(PACKAGE_URL "https://github.com/agarny/${PACKAGE_REPOSITORY}/releases/download/7cc5bea/${PACKAGE_FILE}")
199199
endif()
200200

201201
set(ATTEMPT 1)

src/3rdparty/libCellML/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,49 @@ if(LIBOPENCOR_PREBUILT_LIBCELLML)
3434
if(EMSCRIPTEN)
3535
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
3636
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
37-
f3087749522fb85a72d440180b9b4c3b5bf77eb4)
37+
5bee3b3c508fb274e084468243b43d9f83647beb)
3838
else()
3939
if(WIN32)
4040
if(RELEASE_MODE)
4141
if(INTEL_MODE)
4242
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
4343
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
44-
b1bfb0c9d197e7b858f5f27f305bda5ae40a9ad7)
44+
d277ce028be3806aa2514ba27ec4bed352faf069)
4545
else()
4646
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
4747
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
48-
4d06110bb96f71cff8f1fb0e0e463f94920f8fa9)
48+
388a936417a5681fbcf835bdda20e8ed0fbf3382)
4949
endif()
5050
else()
5151
if(INTEL_MODE)
5252
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
5353
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
54-
214b685fbaf9c616739ad8786800b75d59a47f8b)
54+
c768d8c59db5ee4a07baa0fc61d7a8ccac4ea6db)
5555
else()
5656
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
5757
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
58-
0d6d70f9fdf7443d82016216a78be7d2acea2e7e)
58+
2fd521abaf83b480e5b07c746ae310be529faa7e)
5959
endif()
6060
endif()
6161
elseif(APPLE)
6262
if(INTEL_MODE)
6363
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
6464
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
65-
8ccd4a8a95a3b4b243d900746340f167d9f31075)
65+
055181384ac2e4e942603c6b1f3d0c20f439b523)
6666
else()
6767
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
6868
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
69-
72b1e4f2e4a2b76a0d45efced9ef96cbba263d66)
69+
847c024d893e3a1f73172e8f6d2e55136e46dd86)
7070
endif()
7171
else()
7272
if(INTEL_MODE)
7373
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
7474
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
75-
623866e3cf071f652fe778a22868b5c6917db6f9)
75+
f8d847dffd74264a3074e742149dca0ab4c57653)
7676
else()
7777
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
7878
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
79-
9742ef210ca1cc88549b802c6f0fc5d1c0670f25)
79+
674bb536a67cc7e7d4afef553c843ac38d44d43f)
8080
endif()
8181
endif()
8282
endif()
@@ -86,7 +86,7 @@ elseif(NOT ONLY_BUILD_JAVASCRIPT_THIRD_PARTY_LIBRARIES)
8686
build_package(${PACKAGE_NAME}
8787
URL
8888
# https://github.com/opencor/${PACKAGE_REPOSITORY}/archive/refs/tags/${RELEASE_TAG}.tar.gz
89-
https://github.com/agarny/${PACKAGE_REPOSITORY}/archive/refs/tags/6d27883.tar.gz
89+
https://github.com/agarny/${PACKAGE_REPOSITORY}/archive/refs/tags/7cc5bea.tar.gz
9090
DOWNLOAD_NO_PROGRESS ON
9191
CMAKE_ARGS
9292
-DBINDINGS_PYTHON=OFF

src/api/libopencor/sedinstancetask.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
288288
* @return The number of algebraic variables.
289289
*/
290290

291-
size_t algebraicCount() const;
291+
size_t algebraicVariableCount() const;
292292

293293
/**
294294
* @brief Get the values of the algebraic variable at the given index.
@@ -300,10 +300,10 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
300300
* @return The values of the algebraic variable, as a @c Doubles, if the index is valid, an empty vector otherwise.
301301
*/
302302

303-
Doubles algebraic(size_t pIndex) const;
303+
Doubles algebraicVariable(size_t pIndex) const;
304304

305305
#ifdef __EMSCRIPTEN__
306-
emscripten::val algebraicAsArray(size_t pIndex) const;
306+
emscripten::val algebraicVariableAsArray(size_t pIndex) const;
307307
#endif
308308

309309
/**
@@ -317,7 +317,7 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
317317
* otherwise.
318318
*/
319319

320-
std::string algebraicName(size_t pIndex) const;
320+
std::string algebraicVariableName(size_t pIndex) const;
321321

322322
/**
323323
* @brief Get the unit of the algebraic variable.
@@ -330,7 +330,7 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
330330
* otherwise.
331331
*/
332332

333-
std::string algebraicUnit(size_t pIndex) const;
333+
std::string algebraicVariableUnit(size_t pIndex) const;
334334

335335
private:
336336
class Impl; /**< Forward declaration of the implementation class, @private. */

src/bindings/javascript/sed.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ void sedApi()
120120
.function("computedConstantAsArray", &libOpenCOR::SedInstanceTask::computedConstantAsArray)
121121
.function("computedConstantName", &libOpenCOR::SedInstanceTask::computedConstantName)
122122
.function("computedConstantUnit", &libOpenCOR::SedInstanceTask::computedConstantUnit)
123-
.property("algebraicCount", &libOpenCOR::SedInstanceTask::algebraicCount)
124-
.function("algebraic", &libOpenCOR::SedInstanceTask::algebraic)
125-
.function("algebraicAsArray", &libOpenCOR::SedInstanceTask::algebraicAsArray)
126-
.function("algebraicName", &libOpenCOR::SedInstanceTask::algebraicName)
127-
.function("algebraicUnit", &libOpenCOR::SedInstanceTask::algebraicUnit);
123+
.property("algebraicVariableCount", &libOpenCOR::SedInstanceTask::algebraicVariableCount)
124+
.function("algebraicVariable", &libOpenCOR::SedInstanceTask::algebraicVariable)
125+
.function("algebraicVariableAsArray", &libOpenCOR::SedInstanceTask::algebraicVariableAsArray)
126+
.function("algebraicVariableName", &libOpenCOR::SedInstanceTask::algebraicVariableName)
127+
.function("algebraicVariableUnit", &libOpenCOR::SedInstanceTask::algebraicVariableUnit);
128128

129129
// SedModel API.
130130

src/bindings/python/sed.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ void sedApi(nb::module_ &m)
124124
.def("computed_constant", &libOpenCOR::SedInstanceTask::computedConstant, "Return the values of a computed constant.")
125125
.def("computed_constant_name", &libOpenCOR::SedInstanceTask::computedConstantName, "Return the name of a computed constant.")
126126
.def("computed_constant_unit", &libOpenCOR::SedInstanceTask::computedConstantUnit, "Return the unit of a computed constant.")
127-
.def_prop_ro("algebraic_count", &libOpenCOR::SedInstanceTask::algebraicCount, "Return the number of algebraic variables.")
128-
.def("algebraic", &libOpenCOR::SedInstanceTask::algebraic, "Return the values of an algebraic variable.")
129-
.def("algebraic_name", &libOpenCOR::SedInstanceTask::algebraicName, "Return the name of an algebraic variable.")
130-
.def("algebraic_unit", &libOpenCOR::SedInstanceTask::algebraicUnit, "Return the unit of an algebraic variable.");
127+
.def_prop_ro("algebraic_variable_count", &libOpenCOR::SedInstanceTask::algebraicVariableCount, "Return the number of algebraic variables.")
128+
.def("algebraic_variable", &libOpenCOR::SedInstanceTask::algebraicVariable, "Return the values of an algebraic variable.")
129+
.def("algebraic_variable_name", &libOpenCOR::SedInstanceTask::algebraicVariableName, "Return the name of an algebraic variable.")
130+
.def("algebraic_variable_unit", &libOpenCOR::SedInstanceTask::algebraicVariableUnit, "Return the unit of an algebraic variable.");
131131

132132
// SedModel API.
133133

src/sed/sedchangeattribute.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ void SedChangeAttribute::Impl::apply(const SedInstanceTaskPtr &pInstanceTask,
140140
}
141141

142142
if (!isParameterSet) {
143-
for (size_t i {0}; i < pAnalyserModel->algebraicCount(); ++i) {
144-
if (instanceTaskPimpl->algebraicName(i) == changeName) {
145-
auto algebraicVariable {pAnalyserModel->algebraic()[i]->variable()};
143+
for (size_t i {0}; i < pAnalyserModel->algebraicVariableCount(); ++i) {
144+
if (instanceTaskPimpl->algebraicVariableName(i) == changeName) {
145+
auto algebraicVariable {pAnalyserModel->algebraicVariables()[i]->variable()};
146146
auto algebraicComponent {owningComponent(algebraicVariable)};
147147

148148
addWarning(std::string("The algebraic variable '").append(algebraicVariable->name()).append("' in component '").append(algebraicComponent->name()).append("' cannot be changed. Only state variables and constants can be changed."));

src/sed/sedinstancetask.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ SedInstanceTask::Impl::Impl(const SedAbstractTaskPtr &pTask)
9696

9797
mConstantDoubles.resize(mAnalyserModel->constantCount(), NAN);
9898
mComputedConstantDoubles.resize(mAnalyserModel->computedConstantCount(), NAN);
99-
mAlgebraicDoubles.resize(mAnalyserModel->algebraicCount(), NAN);
99+
mAlgebraicDoubles.resize(mAnalyserModel->algebraicVariableCount(), NAN);
100100

101101
mConstants = mConstantDoubles.data();
102102
mComputedConstants = mComputedConstantDoubles.data();
103103
mAlgebraic = mAlgebraicDoubles.data();
104104

105105
mResults.constants.resize(mAnalyserModel->constantCount(), {});
106106
mResults.computedConstants.resize(mAnalyserModel->computedConstantCount(), {});
107-
mResults.algebraic.resize(mAnalyserModel->algebraicCount(), {});
107+
mResults.algebraic.resize(mAnalyserModel->algebraicVariableCount(), {});
108108
}
109109

110110
void SedInstanceTask::Impl::trackResults(size_t pIndex)
@@ -124,7 +124,7 @@ void SedInstanceTask::Impl::trackResults(size_t pIndex)
124124
mResults.computedConstants[i][pIndex] = mComputedConstants[i]; // NOLINT
125125
}
126126

127-
for (size_t i {0}; i < mAnalyserModel->algebraicCount(); ++i) {
127+
for (size_t i {0}; i < mAnalyserModel->algebraicVariableCount(); ++i) {
128128
mResults.algebraic[i][pIndex] = mAlgebraic[i]; // NOLINT
129129
}
130130
}
@@ -157,15 +157,15 @@ void SedInstanceTask::Impl::initialise()
157157
mVoi = mSedUniformTimeCourse->pimpl()->mOutputStartTime;
158158

159159
#ifdef __EMSCRIPTEN__
160-
mRuntime->initialiseVariablesForDifferentialModel(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
160+
mRuntime->initialiseArraysForDifferentialModel(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
161161
#else
162-
mRuntime->initialiseVariablesForDifferentialModel()(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
162+
mRuntime->initialiseArraysForDifferentialModel()(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
163163
#endif
164164
} else {
165165
#ifdef __EMSCRIPTEN__
166-
mRuntime->initialiseVariablesForAlgebraicModel(mConstants, mComputedConstants, mAlgebraic);
166+
mRuntime->initialiseArraysForAlgebraicModel(mConstants, mComputedConstants, mAlgebraic);
167167
#else
168-
mRuntime->initialiseVariablesForAlgebraicModel()(mConstants, mComputedConstants, mAlgebraic);
168+
mRuntime->initialiseArraysForAlgebraicModel()(mConstants, mComputedConstants, mAlgebraic);
169169
#endif
170170
}
171171

@@ -245,7 +245,7 @@ double SedInstanceTask::Impl::run()
245245
mResults.computedConstants[i].resize(resultsSize, NAN);
246246
}
247247

248-
for (size_t i {0}; i < mAnalyserModel->algebraicCount(); ++i) {
248+
for (size_t i {0}; i < mAnalyserModel->algebraicVariableCount(); ++i) {
249249
mResults.algebraic[i].resize(resultsSize, NAN);
250250
}
251251

@@ -302,7 +302,7 @@ double SedInstanceTask::Impl::run()
302302
mResults.computedConstants[i].resize(1, mComputedConstants[i]); // NOLINT
303303
}
304304

305-
for (size_t i {0}; i < mAnalyserModel->algebraicCount(); ++i) {
305+
for (size_t i {0}; i < mAnalyserModel->algebraicVariableCount(); ++i) {
306306
mResults.algebraic[i].resize(1, mAlgebraic[i]); // NOLINT
307307
}
308308
}
@@ -467,36 +467,36 @@ std::string SedInstanceTask::Impl::computedConstantUnit(size_t pIndex) const
467467
return mAnalyserModel->computedConstants()[pIndex]->variable()->units()->name();
468468
}
469469

470-
size_t SedInstanceTask::Impl::algebraicCount() const
470+
size_t SedInstanceTask::Impl::algebraicVariableCount() const
471471
{
472-
return mAnalyserModel->algebraicCount();
472+
return mAnalyserModel->algebraicVariableCount();
473473
}
474474

475-
Doubles SedInstanceTask::Impl::algebraic(size_t pIndex) const
475+
Doubles SedInstanceTask::Impl::algebraicVariable(size_t pIndex) const
476476
{
477-
if (pIndex >= mAnalyserModel->algebraicCount()) {
477+
if (pIndex >= mAnalyserModel->algebraicVariableCount()) {
478478
return {};
479479
}
480480

481481
return mResults.algebraic[pIndex];
482482
}
483483

484-
std::string SedInstanceTask::Impl::algebraicName(size_t pIndex) const
484+
std::string SedInstanceTask::Impl::algebraicVariableName(size_t pIndex) const
485485
{
486-
if (pIndex >= mAnalyserModel->algebraicCount()) {
486+
if (pIndex >= mAnalyserModel->algebraicVariableCount()) {
487487
return {};
488488
}
489489

490-
return name(mAnalyserModel->algebraic()[pIndex]->variable());
490+
return name(mAnalyserModel->algebraicVariables()[pIndex]->variable());
491491
}
492492

493-
std::string SedInstanceTask::Impl::algebraicUnit(size_t pIndex) const
493+
std::string SedInstanceTask::Impl::algebraicVariableUnit(size_t pIndex) const
494494
{
495-
if (pIndex >= mAnalyserModel->algebraicCount()) {
495+
if (pIndex >= mAnalyserModel->algebraicVariableCount()) {
496496
return {};
497497
}
498498

499-
return mAnalyserModel->algebraic()[pIndex]->variable()->units()->name();
499+
return mAnalyserModel->algebraicVariables()[pIndex]->variable()->units()->name();
500500
}
501501

502502
SedInstanceTask::SedInstanceTask(const SedAbstractTaskPtr &pTask)
@@ -649,31 +649,31 @@ std::string SedInstanceTask::computedConstantUnit(size_t pIndex) const
649649
return pimpl()->computedConstantUnit(pIndex);
650650
}
651651

652-
size_t SedInstanceTask::algebraicCount() const
652+
size_t SedInstanceTask::algebraicVariableCount() const
653653
{
654-
return pimpl()->algebraicCount();
654+
return pimpl()->algebraicVariableCount();
655655
}
656656

657-
Doubles SedInstanceTask::algebraic(size_t pIndex) const
657+
Doubles SedInstanceTask::algebraicVariable(size_t pIndex) const
658658
{
659-
return pimpl()->algebraic(pIndex);
659+
return pimpl()->algebraicVariable(pIndex);
660660
}
661661

662662
#ifdef __EMSCRIPTEN__
663-
emscripten::val SedInstanceTask::algebraicAsArray(size_t pIndex) const
663+
emscripten::val SedInstanceTask::algebraicVariableAsArray(size_t pIndex) const
664664
{
665-
return emscripten::val::array(algebraic(pIndex));
665+
return emscripten::val::array(algebraicVariable(pIndex));
666666
}
667667
#endif
668668

669-
std::string SedInstanceTask::algebraicName(size_t pIndex) const
669+
std::string SedInstanceTask::algebraicVariableName(size_t pIndex) const
670670
{
671-
return pimpl()->algebraicName(pIndex);
671+
return pimpl()->algebraicVariableName(pIndex);
672672
}
673673

674-
std::string SedInstanceTask::algebraicUnit(size_t pIndex) const
674+
std::string SedInstanceTask::algebraicVariableUnit(size_t pIndex) const
675675
{
676-
return pimpl()->algebraicUnit(pIndex);
676+
return pimpl()->algebraicVariableUnit(pIndex);
677677
}
678678

679679
} // namespace libOpenCOR

src/sed/sedinstancetask_p.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ class SedInstanceTask::Impl: public Logger::Impl
9999
std::string computedConstantName(size_t pIndex) const;
100100
std::string computedConstantUnit(size_t pIndex) const;
101101

102-
size_t algebraicCount() const;
103-
Doubles algebraic(size_t pIndex) const;
104-
std::string algebraicName(size_t pIndex) const;
105-
std::string algebraicUnit(size_t pIndex) const;
102+
size_t algebraicVariableCount() const;
103+
Doubles algebraicVariable(size_t pIndex) const;
104+
std::string algebraicVariableName(size_t pIndex) const;
105+
std::string algebraicVariableUnit(size_t pIndex) const;
106106
};
107107

108108
} // namespace libOpenCOR

src/support/cellml/cellmlfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ CellmlFile::Impl::Impl(const FilePtr &pFile, const libcellml::ModelPtr &pModel,
5050

5151
mAnalyser->analyseModel(mModel);
5252

53-
mAnalyserModel = mAnalyser->model();
53+
mAnalyserModel = mAnalyser->analyserModel();
5454

5555
if (mAnalyser->errorCount() != 0) {
5656
addIssues(mAnalyser, "Analyser");

0 commit comments

Comments
 (0)