uses version string from CONFIG file

This commit is contained in:
Martin Diehl 2016-07-14 16:12:05 +02:00
parent 787a8da1c3
commit ade6db3f9c
1 changed files with 1 additions and 8 deletions

View File

@ -6,14 +6,10 @@ from .solver import Solver
class Abaqus(Solver): class Abaqus(Solver):
def __init__(self,version='',solver=''): # example version string: 6.12-2, solver: std or exp def __init__(self,version='',solver=''): # example version string: 6.12-2, solver: std or exp
self.solver='Abaqus' self.solver='Abaqus'
if version =='': if version =='':
import subprocess version = damask.Environment().options['ABAQUS_VERSION']
process = subprocess.Popen(['abaqus', 'information=release'],stdout = subprocess.PIPE,stderr = subprocess.PIPE)
self.version = process.stdout.readlines()[1].split()[1]
print(self.version)
else: else:
self.version = version self.version = version
@ -40,6 +36,3 @@ class Abaqus(Solver):
if self.version != detectedVersion: if self.version != detectedVersion:
raise Exception('found Abaqus version %s, but requested %s'%(detectedVersion,self.version)) raise Exception('found Abaqus version %s, but requested %s'%(detectedVersion,self.version))
return '%s -job %s -user %s/code/DAMASK_abaqus_%s interactive'%(cmd,model,env.rootDir(),self.solver) return '%s -job %s -user %s/code/DAMASK_abaqus_%s interactive'%(cmd,model,env.rootDir(),self.solver)