Nektar++
Loading...
Searching...
No Matches
_exporter.py
Go to the documentation of this file.
2# Exports to Nektar
3#
4# This file is derived from AnsiCExporter in myokit.
5# See http://myokit.org for copyright, sharing, and licensing details.
6#
7
8import os
9
10import myokit.formats
11
12class NektarExporter(myokit.formats.TemplatedRunnableExporter):
13 """
14 This class exports a myokit cell model to Nektar++ code for
15 use in the CardiacEPSolver.
16 """
17 def info(self):
18 import inspect
19 return inspect.getdoc(self)
20
21 def _dir(self, root):
22 return os.path.join(os.getcwd(), 'nektar', 'template')
23
24 def _dict(self):
25 return {'model.cpp': 'model.cpp',
26 'model.h': 'model.h'}
27
28 def _vars(self, model, protocol, name=None, variants=None, initial_states=None):
29 if initial_states and not variants:
30 raise AssertionError('If `initial_states` is passed, `variants` must also be passed')
31 return {'model': model,
32 'protocol': protocol,
33 'name': name,
34 'variants': variants,
35 'initial_states': initial_states}
_vars(self, model, protocol, name=None, variants=None, initial_states=None)
Definition _exporter.py:28