forked from sr76/excitingscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·61 lines (49 loc) · 2.39 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
#%%% -------------------------------- ElaStic@exciting-result -------------------------------- %%%#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
#
# AUTHORS:
# Rostam Golesorkhtabar and Pasquale Pavone
#
# DATE:
# Sun Jan 01 00:00:00 2012
#
# SYNTAX:
# python [email protected]
# ElaStic@exciting-result
#
# EXPLANATION:
#
#__________________________________________________________________________________________________
import sys
import os
#%%%--- Checking the INFO_ElaStic exist ---%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (os.path.exists('INFO_ElaStic') == False):
sys.exit('\n ... Oops ERROR: Where is the "INFO_ElaStic" file !?!?!? \n')
#--------------------------------------------------------------------------------------------------
#%%%--- Reading the INFO_ElaStic file ---%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
INFO=open('INFO_ElaStic', 'r')
l1 = INFO.readline()
ordr= int(l1.split()[-1])
if (ordr != 2 and ordr != 3):
sys.exit('\n ... Oops ERROR: The order of the elastic constant is NOT clear !?!?!?'\
'\n Something is WRONG in "INFO_ElaStic" file.\n')
l2 = INFO.readline()
mthd= l2.split()[-1]
if (mthd != 'Energy'):
sys.exit('\n ... Oops ERROR: The method of the calculation is NOT clear !?!?!?'\
'\n Something is WRONG in "INFO_ElaStic" file.\n')
INFO.close()
#--------------------------------------------------------------------------------------------------
#%%%--- Checking the ElaStic_???.in exist ---%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (ordr == 2):
if (os.path.exists('ElaStic_2nd.in') == False):
sys.exit('\n ... Oops ERROR: Where is the "ElaStic_2nd.in" file !?!?!?\n')
if (ordr == 3):
if (os.path.exists('ElaStic_3rd.in') == False):
sys.exit('\n ... Oops ERROR: Where is the "ElaStic_3rd.in" file !?!?!?\n')
#--------------------------------------------------------------------------------------------------------------------------------
if (mthd == 'Energy' and ordr == 2): os.system('ElaStic_Result_Energy_2nd.py')
if (mthd == 'Energy' and ordr == 3): os.system('ElaStic_Result_Energy_3rd.py')