-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreodp_runner.py
More file actions
executable file
·36 lines (24 loc) · 909 Bytes
/
Copy pathreodp_runner.py
File metadata and controls
executable file
·36 lines (24 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import fire
from os.path import dirname
import os.path
from os import path
def reodp_run(index):
name_before='Initial.dat'
name_='Initial_'+str(index)+'.dat'
current_dir=os.getcwd()
parent_dir=dirname(current_dir)
initial_path=current_dir+'/InputFiles/'+name_
final_path =current_dir+'/INDATA/'+name_before
copy_input_command = 'cp '+initial_path+' '+final_path
os.system(copy_input_command)
run_reodp_command1 = 'chmod +x REODP-v5.out'
run_reodp_command2 = './REODP-v5.out'
os.system(run_reodp_command1)
os.system(run_reodp_command2)
output_path=os.path.join(os.path.sep, current_dir,'OutputFiles')
os.makedirs(output_path, exist_ok=True)
copy_output_command1='cp ./HugoniotData.txt ./OutputFiles/HugoniotData_'+str(index)+'.txt'
os.system(copy_output_command1)
if __name__ == '__main__':
fire.Fire(reodp_run)