now uses msc_tools method to figure out Mentat path
This commit is contained in:
parent
edb8c0cd1e
commit
aba7937845
|
@ -1,36 +1,15 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys, os
|
import sys, os, msc_tools
|
||||||
from colorsys import *
|
from colorsys import *
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
releases = {'2010':['linux64',''],
|
sys.path.append(msc_tools.MSC_TOOLS().library_paths())
|
||||||
'2008r1':[''],
|
|
||||||
'2007r1':[''],
|
|
||||||
'2005r3':[''],
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0])))
|
|
||||||
MSCpath = os.path.normpath(file.readline().strip())
|
|
||||||
file.close()
|
|
||||||
except:
|
|
||||||
MSCpath = '/msc'
|
|
||||||
|
|
||||||
for release,subdirs in sorted(releases.items(),reverse=True):
|
|
||||||
for subdir in subdirs:
|
|
||||||
libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir)
|
|
||||||
if os.path.exists(libPath):
|
|
||||||
sys.path.append(libPath)
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
continue
|
|
||||||
break
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from py_mentat import *
|
from py_mentat import *
|
||||||
except:
|
except:
|
||||||
print('warning: no valid Mentat release found in %s'%MSCpath)
|
print('warning: no valid Mentat release found')
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
@ -135,7 +114,9 @@ For symmetric scales use option "-s".
|
||||||
Example colors:
|
Example colors:
|
||||||
- Non-symmetric scales: 0.167,0.9,0.1 0.167,0.1,0.9
|
- Non-symmetric scales: 0.167,0.9,0.1 0.167,0.1,0.9
|
||||||
- Symmetric scales: 0,0.2,0.9 0.333,0.2,0.9
|
- Symmetric scales: 0,0.2,0.9 0.333,0.2,0.9
|
||||||
""")
|
""" + string.replace('$Id$','\n','\\n')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
parser.add_option("-s","--symmetric", action = "store_true",
|
parser.add_option("-s","--symmetric", action = "store_true",
|
||||||
dest = "symmetric", \
|
dest = "symmetric", \
|
||||||
|
|
|
@ -1,36 +1,14 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys,os,pwd,math,re,string
|
import sys,os,pwd,math,re,string,msc_tools
|
||||||
#import Image,ImageDraw
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
releases = {'2010':['linux64',''],
|
sys.path.append(msc_tools.MSC_TOOLS().library_paths())
|
||||||
'2008r1':[''],
|
|
||||||
'2007r1':[''],
|
|
||||||
'2005r3':[''],
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0])))
|
|
||||||
MSCpath = os.path.normpath(file.readline().strip())
|
|
||||||
file.close()
|
|
||||||
except:
|
|
||||||
MSCpath = '/msc'
|
|
||||||
|
|
||||||
for release,subdirs in sorted(releases.items(),reverse=True):
|
|
||||||
for subdir in subdirs:
|
|
||||||
libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir)
|
|
||||||
if os.path.exists(libPath):
|
|
||||||
sys.path.append(libPath)
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
continue
|
|
||||||
break
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from py_mentat import *
|
from py_mentat import *
|
||||||
except:
|
except:
|
||||||
print('error: no valid Mentat release found in %s'%MSCpath)
|
print('error: no valid Mentat release found')
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,7 +145,7 @@ def servoLink():
|
||||||
parser = OptionParser(usage='%prog [options]', description = """
|
parser = OptionParser(usage='%prog [options]', description = """
|
||||||
Set up servo linking to achieve periodic boundary conditions for a regular hexahedral mesh presently opened in MSC.Mentat
|
Set up servo linking to achieve periodic boundary conditions for a regular hexahedral mesh presently opened in MSC.Mentat
|
||||||
|
|
||||||
""" + string.replace('$Id: spectral_iterationCount 919 2011-06-15 18:14:05Z MPIE\p.eisenlohr $','\n','\\n')
|
""" + string.replace('$Id$','\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option("-p", "--port", type="int",\
|
parser.add_option("-p", "--port", type="int",\
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, sys, math, re, threading, time, string
|
import os, sys, math, re, threading, time, string, msc_tools
|
||||||
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
|
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
|
||||||
|
|
||||||
releases = {'2010':['linux64',''],
|
|
||||||
'2008r1':[''],
|
|
||||||
'2007r1':[''],
|
|
||||||
'2005r3':[''],
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------- FUNCTIONS ----------------------------
|
# ----------------------- FUNCTIONS ----------------------------
|
||||||
|
|
||||||
|
@ -256,27 +251,12 @@ parser.set_defaults(homogenization = 1)
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
try:
|
sys.path.append(msc_tools.MSC_TOOLS().library_paths())
|
||||||
file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0])))
|
|
||||||
MSCpath = os.path.normpath(file.readline().strip())
|
|
||||||
file.close()
|
|
||||||
except:
|
|
||||||
MSCpath = '/msc'
|
|
||||||
|
|
||||||
for release,subdirs in sorted(releases.items(),reverse=True):
|
|
||||||
for subdir in subdirs:
|
|
||||||
libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir)
|
|
||||||
if os.path.exists(libPath):
|
|
||||||
sys.path.append(libPath)
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
continue
|
|
||||||
break
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from py_mentat import *
|
from py_mentat import *
|
||||||
except:
|
except:
|
||||||
print('no valid Mentat release found in %s'%MSCpath)
|
print('no valid Mentat release found')
|
||||||
if options.port != None: sys.exit(-1)
|
if options.port != None: sys.exit(-1)
|
||||||
|
|
||||||
if not os.path.isfile(args[0]):
|
if not os.path.isfile(args[0]):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys,os,math,re,string
|
import sys,os,math,re,string, msc_tools
|
||||||
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
|
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,27 +10,7 @@ try: # check for Python Image Lib
|
||||||
except:
|
except:
|
||||||
ImageCapability = False
|
ImageCapability = False
|
||||||
|
|
||||||
try: # check for MSC.Mentat installation location
|
sys.path.append(msc_tools.MSC_TOOLS().library_paths())
|
||||||
file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0])))
|
|
||||||
MSCpath = os.path.normpath(file.readline().strip())
|
|
||||||
file.close()
|
|
||||||
except:
|
|
||||||
MSCpath = '/msc'
|
|
||||||
|
|
||||||
releases = {'2010':['linux64',''],
|
|
||||||
'2008r1':[''],
|
|
||||||
'2007r1':[''],
|
|
||||||
'2005r3':[''],
|
|
||||||
}
|
|
||||||
for release,subdirs in sorted(releases.items(),reverse=True):
|
|
||||||
for subdir in subdirs:
|
|
||||||
libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir)
|
|
||||||
if os.path.exists(libPath):
|
|
||||||
sys.path.append(libPath)
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
continue
|
|
||||||
break
|
|
||||||
|
|
||||||
try: # check for MSC.Mentat Python interface
|
try: # check for MSC.Mentat Python interface
|
||||||
from py_mentat import *
|
from py_mentat import *
|
||||||
|
@ -794,7 +774,7 @@ parser = OptionParser(option_class=extendedOption, usage='%prog [options] datafi
|
||||||
Produce image, spectral geometry description, and (auto) Mentat procedure from TSL/OIM
|
Produce image, spectral geometry description, and (auto) Mentat procedure from TSL/OIM
|
||||||
reconstructed boundary file
|
reconstructed boundary file
|
||||||
|
|
||||||
""" + string.replace('$Id: spectral_iterationCount 919 2011-06-15 18:14:05Z MPIE\p.eisenlohr $','\n','\\n')
|
""" + string.replace('$Id$','\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option("-o", "--output", action='extend', dest='output', type='string', \
|
parser.add_option("-o", "--output", action='extend', dest='output', type='string', \
|
||||||
|
|
Loading…
Reference in New Issue