OpenCMISS

OpenCMISS
& CellML
Chris Bradley1,2 & David Nickerson1
1Auckland
Bioengineering Institute,
University of Auckland.
2Department
of Physiology, Anatomy and
Genetics, University of Oxford.
Why OpenCMISS?
• We want to solve larger scale coupled models of the
heart, lungs, stomach and other biological systems than
we can currently solve
• We need to redevelop legacy CMISS computational code.
• Take advantage of modern High Performance computer
architectures.
OpenCMISS
• Re-engineering of CMISS
• Main website
– http://www.opencmiss.org/
• Open source on github
– https://github.com/organizations/OpenCMISS
• Fortran 95/2003.
• Object “based”
OpenCMISS Design Goals
1. It should be a library based rather than a
monolithic application.
2. It should use the Physiome standards FieldML
and CellML.
3. It should be a general code.
4. It should be an inherently parallel code.
5. It should be used, developed, and understood by
novices and experts alike.
6. It should deal with multiscale and multiphysics
applications and with complicated workflows.
OpenCMISS library
FieldML API
FieldML API
FieldML API
CellML API FieldML API
CellML API
CellML API
CellML API
core library
openCMISS library
openCMISS
openCMISS
(cm)
openCMISS
(cm)
OpenCMISS
(cm)
(cm)
FieldML file
CellML file
History file
Language
Language
Bindings
Language
Bindings
Language
Bindings
Fortran
Bindings
Fortran
Fortran
C/C++
Fortran
C/C++
C/C++
Python
C/C++
Python
Python
Etc.
Python
Etc.
Etc.
Etc.
External
External
Program
External
Program
External
or script
Program
or script
Program
or script
or script
OpenCOR
Com Layer
FieldML API
Cmgui
CellML API
Network
CellML file
Com Layer
Com Layer
Com Layer
FieldML API Com Layer
FieldML API
FieldML API
CellML API FieldML API
CellML API
CellML API
CellML API
OpenCMISS application
openCMISS
openCMISS
(cm)
openCMISS
(cm)
(cm)
OpenCMISS
FieldML file
History file
General parallel environment
CPU
CPU
CPU
CPU
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
Cache
Memory
Memory
Cache
Bus
Cache
Cache
Memory
Memory
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
Bus
Memory
Memory
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
Accel
Accel
Network
Network
Accel
Accel
Hierarchy of heterogeneous computing elements
Multi-scale & Multi-physics
• In order to accurately model biological
systems OpenCMISS must model multiple
physical systems at different time and space
scales.
• OpenCMISS deals with this via:
– A flexible system for describing multiple models,
solvers and workflows.
– Methods for coupling different physical systems
together.
– Handling different spatial and temporal scales via
FieldML and CellML
Multi-physics: Equations Sets
• Can be broken down into
– Linear/Nonlinear
– Dynamic/Static
• General form of OpenCMISS equations:
Example – Electrical Activation
(Bidomain representation)
Cell model =
Extracellular Space
 e,  e
Cell Membrane
Intracellular Space
 i,  i
Iion
Bidomain equations
Where:
–
–
–
–
–
–
–
–
–
–
–
Vm = transmembrane potential
i = intracellular potential
e = extracellular potential
Am = membrane surface/volume ratio
Cm = membrane capacitance
e = intracellular conductivity tensor
i = intracellular conductivity tensor
Iion = ionic source current from cellular model
Im = transmembrane stimulus current
ii = current injection per volume intro intracellular space
ie = current injection per volume intro extracellular space
Cellular processes
IKs
IKr1IKr2
INa
IK1 IKto
TropC
Calmodulin
Ca2+
+
Na
+
+K
K
+K
+K
+ K Magnesium Buffering
K
MgATP
MgADP
ICa-stretch MgPi
H+
IK-stretch
INa-stretch
INS-stretch
ImKATP
IAn-stretch
IpNa
Calcium Buffering
IKATP
+
IbNa
K+
Na+
Ca2+
DS Vdecay JSR
3MgADP+3Pi
Glycogenolysis
3MgATP
2Lac
IbCa
Vtr
Vrel
Ca2+
ADP
+
Na+
2Na
VCO2transport
H+
MgADP Intrinsic Buffers
AK
MgATP
ADP+H+
Cl
CK
ATP
Cl
+ HCO3
Na
NHE
CHE
NBC
3Na
+
H2PO4-
H+
+
+
2K
OH-
NPE
MgATP
MgATP Ca2+
+
H2PO-4
NSR
Vup
Contraction
Cr
LAT
Vleak
Ca2+
3H+
AMP
PCr
Ca2+
OxPhos
MgATP
MgADP+Pi+H+
K+
H
+
Na
Ca2+
Mg2+
Lac
+
Na
CO2
+
3Na
Ca2
+
NCE
HCO-3
CBE
Problem/Field description
I
I
K
r
1
I
K
t
o
I
K
I
1
I
K
K
r
2
s
I
N
I
a
b
N
I
a
p
N
a
TropC
K
A
T
P
Ca2+
Calmodulin
N
a
K
N
a
+
+
K
N
a
+
+
K
+
Ca 2+
+
K
K
+
K+
+
K
V
l
e
a
k
Na +
+
I
b
C
a
V
Ca 2+
MgATP
Ca 2+
t
r
MgADP
I
C
a
sI
tK
res
ttI
crN
ea
h
tcsI
t
h
N
r
S
estI
tcA
rh
n
ets
ct
r
h
e
t
c
h
r
e
Ca 2+
MgATP
l
Ca 2+
y
3MgADP+3Pi
3
N
a
M
g
A
T
P2
+
K
V
d
e
c
a
H+
NSR
p
DS
V
MgPi
V
u
JSR
Mg2+
+
+
3H+
H2PO4-
VCO2transport
H+
CO2
3MgATP
ImKATP
2Lac
ADP
MgADP
3
N
a
Intrinsic Buffers
AK
+
AMP
K
OxPhos
+
C
a
MgATP
ADP+H+
PCr
2
MgATP
+
MgADP+Pi+H+
C
l
-
CK
C
a
Cr
2
C
l
ATP
NCE
+
-
N
a
2
N
a
HCO-3
+
N
a
HCO-3
+
+
CBE
OHL
a
c
H+
CHE
H+
H
LAT
2
NPE
P
O
NHE
NBC
-
4
Fields:
• Geometric
• Fibre
• Material (i, e, Am, Cm etc.)
• Potential (Vm, e, etc.)
• Source (Iion, etc.)
• Cellular state variables
• Cellular intermediate variables
• Cellular parameter variables
Field parameter vector
33
31
Parameter vector,
x
35
29
21
Component,
u1
17
15
19
7
3
5
1
Field
variable,
u
32
30
29
22
Component,
u2
33
31
23
17
16
15
1
2
34
28
27
26
20
18
10
9
8
25
24
35
19
11
13
12
6
3
4
5
21
14
7
Global
DOFs
Electrophysiology - CellML
+50 mV
300%
-85 mV
100%
Stimulus off
Normal activation
gNa Distribution
+50 mV
+50 mV
-85 mV
-85 mV
gNa activation
Finite Elasticity – Breast
Mechanics
Skin
Undeformed
Deformed
Under gravity
loading
Courtesy of Prasad Gamage
Breast Tissue
Fluid Mechanics – 3D NS
Carotid Artery Flow, Re=100
Mesh
Courtesy of David Ladd
Velocity
Pressure
CellML as a DOF black box
Inputs
Outputs
Component
1
Field
variable
Component
2
Component
3
Parameter
DOF Vector
OpenCMISS CellML Import
CellML Environment
State
CellML Model
Parameters
Intermediate
CellML Variables
State Parameters Intermediate
void computeRates(
Set asdouble
knownVOI,
double *PARAMETERS,
double *RATES,
Set asdouble
wanted
*STATES,
double *INTERMEDIATE);
{
Set as known and wanted
const double FIXED[..];
Import
I
I
K
r
1
N
s
K
r
2
I
I
I
K
I
a
b
N
a
I
p
N
a
K
t
o
I
K
1
I
TropC
K
A
T
P
Ca2+
Calmodulin
N
a
N
a
+
K
+
+
K
N
a
+
K
+
+
Ca 2+
K
K
+
K+
+
V
K
I
l
e
a
Na +
+
b
C
a
k
V
t
Ca 2+
MgATP
Ca 2+
r
NSR
V
u
JSR
Mg2+
MgADP
ICa-stretch
p
3
N
a
+
V
V
d
e
c
a
r
e
l
y
H+
MgATP
DS
MgPi
+
Ca 2+
MgATP
2
K
Ca 2+
3MgADP+3Pi
+
IK-stretch
3H+
H2PO4VCO2transport
INa-stretch
H+
INS-stretch
CO2
3MgATP
ImKATP
IAn-stretch
2Lac
ADP
MgADP
3
N
a
Intrinsic Buffers
+
AK
AMP
K
C
a
2
OxPhos
+
MgATP
C
l
ADP+H+
PCr
+
-
MgATP
MgADP+Pi+H+
CK
C
a2
Cr
+
C
l
ATP
-
N
a
2
N
a
N
a
+
+
HCO-3
+
HCO-3
CBE
OHL
a
c
H+
CHE
H+
H
2
LAT
NPE
P
O
-
4
NHE
NBC
NCE
}
:
:
I
I
I
K
t
o
K
1
K
A
T
P
I
K
K
r
2
K
r
I
I
I
N
s
K
K
N
a
+
p
N
a
N
a
+
Ca 2+
N
a
+
+
K+
Na
V
+
Mg2+
MgADP
H+
JSR
DS
V
MgPi
Ca 2+
V
t
b
C
NSR
a
V
r
u
V
d
e
c
a
3MgADP+3Pi
I
l
e
a
k
Ca 2+
MgATP
C
a
I
sK
It-s
r
etN
ratI
e-c
s
tN
S
h
ctI
-r
h
sA
e
tn
t
r-c
es
h
t
rc
e
h
t
c
h
I
Ca2+
K
+
+
+
+
+
I
b
N
a
TropC
Calmodulin
K
I
a
1
K
K
3
N
a
M
g
A
2
T
K
P
p 2+
Ca
MgATP
r
2+
eCa
3H+
l
H2PO4-
y
+
VCO2transport
+
+
H+
CO2
3MgATP
ImKATP
2Lac
ADP
MgADP
Intrinsic Buffers
3
N
a
AK
AMP
C
OxPhos
a
K
+ MgADP+Pi+H+
2
+
MgATP
+
ADP+H+
PCr
M
g
A
T
P
C
l
CK
-
Cr
2
N
a
ATP
N
a
N
a
2
+
HCO-3
CBE
OH-
H+
LAT
CHE
H
NPE2
P
O
4
H+
NHE
C
a
C
l -3
HCO
-
+
+
+
L
a
c
NBC
NCE
CellML
environ
CellML Interface
OpenCMISS
Field
Models State
Parameters Intermediate
CellML
Fields
Cellular model
CellML
environ
CellML/Field Maps
Models State
Parameters Intermediate
Field tointegrate
CellML
to
CellML
field Map
Map
Transmembrane
Voltage Field
Constitutive
Law
CellML
environ
CellML/Field Maps
Models State
Parameters Intermediate
CellML
to
field Map
Field
toevaluate
CellML
Map
Strain Stress
Field Field
FPGA Acceleration
Investigating using Field Programmable Gate Array
(FPGAs) as accelerators for CellML equations (see
Ting’s talk next).
GPU Acceleration
Acknowledgements
• A (hopefully complete) list of those individuals who have
contributed to OpenCMISS (so far….)
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Bojan Blazevic
Andy Bowery
Chris Bradley
Randall Britten
Vincent Budelmann
Phani Chichapatnam
Richard Christie
Andrew Cookson
Andrew Crozier
Prasad Gamage
Arne Gjuvsland
Thomas Heidlauf
Alice Hung
Peter Hunter
Jagir Hussan
Chloe Irwin Whitney
Jessica Jor
Sebastian Krittian
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
David Ladd
Sander Land
Jack Lee
Caton Little
Xaio Bo Lu
Kumar Mithraratne
Christian Michler
Jennine Mitchell
Martyn Nash
David Nickerson
Steven Niederer
Poul Nielsen
Øyvind Nordbø
David Nordsletten
Stig Omholt
Ali Pashaei
Vijayaraghavan
Rajagopal
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Adam Reeve
Oliver Rohle
Ishani Roy
Ole W. Saastad
Soroush Safaei
Vickie Shim
Matt Sinclair
Nic Smith
Martin Steghofer
Merryn Tawhai
Mark Trew
Jon Olav Vik
Tim Wu
Robert Jiahe Xi
Nancy (Xiani) Yan
Ting Yu
Heye Zhang
Ju Zhang