2010-10-26 20:32:20 +05:30
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2011-03-11 14:50:37 +05:30
|
|
|
# renders the postprocessing routines acessible from everywhere.
|
2010-10-26 20:32:20 +05:30
|
|
|
# you need a ~/bin directory in your home folder
|
2011-03-11 14:50:37 +05:30
|
|
|
# if necessary, add the bin directory to your path by
|
|
|
|
# adding the following lines to your .bashrc file:
|
2010-10-26 20:32:20 +05:30
|
|
|
# PATH="$PATH:~/bin"
|
|
|
|
# export PATH
|
|
|
|
|
2011-01-26 20:47:03 +05:30
|
|
|
import os,sys,glob
|
2010-10-26 20:32:20 +05:30
|
|
|
|
2011-01-26 20:47:03 +05:30
|
|
|
bin_link = { \
|
2010-10-26 20:32:20 +05:30
|
|
|
'pre' : [
|
|
|
|
'marc_addUserOutput',
|
|
|
|
'mentat_pbcOnBoxMesh',
|
|
|
|
'mentat_spectralBox',
|
2011-06-08 00:45:34 +05:30
|
|
|
'patchFromReconstructedBoundaries',
|
2011-06-06 20:59:14 +05:30
|
|
|
'spectral_geomCheck',
|
2011-01-24 21:51:49 +05:30
|
|
|
'voronoi_randomSeeding',
|
|
|
|
'voronoi_tessellation',
|
2010-10-26 20:32:20 +05:30
|
|
|
],
|
|
|
|
'post' : [
|
2011-02-01 16:18:44 +05:30
|
|
|
'3Dvisualize',
|
2011-06-21 21:55:48 +05:30
|
|
|
'addCauchy',
|
|
|
|
'addDeterminant',
|
|
|
|
'addDivergence',
|
|
|
|
'addMises',
|
|
|
|
'addNorm',
|
|
|
|
'addStrainTensors',
|
2011-08-16 23:50:52 +05:30
|
|
|
'averageDown',
|
2010-10-26 20:32:20 +05:30
|
|
|
'mentat_colorMap',
|
2011-05-31 18:01:35 +05:30
|
|
|
'postResults',
|
|
|
|
'spectral_iterationCount',
|
2011-08-14 16:14:15 +05:30
|
|
|
'spectral_convergence',
|
2010-10-26 20:32:20 +05:30
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2011-01-26 20:47:03 +05:30
|
|
|
compile = { \
|
|
|
|
'pre' : [
|
|
|
|
'voronoi_randomSeeding.f90',
|
|
|
|
'voronoi_tessellation.f90',
|
|
|
|
],
|
|
|
|
'post' : [
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2011-03-11 14:50:37 +05:30
|
|
|
execute = { \
|
|
|
|
'pre' : [
|
|
|
|
],
|
|
|
|
'post' : [
|
|
|
|
'make_postprocessingMath',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2010-10-26 20:32:20 +05:30
|
|
|
homedir = os.getenv('HOME')
|
2011-03-22 21:12:53 +05:30
|
|
|
basedir = os.path.join(os.path.dirname(sys.argv[0]),'..')
|
2011-01-26 20:47:03 +05:30
|
|
|
for dir in bin_link:
|
|
|
|
for file in bin_link[dir]:
|
2010-10-26 20:32:20 +05:30
|
|
|
src = os.path.abspath(os.path.join(basedir,dir,file))
|
|
|
|
if (file == ''):
|
|
|
|
dst = os.path.abspath(os.path.join(homedir,'bin',dir))
|
|
|
|
else:
|
|
|
|
dst = os.path.abspath(os.path.join(homedir,'bin',file))
|
|
|
|
print src,'-->',dst
|
|
|
|
if os.path.lexists(dst):
|
|
|
|
os.remove(dst)
|
|
|
|
os.symlink(src,dst)
|
2011-01-26 20:47:03 +05:30
|
|
|
|
|
|
|
for dir in compile:
|
|
|
|
for file in compile[dir]:
|
|
|
|
src = os.path.abspath(os.path.join(basedir,dir,file))
|
|
|
|
if os.path.isfile(src):
|
|
|
|
print file
|
|
|
|
os.system('ifort -O3 -parallel -o%s %s'%(os.path.splitext(src)[0],src))
|
2011-03-22 21:12:53 +05:30
|
|
|
|
|
|
|
modules = glob.glob('*.mod')
|
2011-01-26 20:47:03 +05:30
|
|
|
for module in modules:
|
|
|
|
print module
|
|
|
|
os.remove(module)
|
2011-03-11 14:50:37 +05:30
|
|
|
|
|
|
|
for dir in execute:
|
|
|
|
for file in execute[dir]:
|
|
|
|
cmd = os.path.abspath(os.path.join(basedir,dir,file))
|
|
|
|
if os.access(cmd,os.X_OK):
|
|
|
|
print cmd
|
|
|
|
os.system('%s %s'%(cmd,os.path.join(basedir,dir)))
|