From a0a71eb355933b2186095502ebb7f79425575b79 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 8 Aug 2024 18:42:30 +0200 Subject: [PATCH 1/2] Analyser: some minor cleaning up. --- src/analyser.cpp | 22 ++++++++++++---------- src/analyserequation.cpp | 20 -------------------- src/analyserequation_p.h | 15 ++++----------- src/generator.cpp | 7 ++++--- 4 files changed, 20 insertions(+), 44 deletions(-) diff --git a/src/analyser.cpp b/src/analyser.cpp index ee0663f966..6fda878492 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -3300,16 +3300,18 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) auto equation = aie2aeMappings[internalEquation]; - equation->mPimpl->populate(type, - (type == AnalyserEquation::Type::EXTERNAL) ? - nullptr : - internalEquation->mAst, - equationDependencies, - internalEquation->mNlaSystemIndex, - equationNlaSiblings, - computedConstants, - algebraic, - externals); + equation->mPimpl->mType = type; + equation->mPimpl->mAst = (type == AnalyserEquation::Type::EXTERNAL) ? + nullptr : + internalEquation->mAst; + equation->mPimpl->mNlaSystemIndex = internalEquation->mNlaSystemIndex; + + std::copy(computedConstants.begin(), computedConstants.end(), back_inserter(equation->mPimpl->mComputedConstants)); + std::copy(algebraic.begin(), algebraic.end(), back_inserter(equation->mPimpl->mAlgebraic)); + std::copy(externals.begin(), externals.end(), back_inserter(equation->mPimpl->mExternals)); + + std::copy(equationDependencies.begin(), equationDependencies.end(), back_inserter(equation->mPimpl->mDependencies)); + std::copy(equationNlaSiblings.begin(), equationNlaSiblings.end(), back_inserter(equation->mPimpl->mNlaSiblings)); mModel->mPimpl->mEquations.push_back(equation); } diff --git a/src/analyserequation.cpp b/src/analyserequation.cpp index b124f0e6ce..7caf807cef 100644 --- a/src/analyserequation.cpp +++ b/src/analyserequation.cpp @@ -28,26 +28,6 @@ AnalyserEquationPtr AnalyserEquation::AnalyserEquationImpl::create() return std::shared_ptr {new AnalyserEquation {}}; } -void AnalyserEquation::AnalyserEquationImpl::populate(AnalyserEquation::Type type, - const AnalyserEquationAstPtr &ast, - const std::vector &dependencies, - size_t nlaSystemIndex, - const std::vector &nlaSiblings, - const std::vector &computedConstants, - const std::vector &algebraic, - const std::vector &externals) -{ - mType = type; - mAst = ast; - mNlaSystemIndex = nlaSystemIndex; - - std::copy(dependencies.begin(), dependencies.end(), back_inserter(mDependencies)); - std::copy(nlaSiblings.begin(), nlaSiblings.end(), back_inserter(mNlaSiblings)); - std::copy(computedConstants.begin(), computedConstants.end(), back_inserter(mComputedConstants)); - std::copy(algebraic.begin(), algebraic.end(), back_inserter(mAlgebraic)); - std::copy(externals.begin(), externals.end(), back_inserter(mExternals)); -} - bool AnalyserEquation::AnalyserEquationImpl::isEmptyDependency(const AnalyserEquationWeakPtr &dependency) { auto computedConstants = dependency.lock()->computedConstants(); diff --git a/src/analyserequation_p.h b/src/analyserequation_p.h index 75c2aed94b..471fd9b97b 100644 --- a/src/analyserequation_p.h +++ b/src/analyserequation_p.h @@ -31,24 +31,17 @@ struct AnalyserEquation::AnalyserEquationImpl { AnalyserEquation::Type mType = AnalyserEquation::Type::ALGEBRAIC; AnalyserEquationAstPtr mAst; - std::vector mDependencies; size_t mNlaSystemIndex; - std::vector mNlaSiblings; bool mIsStateRateBased = false; + std::vector mComputedConstants; std::vector mAlgebraic; std::vector mExternals; - static AnalyserEquationPtr create(); + std::vector mDependencies; + std::vector mNlaSiblings; - void populate(AnalyserEquation::Type type, - const AnalyserEquationAstPtr &ast, - const std::vector &dependencies, - size_t nlaSystemIndex, - const std::vector &nlaSiblings, - const std::vector &computedConstants, - const std::vector &algebraic, - const std::vector &externals); + static AnalyserEquationPtr create(); static bool isEmptyDependency(const AnalyserEquationWeakPtr &dependency); diff --git a/src/generator.cpp b/src/generator.cpp index d715e45b19..e0e316a2e4 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -1897,7 +1897,9 @@ void Generator::GeneratorImpl::addImplementationInitialiseVariablesMethodCode(st // Initialise our true constants. - for (const auto &equation : mModel->equations()) { + auto equations = mModel->equations(); + + for (const auto &equation : equations) { if (equation->type() == AnalyserEquation::Type::TRUE_CONSTANT) { methodBody += generateEquationCode(equation, remainingEquations); } @@ -1921,14 +1923,13 @@ void Generator::GeneratorImpl::addImplementationInitialiseVariablesMethodCode(st // Initialise our external variables. if (mModel->hasExternalVariables()) { - auto equations = mModel->equations(); std::vector remainingExternalEquations; std::copy_if(equations.begin(), equations.end(), std::back_inserter(remainingExternalEquations), [](const AnalyserEquationPtr &equation) { return equation->type() == AnalyserEquation::Type::EXTERNAL; }); - for (const auto &equation : mModel->equations()) { + for (const auto &equation : equations) { if (equation->type() == AnalyserEquation::Type::EXTERNAL) { methodBody += generateEquationCode(equation, remainingExternalEquations); } From 0451e141a6019d9008f2640b952ae177619a0ac7 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 8 Aug 2024 21:50:19 +0200 Subject: [PATCH 2/2] AnalyserModel: keep track of the constants, computed constants, and external variables. --- src/analyser.cpp | 25 ++- src/generator.cpp | 15 +- src/utilities.cpp | 6 + .../bindings/javascript/analysermodel.test.js | 16 +- .../javascript/analyservariable.test.js | 22 +-- tests/bindings/javascript/generator.test.js | 4 +- tests/bindings/python/test_analyser.py | 18 +- tests/coverage/coverage.cpp | 30 +-- tests/resources/coverage/generator/model.c | 25 ++- tests/resources/coverage/generator/model.h | 1 - .../generator/model.modified.profile.c | 25 ++- .../generator/model.modified.profile.h | 1 - .../generator/model.modified.profile.py | 25 ++- tests/resources/coverage/generator/model.py | 25 ++- .../algebraic_eqn_computed_var_on_rhs/model.c | 5 +- .../model.external.c | 4 +- .../model.external.py | 4 +- .../algebraic_eqn_computed_var_on_rhs/model.h | 1 - .../model.py | 5 +- .../algebraic_eqn_const_var_on_rhs/model.c | 11 +- .../algebraic_eqn_const_var_on_rhs/model.h | 1 - .../algebraic_eqn_const_var_on_rhs/model.py | 11 +- .../algebraic_eqn_constant_on_rhs/model.c | 5 +- .../algebraic_eqn_constant_on_rhs/model.h | 1 - .../algebraic_eqn_constant_on_rhs/model.py | 5 +- .../algebraic_eqn_derivative_on_rhs/model.c | 5 +- .../algebraic_eqn_derivative_on_rhs/model.h | 1 - .../algebraic_eqn_derivative_on_rhs/model.py | 5 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../algebraic_eqn_state_var_on_rhs/model.c | 5 +- .../algebraic_eqn_state_var_on_rhs/model.h | 1 - .../algebraic_eqn_state_var_on_rhs/model.py | 5 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../model.c | 5 +- .../model.external.c | 6 +- .../model.external.py | 6 +- .../model.h | 1 - .../model.py | 5 +- .../model.c | 1 - .../model.h | 1 - .../model.py | 1 - .../model.three.externals.c | 4 +- .../model.three.externals.h | 6 +- .../model.three.externals.py | 4 +- .../model.not.ordered.c | 19 +- .../model.not.ordered.h | 1 - .../model.not.ordered.py | 19 +- .../model.ordered.c | 9 +- .../model.ordered.h | 1 - .../model.ordered.py | 9 +- .../algebraic_unknown_var_on_rhs/model.c | 5 +- .../algebraic_unknown_var_on_rhs/model.h | 1 - .../algebraic_unknown_var_on_rhs/model.py | 5 +- .../generator/cell_geometry_model/model.c | 9 +- .../cell_geometry_model/model.external.c | 8 +- .../cell_geometry_model/model.external.py | 8 +- .../generator/cell_geometry_model/model.h | 1 - .../generator/cell_geometry_model/model.py | 9 +- .../model.c | 1 - .../model.h | 1 - .../model.py | 1 - .../generator/cellml_slc_example/model.py | 11 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../cellml_unit_scaling_constant/model.c | 7 +- .../cellml_unit_scaling_constant/model.h | 1 - .../cellml_unit_scaling_constant/model.py | 7 +- .../cellml_unit_scaling_rate/model.c | 1 - .../cellml_unit_scaling_rate/model.h | 1 - .../cellml_unit_scaling_rate/model.py | 1 - .../cellml_unit_scaling_state/model.c | 1 - .../cellml_unit_scaling_state/model.h | 1 - .../cellml_unit_scaling_state/model.py | 1 - .../model.c | 1 - .../model.h | 1 - .../model.py | 1 - .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../cellml_unit_scaling_voi_direct/model.c | 1 - .../cellml_unit_scaling_voi_direct/model.h | 1 - .../cellml_unit_scaling_voi_direct/model.py | 1 - .../cellml_unit_scaling_voi_indirect/model.c | 1 - .../cellml_unit_scaling_voi_indirect/model.h | 1 - .../cellml_unit_scaling_voi_indirect/model.py | 1 - .../generator/dae_cellml_1_1_model/model.c | 21 +- .../generator/dae_cellml_1_1_model/model.h | 1 - .../generator/dae_cellml_1_1_model/model.py | 21 +- .../generator/dependent_eqns/model.c | 1 - .../generator/dependent_eqns/model.h | 1 - .../generator/dependent_eqns/model.py | 1 - .../model.c | 185 +++++++++--------- .../model.h | 1 - .../model.py | 185 +++++++++--------- .../model.c | 153 +++++++-------- .../model.h | 1 - .../model.py | 153 +++++++-------- .../model.algebraic.c | 26 +-- .../model.algebraic.py | 26 +-- .../model.c | 23 ++- .../model.computed.constant.c | 26 +-- .../model.computed.constant.py | 26 +-- .../model.constant.c | 26 +-- .../model.constant.py | 26 +-- .../model.dae.c | 39 ++-- .../model.dae.h | 1 - .../model.dae.py | 39 ++-- .../model.dependent.algebraic.c | 24 +-- .../model.dependent.algebraic.py | 24 +-- .../model.dependent.computed.constant.c | 20 +- .../model.dependent.computed.constant.py | 20 +- .../model.dependent.constant.c | 26 +-- .../model.dependent.constant.py | 26 +-- .../model.dependent.state.c | 30 +-- .../model.dependent.state.py | 30 +-- .../model.external.c | 30 +-- .../model.external.py | 30 +-- .../model.h | 1 - .../model.py | 23 ++- .../model.state.c | 28 +-- .../model.state.py | 28 +-- .../generator/noble_model_1962/model.c | 13 +- .../generator/noble_model_1962/model.h | 1 - .../generator/noble_model_1962/model.py | 13 +- .../generator/ode_computed_var_on_rhs/model.c | 5 +- .../generator/ode_computed_var_on_rhs/model.h | 1 - .../ode_computed_var_on_rhs/model.py | 5 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../generator/ode_const_var_on_rhs/model.c | 5 +- .../generator/ode_const_var_on_rhs/model.h | 1 - .../generator/ode_const_var_on_rhs/model.py | 5 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../generator/ode_constant_on_rhs/model.c | 1 - .../generator/ode_constant_on_rhs/model.h | 1 - .../generator/ode_constant_on_rhs/model.py | 1 - .../ode_constant_on_rhs_one_component/model.c | 1 - .../ode_constant_on_rhs_one_component/model.h | 1 - .../model.py | 1 - .../ode_multiple_dependent_odes/model.c | 5 +- .../ode_multiple_dependent_odes/model.h | 1 - .../ode_multiple_dependent_odes/model.py | 5 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- .../ode_multiple_odes_with_same_name/model.c | 5 +- .../ode_multiple_odes_with_same_name/model.h | 1 - .../ode_multiple_odes_with_same_name/model.py | 5 +- .../generator/ode_unknown_var_on_rhs/model.c | 1 - .../generator/ode_unknown_var_on_rhs/model.h | 1 - .../generator/ode_unknown_var_on_rhs/model.py | 1 - .../robertson_model_1966/model.dae.c | 9 +- .../robertson_model_1966/model.dae.h | 1 - .../robertson_model_1966/model.dae.py | 9 +- .../robertson_model_1966/model.ode.c | 5 +- .../robertson_model_1966/model.ode.h | 1 - .../robertson_model_1966/model.ode.py | 5 +- .../generator/sine_model_imports/model.c | 11 +- .../generator/sine_model_imports/model.h | 1 - .../generator/sine_model_imports/model.py | 11 +- .../model.c | 8 +- .../model.py | 8 +- .../model.c | 5 +- .../model.h | 1 - .../model.py | 5 +- 173 files changed, 964 insertions(+), 1096 deletions(-) diff --git a/src/analyser.cpp b/src/analyser.cpp index 6fda878492..0dbbd3848e 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -3134,10 +3134,31 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) aiv2avMappings.emplace(internalVariable, variable); v2avMappings.emplace(internalVariable->mVariable, variable); - if (type == AnalyserVariable::Type::STATE) { + switch (type) { + case AnalyserVariable::Type::STATE: mModel->mPimpl->mStates.push_back(variable); - } else { + + break; + case AnalyserVariable::Type::CONSTANT: + mModel->mPimpl->mConstants.push_back(variable); + + break; + case AnalyserVariable::Type::COMPUTED_CONSTANT: + mModel->mPimpl->mComputedConstants.push_back(variable); + + break; + case AnalyserVariable::Type::ALGEBRAIC: mModel->mPimpl->mAlgebraic.push_back(variable); + + break; + case AnalyserVariable::Type::EXTERNAL: + mModel->mPimpl->mExternals.push_back(variable); + + break; + default: // AnalyserVariable::Type::VARIABLE_OF_INTEGRATION. + // This is the variable of integration, so skip it. + + break; } } diff --git a/src/generator.cpp b/src/generator.cpp index e0e316a2e4..44671415e9 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -95,15 +95,7 @@ AnalyserVariablePtr Generator::GeneratorImpl::analyserVariable(const VariablePtr res = doAnalyserVariable(variable, mModel->states()); if (res == nullptr) { - res = doAnalyserVariable(variable, mModel->constants()); - } - - if (res == nullptr) { - res = doAnalyserVariable(variable, mModel->computedConstants()); - } - - if (res == nullptr) { - res = doAnalyserVariable(variable, mModel->algebraic()); + res = doAnalyserVariable(variable, variables(mModel)); } } @@ -357,8 +349,9 @@ void Generator::GeneratorImpl::addStateAndVariableCountCode(bool interface) "[ALGEBRAIC_COUNT]", std::to_string(mModel->algebraicCount())); } - if ((interface && !mProfile->interfaceExternalCountString().empty()) - || (!interface && !mProfile->implementationExternalCountString().empty())) { + if ((mModel->externalCount() != 0) + && ((interface && !mProfile->interfaceExternalCountString().empty()) + || (!interface && !mProfile->implementationExternalCountString().empty()))) { code += interface ? mProfile->interfaceExternalCountString() : replace(mProfile->implementationExternalCountString(), diff --git a/src/utilities.cpp b/src/utilities.cpp index ff478630ab..77815b38bf 100644 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -1332,6 +1332,12 @@ std::vector variables(const AnalyserModelPtr &model) res.insert(res.end(), algebraic.begin(), algebraic.end()); } + auto externals = model->externals(); + + if (!externals.empty()) { + res.insert(res.end(), externals.begin(), externals.end()); + } + return res; } diff --git a/tests/bindings/javascript/analysermodel.test.js b/tests/bindings/javascript/analysermodel.test.js index c709d93684..7c5ea9ada0 100644 --- a/tests/bindings/javascript/analysermodel.test.js +++ b/tests/bindings/javascript/analysermodel.test.js @@ -62,18 +62,18 @@ describe("Analyser Model tests", () => { expect(am.state(2).variable().name()).toBe("m") }); test('Checking Analyser Model constants related API.', () => { - expect(am.constantCount()).toBe(0) - expect(am.constants().size()).toBe(0) - expect(am.constant(2)).toBeNull() + expect(am.constantCount()).toBe(5) + expect(am.constants().size()).toBe(5) + expect(am.constant(2).variable().name()).toBe("g_L") }); test('Checking Analyser Model computed constants related API.', () => { - expect(am.computedConstantCount()).toBe(0) - expect(am.computedConstants().size()).toBe(0) - expect(am.computedConstant(2)).toBeNull() + expect(am.computedConstantCount()).toBe(3) + expect(am.computedConstants().size()).toBe(3) + expect(am.computedConstant(2).variable().name()).toBe("E_K") }); test('Checking Analyser Model algebraic variables related API.', () => { - expect(am.algebraicCount()).toBe(18) - expect(am.algebraicVariables().size()).toBe(18) + expect(am.algebraicCount()).toBe(10) + expect(am.algebraicVariables().size()).toBe(10) expect(am.algebraicVariable(2).variable().name()).toBe("i_K") }); test('Checking Analyser Model need* API.', () => { diff --git a/tests/bindings/javascript/analyservariable.test.js b/tests/bindings/javascript/analyservariable.test.js index 733684b5dd..8026126561 100644 --- a/tests/bindings/javascript/analyservariable.test.js +++ b/tests/bindings/javascript/analyservariable.test.js @@ -37,9 +37,9 @@ describe("Analyser Variable tests", () => { am = a.model() - expect(am.constantCount()).toBe(0) - expect(am.computedConstantCount()).toBe(0) - expect(am.algebraicCount()).toBe(18) + expect(am.constantCount()).toBe(5) + expect(am.computedConstantCount()).toBe(3) + expect(am.algebraicCount()).toBe(10) }); test('Checking Analyser Variable type.', () => { const av = am.algebraicVariable(0) @@ -48,26 +48,26 @@ describe("Analyser Variable tests", () => { }); test('Checking Analyser Variable index.', () => { const av = am.algebraicVariable(7) - expect(av.index()).toBe(2) + expect(av.index()).toBe(7) }); test('Checking Analyser Variable initialising variable.', () => { - const av = am.algebraicVariable(15) - expect(av.initialisingVariable().name()).toBe("g_K") + const av = am.constant(3) + expect(av.initialisingVariable().name()).toBe("g_Na") }); test('Checking Analyser Variable variable.', () => { - const av = am.algebraicVariable(10) - expect(av.variable().name()).toBe("alpha_m") + const av = am.algebraicVariable(3) + expect(av.variable().name()).toBe("i_Na") }); test('Checking Analyser Equation equationCount.', () => { - const av = am.algebraicVariable(14) + const av = am.computedConstant(1) expect(av.equationCount()).toBe(1) }); test('Checking Analyser Variable equations.', () => { - const av = am.algebraicVariable(14) + const av = am.computedConstant(1) expect(av.equations().size()).toBe(1) }); test('Checking Analyser Variable equation.', () => { - const av = am.algebraicVariable(14) + const av = am.computedConstant(1) expect(av.equation(0).type().value).toBe(libcellml.AnalyserEquation.Type.VARIABLE_BASED_CONSTANT.value) }); }) diff --git a/tests/bindings/javascript/generator.test.js b/tests/bindings/javascript/generator.test.js index be7e04ebd2..bd854e65f8 100644 --- a/tests/bindings/javascript/generator.test.js +++ b/tests/bindings/javascript/generator.test.js @@ -62,10 +62,10 @@ describe("Generator tests", () => { g.setModel(a.model()) const interface_lines = g.interfaceCode().split('\n') - expect(interface_lines.length).toBe(43) + expect(interface_lines.length).toBe(42) const implementation_lines = g.implementationCode().split('\n') - expect(implementation_lines.length).toBe(70) + expect(implementation_lines.length).toBe(69) const equation_line_1 = libcellml.Generator.equationCode(a.model().equation(0).ast()) expect(equation_line_1.length).toBe(14) diff --git a/tests/bindings/python/test_analyser.py b/tests/bindings/python/test_analyser.py index 856ea709d5..4871b3e145 100644 --- a/tests/bindings/python/test_analyser.py +++ b/tests/bindings/python/test_analyser.py @@ -115,13 +115,13 @@ def test_coverage(self): self.assertIsNotNone(am.states()) self.assertIsNotNone(am.state(3)) - self.assertEqual(0, am.constantCount()) + self.assertEqual(5, am.constantCount()) self.assertIsNotNone(am.constants()) - self.assertIsNone(am.constant(3)) + self.assertIsNotNone(am.constant(3)) self.assertEqual(0, am.computedConstantCount()) self.assertIsNotNone(am.computedConstants()) self.assertIsNone(am.computedConstant(3)) - self.assertEqual(17, am.algebraicCount()) + self.assertEqual(12, am.algebraicCount()) self.assertIsNotNone(am.algebraic()) self.assertIsNotNone(am.algebraic(3)) @@ -160,15 +160,15 @@ def test_coverage(self): av = am.algebraic(3) - self.assertEqual(AnalyserVariable.Type.CONSTANT, av.type()) - self.assertEqual("constant", AnalyserVariable.typeAsString(av.type())) - self.assertEqual("constant", AnalyserVariable_typeAsString(av.type())) - self.assertEqual(0, av.index()) - self.assertIsNotNone(av.initialisingVariable()) + self.assertEqual(AnalyserVariable.Type.ALGEBRAIC, av.type()) + self.assertEqual("algebraic", AnalyserVariable.typeAsString(av.type())) + self.assertEqual("algebraic", AnalyserVariable_typeAsString(av.type())) + self.assertEqual(3, av.index()) + self.assertIsNone(av.initialisingVariable()) self.assertIsNotNone(av.variable()) self.assertEqual(1, av.equationCount()) self.assertIsNotNone(av.equations()) - self.assertIsNone(av.equation(0)) + self.assertIsNotNone(av.equation(0)) # Ensure coverage for AnalyserEquation. diff --git a/tests/coverage/coverage.cpp b/tests/coverage/coverage.cpp index 83ce6b317d..096e40b79c 100644 --- a/tests/coverage/coverage.cpp +++ b/tests/coverage/coverage.cpp @@ -594,9 +594,9 @@ TEST(Coverage, generator) EXPECT_EQ("dae", libcellml::AnalyserModel::typeAsString(analyserModel->type())); EXPECT_EQ(size_t(1), analyserModel->stateCount()); - EXPECT_EQ(size_t(0), analyserModel->constantCount()); - EXPECT_EQ(size_t(0), analyserModel->computedConstantCount()); - EXPECT_EQ(size_t(209), analyserModel->algebraicCount()); + EXPECT_EQ(size_t(7), analyserModel->constantCount()); + EXPECT_EQ(size_t(200), analyserModel->computedConstantCount()); + EXPECT_EQ(size_t(2), analyserModel->algebraicCount()); EXPECT_EQ(size_t(203), analyserModel->equationCount()); EXPECT_NE(nullptr, analyserModel->voi()); @@ -608,9 +608,9 @@ TEST(Coverage, generator) EXPECT_NE(size_t(0), analyserModel->state(0)->equations().size()); EXPECT_NE(nullptr, analyserModel->state(0)->equation(0)); EXPECT_EQ(nullptr, analyserModel->state(analyserModel->stateCount())); - EXPECT_EQ(nullptr, analyserModel->constant(0)); + EXPECT_NE(nullptr, analyserModel->constant(0)); EXPECT_EQ(nullptr, analyserModel->constant(analyserModel->constantCount())); - EXPECT_EQ(nullptr, analyserModel->computedConstant(0)); + EXPECT_NE(nullptr, analyserModel->computedConstant(0)); EXPECT_EQ(nullptr, analyserModel->computedConstant(analyserModel->computedConstantCount())); EXPECT_NE(nullptr, analyserModel->algebraic(0)); EXPECT_EQ(nullptr, analyserModel->algebraic(analyserModel->algebraicCount())); @@ -652,27 +652,11 @@ TEST(Coverage, generator) } for (size_t i = 0; i < analyserModel->constantCount(); ++i) { - if ((i == 1) || (i == 2) || (i == 6) || (i == 18) || (i == 179) || (i == 180) || (i == 182) || (i == 205) || (i == 206)) { - EXPECT_TRUE(analyserModel->constant(i)->initialisingVariable() != nullptr); - } - } - - for (size_t i = 0; i < analyserModel->computedConstantCount(); ++i) { - if ((i == 1) || (i == 2) || (i == 6) || (i == 18) || (i == 179) || (i == 180) || (i == 182) || (i == 205) || (i == 206)) { - EXPECT_TRUE(analyserModel->computedConstant(i)->initialisingVariable() != nullptr); - } + EXPECT_NE(nullptr, analyserModel->constant(i)->initialisingVariable()); } for (size_t i = 0; i < analyserModel->algebraicCount(); ++i) { - if ((i == 1) || (i == 2) || (i == 6) || (i == 18) || (i == 179) || (i == 180) || (i == 182) || (i == 205) || (i == 206)) { - EXPECT_TRUE(analyserModel->algebraic(i)->initialisingVariable() != nullptr); - } - } - - for (size_t i = 0; i < analyserModel->externalCount(); ++i) { - if ((i == 1) || (i == 2) || (i == 6) || (i == 18) || (i == 179) || (i == 180) || (i == 182) || (i == 205) || (i == 206)) { - EXPECT_TRUE(analyserModel->external(i)->initialisingVariable() != nullptr); - } + EXPECT_NE(nullptr, analyserModel->algebraic(i)->initialisingVariable()); } EXPECT_EQ(nullptr, generator->model()); diff --git a/tests/resources/coverage/generator/model.c b/tests/resources/coverage/generator/model.c index c6142792ce..aa1b69f193 100644 --- a/tests/resources/coverage/generator/model.c +++ b/tests/resources/coverage/generator/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 209; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 7; +const size_t COMPUTED_CONSTANT_COUNT = 200; +const size_t ALGEBRAIC_COUNT = 2; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; @@ -21,13 +20,17 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"m", "dimensionless", "my_component", CONSTANT}, {"n", "dimensionless", "my_component", CONSTANT}, + {"o", "dimensionless", "my_component", CONSTANT}, + {"p", "dimensionless", "my_component", CONSTANT}, + {"q", "dimensionless", "my_component", CONSTANT}, + {"r", "dimensionless", "my_component", CONSTANT}, + {"s", "dimensionless", "my_component", CONSTANT}, + {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnEqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnNeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnNeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"o", "dimensionless", "my_component", CONSTANT}, {"eqnLt", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLtCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -39,7 +42,6 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnAnd", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndMultiple", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"p", "dimensionless", "my_component", CONSTANT}, {"eqnAndParenthesesLeftPlusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftPlusWithout", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftMinusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -200,10 +202,7 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnPiecewisePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"q", "dimensionless", "my_component", CONSTANT}, - {"r", "dimensionless", "my_component", CONSTANT}, {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"s", "dimensionless", "my_component", CONSTANT}, {"eqnWithPiecewise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnInteger", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnDouble", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -226,10 +225,10 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnCoverageForPowerOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForRootOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForMinusUnary", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, - {"eqnNlaVariable2", "dimensionless", "my_component", ALGEBRAIC}, {"eqnComputedConstant1", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT} + {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT}, + {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, + {"eqnNlaVariable2", "dimensionless", "my_component", ALGEBRAIC} }; double xor(double x, double y) diff --git a/tests/resources/coverage/generator/model.h b/tests/resources/coverage/generator/model.h index c4835137aa..e05872689b 100644 --- a/tests/resources/coverage/generator/model.h +++ b/tests/resources/coverage/generator/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/coverage/generator/model.modified.profile.c b/tests/resources/coverage/generator/model.modified.profile.c index 808684ff94..01e2454c30 100644 --- a/tests/resources/coverage/generator/model.modified.profile.c +++ b/tests/resources/coverage/generator/model.modified.profile.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0.post0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 209; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 7; +const size_t COMPUTED_CONSTANT_COUNT = 200; +const size_t ALGEBRAIC_COUNT = 2; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; @@ -21,13 +20,17 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"m", "dimensionless", "my_component", CONSTANT}, {"n", "dimensionless", "my_component", CONSTANT}, + {"o", "dimensionless", "my_component", CONSTANT}, + {"p", "dimensionless", "my_component", CONSTANT}, + {"q", "dimensionless", "my_component", CONSTANT}, + {"r", "dimensionless", "my_component", CONSTANT}, + {"s", "dimensionless", "my_component", CONSTANT}, + {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnEqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnNeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnNeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"o", "dimensionless", "my_component", CONSTANT}, {"eqnLt", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLtCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -39,7 +42,6 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnAnd", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndMultiple", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"p", "dimensionless", "my_component", CONSTANT}, {"eqnAndParenthesesLeftPlusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftPlusWithout", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftMinusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -200,10 +202,7 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnPiecewisePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"q", "dimensionless", "my_component", CONSTANT}, - {"r", "dimensionless", "my_component", CONSTANT}, {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"s", "dimensionless", "my_component", CONSTANT}, {"eqnWithPiecewise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnInteger", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnDouble", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -226,10 +225,10 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnCoverageForPowerOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForRootOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForMinusUnary", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, - {"eqnNlaVariable2", "dimensionless", "my_component", ALGEBRAIC}, {"eqnComputedConstant1", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT} + {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT}, + {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, + {"eqnNlaVariable2", "dimensionless", "my_component", ALGEBRAIC} }; double xor(double x, double y) diff --git a/tests/resources/coverage/generator/model.modified.profile.h b/tests/resources/coverage/generator/model.modified.profile.h index 08fc9fc5d1..ef3a093e68 100644 --- a/tests/resources/coverage/generator/model.modified.profile.h +++ b/tests/resources/coverage/generator/model.modified.profile.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/coverage/generator/model.modified.profile.py b/tests/resources/coverage/generator/model.modified.profile.py index 67d01e5cf9..cd37464781 100644 --- a/tests/resources/coverage/generator/model.modified.profile.py +++ b/tests/resources/coverage/generator/model.modified.profile.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 209 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 7 +COMPUTED_CONSTANT_COUNT = 200 +ALGEBRAIC_COUNT = 2 class VariableType(Enum): @@ -29,13 +28,17 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "m", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "n", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "o", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "p", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "q", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "r", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "s", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnEqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnNeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnNeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "o", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnLt", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLtCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -47,7 +50,6 @@ class VariableType(Enum): {"name": "eqnAnd", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndMultiple", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "p", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWithout", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftMinusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -208,10 +210,7 @@ class VariableType(Enum): {"name": "eqnPiecewisePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "q", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, - {"name": "r", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "s", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnWithPiecewise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnInteger", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnDouble", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -234,10 +233,10 @@ class VariableType(Enum): {"name": "eqnCoverageForPowerOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForRootOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForMinusUnary", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, - {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT} + {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, + {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC} ] diff --git a/tests/resources/coverage/generator/model.py b/tests/resources/coverage/generator/model.py index ccf8c67060..07afa2a6b5 100644 --- a/tests/resources/coverage/generator/model.py +++ b/tests/resources/coverage/generator/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 209 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 7 +COMPUTED_CONSTANT_COUNT = 200 +ALGEBRAIC_COUNT = 2 class VariableType(Enum): @@ -29,13 +28,17 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "m", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "n", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "o", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "p", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "q", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "r", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "s", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnEqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnNeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnNeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "o", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnLt", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLtCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -47,7 +50,6 @@ class VariableType(Enum): {"name": "eqnAnd", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndMultiple", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "p", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWithout", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftMinusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -208,10 +210,7 @@ class VariableType(Enum): {"name": "eqnPiecewisePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "q", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, - {"name": "r", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "s", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "eqnWithPiecewise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnInteger", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnDouble", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -234,10 +233,10 @@ class VariableType(Enum): {"name": "eqnCoverageForPowerOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForRootOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForMinusUnary", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, - {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT} + {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, + {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC} ] diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c index 7ad5b190a0..ef4da021e4 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c @@ -9,9 +9,8 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 2; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c index 665df96680..37cec86d32 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c @@ -10,8 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 1; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VARIABLE_INFO[] = { {"x", "dimensionless", "my_algebraic_eqn", ALGEBRAIC}, diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py index 1d135a8d6b..7168da1a35 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py @@ -9,8 +9,8 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 1 +EXTERNAL_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.h b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.h index ffa08d4179..8b9a1fb666 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.h +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py index a89a1f8728..c3b91e3df4 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py @@ -8,9 +8,8 @@ LIBCELLML_VERSION = "0.5.0" CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 2 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c index a907301925..b9b36994d3 100644 --- a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c @@ -8,14 +8,13 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 1; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { - {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, - {"a", "dimensionless", "my_algebraic_eqn", CONSTANT} + {"a", "dimensionless", "my_algebraic_eqn", CONSTANT}, + {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT} }; double * createVariablesArray() diff --git a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.h b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.h index ffa08d4179..8b9a1fb666 100644 --- a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.h +++ b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py index cac3a4142d..034cacb34e 100644 --- a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py @@ -7,10 +7,9 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 1 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): @@ -20,8 +19,8 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.CONSTANT} + {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.CONSTANT}, + {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT} ] diff --git a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c index b2142ca770..5e25719055 100644 --- a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c @@ -9,9 +9,8 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { {"x", "dimensionless", "my_component", COMPUTED_CONSTANT} diff --git a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.h b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.h index e5928a2fe5..d26413c671 100644 --- a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.h +++ b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py index e5238d296c..b36b39ca8b 100644 --- a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py @@ -8,9 +8,8 @@ LIBCELLML_VERSION = "0.5.0" CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c index 9cb7a3000a..5f56854dda 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c @@ -10,9 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.h b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.h index 02e634a295..1eeee2f1e3 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.h +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py index ed4157ad3c..b68e0ff042 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py @@ -9,9 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c index 75a65fe9c5..4449ebc701 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c @@ -10,9 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.h b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.h index 89890cfa68..ca79cc5f25 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.h +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py index 2e6d45e10f..3228a39f5b 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py @@ -9,9 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c index c6a0f3adf8..32f1de15fa 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c @@ -10,9 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.h b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.h index 60658293a0..d2a3025e39 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.h +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py index fe2cececb1..44baf1642b 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py @@ -9,9 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c index 2a8dbbed53..352e5bd87c 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c @@ -10,9 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "my_model", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.h b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.h index e98ffacdf3..cfae2b1d2f 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.h +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py index a91cadb067..1a8d75e50b 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py @@ -9,9 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c index 75c1d28aed..78af0f1c1f 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c @@ -9,9 +9,8 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 4; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 1; const VariableInfo VARIABLE_INFO[] = { {"b", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c index ce37e089b2..5e1f7d6b8c 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c @@ -9,9 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 4; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 0; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VARIABLE_INFO[] = { {"b", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py index 3998dee561..ed3205098b 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py @@ -8,9 +8,9 @@ LIBCELLML_VERSION = "0.5.0" CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 4 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 0 +EXTERNAL_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.h b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.h index ffa08d4179..8b9a1fb666 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.h +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py index e823ec04ac..1f349758b7 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py @@ -8,9 +8,8 @@ LIBCELLML_VERSION = "0.5.0" CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 4 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c index 3fed4a9e13..eb6d409ade 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c @@ -11,7 +11,6 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 3; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { {"x", "dimensionless", "my_algebraic_system", ALGEBRAIC}, diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.h b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.h index fee170f4b2..69ce3f6763 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.h +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py index 16bd44fe49..de50e042ec 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py @@ -10,7 +10,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 3 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c index 827f341f93..a22f00fad6 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c @@ -10,8 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 3; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; +const size_t EXTERNAL_COUNT = 3; const VariableInfo VARIABLE_INFO[] = { {"x", "dimensionless", "my_algebraic_system", EXTERNAL}, diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.h b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.h index 0c3b6b4a50..7650d5f48b 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.h +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.h @@ -20,9 +20,9 @@ typedef enum { } VariableType; typedef struct { - char name[2]; - char units[14]; - char component[20]; + char name[0]; + char units[0]; + char component[0]; VariableType type; } VariableInfo; diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py index bdb2fe0fe1..c79c816133 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py @@ -9,8 +9,8 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 3 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 +EXTERNAL_COUNT = 3 class VariableType(Enum): diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c index c1b94c1827..be81938b4f 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c @@ -8,18 +8,17 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 6; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 2; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 3; const VariableInfo VARIABLE_INFO[] = { + {"x", "dimensionless", "my_algebraic_system", CONSTANT}, + {"y", "dimensionless", "my_algebraic_system", CONSTANT}, + {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, {"d", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"b", "dimensionless", "my_algebraic_system", ALGEBRAIC}, - {"c", "dimensionless", "my_algebraic_system", ALGEBRAIC}, - {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, - {"x", "dimensionless", "my_algebraic_system", CONSTANT}, - {"y", "dimensionless", "my_algebraic_system", CONSTANT} + {"c", "dimensionless", "my_algebraic_system", ALGEBRAIC} }; double * createVariablesArray() @@ -72,10 +71,10 @@ void findRoot0(double *variables) void initialiseVariables(double *constants) { - algebraic[1] = 1.0; - algebraic[2] = 1.0; constants[0] = 3.0; constants[1] = 5.0; + algebraic[1] = 1.0; + algebraic[2] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.h b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.h index fee170f4b2..69ce3f6763 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.h +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py index 8a734a9a37..a10c6ed591 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py @@ -7,10 +7,9 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 6 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 2 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 3 class VariableType(Enum): @@ -20,12 +19,12 @@ class VariableType(Enum): VARIABLE_INFO = [ + {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, + {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, + {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, {"name": "d", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "b", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, - {"name": "c", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, - {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, - {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT} + {"name": "c", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC} ] @@ -59,10 +58,10 @@ def find_root_0(variables): def initialise_variables(constants): - algebraic[1] = 1.0 - algebraic[2] = 1.0 constants[0] = 3.0 constants[1] = 5.0 + algebraic[1] = 1.0 + algebraic[2] = 1.0 def compute_computed_constants(constants, computed_constants): diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c index 15de97b498..df91e1567d 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c @@ -8,15 +8,14 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 6; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 2; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 3; const VariableInfo VARIABLE_INFO[] = { - {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, {"x", "dimensionless", "my_algebraic_system", CONSTANT}, {"y", "dimensionless", "my_algebraic_system", CONSTANT}, + {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, {"c", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"b", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"d", "dimensionless", "my_algebraic_system", ALGEBRAIC} diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.h b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.h index fee170f4b2..69ce3f6763 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.h +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py index e842a7e565..3272ba8398 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py @@ -7,10 +7,9 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 6 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 2 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 3 class VariableType(Enum): @@ -20,9 +19,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, + {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, {"name": "c", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "b", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "d", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC} diff --git a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c index 0fab3f892e..bfdee7fae6 100644 --- a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c @@ -9,9 +9,8 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 2; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { {"x", "dimensionless", "my_component", COMPUTED_CONSTANT}, diff --git a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.h b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.h index e5928a2fe5..d26413c671 100644 --- a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.h +++ b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py index 53f8993bf6..020c15fc01 100644 --- a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py @@ -8,9 +8,8 @@ LIBCELLML_VERSION = "0.5.0" CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 2 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cell_geometry_model/model.c b/tests/resources/generator/cell_geometry_model/model.c index e6391bb731..1d2073048e 100644 --- a/tests/resources/generator/cell_geometry_model/model.c +++ b/tests/resources/generator/cell_geometry_model/model.c @@ -8,15 +8,14 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 4; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 2; +const size_t COMPUTED_CONSTANT_COUNT = 2; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { - {"vcell", "microlitre", "cell_geometry", COMPUTED_CONSTANT}, {"L", "centimeter", "cell_geometry", CONSTANT}, {"rad", "centimeter", "cell_geometry", CONSTANT}, + {"vcell", "microlitre", "cell_geometry", COMPUTED_CONSTANT}, {"vss", "microlitre", "cell_geometry", COMPUTED_CONSTANT} }; diff --git a/tests/resources/generator/cell_geometry_model/model.external.c b/tests/resources/generator/cell_geometry_model/model.external.c index 8ecb305e9a..4fe760dd4a 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.c +++ b/tests/resources/generator/cell_geometry_model/model.external.c @@ -10,14 +10,14 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 4; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 2; +const size_t EXTERNAL_COUNT = 2; const VariableInfo VARIABLE_INFO[] = { {"vcell", "microlitre", "cell_geometry", ALGEBRAIC}, + {"vss", "microlitre", "cell_geometry", ALGEBRAIC}, {"L", "centimeter", "cell_geometry", EXTERNAL}, - {"rad", "centimeter", "cell_geometry", EXTERNAL}, - {"vss", "microlitre", "cell_geometry", ALGEBRAIC} + {"rad", "centimeter", "cell_geometry", EXTERNAL} }; double * createVariablesArray() diff --git a/tests/resources/generator/cell_geometry_model/model.external.py b/tests/resources/generator/cell_geometry_model/model.external.py index 2bf7fb6137..4c1af8bb9f 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.py +++ b/tests/resources/generator/cell_geometry_model/model.external.py @@ -9,8 +9,8 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 4 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 2 +EXTERNAL_COUNT = 2 class VariableType(Enum): @@ -22,9 +22,9 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.ALGEBRAIC}, + {"name": "vss", "units": "microlitre", "component": "cell_geometry", "type": VariableType.ALGEBRAIC}, {"name": "L", "units": "centimeter", "component": "cell_geometry", "type": VariableType.EXTERNAL}, - {"name": "rad", "units": "centimeter", "component": "cell_geometry", "type": VariableType.EXTERNAL}, - {"name": "vss", "units": "microlitre", "component": "cell_geometry", "type": VariableType.ALGEBRAIC} + {"name": "rad", "units": "centimeter", "component": "cell_geometry", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/cell_geometry_model/model.h b/tests/resources/generator/cell_geometry_model/model.h index ef37e5ea59..d291cbc391 100644 --- a/tests/resources/generator/cell_geometry_model/model.h +++ b/tests/resources/generator/cell_geometry_model/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/cell_geometry_model/model.py b/tests/resources/generator/cell_geometry_model/model.py index eb269347e4..b25e428a56 100644 --- a/tests/resources/generator/cell_geometry_model/model.py +++ b/tests/resources/generator/cell_geometry_model/model.py @@ -7,10 +7,9 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 4 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 2 +COMPUTED_CONSTANT_COUNT = 2 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): @@ -20,9 +19,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.COMPUTED_CONSTANT}, {"name": "L", "units": "centimeter", "component": "cell_geometry", "type": VariableType.CONSTANT}, {"name": "rad", "units": "centimeter", "component": "cell_geometry", "type": VariableType.CONSTANT}, + {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.COMPUTED_CONSTANT}, {"name": "vss", "units": "microlitre", "component": "cell_geometry", "type": VariableType.COMPUTED_CONSTANT} ] diff --git a/tests/resources/generator/cellml_mappings_and_encapsulations/model.c b/tests/resources/generator/cellml_mappings_and_encapsulations/model.c index 92bf0a4fb9..3f59baaf87 100644 --- a/tests/resources/generator/cellml_mappings_and_encapsulations/model.c +++ b/tests/resources/generator/cellml_mappings_and_encapsulations/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 2; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_mappings_and_encapsulations/model.h b/tests/resources/generator/cellml_mappings_and_encapsulations/model.h index 2aab41a47f..91a2bbdb90 100644 --- a/tests/resources/generator/cellml_mappings_and_encapsulations/model.h +++ b/tests/resources/generator/cellml_mappings_and_encapsulations/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_mappings_and_encapsulations/model.py b/tests/resources/generator/cellml_mappings_and_encapsulations/model.py index 8ecaaaaa46..42799d8118 100644 --- a/tests/resources/generator/cellml_mappings_and_encapsulations/model.py +++ b/tests/resources/generator/cellml_mappings_and_encapsulations/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_slc_example/model.py b/tests/resources/generator/cellml_slc_example/model.py index 5ffe3d04ef..b03cf86487 100644 --- a/tests/resources/generator/cellml_slc_example/model.py +++ b/tests/resources/generator/cellml_slc_example/model.py @@ -7,10 +7,9 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 10 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 9 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): @@ -20,7 +19,6 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "q_Ao", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, @@ -29,7 +27,8 @@ class VariableType(Enum): {"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_4", "units": "per_fmol2_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT} + {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.COMPUTED_CONSTANT} ] diff --git a/tests/resources/generator/cellml_state_initialised_using_variable/model.c b/tests/resources/generator/cellml_state_initialised_using_variable/model.c index 88193e176a..e8e13541c2 100644 --- a/tests/resources/generator/cellml_state_initialised_using_variable/model.c +++ b/tests/resources/generator/cellml_state_initialised_using_variable/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_state_initialised_using_variable/model.h b/tests/resources/generator/cellml_state_initialised_using_variable/model.h index 1a5d4ce25e..e95d12eb15 100644 --- a/tests/resources/generator/cellml_state_initialised_using_variable/model.h +++ b/tests/resources/generator/cellml_state_initialised_using_variable/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_state_initialised_using_variable/model.py b/tests/resources/generator/cellml_state_initialised_using_variable/model.py index ff1defc395..5aae09a47d 100644 --- a/tests/resources/generator/cellml_state_initialised_using_variable/model.py +++ b/tests/resources/generator/cellml_state_initialised_using_variable/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_constant/model.c b/tests/resources/generator/cellml_unit_scaling_constant/model.c index 616edc4038..21638fba96 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.c +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.c @@ -8,10 +8,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 3; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 1; +const size_t COMPUTED_CONSTANT_COUNT = 2; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VARIABLE_INFO[] = { {"k", "mM", "constants", CONSTANT}, diff --git a/tests/resources/generator/cellml_unit_scaling_constant/model.h b/tests/resources/generator/cellml_unit_scaling_constant/model.h index ed21d64734..435deb74f0 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.h +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.h @@ -10,7 +10,6 @@ extern const char LIBCELLML_VERSION[]; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { CONSTANT, diff --git a/tests/resources/generator/cellml_unit_scaling_constant/model.py b/tests/resources/generator/cellml_unit_scaling_constant/model.py index 6cd14b1a99..d2ee195c50 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.py +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.py @@ -7,10 +7,9 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 3 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 1 +COMPUTED_CONSTANT_COUNT = 2 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_rate/model.c b/tests/resources/generator/cellml_unit_scaling_rate/model.c index 87f36e81d0..603a1eab39 100644 --- a/tests/resources/generator/cellml_unit_scaling_rate/model.c +++ b/tests/resources/generator/cellml_unit_scaling_rate/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_unit_scaling_rate/model.h b/tests/resources/generator/cellml_unit_scaling_rate/model.h index 1a5d4ce25e..e95d12eb15 100644 --- a/tests/resources/generator/cellml_unit_scaling_rate/model.h +++ b/tests/resources/generator/cellml_unit_scaling_rate/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_unit_scaling_rate/model.py b/tests/resources/generator/cellml_unit_scaling_rate/model.py index 572138bfca..f74588e123 100644 --- a/tests/resources/generator/cellml_unit_scaling_rate/model.py +++ b/tests/resources/generator/cellml_unit_scaling_rate/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_state/model.c b/tests/resources/generator/cellml_unit_scaling_state/model.c index 0e28895151..34c1bca1f3 100644 --- a/tests/resources/generator/cellml_unit_scaling_state/model.c +++ b/tests/resources/generator/cellml_unit_scaling_state/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_unit_scaling_state/model.h b/tests/resources/generator/cellml_unit_scaling_state/model.h index 1a5d4ce25e..e95d12eb15 100644 --- a/tests/resources/generator/cellml_unit_scaling_state/model.h +++ b/tests/resources/generator/cellml_unit_scaling_state/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_unit_scaling_state/model.py b/tests/resources/generator/cellml_unit_scaling_state/model.py index ea1dd2f48c..ec43146e3c 100644 --- a/tests/resources/generator/cellml_unit_scaling_state/model.py +++ b/tests/resources/generator/cellml_unit_scaling_state/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.c b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.c index 9689d4fc95..c0db3b3a33 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.c +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 2; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 0; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.h b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.h index fe37713823..bd4dd923ef 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.h +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.py b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.py index 214d36e3ff..86e48a995e 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.py +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_constant/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 0 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c index cf6cc56198..27bf38fab2 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 2; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.h b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.h index 4806062496..fc9911e7e4 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.h +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py index 084fde5b22..9e1edd3c46 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 2 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_voi_direct/model.c b/tests/resources/generator/cellml_unit_scaling_voi_direct/model.c index 022b4ee5ae..f0e1d42ba4 100644 --- a/tests/resources/generator/cellml_unit_scaling_voi_direct/model.c +++ b/tests/resources/generator/cellml_unit_scaling_voi_direct/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 2; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 0; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "ms", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_unit_scaling_voi_direct/model.h b/tests/resources/generator/cellml_unit_scaling_voi_direct/model.h index cc72c5b3a4..3f1fb63fd2 100644 --- a/tests/resources/generator/cellml_unit_scaling_voi_direct/model.h +++ b/tests/resources/generator/cellml_unit_scaling_voi_direct/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_unit_scaling_voi_direct/model.py b/tests/resources/generator/cellml_unit_scaling_voi_direct/model.py index 8f5a9954fc..e14df017f1 100644 --- a/tests/resources/generator/cellml_unit_scaling_voi_direct/model.py +++ b/tests/resources/generator/cellml_unit_scaling_voi_direct/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 0 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.c b/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.c index 37a9e4aa41..cd6840c595 100644 --- a/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.c +++ b/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 3; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 0; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.h b/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.h index 2c159313cf..123e68564c 100644 --- a/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.h +++ b/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.py b/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.py index fbb32f6afc..ac4a5b3097 100644 --- a/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.py +++ b/tests/resources/generator/cellml_unit_scaling_voi_indirect/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 0 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/dae_cellml_1_1_model/model.c b/tests/resources/generator/dae_cellml_1_1_model/model.c index 91a85192ac..3b8e5e3bc3 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.c +++ b/tests/resources/generator/dae_cellml_1_1_model/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 5; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 10; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 5; const VariableInfo VOI_INFO = {"t", "second", "main", VARIABLE_OF_INTEGRATION}; @@ -22,16 +21,16 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"v_1", "C_per_s", "main", ALGEBRAIC}, {"v_in", "C_per_s", "main", CONSTANT}, - {"v_2", "C_per_s", "main", ALGEBRAIC}, {"v_out", "C_per_s", "main", CONSTANT}, - {"u_1", "J_per_C", "main", ALGEBRAIC}, - {"u_2", "J_per_C", "main", ALGEBRAIC}, - {"u_3", "J_per_C", "main", ALGEBRAIC}, {"C", "C2_per_J", "main", CONSTANT}, {"R", "Js_per_C2", "main", CONSTANT}, - {"L", "Js2_per_C2", "main", CONSTANT} + {"L", "Js2_per_C2", "main", CONSTANT}, + {"v_1", "C_per_s", "main", ALGEBRAIC}, + {"v_2", "C_per_s", "main", ALGEBRAIC}, + {"u_1", "J_per_C", "main", ALGEBRAIC}, + {"u_2", "J_per_C", "main", ALGEBRAIC}, + {"u_3", "J_per_C", "main", ALGEBRAIC} }; double * createStatesArray() @@ -121,13 +120,13 @@ void findRoot1(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *constants) { - algebraic[0] = 0.0; constants[0] = 1.0; constants[1] = 1.0; - algebraic[4] = 0.0; constants[2] = 20.0; constants[3] = 2.0; constants[4] = 10.0; + algebraic[0] = 0.0; + algebraic[4] = 0.0; states[0] = 1.0; states[1] = 0.0; } diff --git a/tests/resources/generator/dae_cellml_1_1_model/model.h b/tests/resources/generator/dae_cellml_1_1_model/model.h index 12391c8480..2bcb43579c 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.h +++ b/tests/resources/generator/dae_cellml_1_1_model/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/dae_cellml_1_1_model/model.py b/tests/resources/generator/dae_cellml_1_1_model/model.py index c08f819906..50658a4dbf 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.py +++ b/tests/resources/generator/dae_cellml_1_1_model/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 5 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 10 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 5 class VariableType(Enum): @@ -30,16 +29,16 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "v_1", "units": "C_per_s", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "v_in", "units": "C_per_s", "component": "main", "type": VariableType.CONSTANT}, - {"name": "v_2", "units": "C_per_s", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "v_out", "units": "C_per_s", "component": "main", "type": VariableType.CONSTANT}, - {"name": "u_1", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, - {"name": "u_2", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, - {"name": "u_3", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "C", "units": "C2_per_J", "component": "main", "type": VariableType.CONSTANT}, {"name": "R", "units": "Js_per_C2", "component": "main", "type": VariableType.CONSTANT}, - {"name": "L", "units": "Js2_per_C2", "component": "main", "type": VariableType.CONSTANT} + {"name": "L", "units": "Js2_per_C2", "component": "main", "type": VariableType.CONSTANT}, + {"name": "v_1", "units": "C_per_s", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "v_2", "units": "C_per_s", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "u_1", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "u_2", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "u_3", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC} ] @@ -97,13 +96,13 @@ def find_root_1(voi, states, rates, variables): def initialise_variables(states, rates, constants): - algebraic[0] = 0.0 constants[0] = 1.0 constants[1] = 1.0 - algebraic[4] = 0.0 constants[2] = 20.0 constants[3] = 2.0 constants[4] = 10.0 + algebraic[0] = 0.0 + algebraic[4] = 0.0 states[0] = 1.0 states[1] = 0.0 diff --git a/tests/resources/generator/dependent_eqns/model.c b/tests/resources/generator/dependent_eqns/model.c index 8afaa994e1..7bbb981447 100644 --- a/tests/resources/generator/dependent_eqns/model.c +++ b/tests/resources/generator/dependent_eqns/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 2; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"time", "second", "my_component", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/dependent_eqns/model.h b/tests/resources/generator/dependent_eqns/model.h index bfb9e72345..676c75fecd 100644 --- a/tests/resources/generator/dependent_eqns/model.h +++ b/tests/resources/generator/dependent_eqns/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/dependent_eqns/model.py b/tests/resources/generator/dependent_eqns/model.py index 9f92687321..5ed89e9102 100644 --- a/tests/resources/generator/dependent_eqns/model.py +++ b/tests/resources/generator/dependent_eqns/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 2 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c index 839f568740..0e25bc096d 100644 --- a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c +++ b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 33; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 217; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 91; +const size_t COMPUTED_CONSTANT_COUNT = 25; +const size_t ALGEBRAIC_COUNT = 101; const VariableInfo VOI_INFO = {"time", "second", "environment", VARIABLE_OF_INTEGRATION}; @@ -55,47 +54,20 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"ACh", "millimolar", "Rate_modulation_experiments", CONSTANT}, {"Iso_1_uM", "dimensionless", "Rate_modulation_experiments", CONSTANT}, - {"E_Na", "millivolt", "Ionic_values", ALGEBRAIC}, - {"RTONF", "millivolt", "Membrane", COMPUTED_CONSTANT}, {"Nao", "millimolar", "Ionic_values", CONSTANT}, - {"Nai", "millimolar", "Nai_concentration", ALGEBRAIC}, - {"E_K", "millivolt", "Ionic_values", COMPUTED_CONSTANT}, {"Ko", "millimolar", "Ionic_values", CONSTANT}, {"Ki", "millimolar", "Ionic_values", CONSTANT}, - {"E_Ca", "millivolt", "Ionic_values", ALGEBRAIC}, {"Cao", "millimolar", "Ionic_values", CONSTANT}, {"Nai_clamp", "dimensionless", "Nai_concentration", CONSTANT}, - {"i_Na", "nanoA", "i_Na", ALGEBRAIC}, - {"i_NaCa", "nanoA", "i_NaCa", ALGEBRAIC}, - {"i_NaK", "nanoA", "i_NaK", ALGEBRAIC}, - {"i_siNa", "nanoA", "i_CaL", ALGEBRAIC}, - {"i_fNa", "nanoA", "i_f", ALGEBRAIC}, {"F", "coulomb_per_mole", "Membrane", CONSTANT}, - {"V_i", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"V_sub", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"Iso_increase", "dimensionless", "i_NaK", COMPUTED_CONSTANT}, - {"V", "millivolt", "Membrane", ALGEBRAIC}, {"Km_Nap", "millimolar", "i_NaK", CONSTANT}, {"Km_Kp", "millimolar", "i_NaK", CONSTANT}, {"i_NaK_max", "nanoA", "i_NaK", CONSTANT}, {"blockade_NaCa", "dimensionless", "i_NaCa", CONSTANT}, - {"x2", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k21", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"x1", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k12", "dimensionless", "i_NaCa", ALGEBRAIC}, {"K_NaCa", "nanoA", "i_NaCa", CONSTANT}, - {"x4", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"x3", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k41", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k23", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k34", "dimensionless", "i_NaCa", COMPUTED_CONSTANT}, - {"k43", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k32", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k14", "dimensionless", "i_NaCa", ALGEBRAIC}, {"K3ni", "millimolar", "i_NaCa", CONSTANT}, {"Kci", "millimolar", "i_NaCa", CONSTANT}, {"Qci", "dimensionless", "i_NaCa", CONSTANT}, - {"di", "dimensionless", "i_NaCa", ALGEBRAIC}, {"K1ni", "millimolar", "i_NaCa", CONSTANT}, {"K2ni", "millimolar", "i_NaCa", CONSTANT}, {"Qn", "dimensionless", "i_NaCa", CONSTANT}, @@ -103,152 +75,185 @@ const VariableInfo VARIABLE_INFO[] = { {"K3no", "millimolar", "i_NaCa", CONSTANT}, {"Kco", "millimolar", "i_NaCa", CONSTANT}, {"Qco", "dimensionless", "i_NaCa", CONSTANT}, - {"do", "dimensionless", "i_NaCa", ALGEBRAIC}, {"K1no", "millimolar", "i_NaCa", CONSTANT}, {"K2no", "millimolar", "i_NaCa", CONSTANT}, - {"j_SRCarel", "millimolar_per_second", "Ca_SR_release", ALGEBRAIC}, {"ks", "per_second", "Ca_SR_release", CONSTANT}, - {"diff", "millimolar", "Ca_SR_release", ALGEBRAIC}, - {"kCaSR", "dimensionless", "Ca_SR_release", ALGEBRAIC}, {"MaxSR", "dimensionless", "Ca_SR_release", CONSTANT}, {"MinSR", "dimensionless", "Ca_SR_release", CONSTANT}, {"EC50_SR", "millimolar", "Ca_SR_release", CONSTANT}, {"HSR", "dimensionless", "Ca_SR_release", CONSTANT}, - {"koSRCa", "per_millimolar2_second", "Ca_SR_release", ALGEBRAIC}, {"koCa", "per_millimolar2_second", "Ca_SR_release", CONSTANT}, - {"kiSRCa", "per_millimolar_second", "Ca_SR_release", ALGEBRAIC}, {"kiCa", "per_millimolar_second", "Ca_SR_release", CONSTANT}, {"kim", "per_second", "Ca_SR_release", CONSTANT}, {"kom", "per_second", "Ca_SR_release", CONSTANT}, - {"P_tot", "dimensionless", "Ca_SR_release", ALGEBRAIC}, - {"b_up", "dimensionless", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, - {"P_up", "millimolar_per_second", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, {"P_up_basal", "millimolar_per_second", "Ca_intracellular_fluxes", CONSTANT}, - {"j_Ca_dif", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, {"tau_dif_Ca", "second", "Ca_intracellular_fluxes", CONSTANT}, - {"j_up", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, {"K_up", "millimolar", "Ca_intracellular_fluxes", CONSTANT}, {"slope_up", "millimolar", "Ca_intracellular_fluxes", CONSTANT}, - {"j_tr", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, {"tau_tr", "second", "Ca_intracellular_fluxes", CONSTANT}, - {"delta_fTC", "per_second", "Ca_buffering", ALGEBRAIC}, {"kf_TC", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_TC", "per_second", "Ca_buffering", CONSTANT}, - {"delta_fTMC", "per_second", "Ca_buffering", ALGEBRAIC}, {"kf_TMC", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_TMC", "per_second", "Ca_buffering", CONSTANT}, - {"delta_fTMM", "per_second", "Ca_buffering", ALGEBRAIC}, {"kf_TMM", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"Mgi", "millimolar", "Ca_buffering", CONSTANT}, {"kb_TMM", "per_second", "Ca_buffering", CONSTANT}, - {"delta_fCMi", "per_second", "Ca_buffering", ALGEBRAIC}, {"kf_CM", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_CM", "per_second", "Ca_buffering", CONSTANT}, - {"delta_fCMs", "per_second", "Ca_buffering", ALGEBRAIC}, - {"delta_fCQ", "per_second", "Ca_buffering", ALGEBRAIC}, {"kf_CQ", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_CQ", "per_second", "Ca_buffering", CONSTANT}, {"TC_tot", "millimolar", "Ca_buffering", CONSTANT}, {"TMC_tot", "millimolar", "Ca_buffering", CONSTANT}, {"CM_tot", "millimolar", "Ca_buffering", CONSTANT}, {"CQ_tot", "millimolar", "Ca_buffering", CONSTANT}, - {"V_nsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"V_jsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"i_siCa", "nanoA", "i_CaL", ALGEBRAIC}, - {"i_CaT", "nanoA", "i_CaT", ALGEBRAIC}, - {"V_cell", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, {"L_cell", "micrometre", "Cell_parameters", CONSTANT}, {"R_cell", "micrometre", "Cell_parameters", CONSTANT}, {"L_sub", "micrometre", "Cell_parameters", CONSTANT}, {"V_jsr_part", "dimensionless", "Cell_parameters", CONSTANT}, {"V_i_part", "dimensionless", "Cell_parameters", CONSTANT}, {"V_nsr_part", "dimensionless", "Cell_parameters", CONSTANT}, - {"i_tot", "nanoA", "Membrane", ALGEBRAIC}, - {"i_f", "nanoA", "i_f", ALGEBRAIC}, - {"i_Kur", "nanoA", "i_Kur", ALGEBRAIC}, - {"i_KACh", "nanoA", "i_KACh", ALGEBRAIC}, - {"i_CaL", "nanoA", "i_CaL", ALGEBRAIC}, - {"i_to", "nanoA", "i_to", ALGEBRAIC}, - {"i_Ks", "nanoA", "i_Ks", ALGEBRAIC}, - {"i_Kr", "nanoA", "i_Kr", ALGEBRAIC}, {"C", "microF", "Membrane", CONSTANT}, {"R", "joule_per_kilomole_kelvin", "Membrane", CONSTANT}, {"T", "kelvin", "Membrane", CONSTANT}, - {"V_clamp", "millivolt", "Voltage_clamp", ALGEBRAIC}, {"clamp_mode", "dimensionless", "Membrane", CONSTANT}, {"V_test", "millivolt", "Voltage_clamp", CONSTANT}, {"t_holding", "second", "Voltage_clamp", CONSTANT}, {"t_test", "second", "Voltage_clamp", CONSTANT}, {"V_holding", "millivolt", "Voltage_clamp", CONSTANT}, - {"G_f", "microS", "i_f", COMPUTED_CONSTANT}, {"g_f", "microS", "i_f", CONSTANT}, {"Km_f", "millimolar", "i_f", CONSTANT}, - {"G_f_K", "microS", "i_f", COMPUTED_CONSTANT}, {"alpha", "dimensionless", "i_f", CONSTANT}, + {"blockade", "dimensionless", "i_f", CONSTANT}, + {"y_shift", "millivolt", "i_f_y_gate", CONSTANT}, + {"g_Na", "microS", "i_Na", CONSTANT}, + {"g_Na_L", "microS", "i_Na", CONSTANT}, + {"delta_m", "millivolt", "i_Na_m_gate", CONSTANT}, + {"g_Kur", "microS", "i_Kur", CONSTANT}, + {"P_CaL", "nanoA_per_millimolar", "i_CaL", CONSTANT}, + {"V_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, + {"k_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, + {"shift_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, + {"k_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, + {"Km_fCa", "millimolar", "i_CaL_fCa_gate", CONSTANT}, + {"alpha_fCa", "per_second", "i_CaL_fCa_gate", CONSTANT}, + {"P_CaT", "nanoA_per_millimolar", "i_CaT", CONSTANT}, + {"offset_fT", "second", "i_CaT_fT_gate", CONSTANT}, + {"g_to", "microS", "i_to", CONSTANT}, + {"g_Kr", "microS", "i_Kr", CONSTANT}, + {"g_Ks_", "microS", "i_Ks", CONSTANT}, + {"ACh_on", "dimensionless", "i_KACh", CONSTANT}, + {"g_KACh", "microS", "i_KACh", CONSTANT}, + {"RTONF", "millivolt", "Membrane", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "Ionic_values", COMPUTED_CONSTANT}, + {"V_i", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"V_sub", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"Iso_increase", "dimensionless", "i_NaK", COMPUTED_CONSTANT}, + {"k34", "dimensionless", "i_NaCa", COMPUTED_CONSTANT}, + {"b_up", "dimensionless", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, + {"P_up", "millimolar_per_second", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, + {"V_nsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"V_jsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"V_cell", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"G_f", "microS", "i_f", COMPUTED_CONSTANT}, + {"G_f_K", "microS", "i_f", COMPUTED_CONSTANT}, {"G_f_Na", "microS", "i_f", COMPUTED_CONSTANT}, {"g_f_Na", "microS", "i_f", COMPUTED_CONSTANT}, {"g_f_K", "microS", "i_f", COMPUTED_CONSTANT}, - {"blockade", "dimensionless", "i_f", CONSTANT}, - {"i_fK", "nanoA", "i_f", ALGEBRAIC}, {"ACh_shift", "millivolt", "i_f_y_gate", COMPUTED_CONSTANT}, {"Iso_shift", "millivolt", "i_f_y_gate", COMPUTED_CONSTANT}, + {"Iso_increase", "dimensionless", "i_CaL", COMPUTED_CONSTANT}, + {"ACh_block", "dimensionless", "i_CaL", COMPUTED_CONSTANT}, + {"Iso_shift_dL", "millivolt", "i_CaL_dL_gate", COMPUTED_CONSTANT}, + {"Iso_slope_dL", "dimensionless", "i_CaL_dL_gate", COMPUTED_CONSTANT}, + {"g_Ks", "microS", "i_Ks", COMPUTED_CONSTANT}, + {"Iso_shift", "millivolt", "i_Ks_n_gate", COMPUTED_CONSTANT}, + {"alpha_a", "per_second", "i_KACh_a_gate", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "Ionic_values", ALGEBRAIC}, + {"Nai", "millimolar", "Nai_concentration", ALGEBRAIC}, + {"E_Ca", "millivolt", "Ionic_values", ALGEBRAIC}, + {"i_Na", "nanoA", "i_Na", ALGEBRAIC}, + {"i_NaCa", "nanoA", "i_NaCa", ALGEBRAIC}, + {"i_NaK", "nanoA", "i_NaK", ALGEBRAIC}, + {"i_siNa", "nanoA", "i_CaL", ALGEBRAIC}, + {"i_fNa", "nanoA", "i_f", ALGEBRAIC}, + {"V", "millivolt", "Membrane", ALGEBRAIC}, + {"x2", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k21", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"x1", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k12", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"x4", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"x3", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k41", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k23", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k43", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k32", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k14", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"di", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"do", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"j_SRCarel", "millimolar_per_second", "Ca_SR_release", ALGEBRAIC}, + {"diff", "millimolar", "Ca_SR_release", ALGEBRAIC}, + {"kCaSR", "dimensionless", "Ca_SR_release", ALGEBRAIC}, + {"koSRCa", "per_millimolar2_second", "Ca_SR_release", ALGEBRAIC}, + {"kiSRCa", "per_millimolar_second", "Ca_SR_release", ALGEBRAIC}, + {"P_tot", "dimensionless", "Ca_SR_release", ALGEBRAIC}, + {"j_Ca_dif", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, + {"j_up", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, + {"j_tr", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, + {"delta_fTC", "per_second", "Ca_buffering", ALGEBRAIC}, + {"delta_fTMC", "per_second", "Ca_buffering", ALGEBRAIC}, + {"delta_fTMM", "per_second", "Ca_buffering", ALGEBRAIC}, + {"delta_fCMi", "per_second", "Ca_buffering", ALGEBRAIC}, + {"delta_fCMs", "per_second", "Ca_buffering", ALGEBRAIC}, + {"delta_fCQ", "per_second", "Ca_buffering", ALGEBRAIC}, + {"i_siCa", "nanoA", "i_CaL", ALGEBRAIC}, + {"i_CaT", "nanoA", "i_CaT", ALGEBRAIC}, + {"i_tot", "nanoA", "Membrane", ALGEBRAIC}, + {"i_f", "nanoA", "i_f", ALGEBRAIC}, + {"i_Kur", "nanoA", "i_Kur", ALGEBRAIC}, + {"i_KACh", "nanoA", "i_KACh", ALGEBRAIC}, + {"i_CaL", "nanoA", "i_CaL", ALGEBRAIC}, + {"i_to", "nanoA", "i_to", ALGEBRAIC}, + {"i_Ks", "nanoA", "i_Ks", ALGEBRAIC}, + {"i_Kr", "nanoA", "i_Kr", ALGEBRAIC}, + {"V_clamp", "millivolt", "Voltage_clamp", ALGEBRAIC}, + {"i_fK", "nanoA", "i_f", ALGEBRAIC}, {"tau_y", "second", "i_f_y_gate", ALGEBRAIC}, {"y_infinity", "dimensionless", "i_f_y_gate", ALGEBRAIC}, - {"y_shift", "millivolt", "i_f_y_gate", CONSTANT}, {"E_mh", "millivolt", "i_Na", ALGEBRAIC}, {"i_Na_", "nanoA", "i_Na", ALGEBRAIC}, - {"g_Na", "microS", "i_Na", CONSTANT}, {"i_Na_L", "nanoA", "i_Na", ALGEBRAIC}, - {"g_Na_L", "microS", "i_Na", CONSTANT}, {"m_infinity", "dimensionless", "i_Na_m_gate", ALGEBRAIC}, {"E0_m", "millivolt", "i_Na_m_gate", ALGEBRAIC}, {"alpha_m", "per_second", "i_Na_m_gate", ALGEBRAIC}, - {"delta_m", "millivolt", "i_Na_m_gate", CONSTANT}, {"beta_m", "per_second", "i_Na_m_gate", ALGEBRAIC}, {"tau_m", "second", "i_Na_m_gate", ALGEBRAIC}, {"h_infinity", "dimensionless", "i_Na_h_gate", ALGEBRAIC}, {"alpha_h", "per_second", "i_Na_h_gate", ALGEBRAIC}, {"beta_h", "per_second", "i_Na_h_gate", ALGEBRAIC}, {"tau_h", "second", "i_Na_h_gate", ALGEBRAIC}, - {"g_Kur", "microS", "i_Kur", CONSTANT}, {"r_Kur_infinity", "dimensionless", "i_Kur_rKur_gate", ALGEBRAIC}, {"tau_r_Kur", "second", "i_Kur_rKur_gate", ALGEBRAIC}, {"s_Kur_infinity", "dimensionless", "i_Kur_sKur_gate", ALGEBRAIC}, {"tau_s_Kur", "second", "i_Kur_sKur_gate", ALGEBRAIC}, - {"Iso_increase", "dimensionless", "i_CaL", COMPUTED_CONSTANT}, - {"P_CaL", "nanoA_per_millimolar", "i_CaL", CONSTANT}, {"i_siK", "nanoA", "i_CaL", ALGEBRAIC}, - {"ACh_block", "dimensionless", "i_CaL", COMPUTED_CONSTANT}, - {"Iso_shift_dL", "millivolt", "i_CaL_dL_gate", COMPUTED_CONSTANT}, - {"Iso_slope_dL", "dimensionless", "i_CaL_dL_gate", COMPUTED_CONSTANT}, {"dL_infinity", "dimensionless", "i_CaL_dL_gate", ALGEBRAIC}, - {"V_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, - {"k_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, {"tau_dL", "second", "i_CaL_dL_gate", ALGEBRAIC}, {"alpha_dL", "per_second", "i_CaL_dL_gate", ALGEBRAIC}, {"beta_dL", "per_second", "i_CaL_dL_gate", ALGEBRAIC}, {"adVm", "millivolt", "i_CaL_dL_gate", ALGEBRAIC}, {"bdVm", "millivolt", "i_CaL_dL_gate", ALGEBRAIC}, {"fL_infinity", "dimensionless", "i_CaL_fL_gate", ALGEBRAIC}, - {"shift_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, - {"k_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, {"tau_fL", "second", "i_CaL_fL_gate", ALGEBRAIC}, {"fCa_infinity", "dimensionless", "i_CaL_fCa_gate", ALGEBRAIC}, - {"Km_fCa", "millimolar", "i_CaL_fCa_gate", CONSTANT}, {"tau_fCa", "second", "i_CaL_fCa_gate", ALGEBRAIC}, - {"alpha_fCa", "per_second", "i_CaL_fCa_gate", CONSTANT}, - {"P_CaT", "nanoA_per_millimolar", "i_CaT", CONSTANT}, {"dT_infinity", "dimensionless", "i_CaT_dT_gate", ALGEBRAIC}, {"tau_dT", "second", "i_CaT_dT_gate", ALGEBRAIC}, {"fT_infinity", "dimensionless", "i_CaT_fT_gate", ALGEBRAIC}, {"tau_fT", "second", "i_CaT_fT_gate", ALGEBRAIC}, - {"offset_fT", "second", "i_CaT_fT_gate", CONSTANT}, - {"g_to", "microS", "i_to", CONSTANT}, {"q_infinity", "dimensionless", "i_to_q_gate", ALGEBRAIC}, {"tau_q", "second", "i_to_q_gate", ALGEBRAIC}, {"r_infinity", "dimensionless", "i_to_r_gate", ALGEBRAIC}, {"tau_r", "second", "i_to_r_gate", ALGEBRAIC}, - {"g_Kr", "microS", "i_Kr", CONSTANT}, {"alfapaF", "per_second", "i_Kr_pa_gate", ALGEBRAIC}, {"betapaF", "per_second", "i_Kr_pa_gate", ALGEBRAIC}, {"pa_infinity", "dimensionless", "i_Kr_pa_gate", ALGEBRAIC}, @@ -256,17 +261,11 @@ const VariableInfo VARIABLE_INFO[] = { {"tau_paF", "second", "i_Kr_pa_gate", ALGEBRAIC}, {"tau_pi", "second", "i_Kr_pi_gate", ALGEBRAIC}, {"pi_infinity", "dimensionless", "i_Kr_pi_gate", ALGEBRAIC}, - {"g_Ks", "microS", "i_Ks", COMPUTED_CONSTANT}, - {"g_Ks_", "microS", "i_Ks", CONSTANT}, {"E_Ks", "millivolt", "i_Ks", ALGEBRAIC}, - {"Iso_shift", "millivolt", "i_Ks_n_gate", COMPUTED_CONSTANT}, {"n_infinity", "dimensionless", "i_Ks_n_gate", ALGEBRAIC}, {"tau_n", "second", "i_Ks_n_gate", ALGEBRAIC}, {"alpha_n", "per_second", "i_Ks_n_gate", ALGEBRAIC}, {"beta_n", "per_second", "i_Ks_n_gate", ALGEBRAIC}, - {"ACh_on", "dimensionless", "i_KACh", CONSTANT}, - {"g_KACh", "microS", "i_KACh", CONSTANT}, - {"alpha_a", "per_second", "i_KACh_a_gate", COMPUTED_CONSTANT}, {"beta_a", "per_second", "i_KACh_a_gate", ALGEBRAIC}, {"a_infinity", "dimensionless", "i_KACh_a_gate", ALGEBRAIC}, {"tau_a", "second", "i_KACh_a_gate", ALGEBRAIC} diff --git a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.h b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.h index 72e65f5642..e94e9dec00 100644 --- a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.h +++ b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py index bf46049b2b..413cd1d94d 100644 --- a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py +++ b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 33 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 217 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 91 +COMPUTED_CONSTANT_COUNT = 25 +ALGEBRAIC_COUNT = 101 class VariableType(Enum): @@ -63,47 +62,20 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "ACh", "units": "millimolar", "component": "Rate_modulation_experiments", "type": VariableType.CONSTANT}, {"name": "Iso_1_uM", "units": "dimensionless", "component": "Rate_modulation_experiments", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, - {"name": "RTONF", "units": "millivolt", "component": "Membrane", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Nao", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, - {"name": "Nai", "units": "millimolar", "component": "Nai_concentration", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "Ionic_values", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Ko", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, {"name": "Ki", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, - {"name": "E_Ca", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, {"name": "Cao", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, {"name": "Nai_clamp", "units": "dimensionless", "component": "Nai_concentration", "type": VariableType.CONSTANT}, - {"name": "i_Na", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, - {"name": "i_NaCa", "units": "nanoA", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "i_NaK", "units": "nanoA", "component": "i_NaK", "type": VariableType.ALGEBRAIC}, - {"name": "i_siNa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, - {"name": "i_fNa", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, {"name": "F", "units": "coulomb_per_mole", "component": "Membrane", "type": VariableType.CONSTANT}, - {"name": "V_i", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "V_sub", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "Iso_increase", "units": "dimensionless", "component": "i_NaK", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "V", "units": "millivolt", "component": "Membrane", "type": VariableType.ALGEBRAIC}, {"name": "Km_Nap", "units": "millimolar", "component": "i_NaK", "type": VariableType.CONSTANT}, {"name": "Km_Kp", "units": "millimolar", "component": "i_NaK", "type": VariableType.CONSTANT}, {"name": "i_NaK_max", "units": "nanoA", "component": "i_NaK", "type": VariableType.CONSTANT}, {"name": "blockade_NaCa", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "x2", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k21", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "x1", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k12", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "K_NaCa", "units": "nanoA", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "x4", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "x3", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k41", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k23", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k34", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "k43", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k32", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k14", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "K3ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Kci", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Qci", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "di", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "K1ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "K2ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Qn", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, @@ -111,152 +83,185 @@ class VariableType(Enum): {"name": "K3no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Kco", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Qco", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "do", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "K1no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "K2no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "j_SRCarel", "units": "millimolar_per_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "ks", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "diff", "units": "millimolar", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, - {"name": "kCaSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "MaxSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "MinSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "EC50_SR", "units": "millimolar", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "HSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "koSRCa", "units": "per_millimolar2_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "koCa", "units": "per_millimolar2_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "kiSRCa", "units": "per_millimolar_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "kiCa", "units": "per_millimolar_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "kim", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "kom", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "P_tot", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, - {"name": "b_up", "units": "dimensionless", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "P_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, {"name": "P_up_basal", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "j_Ca_dif", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, {"name": "tau_dif_Ca", "units": "second", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "j_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, {"name": "K_up", "units": "millimolar", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, {"name": "slope_up", "units": "millimolar", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "j_tr", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, {"name": "tau_tr", "units": "second", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "delta_fTC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, {"name": "kf_TC", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_TC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, - {"name": "delta_fTMC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, {"name": "kf_TMC", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_TMC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, - {"name": "delta_fTMM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, {"name": "kf_TMM", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "Mgi", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_TMM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, - {"name": "delta_fCMi", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, {"name": "kf_CM", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_CM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, - {"name": "delta_fCMs", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, - {"name": "delta_fCQ", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, {"name": "kf_CQ", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_CQ", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "TC_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "TMC_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "CM_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "CQ_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, - {"name": "V_nsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "V_jsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "i_siCa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, - {"name": "i_CaT", "units": "nanoA", "component": "i_CaT", "type": VariableType.ALGEBRAIC}, - {"name": "V_cell", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, {"name": "L_cell", "units": "micrometre", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "R_cell", "units": "micrometre", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "L_sub", "units": "micrometre", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "V_jsr_part", "units": "dimensionless", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "V_i_part", "units": "dimensionless", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "V_nsr_part", "units": "dimensionless", "component": "Cell_parameters", "type": VariableType.CONSTANT}, - {"name": "i_tot", "units": "nanoA", "component": "Membrane", "type": VariableType.ALGEBRAIC}, - {"name": "i_f", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, - {"name": "i_Kur", "units": "nanoA", "component": "i_Kur", "type": VariableType.ALGEBRAIC}, - {"name": "i_KACh", "units": "nanoA", "component": "i_KACh", "type": VariableType.ALGEBRAIC}, - {"name": "i_CaL", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, - {"name": "i_to", "units": "nanoA", "component": "i_to", "type": VariableType.ALGEBRAIC}, - {"name": "i_Ks", "units": "nanoA", "component": "i_Ks", "type": VariableType.ALGEBRAIC}, - {"name": "i_Kr", "units": "nanoA", "component": "i_Kr", "type": VariableType.ALGEBRAIC}, {"name": "C", "units": "microF", "component": "Membrane", "type": VariableType.CONSTANT}, {"name": "R", "units": "joule_per_kilomole_kelvin", "component": "Membrane", "type": VariableType.CONSTANT}, {"name": "T", "units": "kelvin", "component": "Membrane", "type": VariableType.CONSTANT}, - {"name": "V_clamp", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.ALGEBRAIC}, {"name": "clamp_mode", "units": "dimensionless", "component": "Membrane", "type": VariableType.CONSTANT}, {"name": "V_test", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, {"name": "t_holding", "units": "second", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, {"name": "t_test", "units": "second", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, {"name": "V_holding", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, - {"name": "G_f", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f", "units": "microS", "component": "i_f", "type": VariableType.CONSTANT}, {"name": "Km_f", "units": "millimolar", "component": "i_f", "type": VariableType.CONSTANT}, - {"name": "G_f_K", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "alpha", "units": "dimensionless", "component": "i_f", "type": VariableType.CONSTANT}, + {"name": "blockade", "units": "dimensionless", "component": "i_f", "type": VariableType.CONSTANT}, + {"name": "y_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.CONSTANT}, + {"name": "g_Na", "units": "microS", "component": "i_Na", "type": VariableType.CONSTANT}, + {"name": "g_Na_L", "units": "microS", "component": "i_Na", "type": VariableType.CONSTANT}, + {"name": "delta_m", "units": "millivolt", "component": "i_Na_m_gate", "type": VariableType.CONSTANT}, + {"name": "g_Kur", "units": "microS", "component": "i_Kur", "type": VariableType.CONSTANT}, + {"name": "P_CaL", "units": "nanoA_per_millimolar", "component": "i_CaL", "type": VariableType.CONSTANT}, + {"name": "V_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, + {"name": "k_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, + {"name": "shift_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, + {"name": "k_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, + {"name": "Km_fCa", "units": "millimolar", "component": "i_CaL_fCa_gate", "type": VariableType.CONSTANT}, + {"name": "alpha_fCa", "units": "per_second", "component": "i_CaL_fCa_gate", "type": VariableType.CONSTANT}, + {"name": "P_CaT", "units": "nanoA_per_millimolar", "component": "i_CaT", "type": VariableType.CONSTANT}, + {"name": "offset_fT", "units": "second", "component": "i_CaT_fT_gate", "type": VariableType.CONSTANT}, + {"name": "g_to", "units": "microS", "component": "i_to", "type": VariableType.CONSTANT}, + {"name": "g_Kr", "units": "microS", "component": "i_Kr", "type": VariableType.CONSTANT}, + {"name": "g_Ks_", "units": "microS", "component": "i_Ks", "type": VariableType.CONSTANT}, + {"name": "ACh_on", "units": "dimensionless", "component": "i_KACh", "type": VariableType.CONSTANT}, + {"name": "g_KACh", "units": "microS", "component": "i_KACh", "type": VariableType.CONSTANT}, + {"name": "RTONF", "units": "millivolt", "component": "Membrane", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "Ionic_values", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "V_i", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "V_sub", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "Iso_increase", "units": "dimensionless", "component": "i_NaK", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "k34", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "b_up", "units": "dimensionless", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "P_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "V_nsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "V_jsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "V_cell", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "G_f", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "G_f_K", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "G_f_Na", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_Na", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_K", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "blockade", "units": "dimensionless", "component": "i_f", "type": VariableType.CONSTANT}, - {"name": "i_fK", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, {"name": "ACh_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Iso_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "Iso_increase", "units": "dimensionless", "component": "i_CaL", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "ACh_block", "units": "dimensionless", "component": "i_CaL", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "Iso_shift_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "Iso_slope_dL", "units": "dimensionless", "component": "i_CaL_dL_gate", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_Ks", "units": "microS", "component": "i_Ks", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "Iso_shift", "units": "millivolt", "component": "i_Ks_n_gate", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "alpha_a", "units": "per_second", "component": "i_KACh_a_gate", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, + {"name": "Nai", "units": "millimolar", "component": "Nai_concentration", "type": VariableType.ALGEBRAIC}, + {"name": "E_Ca", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, + {"name": "i_NaCa", "units": "nanoA", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "i_NaK", "units": "nanoA", "component": "i_NaK", "type": VariableType.ALGEBRAIC}, + {"name": "i_siNa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, + {"name": "i_fNa", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, + {"name": "V", "units": "millivolt", "component": "Membrane", "type": VariableType.ALGEBRAIC}, + {"name": "x2", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k21", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "x1", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k12", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "x4", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "x3", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k41", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k23", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k43", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k32", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k14", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "di", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "do", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "j_SRCarel", "units": "millimolar_per_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "diff", "units": "millimolar", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "kCaSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "koSRCa", "units": "per_millimolar2_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "kiSRCa", "units": "per_millimolar_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "P_tot", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "j_Ca_dif", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, + {"name": "j_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, + {"name": "j_tr", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, + {"name": "delta_fTC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, + {"name": "delta_fTMC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, + {"name": "delta_fTMM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, + {"name": "delta_fCMi", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, + {"name": "delta_fCMs", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, + {"name": "delta_fCQ", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, + {"name": "i_siCa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, + {"name": "i_CaT", "units": "nanoA", "component": "i_CaT", "type": VariableType.ALGEBRAIC}, + {"name": "i_tot", "units": "nanoA", "component": "Membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_f", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, + {"name": "i_Kur", "units": "nanoA", "component": "i_Kur", "type": VariableType.ALGEBRAIC}, + {"name": "i_KACh", "units": "nanoA", "component": "i_KACh", "type": VariableType.ALGEBRAIC}, + {"name": "i_CaL", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, + {"name": "i_to", "units": "nanoA", "component": "i_to", "type": VariableType.ALGEBRAIC}, + {"name": "i_Ks", "units": "nanoA", "component": "i_Ks", "type": VariableType.ALGEBRAIC}, + {"name": "i_Kr", "units": "nanoA", "component": "i_Kr", "type": VariableType.ALGEBRAIC}, + {"name": "V_clamp", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.ALGEBRAIC}, + {"name": "i_fK", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, {"name": "tau_y", "units": "second", "component": "i_f_y_gate", "type": VariableType.ALGEBRAIC}, {"name": "y_infinity", "units": "dimensionless", "component": "i_f_y_gate", "type": VariableType.ALGEBRAIC}, - {"name": "y_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.CONSTANT}, {"name": "E_mh", "units": "millivolt", "component": "i_Na", "type": VariableType.ALGEBRAIC}, {"name": "i_Na_", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, - {"name": "g_Na", "units": "microS", "component": "i_Na", "type": VariableType.CONSTANT}, {"name": "i_Na_L", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, - {"name": "g_Na_L", "units": "microS", "component": "i_Na", "type": VariableType.CONSTANT}, {"name": "m_infinity", "units": "dimensionless", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "E0_m", "units": "millivolt", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, - {"name": "delta_m", "units": "millivolt", "component": "i_Na_m_gate", "type": VariableType.CONSTANT}, {"name": "beta_m", "units": "per_second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_m", "units": "second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "h_infinity", "units": "dimensionless", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_second", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_second", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_h", "units": "second", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Kur", "units": "microS", "component": "i_Kur", "type": VariableType.CONSTANT}, {"name": "r_Kur_infinity", "units": "dimensionless", "component": "i_Kur_rKur_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_r_Kur", "units": "second", "component": "i_Kur_rKur_gate", "type": VariableType.ALGEBRAIC}, {"name": "s_Kur_infinity", "units": "dimensionless", "component": "i_Kur_sKur_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_s_Kur", "units": "second", "component": "i_Kur_sKur_gate", "type": VariableType.ALGEBRAIC}, - {"name": "Iso_increase", "units": "dimensionless", "component": "i_CaL", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "P_CaL", "units": "nanoA_per_millimolar", "component": "i_CaL", "type": VariableType.CONSTANT}, {"name": "i_siK", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, - {"name": "ACh_block", "units": "dimensionless", "component": "i_CaL", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "Iso_shift_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "Iso_slope_dL", "units": "dimensionless", "component": "i_CaL_dL_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "dL_infinity", "units": "dimensionless", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "V_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, - {"name": "k_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, {"name": "tau_dL", "units": "second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_dL", "units": "per_second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_dL", "units": "per_second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "adVm", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "bdVm", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "fL_infinity", "units": "dimensionless", "component": "i_CaL_fL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "shift_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, - {"name": "k_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, {"name": "tau_fL", "units": "second", "component": "i_CaL_fL_gate", "type": VariableType.ALGEBRAIC}, {"name": "fCa_infinity", "units": "dimensionless", "component": "i_CaL_fCa_gate", "type": VariableType.ALGEBRAIC}, - {"name": "Km_fCa", "units": "millimolar", "component": "i_CaL_fCa_gate", "type": VariableType.CONSTANT}, {"name": "tau_fCa", "units": "second", "component": "i_CaL_fCa_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_fCa", "units": "per_second", "component": "i_CaL_fCa_gate", "type": VariableType.CONSTANT}, - {"name": "P_CaT", "units": "nanoA_per_millimolar", "component": "i_CaT", "type": VariableType.CONSTANT}, {"name": "dT_infinity", "units": "dimensionless", "component": "i_CaT_dT_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_dT", "units": "second", "component": "i_CaT_dT_gate", "type": VariableType.ALGEBRAIC}, {"name": "fT_infinity", "units": "dimensionless", "component": "i_CaT_fT_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_fT", "units": "second", "component": "i_CaT_fT_gate", "type": VariableType.ALGEBRAIC}, - {"name": "offset_fT", "units": "second", "component": "i_CaT_fT_gate", "type": VariableType.CONSTANT}, - {"name": "g_to", "units": "microS", "component": "i_to", "type": VariableType.CONSTANT}, {"name": "q_infinity", "units": "dimensionless", "component": "i_to_q_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_q", "units": "second", "component": "i_to_q_gate", "type": VariableType.ALGEBRAIC}, {"name": "r_infinity", "units": "dimensionless", "component": "i_to_r_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_r", "units": "second", "component": "i_to_r_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Kr", "units": "microS", "component": "i_Kr", "type": VariableType.CONSTANT}, {"name": "alfapaF", "units": "per_second", "component": "i_Kr_pa_gate", "type": VariableType.ALGEBRAIC}, {"name": "betapaF", "units": "per_second", "component": "i_Kr_pa_gate", "type": VariableType.ALGEBRAIC}, {"name": "pa_infinity", "units": "dimensionless", "component": "i_Kr_pa_gate", "type": VariableType.ALGEBRAIC}, @@ -264,17 +269,11 @@ class VariableType(Enum): {"name": "tau_paF", "units": "second", "component": "i_Kr_pa_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_pi", "units": "second", "component": "i_Kr_pi_gate", "type": VariableType.ALGEBRAIC}, {"name": "pi_infinity", "units": "dimensionless", "component": "i_Kr_pi_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Ks", "units": "microS", "component": "i_Ks", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Ks_", "units": "microS", "component": "i_Ks", "type": VariableType.CONSTANT}, {"name": "E_Ks", "units": "millivolt", "component": "i_Ks", "type": VariableType.ALGEBRAIC}, - {"name": "Iso_shift", "units": "millivolt", "component": "i_Ks_n_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "n_infinity", "units": "dimensionless", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_n", "units": "second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_n", "units": "per_second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_n", "units": "per_second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "ACh_on", "units": "dimensionless", "component": "i_KACh", "type": VariableType.CONSTANT}, - {"name": "g_KACh", "units": "microS", "component": "i_KACh", "type": VariableType.CONSTANT}, - {"name": "alpha_a", "units": "per_second", "component": "i_KACh_a_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "beta_a", "units": "per_second", "component": "i_KACh_a_gate", "type": VariableType.ALGEBRAIC}, {"name": "a_infinity", "units": "dimensionless", "component": "i_KACh_a_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_a", "units": "second", "component": "i_KACh_a_gate", "type": VariableType.ALGEBRAIC} diff --git a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c index 19a61164cc..798a745cac 100644 --- a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c +++ b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 15; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 185; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 110; +const size_t COMPUTED_CONSTANT_COUNT = 23; +const size_t ALGEBRAIC_COUNT = 52; const VariableInfo VOI_INFO = {"time", "second", "environment", VARIABLE_OF_INTEGRATION}; @@ -35,56 +34,32 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"FCell", "dimensionless", "membrane", COMPUTED_CONSTANT}, {"dCell", "dimensionless", "membrane", CONSTANT}, {"Version", "dimensionless", "membrane", CONSTANT}, {"FCellConstant", "dimensionless", "membrane", CONSTANT}, - {"Cm", "microF", "membrane", COMPUTED_CONSTANT}, {"CmCentre", "microF", "membrane", CONSTANT}, {"CmPeriphery", "microF", "membrane", CONSTANT}, - {"i_Na", "nanoA", "sodium_current", ALGEBRAIC}, - {"i_Ca_p", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, - {"i_p", "nanoA", "sodium_potassium_pump", ALGEBRAIC}, - {"i_NaCa", "nanoA", "sodium_calcium_exchanger", ALGEBRAIC}, - {"i_b_K", "nanoA", "potassium_background_current", ALGEBRAIC}, - {"i_b_Ca", "nanoA", "calcium_background_current", ALGEBRAIC}, - {"i_b_Na", "nanoA", "sodium_background_current", ALGEBRAIC}, - {"i_f_K", "nanoA", "hyperpolarisation_activated_current", ALGEBRAIC}, - {"i_f_Na", "nanoA", "hyperpolarisation_activated_current", ALGEBRAIC}, - {"i_K_s", "nanoA", "slow_delayed_rectifying_potassium_current", ALGEBRAIC}, - {"i_K_r", "nanoA", "rapid_delayed_rectifying_potassium_current", ALGEBRAIC}, - {"i_sus", "nanoA", "four_AP_sensitive_currents", ALGEBRAIC}, - {"i_to", "nanoA", "four_AP_sensitive_currents", ALGEBRAIC}, - {"i_Ca_T", "nanoA", "T_type_Ca_channel", ALGEBRAIC}, - {"i_Ca_L", "nanoA", "L_type_Ca_channel", ALGEBRAIC}, {"R", "millijoule_per_mole_kelvin", "membrane", CONSTANT}, {"T", "kelvin", "membrane", CONSTANT}, {"F", "coulomb_per_mole", "membrane", CONSTANT}, - {"g_b_Na", "microS", "sodium_background_current", COMPUTED_CONSTANT}, {"g_b_Na_Centre_Published", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Periphery_Published", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Centre_1DCapable", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Periphery_1DCapable", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Centre_0DCapable", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Periphery_0DCapable", "microS", "sodium_background_current", CONSTANT}, - {"E_Na", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"g_b_K", "microS", "potassium_background_current", COMPUTED_CONSTANT}, {"g_b_K_Centre_Published", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Periphery_Published", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Centre_1DCapable", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Periphery_1DCapable", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Centre_0DCapable", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Periphery_0DCapable", "microS", "potassium_background_current", CONSTANT}, - {"E_K", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"g_b_Ca", "microS", "calcium_background_current", COMPUTED_CONSTANT}, {"g_b_Ca_Centre_Published", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Periphery_Published", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Centre_1DCapable", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Periphery_1DCapable", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Centre_0DCapable", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Periphery_0DCapable", "microS", "calcium_background_current", CONSTANT}, - {"E_Ca", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"k_NaCa", "nanoA", "sodium_calcium_exchanger", COMPUTED_CONSTANT}, {"k_NaCa_Centre_Published", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Periphery_Published", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Centre_1DCapable", "nanoA", "sodium_calcium_exchanger", CONSTANT}, @@ -97,7 +72,6 @@ const VariableInfo VARIABLE_INFO[] = { {"Na_o", "millimolar", "ionic_concentrations", CONSTANT}, {"Ca_i", "millimolar", "ionic_concentrations", CONSTANT}, {"d_NaCa", "dimensionless", "sodium_calcium_exchanger", CONSTANT}, - {"i_p_max", "nanoA", "sodium_potassium_pump", COMPUTED_CONSTANT}, {"i_p_max_Centre_Published", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Periphery_Published", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Centre_1DCapable", "nanoA", "sodium_potassium_pump", CONSTANT}, @@ -107,7 +81,6 @@ const VariableInfo VARIABLE_INFO[] = { {"K_o", "millimolar", "ionic_concentrations", CONSTANT}, {"K_m_K", "millimolar", "sodium_potassium_pump", CONSTANT}, {"K_m_Na", "millimolar", "sodium_potassium_pump", CONSTANT}, - {"i_Ca_p_max", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, {"i_Ca_p_max_Centre_Published", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Periphery_Published", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Centre_1DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, @@ -115,23 +88,12 @@ const VariableInfo VARIABLE_INFO[] = { {"i_Ca_p_max_Centre_0DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Periphery_0DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, {"K_i", "millimolar", "ionic_concentrations", CONSTANT}, - {"E_K_s", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"g_Na", "microlitre_per_second", "sodium_current", COMPUTED_CONSTANT}, {"g_Na_Centre_Published", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Periphery_Published", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Centre_1DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Periphery_1DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Centre_0DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Periphery_0DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, - {"h", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, - {"m_infinity", "dimensionless", "sodium_current_m_gate", ALGEBRAIC}, - {"tau_m", "second", "sodium_current_m_gate", ALGEBRAIC}, - {"F_Na", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, - {"h1_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, - {"tau_h1", "second", "sodium_current_h_gate", ALGEBRAIC}, - {"h2_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, - {"tau_h2", "second", "sodium_current_h_gate", ALGEBRAIC}, - {"g_Ca_L", "microS", "L_type_Ca_channel", COMPUTED_CONSTANT}, {"g_Ca_L_Centre_Published", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Periphery_Published", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Centre_1DCapable", "microS", "L_type_Ca_channel", CONSTANT}, @@ -139,15 +101,6 @@ const VariableInfo VARIABLE_INFO[] = { {"g_Ca_L_Centre_0DCapable", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Periphery_0DCapable", "microS", "L_type_Ca_channel", CONSTANT}, {"E_Ca_L", "millivolt", "L_type_Ca_channel", CONSTANT}, - {"d_L_infinity", "dimensionless", "L_type_Ca_channel_d_gate", ALGEBRAIC}, - {"tau_d_L", "second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, - {"alpha_d_L", "per_second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, - {"beta_d_L", "per_second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, - {"f_L_infinity", "dimensionless", "L_type_Ca_channel_f_gate", ALGEBRAIC}, - {"tau_f_L", "second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, - {"alpha_f_L", "per_second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, - {"beta_f_L", "per_second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, - {"g_Ca_T", "microS", "T_type_Ca_channel", COMPUTED_CONSTANT}, {"g_Ca_T_Centre_Published", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Periphery_Published", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Centre_1DCapable", "microS", "T_type_Ca_channel", CONSTANT}, @@ -155,69 +108,115 @@ const VariableInfo VARIABLE_INFO[] = { {"g_Ca_T_Centre_0DCapable", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Periphery_0DCapable", "microS", "T_type_Ca_channel", CONSTANT}, {"E_Ca_T", "millivolt", "T_type_Ca_channel", CONSTANT}, - {"d_T_infinity", "dimensionless", "T_type_Ca_channel_d_gate", ALGEBRAIC}, - {"tau_d_T", "second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, - {"alpha_d_T", "per_second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, - {"beta_d_T", "per_second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, - {"f_T_infinity", "dimensionless", "T_type_Ca_channel_f_gate", ALGEBRAIC}, - {"tau_f_T", "second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, - {"alpha_f_T", "per_second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, - {"beta_f_T", "per_second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, - {"g_to", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, {"g_to_Centre_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Periphery_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Centre_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Periphery_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Centre_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Periphery_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, - {"g_sus", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, {"g_sus_Centre_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Periphery_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Centre_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Periphery_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Centre_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Periphery_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, - {"q_infinity", "dimensionless", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, - {"tau_q", "second", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, - {"r_infinity", "dimensionless", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, - {"tau_r", "second", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, - {"g_K_r", "microS", "rapid_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, {"g_K_r_Centre_Published", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Periphery_Published", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Centre_1DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Periphery_1DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Centre_0DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Periphery_0DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, - {"P_a", "dimensionless", "rapid_delayed_rectifying_potassium_current", ALGEBRAIC}, - {"P_af_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, - {"tau_P_af", "second", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, - {"P_as_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, - {"tau_P_as", "second", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, - {"tau_P_i", "second", "rapid_delayed_rectifying_potassium_current_P_i_gate", COMPUTED_CONSTANT}, - {"P_i_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_i_gate", ALGEBRAIC}, - {"g_K_s", "microS", "slow_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, {"g_K_s_Centre_Published", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Periphery_Published", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Centre_1DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Periphery_1DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Centre_0DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Periphery_0DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, - {"alpha_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, - {"beta_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, - {"g_f_Na", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, {"g_f_Na_Centre_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Periphery_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Centre_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Periphery_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Centre_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Periphery_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, - {"g_f_K", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, {"g_f_K_Centre_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Periphery_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Centre_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Periphery_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Centre_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Periphery_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, + {"FCell", "dimensionless", "membrane", COMPUTED_CONSTANT}, + {"Cm", "microF", "membrane", COMPUTED_CONSTANT}, + {"i_Ca_p", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, + {"g_b_Na", "microS", "sodium_background_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, + {"g_b_K", "microS", "potassium_background_current", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, + {"g_b_Ca", "microS", "calcium_background_current", COMPUTED_CONSTANT}, + {"E_Ca", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, + {"k_NaCa", "nanoA", "sodium_calcium_exchanger", COMPUTED_CONSTANT}, + {"i_p_max", "nanoA", "sodium_potassium_pump", COMPUTED_CONSTANT}, + {"i_Ca_p_max", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, + {"E_K_s", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, + {"g_Na", "microlitre_per_second", "sodium_current", COMPUTED_CONSTANT}, + {"g_Ca_L", "microS", "L_type_Ca_channel", COMPUTED_CONSTANT}, + {"g_Ca_T", "microS", "T_type_Ca_channel", COMPUTED_CONSTANT}, + {"g_to", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, + {"g_sus", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, + {"g_K_r", "microS", "rapid_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, + {"tau_P_i", "second", "rapid_delayed_rectifying_potassium_current_P_i_gate", COMPUTED_CONSTANT}, + {"g_K_s", "microS", "slow_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, + {"g_f_Na", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, + {"g_f_K", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, + {"i_Na", "nanoA", "sodium_current", ALGEBRAIC}, + {"i_p", "nanoA", "sodium_potassium_pump", ALGEBRAIC}, + {"i_NaCa", "nanoA", "sodium_calcium_exchanger", ALGEBRAIC}, + {"i_b_K", "nanoA", "potassium_background_current", ALGEBRAIC}, + {"i_b_Ca", "nanoA", "calcium_background_current", ALGEBRAIC}, + {"i_b_Na", "nanoA", "sodium_background_current", ALGEBRAIC}, + {"i_f_K", "nanoA", "hyperpolarisation_activated_current", ALGEBRAIC}, + {"i_f_Na", "nanoA", "hyperpolarisation_activated_current", ALGEBRAIC}, + {"i_K_s", "nanoA", "slow_delayed_rectifying_potassium_current", ALGEBRAIC}, + {"i_K_r", "nanoA", "rapid_delayed_rectifying_potassium_current", ALGEBRAIC}, + {"i_sus", "nanoA", "four_AP_sensitive_currents", ALGEBRAIC}, + {"i_to", "nanoA", "four_AP_sensitive_currents", ALGEBRAIC}, + {"i_Ca_T", "nanoA", "T_type_Ca_channel", ALGEBRAIC}, + {"i_Ca_L", "nanoA", "L_type_Ca_channel", ALGEBRAIC}, + {"h", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, + {"m_infinity", "dimensionless", "sodium_current_m_gate", ALGEBRAIC}, + {"tau_m", "second", "sodium_current_m_gate", ALGEBRAIC}, + {"F_Na", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, + {"h1_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, + {"tau_h1", "second", "sodium_current_h_gate", ALGEBRAIC}, + {"h2_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, + {"tau_h2", "second", "sodium_current_h_gate", ALGEBRAIC}, + {"d_L_infinity", "dimensionless", "L_type_Ca_channel_d_gate", ALGEBRAIC}, + {"tau_d_L", "second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, + {"alpha_d_L", "per_second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, + {"beta_d_L", "per_second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, + {"f_L_infinity", "dimensionless", "L_type_Ca_channel_f_gate", ALGEBRAIC}, + {"tau_f_L", "second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, + {"alpha_f_L", "per_second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, + {"beta_f_L", "per_second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, + {"d_T_infinity", "dimensionless", "T_type_Ca_channel_d_gate", ALGEBRAIC}, + {"tau_d_T", "second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, + {"alpha_d_T", "per_second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, + {"beta_d_T", "per_second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, + {"f_T_infinity", "dimensionless", "T_type_Ca_channel_f_gate", ALGEBRAIC}, + {"tau_f_T", "second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, + {"alpha_f_T", "per_second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, + {"beta_f_T", "per_second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, + {"q_infinity", "dimensionless", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, + {"tau_q", "second", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, + {"r_infinity", "dimensionless", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, + {"tau_r", "second", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, + {"P_a", "dimensionless", "rapid_delayed_rectifying_potassium_current", ALGEBRAIC}, + {"P_af_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, + {"tau_P_af", "second", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, + {"P_as_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, + {"tau_P_as", "second", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, + {"P_i_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_i_gate", ALGEBRAIC}, + {"alpha_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, + {"beta_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, {"alpha_y", "per_second", "hyperpolarisation_activated_current_y_gate", ALGEBRAIC}, {"beta_y", "per_second", "hyperpolarisation_activated_current_y_gate", ALGEBRAIC} }; diff --git a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.h b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.h index 7ce78ee1d9..2715ae2d90 100644 --- a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.h +++ b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py index c62e1982cd..4c0443449d 100644 --- a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py +++ b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 15 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 185 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 110 +COMPUTED_CONSTANT_COUNT = 23 +ALGEBRAIC_COUNT = 52 class VariableType(Enum): @@ -43,56 +42,32 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "FCell", "units": "dimensionless", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, {"name": "dCell", "units": "dimensionless", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "Version", "units": "dimensionless", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "FCellConstant", "units": "dimensionless", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "Cm", "units": "microF", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, {"name": "CmCentre", "units": "microF", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "CmPeriphery", "units": "microF", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "i_Na", "units": "nanoA", "component": "sodium_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_Ca_p", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "i_p", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.ALGEBRAIC}, - {"name": "i_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.ALGEBRAIC}, - {"name": "i_b_K", "units": "nanoA", "component": "potassium_background_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_b_Ca", "units": "nanoA", "component": "calcium_background_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_b_Na", "units": "nanoA", "component": "sodium_background_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_f_K", "units": "nanoA", "component": "hyperpolarisation_activated_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_f_Na", "units": "nanoA", "component": "hyperpolarisation_activated_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K_s", "units": "nanoA", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K_r", "units": "nanoA", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_sus", "units": "nanoA", "component": "four_AP_sensitive_currents", "type": VariableType.ALGEBRAIC}, - {"name": "i_to", "units": "nanoA", "component": "four_AP_sensitive_currents", "type": VariableType.ALGEBRAIC}, - {"name": "i_Ca_T", "units": "nanoA", "component": "T_type_Ca_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Ca_L", "units": "nanoA", "component": "L_type_Ca_channel", "type": VariableType.ALGEBRAIC}, {"name": "R", "units": "millijoule_per_mole_kelvin", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "T", "units": "kelvin", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "F", "units": "coulomb_per_mole", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "g_b_Na", "units": "microS", "component": "sodium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_b_Na_Centre_Published", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Periphery_Published", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Centre_1DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Periphery_1DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Centre_0DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Periphery_0DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_b_K", "units": "microS", "component": "potassium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_b_K_Centre_Published", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Periphery_Published", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Centre_1DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Periphery_1DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Centre_0DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Periphery_0DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, - {"name": "E_K", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_b_Ca", "units": "microS", "component": "calcium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_b_Ca_Centre_Published", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Periphery_Published", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Centre_1DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Periphery_1DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Centre_0DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Periphery_0DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, - {"name": "E_Ca", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "k_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.COMPUTED_CONSTANT}, {"name": "k_NaCa_Centre_Published", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Periphery_Published", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Centre_1DCapable", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, @@ -105,7 +80,6 @@ class VariableType(Enum): {"name": "Na_o", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "Ca_i", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "d_NaCa", "units": "dimensionless", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, - {"name": "i_p_max", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_p_max_Centre_Published", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Periphery_Published", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Centre_1DCapable", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, @@ -115,7 +89,6 @@ class VariableType(Enum): {"name": "K_o", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "K_m_K", "units": "millimolar", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "K_m_Na", "units": "millimolar", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, - {"name": "i_Ca_p_max", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_Ca_p_max_Centre_Published", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Periphery_Published", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Centre_1DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, @@ -123,23 +96,12 @@ class VariableType(Enum): {"name": "i_Ca_p_max_Centre_0DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Periphery_0DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "K_i", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, - {"name": "E_K_s", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Na", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na_Centre_Published", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Periphery_Published", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Centre_1DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Periphery_1DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Centre_0DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Periphery_0DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, - {"name": "h", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "m_infinity", "units": "dimensionless", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_m", "units": "second", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, - {"name": "F_Na", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "h1_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_h1", "units": "second", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "h2_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_h2", "units": "second", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Ca_L", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Ca_L_Centre_Published", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Periphery_Published", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Centre_1DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, @@ -147,15 +109,6 @@ class VariableType(Enum): {"name": "g_Ca_L_Centre_0DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Periphery_0DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "E_Ca_L", "units": "millivolt", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, - {"name": "d_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_d_L", "units": "second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_d_L", "units": "per_second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_d_L", "units": "per_second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "f_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_f_L", "units": "second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_f_L", "units": "per_second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_f_L", "units": "per_second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Ca_T", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Ca_T_Centre_Published", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Periphery_Published", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Centre_1DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, @@ -163,69 +116,115 @@ class VariableType(Enum): {"name": "g_Ca_T_Centre_0DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Periphery_0DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "E_Ca_T", "units": "millivolt", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, - {"name": "d_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_d_T", "units": "second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_d_T", "units": "per_second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_d_T", "units": "per_second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "f_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_f_T", "units": "second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_f_T", "units": "per_second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_f_T", "units": "per_second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_to", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_to_Centre_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Periphery_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Centre_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Periphery_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Centre_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Periphery_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, - {"name": "g_sus", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_sus_Centre_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Periphery_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Centre_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Periphery_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Centre_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Periphery_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, - {"name": "q_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_q", "units": "second", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, - {"name": "r_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_r", "units": "second", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_K_r", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_K_r_Centre_Published", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Periphery_Published", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Centre_1DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Periphery_1DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Centre_0DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Periphery_0DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, - {"name": "P_a", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, - {"name": "P_af_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_P_af", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, - {"name": "P_as_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_P_as", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_P_i", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "P_i_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_K_s", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_K_s_Centre_Published", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Periphery_Published", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Centre_1DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Periphery_1DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Centre_0DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Periphery_0DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, - {"name": "alpha_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_f_Na", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_Na_Centre_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Periphery_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Centre_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Periphery_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Centre_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Periphery_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, - {"name": "g_f_K", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_K_Centre_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Periphery_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Centre_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Periphery_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Centre_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Periphery_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, + {"name": "FCell", "units": "dimensionless", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "Cm", "units": "microF", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Ca_p", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_b_Na", "units": "microS", "component": "sodium_background_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_b_K", "units": "microS", "component": "potassium_background_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_b_Ca", "units": "microS", "component": "calcium_background_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Ca", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "k_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_p_max", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Ca_p_max", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K_s", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_Na", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_Ca_L", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_Ca_T", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_to", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_sus", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_K_r", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "tau_P_i", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_K_s", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_f_Na", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_f_K", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Na", "units": "nanoA", "component": "sodium_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_p", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.ALGEBRAIC}, + {"name": "i_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.ALGEBRAIC}, + {"name": "i_b_K", "units": "nanoA", "component": "potassium_background_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_b_Ca", "units": "nanoA", "component": "calcium_background_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_b_Na", "units": "nanoA", "component": "sodium_background_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_f_K", "units": "nanoA", "component": "hyperpolarisation_activated_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_f_Na", "units": "nanoA", "component": "hyperpolarisation_activated_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K_s", "units": "nanoA", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K_r", "units": "nanoA", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_sus", "units": "nanoA", "component": "four_AP_sensitive_currents", "type": VariableType.ALGEBRAIC}, + {"name": "i_to", "units": "nanoA", "component": "four_AP_sensitive_currents", "type": VariableType.ALGEBRAIC}, + {"name": "i_Ca_T", "units": "nanoA", "component": "T_type_Ca_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Ca_L", "units": "nanoA", "component": "L_type_Ca_channel", "type": VariableType.ALGEBRAIC}, + {"name": "h", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "m_infinity", "units": "dimensionless", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_m", "units": "second", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, + {"name": "F_Na", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "h1_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_h1", "units": "second", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "h2_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_h2", "units": "second", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "d_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_d_L", "units": "second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_d_L", "units": "per_second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "beta_d_L", "units": "per_second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "f_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_f_L", "units": "second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_f_L", "units": "per_second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "beta_f_L", "units": "per_second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "d_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_d_T", "units": "second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_d_T", "units": "per_second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "beta_d_T", "units": "per_second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "f_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_f_T", "units": "second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_f_T", "units": "per_second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "beta_f_T", "units": "per_second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "q_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_q", "units": "second", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, + {"name": "r_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_r", "units": "second", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, + {"name": "P_a", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, + {"name": "P_af_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_P_af", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, + {"name": "P_as_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_P_as", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, + {"name": "P_i_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, + {"name": "beta_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_y", "units": "per_second", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_y", "units": "per_second", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.ALGEBRAIC} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c index cd52f74514..1d4908a139 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 9; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,24 +24,24 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", EXTERNAL}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"i_Stim", "microA_per_cm2", "membrane", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py index a741566be0..5a01f6f0a8 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 9 +EXTERNAL_COUNT = 1 class VariableType(Enum): @@ -33,24 +33,24 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c index f687edd86f..68474ef4fe 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 10; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,22 +23,22 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} }; diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c index c56e1e8f48..69c72fb83b 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 2; +const size_t ALGEBRAIC_COUNT = 10; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,24 +24,24 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", EXTERNAL}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"E_L", "millivolt", "leakage_current", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py index 796983378f..39e9f1d653 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 2 +ALGEBRAIC_COUNT = 10 +EXTERNAL_COUNT = 1 class VariableType(Enum): @@ -33,24 +33,24 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.EXTERNAL}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c index 1cc4901fd0..d9d05dbabc 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 4; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 10; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,24 +24,24 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { + {"E_R", "millivolt", "membrane", CONSTANT}, + {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, + {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, - {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, - {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, - {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py index b78d3d5880..3749793d0d 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 4 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 10 +EXTERNAL_COUNT = 1 class VariableType(Enum): @@ -33,24 +33,24 @@ class VariableType(Enum): ] VARIABLE_INFO = [ + {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, + {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, - {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c index cfcaf93f2c..4048ffd583 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 10; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,22 +23,22 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} }; @@ -491,22 +490,22 @@ void findRoot16(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *constants) { - algebraic[0] = 0.0; - algebraic[1] = 0.0; - algebraic[2] = 0.0; - algebraic[3] = 0.0; constants[0] = 1.0; constants[1] = 0.0; - computedConstants[0] = 0.0; constants[2] = 0.3; - computedConstants[1] = 0.0; constants[3] = 120.0; + constants[4] = 36.0; + computedConstants[0] = 0.0; + computedConstants[1] = 0.0; + computedConstants[2] = 0.0; + algebraic[0] = 0.0; + algebraic[1] = 0.0; + algebraic[2] = 0.0; + algebraic[3] = 0.0; algebraic[4] = 0.0; algebraic[5] = 0.0; algebraic[6] = 0.0; algebraic[7] = 0.0; - computedConstants[2] = 0.0; - constants[4] = 36.0; algebraic[8] = 0.0; algebraic[9] = 0.0; states[0] = 0.0; diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.h index be76c88f61..2379ada7dc 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.h +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py index fbc3704f87..cbeb56196a 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 10 class VariableType(Enum): @@ -32,22 +31,22 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} ] @@ -434,22 +433,22 @@ def find_root_16(voi, states, rates, variables): def initialise_variables(states, rates, constants): - algebraic[0] = 0.0 - algebraic[1] = 0.0 - algebraic[2] = 0.0 - algebraic[3] = 0.0 constants[0] = 1.0 constants[1] = 0.0 - computed_constants[0] = 0.0 constants[2] = 0.3 - computed_constants[1] = 0.0 constants[3] = 120.0 + constants[4] = 36.0 + computed_constants[0] = 0.0 + computed_constants[1] = 0.0 + computed_constants[2] = 0.0 + algebraic[0] = 0.0 + algebraic[1] = 0.0 + algebraic[2] = 0.0 + algebraic[3] = 0.0 algebraic[4] = 0.0 algebraic[5] = 0.0 algebraic[6] = 0.0 algebraic[7] = 0.0 - computed_constants[2] = 0.0 - constants[4] = 36.0 algebraic[8] = 0.0 algebraic[9] = 0.0 states[0] = 0.0 diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c index 2da76b8e8d..e38ef8855e 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 8; +const size_t EXTERNAL_COUNT = 2; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,23 +24,23 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", EXTERNAL}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"i_Stim", "microA_per_cm2", "membrane", EXTERNAL}, {"beta_n", "per_millisecond", "potassium_channel_n_gate", EXTERNAL} }; diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py index 4a645f0713..98ab308f32 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 8 +EXTERNAL_COUNT = 2 class VariableType(Enum): @@ -33,23 +33,23 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c index 50798a7967..91f595dd07 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 4; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 12; +const size_t EXTERNAL_COUNT = 2; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,24 +24,24 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, + {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, + {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, - {"E_R", "millivolt", "membrane", EXTERNAL}, {"E_L", "millivolt", "leakage_current", ALGEBRAIC}, - {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, {"E_Na", "millivolt", "sodium_channel", ALGEBRAIC}, - {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", EXTERNAL}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"E_R", "millivolt", "membrane", EXTERNAL}, + {"E_K", "millivolt", "potassium_channel", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py index e83d4154ec..7785dba580 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 4 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 12 +EXTERNAL_COUNT = 2 class VariableType(Enum): @@ -33,24 +33,24 @@ class VariableType(Enum): ] VARIABLE_INFO = [ + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, + {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.EXTERNAL}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c index c608b0c7f5..3193041ba2 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 18; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 3; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 10; +const size_t EXTERNAL_COUNT = 2; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,24 +24,24 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { + {"E_R", "millivolt", "membrane", CONSTANT}, + {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, - {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, - {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, - {"g_Na", "milliS_per_cm2", "sodium_channel", EXTERNAL}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, + {"g_Na", "milliS_per_cm2", "sodium_channel", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py index 81364cfcb3..49f7f8bcb6 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 3 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 10 +EXTERNAL_COUNT = 2 class VariableType(Enum): @@ -33,24 +33,24 @@ class VariableType(Enum): ] VARIABLE_INFO = [ + {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, + {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, - {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.EXTERNAL}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c index 5627364ba8..a36578b7b9 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 20; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 10; +const size_t EXTERNAL_COUNT = 2; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -22,26 +22,26 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"V", "millivolt", "membrane", EXTERNAL}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, - {"m", "dimensionless", "sodium_channel_m_gate", EXTERNAL}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"V", "millivolt", "membrane", EXTERNAL}, + {"m", "dimensionless", "sodium_channel_m_gate", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py index d887340c1b..10b92a843f 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 20 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 10 +EXTERNAL_COUNT = 2 class VariableType(Enum): @@ -31,26 +31,26 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, - {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.EXTERNAL}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c index 329a24f94a..3cb02dcd1c 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 3; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 19; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 8; +const size_t EXTERNAL_COUNT = 3; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -23,25 +23,25 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"V", "millivolt", "membrane", EXTERNAL}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", EXTERNAL}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, - {"alpha_n", "per_millisecond", "potassium_channel_n_gate", EXTERNAL}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"V", "millivolt", "membrane", EXTERNAL}, + {"i_Na", "microA_per_cm2", "sodium_channel", EXTERNAL}, + {"alpha_n", "per_millisecond", "potassium_channel_n_gate", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py index 019a0c8577..1f15be90f4 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 3 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 19 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 8 +EXTERNAL_COUNT = 3 class VariableType(Enum): @@ -32,25 +32,25 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.EXTERNAL}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, - {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.EXTERNAL}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.EXTERNAL}, + {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.h index be76c88f61..2379ada7dc 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.h +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py index b37f2884e9..de38477e32 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 18 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 10 class VariableType(Enum): @@ -32,22 +31,22 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} ] diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c index 1f5098cc59..a1ec41db71 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c @@ -9,10 +9,10 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 3; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 19; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 5; +const size_t COMPUTED_CONSTANT_COUNT = 3; +const size_t ALGEBRAIC_COUNT = 10; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -23,25 +23,25 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, - {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, - {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, - {"m", "dimensionless", "sodium_channel_m_gate", EXTERNAL}, + {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, + {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, + {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, + {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"E_K", "millivolt", "potassium_channel", COMPUTED_CONSTANT}, - {"g_K", "milliS_per_cm2", "potassium_channel", CONSTANT}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, - {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} + {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, + {"m", "dimensionless", "sodium_channel_m_gate", EXTERNAL} }; double * createStatesArray() diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py index b68a159ffe..2ed93ed11c 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py @@ -8,10 +8,10 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 3 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 19 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 5 +COMPUTED_CONSTANT_COUNT = 3 +ALGEBRAIC_COUNT = 10 +EXTERNAL_COUNT = 1 class VariableType(Enum): @@ -32,25 +32,25 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, - {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.EXTERNAL}, + {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, + {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "potassium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_K", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} + {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/noble_model_1962/model.c b/tests/resources/generator/noble_model_1962/model.c index b2b3956e7f..01b9013b68 100644 --- a/tests/resources/generator/noble_model_1962/model.c +++ b/tests/resources/generator/noble_model_1962/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 4; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 5; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 17; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 12; const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF_INTEGRATION}; @@ -24,15 +23,15 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"i_Leak", "microA_per_cm2", "leakage_current", ALGEBRAIC}, - {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, {"E_L", "millivolt", "leakage_current", CONSTANT}, - {"g_Na", "milliS_per_cm2", "sodium_channel", ALGEBRAIC}, {"g_Na_max", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"E_Na", "millivolt", "sodium_channel", CONSTANT}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, + {"i_Leak", "microA_per_cm2", "leakage_current", ALGEBRAIC}, + {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, + {"g_Na", "milliS_per_cm2", "sodium_channel", ALGEBRAIC}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, diff --git a/tests/resources/generator/noble_model_1962/model.h b/tests/resources/generator/noble_model_1962/model.h index 8149205d0d..a4c365da25 100644 --- a/tests/resources/generator/noble_model_1962/model.h +++ b/tests/resources/generator/noble_model_1962/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/noble_model_1962/model.py b/tests/resources/generator/noble_model_1962/model.py index 8fb96500a0..4eb81b090f 100644 --- a/tests/resources/generator/noble_model_1962/model.py +++ b/tests/resources/generator/noble_model_1962/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 4 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 5 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 17 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 12 class VariableType(Enum): @@ -32,15 +31,15 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "i_Leak", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, - {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "g_Na_max", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Leak", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, + {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, diff --git a/tests/resources/generator/ode_computed_var_on_rhs/model.c b/tests/resources/generator/ode_computed_var_on_rhs/model.c index 4e94793685..1eadd46729 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs/model.c +++ b/tests/resources/generator/ode_computed_var_on_rhs/model.c @@ -10,9 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_computed_var_on_rhs/model.h b/tests/resources/generator/ode_computed_var_on_rhs/model.h index cc72c5b3a4..3f1fb63fd2 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs/model.h +++ b/tests/resources/generator/ode_computed_var_on_rhs/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_computed_var_on_rhs/model.py b/tests/resources/generator/ode_computed_var_on_rhs/model.py index 4c7b0bfdfa..6de2a7b40a 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs/model.py +++ b/tests/resources/generator/ode_computed_var_on_rhs/model.py @@ -9,9 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c index 9462cd1ded..35629691c5 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c +++ b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c @@ -10,9 +10,8 @@ const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.h b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.h index 89890cfa68..ca79cc5f25 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.h +++ b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py index ff803cc8f1..48b38de074 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py +++ b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py @@ -9,9 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +COMPUTED_CONSTANT_COUNT = 1 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_const_var_on_rhs/model.c b/tests/resources/generator/ode_const_var_on_rhs/model.c index 6c6342e787..7324a50b7b 100644 --- a/tests/resources/generator/ode_const_var_on_rhs/model.c +++ b/tests/resources/generator/ode_const_var_on_rhs/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_const_var_on_rhs/model.h b/tests/resources/generator/ode_const_var_on_rhs/model.h index cc72c5b3a4..3f1fb63fd2 100644 --- a/tests/resources/generator/ode_const_var_on_rhs/model.h +++ b/tests/resources/generator/ode_const_var_on_rhs/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_const_var_on_rhs/model.py b/tests/resources/generator/ode_const_var_on_rhs/model.py index 283bdd003b..913f34ea27 100644 --- a/tests/resources/generator/ode_const_var_on_rhs/model.py +++ b/tests/resources/generator/ode_const_var_on_rhs/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c index 0b0fb3bb34..2e3fe1c553 100644 --- a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c +++ b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.h b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.h index 89890cfa68..ca79cc5f25 100644 --- a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.h +++ b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py index 986a9feb16..65e03adfd4 100644 --- a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py +++ b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_constant_on_rhs/model.c b/tests/resources/generator/ode_constant_on_rhs/model.c index 83124f7ed9..71e7ea5a8a 100644 --- a/tests/resources/generator/ode_constant_on_rhs/model.c +++ b/tests/resources/generator/ode_constant_on_rhs/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 0; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_constant_on_rhs/model.h b/tests/resources/generator/ode_constant_on_rhs/model.h index cc72c5b3a4..3f1fb63fd2 100644 --- a/tests/resources/generator/ode_constant_on_rhs/model.h +++ b/tests/resources/generator/ode_constant_on_rhs/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_constant_on_rhs/model.py b/tests/resources/generator/ode_constant_on_rhs/model.py index 00b49ef0fe..bc525feb58 100644 --- a/tests/resources/generator/ode_constant_on_rhs/model.py +++ b/tests/resources/generator/ode_constant_on_rhs/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 0 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_constant_on_rhs_one_component/model.c b/tests/resources/generator/ode_constant_on_rhs_one_component/model.c index 997ae718f5..a37c8889b6 100644 --- a/tests/resources/generator/ode_constant_on_rhs_one_component/model.c +++ b/tests/resources/generator/ode_constant_on_rhs_one_component/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 0; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_constant_on_rhs_one_component/model.h b/tests/resources/generator/ode_constant_on_rhs_one_component/model.h index 89890cfa68..ca79cc5f25 100644 --- a/tests/resources/generator/ode_constant_on_rhs_one_component/model.h +++ b/tests/resources/generator/ode_constant_on_rhs_one_component/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_constant_on_rhs_one_component/model.py b/tests/resources/generator/ode_constant_on_rhs_one_component/model.py index 72fd031fc9..22311d1da6 100644 --- a/tests/resources/generator/ode_constant_on_rhs_one_component/model.py +++ b/tests/resources/generator/ode_constant_on_rhs_one_component/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 0 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.c b/tests/resources/generator/ode_multiple_dependent_odes/model.c index 6d83c015ca..d8bbbf62ad 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.c +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.h b/tests/resources/generator/ode_multiple_dependent_odes/model.h index 14013eaefa..cc74aaa0bd 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.h +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.py b/tests/resources/generator/ode_multiple_dependent_odes/model.py index 9f9df39e8b..a6af28cef0 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.py +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c index 21f46b37f5..9ce2fe018f 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c +++ b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.h b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.h index 2c7d5a183c..f0d48d38d5 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.h +++ b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py index b4fff77d2c..faa79d3225 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py +++ b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_multiple_odes_with_same_name/model.c b/tests/resources/generator/ode_multiple_odes_with_same_name/model.c index 4612882189..82e57fc2df 100644 --- a/tests/resources/generator/ode_multiple_odes_with_same_name/model.c +++ b/tests/resources/generator/ode_multiple_odes_with_same_name/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_multiple_odes_with_same_name/model.h b/tests/resources/generator/ode_multiple_odes_with_same_name/model.h index d4cb731d44..0b0953abe2 100644 --- a/tests/resources/generator/ode_multiple_odes_with_same_name/model.h +++ b/tests/resources/generator/ode_multiple_odes_with_same_name/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_multiple_odes_with_same_name/model.py b/tests/resources/generator/ode_multiple_odes_with_same_name/model.py index 67babcba79..2a5ff0d6c8 100644 --- a/tests/resources/generator/ode_multiple_odes_with_same_name/model.py +++ b/tests/resources/generator/ode_multiple_odes_with_same_name/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/ode_unknown_var_on_rhs/model.c b/tests/resources/generator/ode_unknown_var_on_rhs/model.c index e464292324..0b29e548b4 100644 --- a/tests/resources/generator/ode_unknown_var_on_rhs/model.c +++ b/tests/resources/generator/ode_unknown_var_on_rhs/model.c @@ -12,7 +12,6 @@ const size_t STATE_COUNT = 2; const size_t CONSTANT_COUNT = 0; const size_t COMPUTED_CONSTANT_COUNT = 0; const size_t ALGEBRAIC_COUNT = 0; -const size_t EXTERNAL_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/ode_unknown_var_on_rhs/model.h b/tests/resources/generator/ode_unknown_var_on_rhs/model.h index cc72c5b3a4..3f1fb63fd2 100644 --- a/tests/resources/generator/ode_unknown_var_on_rhs/model.h +++ b/tests/resources/generator/ode_unknown_var_on_rhs/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/ode_unknown_var_on_rhs/model.py b/tests/resources/generator/ode_unknown_var_on_rhs/model.py index a19fdebbf8..2f19ddc26b 100644 --- a/tests/resources/generator/ode_unknown_var_on_rhs/model.py +++ b/tests/resources/generator/ode_unknown_var_on_rhs/model.py @@ -11,7 +11,6 @@ CONSTANT_COUNT = 0 COMPUTED_CONSTANT_COUNT = 0 ALGEBRAIC_COUNT = 0 -EXTERNAL_COUNT = 0 class VariableType(Enum): diff --git a/tests/resources/generator/robertson_model_1966/model.dae.c b/tests/resources/generator/robertson_model_1966/model.dae.c index 63de63a9fc..81baaa83cd 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.c +++ b/tests/resources/generator/robertson_model_1966/model.dae.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 2; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 3; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 5; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 2; const VariableInfo VOI_INFO = {"t", "dimensionless", "main", VARIABLE_OF_INTEGRATION}; @@ -24,8 +23,8 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"k1", "dimensionless", "main", CONSTANT}, {"k3", "dimensionless", "main", CONSTANT}, - {"y3", "dimensionless", "main", ALGEBRAIC}, {"k2", "dimensionless", "main", CONSTANT}, + {"y3", "dimensionless", "main", ALGEBRAIC}, {"y2_scaled", "dimensionless", "main", ALGEBRAIC} }; @@ -94,8 +93,8 @@ void initialiseVariables(double *states, double *rates, double *constants) { constants[0] = 0.04; constants[1] = 1.0e4; - algebraic[0] = 0.0; constants[2] = 3.0e7; + algebraic[0] = 0.0; states[0] = 1.0; states[1] = 0.0; } diff --git a/tests/resources/generator/robertson_model_1966/model.dae.h b/tests/resources/generator/robertson_model_1966/model.dae.h index 653f64a637..bca2cef3a4 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.h +++ b/tests/resources/generator/robertson_model_1966/model.dae.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/robertson_model_1966/model.dae.py b/tests/resources/generator/robertson_model_1966/model.dae.py index b5f40fc30a..8a4f383de4 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.py +++ b/tests/resources/generator/robertson_model_1966/model.dae.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 2 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 3 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 5 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 2 class VariableType(Enum): @@ -32,8 +31,8 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "k1", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "k3", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, - {"name": "y3", "units": "dimensionless", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "k2", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, + {"name": "y3", "units": "dimensionless", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "y2_scaled", "units": "dimensionless", "component": "main", "type": VariableType.ALGEBRAIC} ] @@ -73,8 +72,8 @@ def find_root_0(voi, states, rates, variables): def initialise_variables(states, rates, constants): constants[0] = 0.04 constants[1] = 1.0e4 - algebraic[0] = 0.0 constants[2] = 3.0e7 + algebraic[0] = 0.0 states[0] = 1.0 states[1] = 0.0 diff --git a/tests/resources/generator/robertson_model_1966/model.ode.c b/tests/resources/generator/robertson_model_1966/model.ode.c index 0bc157d926..7bbd363e08 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.c +++ b/tests/resources/generator/robertson_model_1966/model.ode.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 3; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 3; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 4; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 1; const VariableInfo VOI_INFO = {"t", "dimensionless", "main", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/robertson_model_1966/model.ode.h b/tests/resources/generator/robertson_model_1966/model.ode.h index 653f64a637..bca2cef3a4 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.h +++ b/tests/resources/generator/robertson_model_1966/model.ode.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/robertson_model_1966/model.ode.py b/tests/resources/generator/robertson_model_1966/model.ode.py index f96e5d8786..2aaab1f031 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.py +++ b/tests/resources/generator/robertson_model_1966/model.ode.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 3 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 3 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 4 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 1 class VariableType(Enum): diff --git a/tests/resources/generator/sine_model_imports/model.c b/tests/resources/generator/sine_model_imports/model.c index 02fb665ff0..0c1602c01f 100644 --- a/tests/resources/generator/sine_model_imports/model.c +++ b/tests/resources/generator/sine_model_imports/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; -const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 10; -const size_t EXTERNAL_COUNT = 0; +const size_t CONSTANT_COUNT = 2; +const size_t COMPUTED_CONSTANT_COUNT = 5; +const size_t ALGEBRAIC_COUNT = 3; const VariableInfo VOI_INFO = {"x", "dimensionless", "main", VARIABLE_OF_INTEGRATION}; @@ -21,15 +20,15 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"sin", "dimensionless", "actual_sin", ALGEBRAIC}, {"deriv_approx_initial_value", "dimensionless", "main", CONSTANT}, - {"sin", "dimensionless", "parabolic_approx_sin", ALGEBRAIC}, {"C", "dimensionless", "main", CONSTANT}, {"k2_oPi", "dimensionless", "parabolic_approx_sin", COMPUTED_CONSTANT}, {"k2Pi", "dimensionless", "parabolic_approx_sin", COMPUTED_CONSTANT}, {"kPi_2", "dimensionless", "parabolic_approx_sin", COMPUTED_CONSTANT}, {"kPi", "dimensionless", "parabolic_approx_sin", COMPUTED_CONSTANT}, {"kPi_32", "dimensionless", "parabolic_approx_sin", COMPUTED_CONSTANT}, + {"sin", "dimensionless", "actual_sin", ALGEBRAIC}, + {"sin", "dimensionless", "parabolic_approx_sin", ALGEBRAIC}, {"z", "dimensionless", "parabolic_approx_sin", ALGEBRAIC} }; diff --git a/tests/resources/generator/sine_model_imports/model.h b/tests/resources/generator/sine_model_imports/model.h index ad2862fae3..93c965f336 100644 --- a/tests/resources/generator/sine_model_imports/model.h +++ b/tests/resources/generator/sine_model_imports/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/sine_model_imports/model.py b/tests/resources/generator/sine_model_imports/model.py index 4c559e5e17..8119f98058 100644 --- a/tests/resources/generator/sine_model_imports/model.py +++ b/tests/resources/generator/sine_model_imports/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 -COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 10 -EXTERNAL_COUNT = 0 +CONSTANT_COUNT = 2 +COMPUTED_CONSTANT_COUNT = 5 +ALGEBRAIC_COUNT = 3 class VariableType(Enum): @@ -29,15 +28,15 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "sin", "units": "dimensionless", "component": "actual_sin", "type": VariableType.ALGEBRAIC}, {"name": "deriv_approx_initial_value", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, - {"name": "sin", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.ALGEBRAIC}, {"name": "C", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "k2_oPi", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.COMPUTED_CONSTANT}, {"name": "k2Pi", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.COMPUTED_CONSTANT}, {"name": "kPi_2", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.COMPUTED_CONSTANT}, {"name": "kPi", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.COMPUTED_CONSTANT}, {"name": "kPi_32", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "sin", "units": "dimensionless", "component": "actual_sin", "type": VariableType.ALGEBRAIC}, + {"name": "sin", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.ALGEBRAIC}, {"name": "z", "units": "dimensionless", "component": "parabolic_approx_sin", "type": VariableType.ALGEBRAIC} ] diff --git a/tests/resources/generator/unknown_variable_as_external_variable/model.c b/tests/resources/generator/unknown_variable_as_external_variable/model.c index 015da83af5..9a6fb704d7 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.c +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.c @@ -8,13 +8,12 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 8; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 10; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 1; +const size_t EXTERNAL_COUNT = 1; const VariableInfo VARIABLE_INFO[] = { - {"v", "fmol_per_sec", "SLC_template3_ss", ALGEBRAIC}, {"E", "fmol", "SLC_template3_ss", CONSTANT}, {"P_0", "per_fmol_sec4", "SLC_template3_ss", CONSTANT}, {"q_Ao", "fmol", "SLC_template3_ss", CONSTANT}, @@ -23,6 +22,7 @@ const VariableInfo VARIABLE_INFO[] = { {"P_2", "per_fmol_sec3", "SLC_template3_ss", CONSTANT}, {"P_5", "per_sec3", "SLC_template3_ss", CONSTANT}, {"P_4", "per_fmol2_sec3", "SLC_template3_ss", CONSTANT}, + {"v", "fmol_per_sec", "SLC_template3_ss", ALGEBRAIC}, {"P_3", "per_fmol_sec3", "SLC_template3_ss", EXTERNAL} }; diff --git a/tests/resources/generator/unknown_variable_as_external_variable/model.py b/tests/resources/generator/unknown_variable_as_external_variable/model.py index e09f76a957..67a0315a54 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.py +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.py @@ -7,10 +7,10 @@ __version__ = "0.5.0" LIBCELLML_VERSION = "0.5.0" -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 8 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 10 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 1 +EXTERNAL_COUNT = 1 class VariableType(Enum): @@ -21,7 +21,6 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.ALGEBRAIC}, {"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "q_Ao", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, @@ -30,6 +29,7 @@ class VariableType(Enum): {"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_4", "units": "per_fmol2_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.ALGEBRAIC}, {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.EXTERNAL} ] diff --git a/tests/resources/generator/variable_initialised_using_a_constant/model.c b/tests/resources/generator/variable_initialised_using_a_constant/model.c index 004fa4ce55..bf4de6ab23 100644 --- a/tests/resources/generator/variable_initialised_using_a_constant/model.c +++ b/tests/resources/generator/variable_initialised_using_a_constant/model.c @@ -9,10 +9,9 @@ const char VERSION[] = "0.6.0"; const char LIBCELLML_VERSION[] = "0.5.0"; const size_t STATE_COUNT = 1; -const size_t CONSTANT_COUNT = 0; +const size_t CONSTANT_COUNT = 1; const size_t COMPUTED_CONSTANT_COUNT = 0; -const size_t ALGEBRAIC_COUNT = 1; -const size_t EXTERNAL_COUNT = 0; +const size_t ALGEBRAIC_COUNT = 0; const VariableInfo VOI_INFO = {"t", "second", "component_1", VARIABLE_OF_INTEGRATION}; diff --git a/tests/resources/generator/variable_initialised_using_a_constant/model.h b/tests/resources/generator/variable_initialised_using_a_constant/model.h index 890a583bb2..340f578dd8 100644 --- a/tests/resources/generator/variable_initialised_using_a_constant/model.h +++ b/tests/resources/generator/variable_initialised_using_a_constant/model.h @@ -11,7 +11,6 @@ extern const size_t STATE_COUNT; extern const size_t CONSTANT_COUNT; extern const size_t COMPUTED_CONSTANT_COUNT; extern const size_t ALGEBRAIC_COUNT; -extern const size_t EXTERNAL_COUNT; typedef enum { VARIABLE_OF_INTEGRATION, diff --git a/tests/resources/generator/variable_initialised_using_a_constant/model.py b/tests/resources/generator/variable_initialised_using_a_constant/model.py index 0c4afd7307..491332bdf0 100644 --- a/tests/resources/generator/variable_initialised_using_a_constant/model.py +++ b/tests/resources/generator/variable_initialised_using_a_constant/model.py @@ -8,10 +8,9 @@ LIBCELLML_VERSION = "0.5.0" STATE_COUNT = 1 -CONSTANT_COUNT = 0 +CONSTANT_COUNT = 1 COMPUTED_CONSTANT_COUNT = 0 -ALGEBRAIC_COUNT = 1 -EXTERNAL_COUNT = 0 +ALGEBRAIC_COUNT = 0 class VariableType(Enum):