From 44e5d25274d9b445e9304efdf75fa577c9f7cc3b Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 9 Nov 2011 17:51:00 +0000 Subject: [PATCH] now aware of $DAMASK_BIN and guessing if environment missing --- processing/setup/setup_processing.py | 92 ++++++++++++++-------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/processing/setup/setup_processing.py b/processing/setup/setup_processing.py index 87f5dc17a..479249119 100755 --- a/processing/setup/setup_processing.py +++ b/processing/setup/setup_processing.py @@ -13,64 +13,66 @@ import damask_tools; reload(damask_tools) damask_tools.DAMASK_TOOLS().check_env() bin_link = { \ - 'pre' : [ - 'marc_addUserOutput.py', - 'mentat_pbcOnBoxMesh.py', - 'mentat_spectralBox.py', - 'patchFromReconstructedBoundaries.py', - 'spectral_geomCheck.py', - 'spectral_minimalSurface.py', - 'spectral_vicinityOffset.py', - 'voronoi_randomSeeding.py', - 'voronoi_tessellation.py', - ], - 'post' : [ - '3Dvisualize.py', - 'addCauchy.py', - 'addDeterminant.py', - 'addDivergence.py', - 'addMises.py', - 'addNorm.py', - 'addStrainTensors.py', - 'addCompatibilityMismatch.py', - 'averageDown.py', - 'mentat_colorMap.py', - 'postResults.py', - 'spectral_iterationCount.py', - 'spectral_convergence.py', - 'spectral_scaleGeom.py', - ], - } + 'pre' : [ + 'marc_addUserOutput.py', + 'mentat_pbcOnBoxMesh.py', + 'mentat_spectralBox.py', + 'patchFromReconstructedBoundaries.py', + 'spectral_geomCheck.py', + 'spectral_minimalSurface.py', + 'spectral_vicinityOffset.py', + 'voronoi_randomSeeding.py', + 'voronoi_tessellation.py', + ], + 'post' : [ + '3Dvisualize.py', + 'addCauchy.py', + 'addDeterminant.py', + 'addDivergence.py', + 'addMises.py', + 'addNorm.py', + 'addStrainTensors.py', + 'addCompatibilityMismatch.py', + 'averageDown.py', + 'mentat_colorMap.py', + 'postResults.py', + 'spectral_iterationCount.py', + 'spectral_convergence.py', + 'spectral_scaleGeom.py', + ], + } compile = { \ - 'pre' : [ - 'voronoi_randomSeeding.f90', - 'voronoi_tessellation.f90', - ], - 'post' : [ - ], - } + 'pre' : [ + 'voronoi_randomSeeding.f90', + 'voronoi_tessellation.f90', + ], + 'post' : [ + ], + } execute = { \ - 'pre' : [ - ], - 'post' : [ - 'make_postprocessingMath', - ], - } + 'pre' : [ + ], + 'post' : [ + 'make_postprocessingMath', + ], + } homedir = os.getenv('HOME') -#basedir = os.path.join(os.path.dirname(sys.argv[0]),'..') damask_root = os.getenv('DAMASK_ROOT') -basedir = os.getenv('DAMASK_ROOT')+'/processing/' +if damask_root == '' or damask_root == None: damask_root = os.path.join(os.path.dirname(sys.argv[0]),'../../') +damask_bin = os.getenv('DAMASK_BIN') +if damask_bin == '' or damask_bin == None: damask_bin = os.path.join(damask_root,'bin/') +basedir = os.path.join(damask_root,'processing/') for dir in bin_link: for file in bin_link[dir]: src = os.path.abspath(os.path.join(basedir,dir,file)) if (file == ''): - sym_link = os.path.abspath(os.path.join(damask_root,'bin',dir)) + sym_link = os.path.abspath(os.path.join(damask_bin,dir)) else: - sym_link = os.path.abspath(os.path.join(damask_root,'bin',os.path.splitext(file)[0])) + sym_link = os.path.abspath(os.path.join(damask_bin,os.path.splitext(file)[0])) print sym_link,'-->',src if os.path.lexists(sym_link): os.remove(sym_link)