restructured to get help even without mentat release
This commit is contained in:
parent
8474da26d9
commit
324c5b36d3
|
@ -7,6 +7,7 @@ import damask
|
||||||
|
|
||||||
scriptID = string.replace('$Id$','\n','\\n')
|
scriptID = string.replace('$Id$','\n','\\n')
|
||||||
scriptName = os.path.splitext(scriptID.split()[1])[0]
|
scriptName = os.path.splitext(scriptID.split()[1])[0]
|
||||||
|
sys.path.append(damask.solver.Marc().libraryPath('../../'))
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------------------------
|
||||||
def outMentat(cmd,locals):
|
def outMentat(cmd,locals):
|
||||||
|
@ -52,6 +53,7 @@ def init():
|
||||||
#-------------------------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------------------------
|
||||||
return [
|
return [
|
||||||
"#"+' '.join([scriptID] + sys.argv[1:]),
|
"#"+' '.join([scriptID] + sys.argv[1:]),
|
||||||
|
"*draw_manual", # prevent redrawing in Mentat, should be much faster
|
||||||
"*new_model yes",
|
"*new_model yes",
|
||||||
"*reset",
|
"*reset",
|
||||||
"*select_clear",
|
"*select_clear",
|
||||||
|
@ -223,14 +225,6 @@ parser.set_defaults(homogenization = 1)
|
||||||
(options, filenames) = parser.parse_args()
|
(options, filenames) = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
sys.path.append(damask.solver.Marc().libraryPath('../../'))
|
|
||||||
|
|
||||||
try:
|
|
||||||
from py_mentat import *
|
|
||||||
except:
|
|
||||||
print('no valid Mentat release found')
|
|
||||||
if options.port != None: sys.exit(-1)
|
|
||||||
|
|
||||||
#--- setup file handles --------------------------------------------------------------------------
|
#--- setup file handles --------------------------------------------------------------------------
|
||||||
files = []
|
files = []
|
||||||
if filenames == []:
|
if filenames == []:
|
||||||
|
@ -248,11 +242,16 @@ else:
|
||||||
'croak':sys.stdout,
|
'croak':sys.stdout,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
try:
|
||||||
|
from py_mentat import *
|
||||||
|
except:
|
||||||
|
file['croak'].write('no valid Mentat release found')
|
||||||
|
if options.port != None: sys.exit(-1)
|
||||||
|
|
||||||
#--- loop over input files ------------------------------------------------------------------------
|
#--- loop over input files ------------------------------------------------------------------------
|
||||||
for file in files:
|
for file in files:
|
||||||
file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n')
|
file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n')
|
||||||
|
|
||||||
|
|
||||||
content = file['input'].readlines()
|
content = file['input'].readlines()
|
||||||
|
|
||||||
(grid,size,homog,microstructures) = parse_geomFile(content, options.homogenization)
|
(grid,size,homog,microstructures) = parse_geomFile(content, options.homogenization)
|
||||||
|
|
Loading…
Reference in New Issue