-
Notifications
You must be signed in to change notification settings - Fork 6
/
ElaStic_Analyze
executable file
·49 lines (40 loc) · 1.79 KB
/
ElaStic_Analyze
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
#!/usr/bin/env python
#%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%#
#%!%!% ---------------------------------- ElaStic_Analyze ---------------------------------- %!%!%#
#%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%#
# AUTHOR:
# Rostam Golesorkhtabar
# r.golesorkhtabar@gmail.com
#
# DATE:
# Sun Jan 01 00:00:00 2012
#
# SYNTAX:
# python ElaStic_Analyze.py
# ElaStic_Analyze
#
# EXPLANATION:
#
#__________________________________________________________________________________________________
import sys
import os
#%!%!%--- Checking the "INFO_ElaStic" file 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 the "INFO_ElaStic" file.\n')
l2 = INFO.readline()
mthd= l2.split()[-1]
if (mthd != 'Stress' and mthd != 'Energy'):
sys.exit('\n.... Oops ERROR: The method of the calculation is NOT clear !?!?!?'\
'\n Something is WRONG in the "INFO_ElaStic" file.\n')
INFO.close()
#--------------------------------------------------------------------------------------------------
if (mthd == 'Energy'): os.system('ElaStic_Analyze_Energy')
if (mthd == 'Stress'): os.system('ElaStic_Analyze_Stress')