Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63214208
run_mech.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 18, 12:58
Size
1 KB
Mime Type
text/x-python
Expires
Mon, May 20, 12:58 (2 d)
Engine
blob
Format
Raw Data
Handle
17745784
Attached To
R4670 PySONIC (old)
run_mech.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Email: theo.lemaire@epfl.ch
# @Date: 2016-11-21 10:46:56
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2019-07-01 15:49:33
''' Run simulations of the NICE mechanical model. '''
from
PySONIC.core
import
BilayerSonophore
,
Batch
from
PySONIC.utils
import
logger
from
PySONIC.parsers
import
MechSimParser
def
main
():
# Parse command line arguments
parser
=
MechSimParser
()
args
=
parser
.
parse
()
logger
.
setLevel
(
args
[
'loglevel'
])
# Run MECH batch
logger
.
info
(
"Starting mechanical simulation batch"
)
queue
=
BilayerSonophore
.
simQueue
(
*
parser
.
parseSimInputs
(
args
),
outputdir
=
args
[
'outputdir'
])
output
=
[]
for
a
in
args
[
'radius'
]:
for
d
in
args
[
'embedding'
]:
for
Cm0
in
args
[
'Cm0'
]:
for
Qm0
in
args
[
'Qm0'
]:
bls
=
BilayerSonophore
(
a
,
Cm0
,
Qm0
,
embedding_depth
=
d
)
batch
=
Batch
(
bls
.
simAndSave
if
args
[
'save'
]
else
bls
.
simulate
,
queue
)
output
+=
batch
(
mpi
=
args
[
'mpi'
],
loglevel
=
args
[
'loglevel'
])
# Plot resulting profiles
if
args
[
'plot'
]
is
not
None
:
parser
.
parsePlot
(
args
,
output
)
if
__name__
==
'__main__'
:
main
()
Event Timeline
Log In to Comment