From 982e925f7bbc34313cd7f8b2b480965564cb624f Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 16 May 2017 12:28:42 -0400 Subject: [PATCH 01/23] renamed DAMASK_env to env/DAMASK --- DAMASK_env.csh | 2 +- DAMASK_env.sh | 2 +- DAMASK_env.zsh | 2 +- env/{DAMASK_env.csh => DAMASK.csh} | 0 env/{DAMASK_env.sh => DAMASK.sh} | 0 env/{DAMASK_env.zsh => DAMASK.zsh} | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename env/{DAMASK_env.csh => DAMASK.csh} (100%) rename env/{DAMASK_env.sh => DAMASK.sh} (100%) rename env/{DAMASK_env.zsh => DAMASK.zsh} (100%) diff --git a/DAMASK_env.csh b/DAMASK_env.csh index 4535015d8..e8a0a2c05 120000 --- a/DAMASK_env.csh +++ b/DAMASK_env.csh @@ -1 +1 @@ -env/DAMASK_env.csh \ No newline at end of file +env/DAMASK.csh \ No newline at end of file diff --git a/DAMASK_env.sh b/DAMASK_env.sh index e49b7df7c..264b07d52 120000 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -1 +1 @@ -env/DAMASK_env.sh \ No newline at end of file +env/DAMASK.sh \ No newline at end of file diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index 22da3bd4d..cf3a247ef 120000 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -1 +1 @@ -env/DAMASK_env.zsh \ No newline at end of file +env/DAMASK.zsh \ No newline at end of file diff --git a/env/DAMASK_env.csh b/env/DAMASK.csh similarity index 100% rename from env/DAMASK_env.csh rename to env/DAMASK.csh diff --git a/env/DAMASK_env.sh b/env/DAMASK.sh similarity index 100% rename from env/DAMASK_env.sh rename to env/DAMASK.sh diff --git a/env/DAMASK_env.zsh b/env/DAMASK.zsh similarity index 100% rename from env/DAMASK_env.zsh rename to env/DAMASK.zsh From b597919acd42cbf6577672ce4bafd5f5922e52eb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 18 Jun 2017 03:33:30 +0200 Subject: [PATCH 02/23] script to gahter support information --- DAMASK_prerequisits.sh | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 DAMASK_prerequisits.sh diff --git a/DAMASK_prerequisits.sh b/DAMASK_prerequisits.sh new file mode 100755 index 000000000..8ed094cc3 --- /dev/null +++ b/DAMASK_prerequisits.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +OUTFILE="bla.txt" +echo date +"%m-%d-%y" >OUTFILE + +# redirect STDOUT and STDERR to logfile +# https://stackoverflow.com/questions/11229385/redirect-all-output-in-a-bash-script-when-using-set-x^ +exec > $OUTFILE 2>&1 + +# directory, file is not a symlink by definition +# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within +DAMASK_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +echo ============================================================================================== +echo DAMASK settings +echo ============================================================================================== +echo +echo DAMASK_ROOT: $DAMASK_ROOT +echo +echo Settings in CONFIG: +cat CONFIG +echo +echo ============================================================================================== +echo Python +echo ============================================================================================== + +DEFAULT_PYTHON=python2.7 +for executable in python python2 python3 python2.7; do + if [[ "$(which $executable)x" != "x" ]]; then + echo $executable version: $($executable --version 2>&1) + else + echo $executable does not exist + fi +done +echo Location of $DEFAULT_PYTHON: $(ls -la $(which $DEFAULT_PYTHON)) +echo +for module in numpy scipy;do + echo ---------------------------------------------------------------------------------------------- + echo $module + $DEFAULT_PYTHON -c "import $module; print('Version: {}'.format($module.__version__));print('Location: {}'.format($module.__file__))" +done +echo ---------------------------------------------------------------------------------------------- +echo vtk +$DEFAULT_PYTHON -c "import vtk; print('Location: {}'.format(vtk.__file__))" From 6547ab8c69dc24288ebac1541a9526dfe6c27b39 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 5 Jul 2017 04:43:20 +0200 Subject: [PATCH 03/23] not needed, ASCII table ensures shape (Npoints,Nvalues) --- processing/post/vtk_pointcloud.py | 1 - processing/post/vtk_rectilinearGrid.py | 1 - 2 files changed, 2 deletions(-) diff --git a/processing/post/vtk_pointcloud.py b/processing/post/vtk_pointcloud.py index 5779b7540..54f02d300 100755 --- a/processing/post/vtk_pointcloud.py +++ b/processing/post/vtk_pointcloud.py @@ -61,7 +61,6 @@ for name in filenames: # ------------------------------------------ process data --------------------------------------- table.data_readArray(options.pos) - if len(table.data.shape) < 2: table.data.shape += (1,) # expand to 2D shape if table.data.shape[1] < 3: table.data = np.hstack((table.data, np.zeros((table.data.shape[0], diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index cc6c01711..326f26046 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -70,7 +70,6 @@ for name in filenames: # --------------- figure out size and grid --------------------------------------------------------- table.data_readArray(options.pos) - if len(table.data.shape) < 2: table.data.shape += (1,) # expand to 2D shape if table.data.shape[1] < 3: table.data = np.hstack((table.data, np.zeros((table.data.shape[0], From 42a3cbd4a4c36050b2cc3ce6f9b8b9b52a772c11 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 5 Jul 2017 10:24:47 +0200 Subject: [PATCH 04/23] obtaining information on compilers as well --- DAMASK_prerequisits.sh | 52 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/DAMASK_prerequisits.sh b/DAMASK_prerequisits.sh index 8ed094cc3..56a2f7e40 100755 --- a/DAMASK_prerequisits.sh +++ b/DAMASK_prerequisits.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -OUTFILE="bla.txt" +OUTFILE="system_report.txt" echo date +"%m-%d-%y" >OUTFILE # redirect STDOUT and STDERR to logfile @@ -14,7 +14,6 @@ DAMASK_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo ============================================================================================== echo DAMASK settings echo ============================================================================================== -echo echo DAMASK_ROOT: $DAMASK_ROOT echo echo Settings in CONFIG: @@ -37,8 +36,53 @@ echo for module in numpy scipy;do echo ---------------------------------------------------------------------------------------------- echo $module - $DEFAULT_PYTHON -c "import $module; print('Version: {}'.format($module.__version__));print('Location: {}'.format($module.__file__))" + echo ---------------------------------------------------------------------------------------------- + $DEFAULT_PYTHON -c "import $module; \ + print('Version: {}'.format($module.__version__)); \ + print('Location: {}'.format($module.__file__))" done echo ---------------------------------------------------------------------------------------------- echo vtk -$DEFAULT_PYTHON -c "import vtk; print('Location: {}'.format(vtk.__file__))" +echo ---------------------------------------------------------------------------------------------- +$DEFAULT_PYTHON -c "import vtk; \ + print('Version: {}'.format(vtk.vtkVersion.GetVTKVersion())); \ + print('Location: {}'.format(vtk.__file__))" +echo ---------------------------------------------------------------------------------------------- +echo h5py +echo ---------------------------------------------------------------------------------------------- +$DEFAULT_PYTHON -c "import h5py; \ + print('Version: {}'.format(h5py.version.version)); \ + print('Location: {}'.format(h5py.__file__))" +echo +echo ============================================================================================== +echo GCC +echo ============================================================================================== +for executable in gcc g++ gfortran ;do + if [[ "$(which $executable)x" != "x" ]]; then + echo $(which $executable) version: $($executable --version 2>&1) + else + echo $executable does not exist + fi +done +echo +echo ============================================================================================== +echo Intel Compiler Suite +echo ============================================================================================== +for executable in icc icpc ifort ;do + if [[ "$(which $executable)x" != "x" ]]; then + echo $(which $executable) version: $($executable --version 2>&1) + else + echo $executable does not exist + fi +done +echo +echo ============================================================================================== +echo MPI Wrappers +echo ============================================================================================== +for executable in mpicc mpiCC mpicxx mpicxx mpifort mpif90 mpif77; do + if [[ "$(which $executable)x" != "x" ]]; then + echo $(which $executable) version: $($executable --show 2>&1) + else + echo $executable does not exist + fi +done From bc15313677175fc3fc25efc89e992496ed5f959e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 10 Jul 2017 03:29:05 +0200 Subject: [PATCH 05/23] also reporting DAMASK version and os information --- DAMASK_prerequisits.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/DAMASK_prerequisits.sh b/DAMASK_prerequisits.sh index 56a2f7e40..fccd63ead 100755 --- a/DAMASK_prerequisits.sh +++ b/DAMASK_prerequisits.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash OUTFILE="system_report.txt" -echo date +"%m-%d-%y" >OUTFILE +echo date +"%m-%d-%y" >$OUTFILE # redirect STDOUT and STDERR to logfile # https://stackoverflow.com/questions/11229385/redirect-all-output-in-a-bash-script-when-using-set-x^ @@ -14,12 +14,21 @@ DAMASK_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo ============================================================================================== echo DAMASK settings echo ============================================================================================== -echo DAMASK_ROOT: $DAMASK_ROOT +echo DAMASK_ROOT: +echo $DAMASK_ROOT +echo +echo Version: +cat VERSION echo echo Settings in CONFIG: cat CONFIG echo echo ============================================================================================== +echo System +echo ============================================================================================== +uname -a +echo +echo ============================================================================================== echo Python echo ============================================================================================== From da8cadea9a0de8541272606c346cfe350f2dcded Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 12 Jul 2017 12:50:59 +0200 Subject: [PATCH 06/23] limiting stack/heap causes ocansionally problems. apparently, unlimited will not cause any problems. --- env/DAMASK.csh | 14 +++++--------- env/DAMASK.sh | 20 +++++++------------- env/DAMASK.zsh | 21 +++++++++++---------- 3 files changed, 23 insertions(+), 32 deletions(-) diff --git a/env/DAMASK.csh b/env/DAMASK.csh index 819b263ef..bf728c2db 100644 --- a/env/DAMASK.csh +++ b/env/DAMASK.csh @@ -26,15 +26,11 @@ if ( "x$DAMASK_NUM_THREADS" == "x" ) then set DAMASK_NUM_THREADS=1 endif -# according to http://software.intel.com/en-us/forums/topic/501500 -# this seems to make sense for the stack size -if ( `which free` != "free: Command not found." ) then - set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - set heap=` expr $freeMem / 2` - set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` - # http://superuser.com/questions/220059/what-parameters-has-ulimit - limit datasize $heap # maximum heap size (kB) - limit stacksize $stack # maximum stack size (kB) +# currently, there is no information that unlimited causes problems +# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it +# http://superuser.com/questions/220059/what-parameters-has-ulimit +limit datasize unlimited # maximum heap size (kB) +limit stacksize unlimited # maximum stack size (kB) endif if ( `limit | grep memoryuse` != "" ) then limit memoryuse unlimited # maximum physical memory size diff --git a/env/DAMASK.sh b/env/DAMASK.sh index 3e9889fec..c0dbe64ef 100644 --- a/env/DAMASK.sh +++ b/env/DAMASK.sh @@ -36,19 +36,13 @@ PROCESSING=$(which postResults || true 2>/dev/null) [ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1 -# according to http://software.intel.com/en-us/forums/topic/501500 -# this seems to make sense for the stack size -FREE=$(type -p free 2>/dev/null) -if [ "x$FREE" != "x" ]; then - freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}') - # http://superuser.com/questions/220059/what-parameters-has-ulimit - ulimit -d unlimited 2>/dev/null \ - || ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB) - ulimit -s unlimited 2>/dev/null \ - || ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) -fi -ulimit -v unlimited 2>/dev/null # maximum virtual memory size -ulimit -m unlimited 2>/dev/null # maximum physical memory size +# currently, there is no information that unlimited causes problems +# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it +# http://superuser.com/questions/220059/what-parameters-has-ulimit +ulimit -d unlimited 2>/dev/null # maximum heap size (kB) +ulimit -s unlimited 2>/dev/null # maximum stack size (kB) +ulimit -v unlimited 2>/dev/null # maximum virtual memory size +ulimit -m unlimited 2>/dev/null # maximum physical memory size # disable output in case of scp if [ ! -z "$PS1" ]; then diff --git a/env/DAMASK.zsh b/env/DAMASK.zsh index c662e6aee..5f510dabb 100644 --- a/env/DAMASK.zsh +++ b/env/DAMASK.zsh @@ -22,20 +22,21 @@ unset -f set [ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH SOLVER=`which DAMASK_spectral || True 2>/dev/null` +[ "x$SOLVER" == "x" ] && SOLVER='Not found!' + PROCESSING=`which postResults || True 2>/dev/null` +[ "x$PROCESSING" == "x" ] && PROCESSING='Not found!' + [ "x$DAMASK_NUM_THREADS" = "x" ] && DAMASK_NUM_THREADS=1 # according to http://software.intel.com/en-us/forums/topic/501500 -# this seems to make sense for the stack size -if [ "`which free 2>/dev/null`" != "free not found" ]; then - freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - - # http://superuser.com/questions/220059/what-parameters-has-ulimit - #ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB) - ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB) -fi -ulimit -v unlimited 2>/dev/null # maximum virtual memory size -ulimit -m unlimited 2>/dev/null # maximum physical memory size +# currently, there is no information that unlimited causes problems +# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it +# http://superuser.com/questions/220059/what-parameters-has-ulimit +ulimit -d unlimited 2>/dev/null # maximum heap size (kB) +ulimit -s unlimited 2>/dev/null # maximum stack size (kB) +ulimit -v unlimited 2>/dev/null # maximum virtual memory size +ulimit -m unlimited 2>/dev/null # maximum physical memory size # disable output in case of scp if [ ! -z "$PS1" ]; then From 439b3569d3d7a3757fbe53f10ae1baea3cc6a776 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 13 Jul 2017 15:48:54 +0200 Subject: [PATCH 07/23] installation usually does not succeed, instead of wasting time just drop it completely --- .../mods_Abaqus/abaqus_v6_windows.env | 177 ------------------ 1 file changed, 177 deletions(-) delete mode 100644 installation/mods_Abaqus/abaqus_v6_windows.env diff --git a/installation/mods_Abaqus/abaqus_v6_windows.env b/installation/mods_Abaqus/abaqus_v6_windows.env deleted file mode 100644 index 3a3445c7b..000000000 --- a/installation/mods_Abaqus/abaqus_v6_windows.env +++ /dev/null @@ -1,177 +0,0 @@ -# -# System-Wide Abaqus Environment File -# ------------------------------------- -standard_parallel = ALL -mp_mode = MPI -mp_file_system = (DETECT,DETECT) -mp_num_parallel_ftps = (4, 4) -mp_environment_export = ('MPI_PROPAGATE_TSTP', - 'ABA_CM_BUFFERING', - 'ABA_CM_BUFFERING_LIMIT', - 'ABA_ITERATIVE_SOLVER_VERBOSE', - 'ABA_DMPSOLVER_BWDPARALLELOFF', - 'ABA_ELP_SURFACE_SPLIT', - 'ABA_ELP_SUSPEND', - 'ABA_HOME', - 'ABA_MEMORY_MODE', - 'ABA_MPI_MESSAGE_TRACKING', - 'ABA_MPI_VERBOSE_LEVEL', - 'ABA_PATH', - 'ABAQUS_CSE_RELTIMETOLERANCE', - 'ABA_RESOURCE_MONITOR', - 'ABA_RESOURCE_USEMALLINFO', - 'ABAQUS_LANG', - 'ABAQUS_CSE_CURRCONFIGMAPPING', - 'ABAQUS_MPF_DIAGNOSTIC_LEVEL', - 'ABAQUSLM_LICENSE_FILE', - 'ABQ_CRTMALLOC', - 'ABQ_DATACHECK', - 'ABQ_RECOVER', - 'ABQ_RESTART', - 'ABQ_SPLITFILE', - 'ABQ_XPL_WINDOWDUMP', - 'ABQ_XPL_PARTITIONSIZE', - 'ABQLMHANGLIMIT', - 'ABQLMQUEUE', - 'ABQLMUSER', - 'CCI_RENDEZVOUS', - 'DOMAIN', - 'DOMAIN_CPUS', - 'DOUBLE_PRECISION', - 'FLEXLM_DIAGNOSTICS', - 'FOR0006', - 'FOR0064', - 'FOR_IGNORE_EXCEPTIONS', - 'FOR_DISABLE_DIAGNOSTIC_DISPLAY', - 'LD_PRELOAD', - 'MP_NUMBER_OF_THREADS', - 'MPC_GANG', - 'MPI_FLAGS', - 'MPI_FLUSH_FCACHE', - 'MPI_RDMA_NENVELOPE', - 'MPI_SOCKBUFSIZE', - 'MPI_USE_MALLOPT_MMAP_MAX', - 'MPI_USE_MALLOPT_MMAP_THRESHOLD', - 'MPI_USE_MALLOPT_SBRK_PROTECTION', - 'MPI_WORKDIR', - 'MPCCI_DEBUG', - 'MPCCI_CODEID', - 'MPCCI_JOBID', - 'MPCCI_NETDEVICE', - 'MPCCI_TINFO', - 'MPCCI_SERVER', - 'ABAQUS_CCI_DEBUG', - 'NCPUS', - 'OMP_DYNAMIC', - 'OMP_NUM_THREADS', - 'OUTDIR', - 'PAIDUP', - 'PARALLEL_METHOD', - 'RAIDEV_NDREG_LAZYMEM', - 'ABA_SYMBOLIC_GENERALCOLLAPSE', - 'ABA_SYMBOLIC_GENERAL_MAXCLIQUERANK', - 'ABA_ADM_MINIMUMINCREASE', - 'ABA_ADM_MINIMUMDECREASE', - 'IPATH_NO_CPUAFFINITY', - 'MALLOC_MMAP_THRESHOLD_', - 'ABA_EXT_SIMOUTPUT', - 'SMA_WS', - 'SMA_PARENT', - 'SMA_PLATFORM', - 'ABA_PRE_DECOMPOSITION', - 'ACML_FAST_MALLOC', - 'ACML_FAST_MALLOC_CHUNK_SIZE', - 'ACML_FAST_MALLOC_MAX_CHUNKS', - 'ACML_FAST_MALLOC_DEBUG') - -import driverUtils, os -#-*- mode: python -*- - -# # -# Compile and Link command settings for the Windows 64 Platform # -# ( AMD Opteron / Intel EM64T ) # -# # - - -compile_fortran=['ifort', - '/c','/DABQ_WIN86_64', '/u', - '/iface:cref', '/recursive', '/Qauto-scalar', - '/QxSSE3', '/QaxAVX', - '/heap-arrays:1', - # '/Od', '/Ob0' # <-- Optimization - # '/Zi', # <-- Debugging - '/include:%I', '/free', '/O1', '/fpp', '/openmp', '/Qmkl'] - -link_sl=['LINK', - '/nologo', '/NOENTRY', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', - '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB', - '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', '/DEFAULTLIB:LIBIFPORTMD', '/DEFAULTLIB:LIBMMD.LIB', - '/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib', - '/FIXED:NO', '/dll', - '/def:%E', '/out:%U', '%F', '%A', '%L', '%B', - 'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib', 'advapi32.lib'] - -link_exe=['LINK', - '/nologo', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', '/STACK:20000000', - '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB', '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', - '/DEFAULTLIB:LIBIFPORTMD', '/DEFAULTLIB:LIBMMD.LIB', '/DEFAULTLIB:kernel32.lib', - '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib', - '/FIXED:NO', '/LARGEADDRESSAWARE', - '/out:%J', '%F', '%M', '%L', '%B', '%O', - 'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib', 'advapi32.lib'] - -# Link command to be used for MAKE w/o fortran compiler. -# remove the pound signs in order to remove the comments and have the file take effect. -# -#link_exe=['LINK', '/nologo', 'INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB', -# '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:MSVCRT.LIB', '/DEFAULTLIB:kernel32.lib', 'DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib', -# '/FIXED:NO', '/LARGEADDRESSAWARE', '/DEBUG', '/out:%J', '%F', '%M', '%L', '%B', '%O', 'oldnames.lib', 'user32.lib', 'ws2_32.lib', -# 'netapi32.lib', 'advapi32.lib] - -# MPI Configuration -mp_mode = THREADS - -mp_mpi_implementation = NATIVE -mp_rsh_command = 'dummy %H -l %U -n %C' -mp_mpirun_path = {} -mpirun = '' -progDir = os.environ.get('ProgramFiles','C:\\Program Files') - -for mpiDir in ('Microsoft HPC Pack', 'Microsoft HPC Pack 2008 R2', 'Microsoft HPC Pack 2008', 'Microsoft HPC Pack 2008 SDK'): - mpirun = progDir + os.sep + mpiDir + os.sep + 'bin' + os.sep + 'mpiexec.exe' - if os.path.exists(mpirun): - mp_mpirun_path[NATIVE] = mpirun - mp_mpirun_path[MSSDK] = os.path.join(progDir, mpiDir) - break - -if os.environ.has_key('CCP_HOME'): - from queueCCS import QueueCCS - queues['default'] = QueueCCS(queueName='share') - queues['share'] = QueueCCS(queueName='share') - queues['local'] = QueueCCS(queueName='local') - queues['genxmlshare'] = QueueCCS(queueName='genxmlshare') - queues['genxmllocal'] = QueueCCS(queueName='genxmllocal') - del QueueCCS - mpirun = os.path.join(os.environ['CCP_HOME'], 'bin', 'mpiexec.exe') - if os.path.exists(mpirun): - mp_mpirun_path[NATIVE] = mpirun - run_mode=BATCH - -if mp_mpirun_path: - mp_mode=MPI - -del progDir, mpiDir, mpirun - -graphicsEnv = driverUtils.locateFile(os.environ['ABA_PATH'],'site','graphicsConfig','env') -if graphicsEnv: - execfile(graphicsEnv) -else: - raise 'Cannot find the graphics configuration environment file (graphicsConfig.env)' - -del driverUtils, os, graphicsEnv -license_server_type=FLEXNET - -abaquslm_license_file="" -doc_root=" -doc_root_type="html" -academic=RESEARCH From dc3eda336d0e871575e4b7e52ba7a2ad81b208d0 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Fri, 14 Jul 2017 15:28:09 +0200 Subject: [PATCH 08/23] corrected unit of atomic volume to b^3 --- examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config b/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config index e7c9d4e19..0330e6f4a 100644 --- a/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config +++ b/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config @@ -43,7 +43,7 @@ q_slip 1.0 # q-exponent in glide velocity CLambdaSlip 10.0 # Adj. parameter controlling dislocation mean free path D0 4.0e-5 # Vacancy diffusion prefactor [m**2/s] Qsd 4.5e-19 # Activation energy for climb [J] -Catomicvolume 1.0 # Adj. parameter controlling the atomic volume [in b] +Catomicvolume 1.0 # Adj. parameter controlling the atomic volume [in b^3] Cedgedipmindistance 1.0 # Adj. parameter controlling the minimum dipole distance [in b] atol_rho 1.0 interactionSlipSlip 0.122 0.122 0.625 0.07 0.137 0.122 # Interaction coefficients (Kubin et al. 2008) From a4ceebc00b582d342c27cf38886e57d07e9e6821 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 14 Jul 2017 20:26:55 +0200 Subject: [PATCH 09/23] [skip ci] updated version information after successful test of v2.0.1-805-gdc3eda3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 85d08b940..12e0d6df0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-803-gdd68374 +v2.0.1-805-gdc3eda3 From 1973cf8d14d1161fad87554c643073cf1a3a409b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 18 Jul 2017 11:17:22 +0200 Subject: [PATCH 10/23] python 3 compatible (waste of memory / increase in runtime should not be a showstoper for typical use cases ) --- lib/damask/config/material.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index d59aaa6a9..a56c5d976 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -101,8 +101,6 @@ class Texture(Section): class Material(): """Reads, manipulates and writes material.config files""" - __slots__ = ['data'] - def __init__(self,verbose=True): """Generates ordered list of parts""" self.parts = [ From 837b14592a3578560045a4c375f0875eca2b40e4 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 31 Jul 2017 09:34:30 -0400 Subject: [PATCH 11/23] addLinked can now link between vector-valued columns --- processing/post/addLinked.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/processing/post/addLinked.py b/processing/post/addLinked.py index 5ea9abe43..dae1ff789 100755 --- a/processing/post/addLinked.py +++ b/processing/post/addLinked.py @@ -48,17 +48,16 @@ if options.asciitable is not None and os.path.isfile(options.asciitable): buffered = False, readonly = True) linkedTable.head_read() # read ASCII header info of linked table - if linkedTable.label_dimension(options.link[1]) != 1: - parser.error('linking column {} needs to be scalar valued.'.format(options.link[1])) + linkDim = linkedTable.label_dimension(options.link[1]) # dimension of linking column - missing_labels = linkedTable.data_readArray([options.link[1]]+options.label) + missing_labels = linkedTable.data_readArray([options.link[1]]+options.label) # try reading linked ASCII table linkedTable.close() # close linked ASCII table if len(missing_labels) > 0: damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) - index = linkedTable.data[:,0] - data = linkedTable.data[:,1:] + index = linkedTable.data[:,:linkDim] + data = linkedTable.data[:,linkDim:] else: parser.error('no linked ASCIItable given.') @@ -80,8 +79,10 @@ for name in filenames: errors = [] - linkColumn = table.label_index(options.link[0]) - if linkColumn < 0: errors.append('linking column {} not found.'.format(options.link[0])) + myLink = table.label_index (options.link[0]) + myLinkDim = table.label_dimension(options.link[0]) + if myLink < 0: errors.append('linking column {} not found.'.format(options.link[0])) + if myLinkDim != linkDim: errors.append('dimension mismatch for column {}.'.format(options.link[0])) if errors != []: damask.util.croak(errors) @@ -91,7 +92,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(linkedTable.labels(raw = True)[1:]) # extend with new labels (except for linked column) + table.labels_append(linkedTable.labels(raw = True)[linkDim:]) # extend with new labels (except for linked column) table.head_write() @@ -100,7 +101,12 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table try: - table.data_append(data[np.argwhere(index == float(table.data[linkColumn]))[0]]) # add data from first matching line + table.data_append( + data[ + np.argwhere(np.all( + (map(float,table.data[myLink:myLink+myLinkDim]) - index) == 0, + axis = 1))[0] + ]) # add data from first matching line except IndexError: table.data_append(np.nan*np.ones_like(data[0])) # or add NaNs outputAlive = table.data_write() # output processed line From 68493a00f543b55cdf8d929debe05848e5efee72 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 31 Jul 2017 10:02:58 -0400 Subject: [PATCH 12/23] fixed PEP line continuation warning --- processing/post/addLinked.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/processing/post/addLinked.py b/processing/post/addLinked.py index dae1ff789..c7fa53a88 100755 --- a/processing/post/addLinked.py +++ b/processing/post/addLinked.py @@ -101,12 +101,7 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table try: - table.data_append( - data[ - np.argwhere(np.all( - (map(float,table.data[myLink:myLink+myLinkDim]) - index) == 0, - axis = 1))[0] - ]) # add data from first matching line + table.data_append(data[np.argwhere(np.all((map(float,table.data[myLink:myLink+myLinkDim]) - index)==0,axis=1))[0]]) # add data of first matching line except IndexError: table.data_append(np.nan*np.ones_like(data[0])) # or add NaNs outputAlive = table.data_write() # output processed line From 028f84d28aa2242ba364519d48d2752335ad55af Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 31 Jul 2017 18:55:09 -0400 Subject: [PATCH 13/23] added canonicalPath function as shorthand --- env/DAMASK.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/env/DAMASK.sh b/env/DAMASK.sh index 3e9889fec..9baf2be04 100644 --- a/env/DAMASK.sh +++ b/env/DAMASK.sh @@ -1,9 +1,13 @@ # sets up an environment for DAMASK on bash # usage: source DAMASK.sh +function canonicalPath { + python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $1 +} + if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then - DAMASK_ROOT=$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$(dirname $BASH_SOURCE)") + DAMASK_ROOT=$(dirname $BASH_SOURCE) else [[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="$(pwd)/" STAT=$(stat "$(dirname $BASE$BASH_SOURCE)") @@ -12,9 +16,11 @@ fi # transition compatibility (renamed $DAMASK_ROOT/DAMASK_env.sh to $DAMASK_ROOT/env/DAMASK.sh) if [ ${BASH_SOURCE##*/} == "DAMASK.sh" ]; then - DAMASK_ROOT=$DAMASK_ROOT'/..' + DAMASK_ROOT="$DAMASK_ROOT/.." fi +DAMASK_ROOT=$(canonicalPath $DAMASK_ROOT) + # shorthand command to change to DAMASK_ROOT directory eval "function DAMASK_root() { cd $DAMASK_ROOT; }" @@ -28,10 +34,10 @@ unset -f set # add DAMASK_BIN if present [ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH -SOLVER=$(which DAMASK_spectral || true 2>/dev/null) +SOLVER=$(type -p DAMASK_spectral || true 2>/dev/null) [ "x$SOLVER" == "x" ] && SOLVER='Not found!' -PROCESSING=$(which postResults || true 2>/dev/null) +PROCESSING=$(type -p postResults || true 2>/dev/null) [ "x$PROCESSING" == "x" ] && PROCESSING='Not found!' [ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1 @@ -64,8 +70,8 @@ if [ ! -z "$PS1" ]; then echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" if [ "x$PETSC_DIR" != "x" ]; then echo "PETSc location $PETSC_DIR" - [[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \ - || echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") + [[ $(canonicalPath "$PETSC_DIR") == $PETSC_DIR ]] \ + || echo " ~~> "$(canonicalPath "$PETSC_DIR") fi echo "MSC.Marc/Mentat $MSC_ROOT" echo From aec8dbe5e093c2c1911fc065bbe42241c25614b4 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 1 Aug 2017 01:13:41 +0200 Subject: [PATCH 14/23] [skip ci] updated version information after successful test of v2.0.1-810-g68493a0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 12e0d6df0..74ae1f2f8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-805-gdc3eda3 +v2.0.1-810-g68493a0 From 5d4f272f0398f4dd1d68fd8f8368648991ac6cfd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 1 Aug 2017 02:43:23 +0200 Subject: [PATCH 15/23] __slots__ cause problems with python3 --- lib/damask/asciitable.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 446770313..fe53ecafd 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -14,12 +14,6 @@ except(NameError): class ASCIItable(): """Read and write to ASCII tables""" - __slots__ = ['__IO__', - 'info', - 'labeled', - 'data', - ] - tmpext = '_tmp' # filename extension for in-place access # ------------------------------------------------------------------ From deb69e4be8cf2abead98b0e6dcafb4eb64d64ff5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 1 Aug 2017 02:57:42 +0200 Subject: [PATCH 16/23] adapting philips improvements for zsh --- env/DAMASK.sh | 1 - env/DAMASK.zsh | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/env/DAMASK.sh b/env/DAMASK.sh index 599226033..8a987c4dc 100644 --- a/env/DAMASK.sh +++ b/env/DAMASK.sh @@ -5,7 +5,6 @@ function canonicalPath { python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $1 } - if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then DAMASK_ROOT=$(dirname $BASH_SOURCE) else diff --git a/env/DAMASK.zsh b/env/DAMASK.zsh index 5f510dabb..e00ea8bdc 100644 --- a/env/DAMASK.zsh +++ b/env/DAMASK.zsh @@ -1,6 +1,10 @@ # sets up an environment for DAMASK on zsh # usage: source DAMASK.zsh +function canonicalPath { + python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $1 +} + # transition compatibility (renamed $DAMASK_ROOT/DAMASK_env.zsh to $DAMASK_ROOT/env/DAMASK.zsh) if [ ${0:t:r} = 'DAMASK' ]; then DAMASK_ROOT=${0:a:h}'/..' @@ -21,15 +25,14 @@ unset -f set # add DAMASK_BIN if present [ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH -SOLVER=`which DAMASK_spectral || True 2>/dev/null` +SOLVER=$(type -p DAMASK_spectral || true 2>/dev/null) [ "x$SOLVER" == "x" ] && SOLVER='Not found!' -PROCESSING=`which postResults || True 2>/dev/null` +PROCESSING=$(type -p postResults || true 2>/dev/null) [ "x$PROCESSING" == "x" ] && PROCESSING='Not found!' -[ "x$DAMASK_NUM_THREADS" = "x" ] && DAMASK_NUM_THREADS=1 +[ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1 -# according to http://software.intel.com/en-us/forums/topic/501500 # currently, there is no information that unlimited causes problems # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it # http://superuser.com/questions/220059/what-parameters-has-ulimit @@ -52,8 +55,8 @@ if [ ! -z "$PS1" ]; then echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" if [ "x$PETSC_DIR" != "x" ]; then echo "PETSc location $PETSC_DIR" - [[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \ - || echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") + [[ $(canonicalPath "$PETSC_DIR") == $PETSC_DIR ]] \ + || echo " ~~> "$(canonicalPath "$PETSC_DIR") fi [[ "x$PETSC_ARCH" == "x" ]] \ || echo "PETSc architecture $PETSC_ARCH" @@ -80,7 +83,7 @@ fi export DAMASK_NUM_THREADS export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH -for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN MATCH; do +for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN; do unset "${var}" done for var in DAMASK MSC; do From 734bc69071fb24a5222d37924d8b09e872d15492 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 1 Aug 2017 09:13:25 +0200 Subject: [PATCH 17/23] whitespace at line end not needed --- DAMASK_prerequisits.sh | 2 +- env/DAMASK.csh | 2 +- env/DAMASK.sh | 2 +- env/DAMASK.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DAMASK_prerequisits.sh b/DAMASK_prerequisits.sh index fccd63ead..38c73fe7b 100755 --- a/DAMASK_prerequisits.sh +++ b/DAMASK_prerequisits.sh @@ -14,7 +14,7 @@ DAMASK_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo ============================================================================================== echo DAMASK settings echo ============================================================================================== -echo DAMASK_ROOT: +echo DAMASK_ROOT: echo $DAMASK_ROOT echo echo Version: diff --git a/env/DAMASK.csh b/env/DAMASK.csh index bf728c2db..d5bfb4437 100644 --- a/env/DAMASK.csh +++ b/env/DAMASK.csh @@ -28,7 +28,7 @@ endif # currently, there is no information that unlimited causes problems # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it -# http://superuser.com/questions/220059/what-parameters-has-ulimit +# http://superuser.com/questions/220059/what-parameters-has-ulimit limit datasize unlimited # maximum heap size (kB) limit stacksize unlimited # maximum stack size (kB) endif diff --git a/env/DAMASK.sh b/env/DAMASK.sh index 8a987c4dc..1c5ffcf4b 100644 --- a/env/DAMASK.sh +++ b/env/DAMASK.sh @@ -43,7 +43,7 @@ PROCESSING=$(type -p postResults || true 2>/dev/null) # currently, there is no information that unlimited causes problems # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it -# http://superuser.com/questions/220059/what-parameters-has-ulimit +# http://superuser.com/questions/220059/what-parameters-has-ulimit ulimit -d unlimited 2>/dev/null # maximum heap size (kB) ulimit -s unlimited 2>/dev/null # maximum stack size (kB) ulimit -v unlimited 2>/dev/null # maximum virtual memory size diff --git a/env/DAMASK.zsh b/env/DAMASK.zsh index e00ea8bdc..deea2b072 100644 --- a/env/DAMASK.zsh +++ b/env/DAMASK.zsh @@ -35,7 +35,7 @@ PROCESSING=$(type -p postResults || true 2>/dev/null) # currently, there is no information that unlimited causes problems # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it -# http://superuser.com/questions/220059/what-parameters-has-ulimit +# http://superuser.com/questions/220059/what-parameters-has-ulimit ulimit -d unlimited 2>/dev/null # maximum heap size (kB) ulimit -s unlimited 2>/dev/null # maximum stack size (kB) ulimit -v unlimited 2>/dev/null # maximum virtual memory size From d89a3938155e1438f175ff4b91294c367282362c Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 1 Aug 2017 10:17:40 +0200 Subject: [PATCH 18/23] [skip ci] updated version information after successful test of v2.0.1-811-g028f84d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 12e0d6df0..61af6866f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-805-gdc3eda3 +v2.0.1-811-g028f84d From 347c1e301abddafc3f6d3ede74d45151b35c6cad Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 1 Aug 2017 23:27:47 +0200 Subject: [PATCH 19/23] [skip ci] updated version information after successful test of v2.0.1-825-g734bc69 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 74ae1f2f8..c91d51e5e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-810-g68493a0 +v2.0.1-825-g734bc69 From 84a3885af8e3549e1f478c1666b244439062ab1b Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 3 Aug 2017 12:08:51 -0400 Subject: [PATCH 20/23] negated option from "voxelspace" to "realspace". introduced logarithmic sense of curvature exponents, additional polishing --- processing/pre/geom_addPrimitive.py | 90 ++++++++++++++--------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 607e5facd..28578a063 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -36,8 +36,9 @@ parser.add_option('-c', '--center', dest='center', type='float', nargs = 3, parser.add_option('-d', '--dimension', dest='dimension', type='float', nargs = 3, metavar=' '.join(['float']*3), help='a,b,c extension of hexahedral box; negative values are diameters') parser.add_option('-e', '--exponent', dest='exponent', type='float', nargs = 3, metavar=' '.join(['float']*3), - help='i,j,k exponents for axes - 2 gives a sphere (x^2 + y^2 + z^2 < 1), 1 makes \ -octahedron (|x| + |y| + |z| < 1). Large values produce boxes, 0 - 1 is concave. ') + help='i,j,k exponents for axes - 0 gives octahedron (|x|^(2^0) + |y|^(2^0) + |z|^(2^0) < 1), \ + 1 gives a sphere (|x|^(2^1) + |y|^(2^1) + |z|^(2^1) < 1), \ + large values produce boxes, negative turns concave.') parser.add_option('-f', '--fill', dest='fill', type='int', metavar = 'int', help='grain index to fill primitive. "0" selects maximum microstructure index + 1 [%default]') parser.add_option('-q', '--quaternion', dest='quaternion', type='float', nargs = 4, metavar=' '.join(['float']*4), @@ -48,15 +49,14 @@ parser.add_option( '--degrees', dest='degrees', action='store_true', help = 'angle is given in degrees [%default]') parser.add_option( '--nonperiodic', dest='periodic', action='store_false', help = 'wrap around edges [%default]') -parser.add_option( '--voxelspace', dest='voxelspace', action='store_true', - help = '-c and -d are given in (0 to grid) coordinates instead of (origin to origin+size) \ -coordinates [%default]') +parser.add_option( '--realspace', dest='realspace', action='store_true', + help = '-c and -d span [origin,origin+size] instead of [0,grid] coordinates') parser.set_defaults(center = (.0,.0,.0), fill = 0, degrees = False, exponent = (1e10,1e10,1e10), # box shape by default periodic = True, - voxelspace = False + realspace = False, ) (options, filenames) = parser.parse_args() @@ -74,14 +74,15 @@ else: options.center = np.array(options.center) options.dimension = np.array(options.dimension) +options.exponent = np.power(2,options.exponent) # undo logarithmic sense of exponent # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False, labeled = False) + try: table = damask.ASCIItable(name = name, + buffered = False, + labeled = False) except: continue damask.util.report(scriptName,name) @@ -115,45 +116,44 @@ for name in filenames: 'microstructures': 0, } - if options.fill == 0: - options.fill = microstructure.max()+1 + options.fill = microstructure.max()+1 if options.fill == 0 else options.fill # If we have a negative dimension, make it an ellipsoid for backwards compatibility options.exponent = np.where(np.array(options.dimension) > 0, options.exponent, 2) microstructure = microstructure.reshape(info['grid'],order='F') # coordinates given in real space (default) vs voxel space - if not options.voxelspace: - options.center += info['origin'] + if options.realspace: + options.center -= info['origin'] options.center *= np.array(info['grid']) / np.array(info['size']) options.dimension *= np.array(info['grid']) / np.array(info['size']) - size = microstructure.shape + grid = microstructure.shape # change to coordinate space where the primitive is the unit sphere/cube/etc if options.periodic: # use padding to achieve periodicity - (X, Y, Z) = np.meshgrid(np.arange(-size[0]/2, (3*size[0])/2, dtype=np.float32), # 50% padding on each side - np.arange(-size[1]/2, (3*size[1])/2, dtype=np.float32), - np.arange(-size[2]/2, (3*size[2])/2, dtype=np.float32), + (X, Y, Z) = np.meshgrid(np.arange(-grid[0]/2, (3*grid[0])/2, dtype=np.float32), # 50% padding on each side + np.arange(-grid[1]/2, (3*grid[1])/2, dtype=np.float32), + np.arange(-grid[2]/2, (3*grid[2])/2, dtype=np.float32), indexing='ij') # Padding handling X = np.roll(np.roll(np.roll(X, - -size[0]/2, axis=0), - -size[1]/2, axis=1), - -size[2]/2, axis=2) + -grid[0]/2, axis=0), + -grid[1]/2, axis=1), + -grid[2]/2, axis=2) Y = np.roll(np.roll(np.roll(Y, - -size[0]/2, axis=0), - -size[1]/2, axis=1), - -size[2]/2, axis=2) + -grid[0]/2, axis=0), + -grid[1]/2, axis=1), + -grid[2]/2, axis=2) Z = np.roll(np.roll(np.roll(Z, - -size[0]/2, axis=0), - -size[1]/2, axis=1), - -size[2]/2, axis=2) + -grid[0]/2, axis=0), + -grid[1]/2, axis=1), + -grid[2]/2, axis=2) else: # nonperiodic, much lighter on resources # change to coordinate space where the primitive is the unit sphere/cube/etc - (X, Y, Z) = np.meshgrid(np.arange(0, size[0], dtype=np.float32), - np.arange(0, size[1], dtype=np.float32), - np.arange(0, size[2], dtype=np.float32), + (X, Y, Z) = np.meshgrid(np.arange(0, grid[0], dtype=np.float32), + np.arange(0, grid[1], dtype=np.float32), + np.arange(0, grid[2], dtype=np.float32), indexing='ij') # first by translating the center onto 0, 0.5 shifts the voxel origin onto the center of the voxel @@ -174,27 +174,27 @@ for name in filenames: np.seterr(over='ignore', under='ignore') if options.periodic: # use padding to achieve periodicity - inside = np.zeros(size, dtype=bool) + inside = np.zeros(grid, dtype=bool) for i in range(2): for j in range(2): for k in range(2): inside = inside | ( # Most of this is handling the padding - np.abs(X[size[0] * i : size[0] * (i+1), - size[1] * j : size[1] * (j+1), - size[2] * k : size[2] * (k+1)])**options.exponent[0] + - np.abs(Y[size[0] * i : size[0] * (i+1), - size[1] * j : size[1] * (j+1), - size[2] * k : size[2] * (k+1)])**options.exponent[1] + - np.abs(Z[size[0] * i : size[0] * (i+1), - size[1] * j : size[1] * (j+1), - size[2] * k : size[2] * (k+1)])**options.exponent[2] < 1) + np.abs(X[grid[0] * i : grid[0] * (i+1), + grid[1] * j : grid[1] * (j+1), + grid[2] * k : grid[2] * (k+1)])**options.exponent[0] + + np.abs(Y[grid[0] * i : grid[0] * (i+1), + grid[1] * j : grid[1] * (j+1), + grid[2] * k : grid[2] * (k+1)])**options.exponent[1] + + np.abs(Z[grid[0] * i : grid[0] * (i+1), + grid[1] * j : grid[1] * (j+1), + grid[2] * k : grid[2] * (k+1)])**options.exponent[2] <= 1.0) microstructure = np.where(inside, options.fill, microstructure) else: # nonperiodic, much lighter on resources microstructure = np.where(np.abs(X)**options.exponent[0] + np.abs(Y)**options.exponent[1] + - np.abs(Z)**options.exponent[2] < 1, options.fill, microstructure) + np.abs(Z)**options.exponent[2] <= 1.0, options.fill, microstructure) np.seterr(**old_settings) # Reset warnings to old state newInfo['microstructures'] = microstructure.max() @@ -209,11 +209,11 @@ for name in filenames: table.info_clear() table.info_append([ scriptID + ' ' + ' '.join(sys.argv[1:]), - "grid\ta {grid[0]}\tb {grid[1]}\tc {grid[2]}".format(grid=info['grid']), - "size\tx {size[0]}\ty {size[1]}\tz {size[2]}".format(size=info['size']), - "origin\tx {origin[0]}\ty {origin[1]}\tz {origin[2]}".format(origin=info['origin']), - "homogenization\t{homog}".format(homog=info['homogenization']), - "microstructures\t{microstructures}".format(microstructures=newInfo['microstructures']), + "grid\ta {}\tb {}\tc {}".format(*info['grid']), + "size\tx {}\ty {}\tz {}".format(*info['size']), + "origin\tx {}\ty {}\tz {}".format(*info['origin']), + "homogenization\t{}".format(info['homogenization']), + "microstructures\t{}".format(newInfo['microstructures']), extra_header ]) table.labels_clear() From 1a423617c2509ef47a5928b49091982f9c0f0d8d Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 3 Aug 2017 12:12:47 -0400 Subject: [PATCH 21/23] combined assignement of curvature exponent to deal with negative dimensions --- processing/pre/geom_addPrimitive.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 28578a063..e81ee0eb4 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -54,7 +54,7 @@ parser.add_option( '--realspace', dest='realspace', action='store_true', parser.set_defaults(center = (.0,.0,.0), fill = 0, degrees = False, - exponent = (1e10,1e10,1e10), # box shape by default + exponent = (20,20,20), # box shape by default periodic = True, realspace = False, ) @@ -74,7 +74,8 @@ else: options.center = np.array(options.center) options.dimension = np.array(options.dimension) -options.exponent = np.power(2,options.exponent) # undo logarithmic sense of exponent +# undo logarithmic sense of exponent and generate ellipsoids for negative dimensions (backward compatibility) +options.exponent = np.where(np.array(options.dimension) > 0, np.power(2,options.exponent), 2) # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] @@ -118,8 +119,6 @@ for name in filenames: options.fill = microstructure.max()+1 if options.fill == 0 else options.fill - # If we have a negative dimension, make it an ellipsoid for backwards compatibility - options.exponent = np.where(np.array(options.dimension) > 0, options.exponent, 2) microstructure = microstructure.reshape(info['grid'],order='F') # coordinates given in real space (default) vs voxel space From 6cb471e819301f4414b92e3b167c2d98b4e82f65 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 4 Aug 2017 03:08:00 +0200 Subject: [PATCH 22/23] [skip ci] updated version information after successful test of v2.0.1-833-ga28b4b3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c91d51e5e..a000cbdc4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-825-g734bc69 +v2.0.1-833-ga28b4b3 From cd57f05d78319425c2f6239b2476409a12f85e8c Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 4 Aug 2017 12:12:53 +0200 Subject: [PATCH 23/23] [skip ci] updated version information after successful test of v2.0.1-834-g1a42361 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c91d51e5e..f1877e9a9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-825-g734bc69 +v2.0.1-834-g1a42361