first round of libraries

This commit is contained in:
Martin Diehl 2016-03-01 23:02:47 +01:00
parent c1dd5febd5
commit 4d8aad36f1
4 changed files with 14 additions and 20 deletions

View File

@ -1,8 +1,7 @@
# -*- coding: UTF-8 no BOM -*- # -*- coding: UTF-8 no BOM -*-
"""Tools to control the various BVP solvers"""
# $Id$ from .solver import Solver # noqa
from .spectral import Spectral # noqa
from .solver import Solver # only one class from .marc import Marc # noqa
from .spectral import Spectral # only one class from .abaqus import Abaqus # noqa
from .marc import Marc # only one class
from .abaqus import Abaqus # only one class

View File

@ -7,7 +7,8 @@ from .solver import Solver
class Abaqus(Solver): class Abaqus(Solver):
def __init__(self,version='',solver=''): # example of version string: 6.12-2, solver: either 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 import subprocess

View File

@ -7,9 +7,7 @@ from .solver import Solver
class Marc(Solver): class Marc(Solver):
#--------------------------
def __init__(self): def __init__(self):
#--------------------------
self.solver = 'Marc' self.solver = 'Marc'
self.releases = { \ self.releases = { \
'2015': ['linux64',''], '2015': ['linux64',''],
@ -24,7 +22,6 @@ class Marc(Solver):
#-------------------------- #--------------------------
def version(self,rootRelation = ''): def version(self,rootRelation = ''):
#--------------------------
import os,damask.environment import os,damask.environment
MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT']
@ -40,7 +37,6 @@ class Marc(Solver):
#-------------------------- #--------------------------
def libraryPath(self,rootRelation = '',releases = []): def libraryPath(self,rootRelation = '',releases = []):
#--------------------------
import os,damask.environment import os,damask.environment
MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT']
@ -59,7 +55,6 @@ class Marc(Solver):
#-------------------------- #--------------------------
def toolsPath(self,rootRelation = '',release = ''): def toolsPath(self,rootRelation = '',release = ''):
#--------------------------
import os,damask.environment import os,damask.environment
MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT']
@ -72,7 +67,6 @@ class Marc(Solver):
#-------------------------- #--------------------------
def submit_job(self, def submit_job(self,
#--------------------------
rootRelation = '', rootRelation = '',
release = '', release = '',
model = 'model', model = 'model',
@ -84,7 +78,7 @@ class Marc(Solver):
): ):
import os,damask.environment import os,damask.environment
import subprocess,shlex,shutil import subprocess,shlex
if len(release) == 0: release = self.version(rootRelation) if len(release) == 0: release = self.version(rootRelation)
@ -94,7 +88,7 @@ class Marc(Solver):
damaskEnv = damask.environment.Environment(rootRelation) damaskEnv = damask.environment.Environment(rootRelation)
user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc') # might be updated if special version is found (usually symlink) user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc') # might be updated if special version (symlink) is found
if compile: if compile:
if os.path.isfile(os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s.f90'%release)): if os.path.isfile(os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s.f90'%release)):
user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s'%release) user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s'%release)
@ -123,7 +117,6 @@ class Marc(Solver):
#-------------------------- #--------------------------
def exit_number_from_outFile(self,outFile=None): def exit_number_from_outFile(self,outFile=None):
#--------------------------
import string import string
exitnumber = -1 exitnumber = -1
fid_out = open(outFile,'r') fid_out = open(outFile,'r')

View File

@ -5,10 +5,11 @@
import damask.solver import damask.solver
class Solver(): class Solver():
''' """
General class for solver specific functionality. General class for solver specific functionality.
Sub-classed by the individual solvers. Sub-classed by the individual solvers.
''' """
def __init__(self,solver=''): def __init__(self,solver=''):
solverClass = { solverClass = {