Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F124464952
cosolver_2_molix.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, Aug 2, 16:26
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Aug 4, 16:26 (2 d)
Engine
blob
Format
Raw Data
Handle
27856717
Attached To
rCOSOLVER COSOlver
cosolver_2_molix.py
View Options
#!/usr/bin/env python
# generates *.h5 files as input for molix
import
os
import
sys
import
h5py
as
h5
# Define directories
cwd
=
os
.
getcwd
()
# Where to find the cosolver *.h5 files
cosolver_dir
=
os
.
path
.
join
(
cwd
,
'dk.sugama.ab'
)
# Define size of matrices (all matrices are assumed to have the same size)
Pmaxi
=
25
Jmaxi
=
8
Pmaxe
=
25
Jmaxe
=
8
# Define h5 files to gather
eicolls_file
=
os
.
path
.
join
(
cwd
,
cosolver_dir
,
'ei_Coll_GKE_0_GKI_0_ETEST_3_EBACK_3_Pmaxe_25_Jmaxe_8_Pmaxi_25_Jmaxi_8_JE_12_tau_1.0000_mu_0.0233.h5'
)
iecolls_file
=
os
.
path
.
join
(
cwd
,
cosolver_dir
,
'ie_Coll_GKE_0_GKI_0_ITEST_3_IBACK_3_Pmaxe_25_Jmaxe_8_Pmaxi_25_Jmaxi_8_JE_12_tau_1.0000_mu_0.0233.h5'
)
selfcolls_file
=
os
.
path
.
join
(
cwd
,
cosolver_dir
,
'self_Coll_GKE_0_GKI_0_ESELF_3_ISELF_3_Pmaxe_25_Jmaxe_8_Pmaxi_25_Jmaxi_8_JE_12.h5'
)
# Define output filename
outputfilename
=
os
.
path
.
join
(
cwd
,
'sugama.h5'
)
# Open the h5 files in read mode
eih5
=
h5
.
File
(
eicolls_file
,
'r'
)
ieh5
=
h5
.
File
(
iecolls_file
,
'r'
)
selfh5
=
h5
.
File
(
selfcolls_file
,
'r'
)
# Create ouput file
outh5
=
h5
.
File
(
outputfilename
,
'w'
)
# Flush ei/ie/self collisions to output h5 file
outh5
.
create_dataset
(
"/Ceipj/CeipjF"
,
data
=
eih5
[
'/Ceipj/CeipjF'
])
outh5
.
create_dataset
(
"/Ceipj/CeipjT"
,
data
=
eih5
[
'/Ceipj/CeipjT'
])
outh5
.
create_dataset
(
"/Ceipj/fort.f90"
,
data
=
eih5
[
'/files/fort.f90'
])
outh5
.
create_dataset
(
"/Ciepj/CiepjF"
,
data
=
ieh5
[
'/Ciepj/CiepjF'
])
outh5
.
create_dataset
(
"/Ciepj/CiepjT"
,
data
=
ieh5
[
'/Ciepj/CiepjT'
])
outh5
.
create_dataset
(
"/Ciepj/fort.f90"
,
data
=
ieh5
[
'/files/fort.f90'
])
outh5
.
create_dataset
(
"/Ciipj"
,
data
=
selfh5
[
'/Caapj/Ciipj'
])
outh5
.
create_dataset
(
"/Ceepj"
,
data
=
selfh5
[
'/Caapj/Ciipj'
])
outh5
.
create_dataset
(
"/Caapj/fort.f90"
,
data
=
selfh5
[
'/files/fort.f90'
])
outh5
.
create_dataset
(
"/dims_i"
,
data
=
[
Pmaxi
,
Jmaxi
])
outh5
.
create_dataset
(
"/dims_e"
,
data
=
[
Pmaxe
,
Jmaxe
])
# Close file
outh5
.
close
()
Event Timeline
Log In to Comment