mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
290 lines
9.5 KiB
Bash
Executable File
290 lines
9.5 KiB
Bash
Executable File
#----------------------------------*-sh-*--------------------------------------
|
|
# CFDEMcoupling
|
|
#
|
|
# Copyright 2009-2012 JKU Linz
|
|
# Copyright 2012-2015 DCS Computing GmbH, Linz
|
|
# Copyright 2015- JKU Linz
|
|
#------------------------------------------------------------------------------
|
|
#
|
|
# File
|
|
# etc/cshrc
|
|
#
|
|
# Description
|
|
# Startup file for CFDEMcoupling
|
|
# Sourced from ~/.cshrc
|
|
#------------------------------------------------------------------------------
|
|
|
|
setenv CFDEM_PROJECT CFDEM
|
|
setenv CFDEM_VERSION 19.09
|
|
|
|
################################################################################
|
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
|
#
|
|
# Please set to the appropriate path if the default is not correct.
|
|
#
|
|
# activate compatible OpenFOAM version
|
|
. $HOME/OpenFOAM/OpenFOAM-6/etc/cshrc
|
|
#
|
|
# CFDEMcoupling
|
|
setenv CFDEM_INST_DIR $HOME/$CFDEM_PROJECT
|
|
setenv CFDEM_PROJECT_DIR $CFDEM_INST_DIR/CFDEMcoupling
|
|
setenv CFDEM_PROJECT_USER_DIR $CFDEM_INST_DIR/$USER-$WM_PROJECT_VERSION
|
|
#
|
|
# LIGGGHTS
|
|
setenv CFDEM_LIGGGHTS_INST_DIR $CFDEM_INST_DIR/LIGGGHTS
|
|
#
|
|
# LPP installation path
|
|
setenv CFDEM_LPP_INST_DIR $CFDEM_INST_DIR/LPP
|
|
#
|
|
# Path to additional libraries
|
|
setenv CFDEM_ADD_LIBS_DIR
|
|
#
|
|
# END OF (NORMAL) USER EDITABLE PART
|
|
################################################################################
|
|
|
|
#- The old dirs to be cleaned from the environment variables
|
|
set cfdemOldDirs=
|
|
if ( $?CFDEM_LIGGGHTS_BIN_DIR ) then
|
|
set cfdemOldDirs="$cfdemOldDirs $CFDEM_LIGGGHTS_BIN_DIR"
|
|
endif
|
|
if ( $?CFDEM_APP_DIR ) then
|
|
set cfdemOldDirs="$cfdemOldDirs $CFDEM_APP_DIR"
|
|
endif
|
|
if ( $?CFDEM_LIB_DIR ) then
|
|
set cfdemOldDirs="$cfdemOldDirs $CFDEM_LIB_DIR"
|
|
endif
|
|
|
|
setenv CFDEM_LIGGGHTS_SRC_DIR $CFDEM_LIGGGHTS_INST_DIR/src
|
|
setenv CFDEM_LIGGGHTS_BIN_DIR $CFDEM_LIGGGHTS_INST_DIR/src-build
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Source files, possibly with some verbosity
|
|
#------------------------------------------------------------------------------
|
|
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Evaluate command-line parameters
|
|
# these can be used to set/unset values
|
|
#------------------------------------------------------------------------------
|
|
while ( $#argv > 0 )
|
|
switch ($argv[1])
|
|
case -*:
|
|
# stray option (not meant for us here) -> get out
|
|
break
|
|
breaksw
|
|
case *=:
|
|
# name= -> unsetenv name
|
|
if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $argv[1]:s/=//"
|
|
eval "unsetenv $argv[1]:s/=//"
|
|
breaksw
|
|
case *=*:
|
|
# name=value -> setenv name value
|
|
if ($?FOAM_VERBOSE && $?prompt) echo "setenv $argv[1]:s/=/ /"
|
|
eval "setenv $argv[1]:s/=/ /"
|
|
breaksw
|
|
default:
|
|
# filename: source it
|
|
if ( -f "$1" ) then
|
|
_foamSource "$1"
|
|
else
|
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
|
endif
|
|
breaksw
|
|
endsw
|
|
shift
|
|
end
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
setenv CFDEM_SRC_DIR $CFDEM_PROJECT_DIR/src
|
|
setenv CFDEM_SOLVER_DIR $CFDEM_PROJECT_DIR/applications/solvers
|
|
setenv CFDEM_UT_DIR $CFDEM_PROJECT_DIR/applications/utilities
|
|
setenv CFDEM_DOC_DIR $CFDEM_PROJECT_DIR/doc
|
|
setenv CFDEM_TUT_DIR $CFDEM_PROJECT_DIR/tutorials
|
|
setenv CFDEM_LPP_DIR $CFDEM_LPP_INST_DIR/src
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#- CFDEM lib name
|
|
setenv CFDEM_LIB_NAME lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
|
|
|
|
#- CFDEM compressible lib name
|
|
setenv CFDEM_LIB_COMP_NAME lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION
|
|
|
|
#- Check if additional libraries should be compiled together with solvers
|
|
if ( ! ($?CFDEM_ADD_LIBS_DIR) ) then
|
|
setenv CFDEM_ADD_LIBS_DIR $CFDEM_PROJECT_DIR/etc
|
|
else
|
|
echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user."
|
|
endif
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#- LMP Many2Many lib path and makefile
|
|
setenv CFDEM_Many2ManyLIB_PATH $CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library
|
|
setenv CFDEM_Many2ManyLIB_MAKEFILENAME fedora_fpic
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#- path to test harness
|
|
setenv CFDEM_TEST_HARNESS_PATH $CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
|
|
|
|
#- path to libraries
|
|
setenv CFDEM_LIB_DIR $CFDEM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
|
|
|
|
#- path to apps
|
|
setenv CFDEM_APP_DIR $CFDEM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
|
|
|
|
#- create directories
|
|
mkdir -p $CFDEM_LIB_DIR
|
|
mkdir -p $CFDEM_APP_DIR
|
|
|
|
#- path to OF version flag file
|
|
setenv CFDEM_OFVERSION_DIR $CFDEM_PROJECT_DIR/etc/OFversion
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Clean standard environment variables (PATH, LD_LIBRARY_PATH)
|
|
#------------------------------------------------------------------------------
|
|
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
|
|
|
#- prevent local variables from shadowing setenv variables
|
|
unset PATH LD_LIBRARY_PATH
|
|
|
|
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH ''
|
|
|
|
#- Clean PATH
|
|
set cleaned=`$foamClean "$PATH" "$cfdemOldDirs"`
|
|
if ( $status == 0 ) setenv PATH $cleaned
|
|
|
|
#- Clean LD_LIBRARY_PATH
|
|
set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$cfdemOldDirs"`
|
|
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
|
|
|
|
#- add binary directories to $PATH
|
|
_foamAddPath $CFDEM_APP_DIR:$CFDEM_LIGGGHTS_BIN_DIR
|
|
_foamAddLib $CFDEM_LIB_DIR
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Cleanup environment:
|
|
#------------------------------------------------------------------------------
|
|
unset cleaned foamClean cfdemOldDirs
|
|
unalias _foamSource
|
|
|
|
#------------------------------------------------------------------------------
|
|
#- settings for lpp postproc tool
|
|
#------------------------------------------------------------------------------
|
|
|
|
#- nr of procs for lpp tool
|
|
setenv CFDEM_LPP_NPROCS 4
|
|
|
|
#- nr of procs for lpp tool
|
|
setenv CFDEM_LPP_CHUNKSIZE 1
|
|
|
|
#- shortcut to run lpp
|
|
alias lpp 'python -i $CFDEM_LPP_DIR/lpp.py --cpunum $CFDEM_LPP_NPROCS --chunksize $CFDEM_LPP_CHUNKSIZE \!:1'
|
|
|
|
#------------------------------------------------------------------------------
|
|
# aliases for easy navigation (no changes necessary)
|
|
#------------------------------------------------------------------------------
|
|
|
|
#- shortcut to cfdem path
|
|
alias cfdem 'cd $CFDEM_PROJECT_DIR'
|
|
|
|
#- shortcut to src path
|
|
alias cfdemSrc 'cd $CFDEM_SRC_DIR'
|
|
|
|
#- shortcut to tutorial path
|
|
alias cfdemTut 'cd $CFDEM_TUT_DIR'
|
|
|
|
#- shortcut to solver path
|
|
alias cfdemSol 'cd $CFDEM_SOLVER_DIR'
|
|
|
|
#- shortcut to utilities path
|
|
alias cfdemUt 'cd $CFDEM_UT_DIR'
|
|
|
|
#- shortcut to run path
|
|
alias cfdemRun 'cd $CFDEM_PROJECT_USER_DIR/run'
|
|
|
|
#- shortcut to user solver path
|
|
alias cfdemUsrSol 'cd $CFDEM_PROJECT_USER_DIR/applications/solvers'
|
|
|
|
#- shortcut to documentation path
|
|
alias cfdemDoc 'cd $CFDEM_DOC_DIR'
|
|
|
|
#- shortcut to open the doxygen with firefox
|
|
alias cfdemDox 'firefox $CFDEM_DOC_DIR/doxygen/html/index.html'
|
|
|
|
#- shortcut to LIGGGHTS path
|
|
alias cfdemLIG 'cd $CFDEM_LIGGGHTS_SRC_DIR'
|
|
|
|
#- shortcut to system test
|
|
alias cfdemSysTest 'bash $CFDEM_PROJECT_DIR/etc/cfdemSystemTest.sh'
|
|
|
|
#- shortcut to pull LIGGGHTS
|
|
alias cfdemPullLIG 'bash $CFDEM_PROJECT_DIR/etc/pullLIGGGHTS.sh'
|
|
|
|
#- shortcut to pull CFDEMcoupling
|
|
alias cfdemPullCFDEMcoupling 'bash $CFDEM_PROJECT_DIR/etc/pullCFDEMcoupling.sh'
|
|
|
|
#- shortcut to clean CFDEM
|
|
alias cfdemCleanCFDEM 'bash $CFDEM_PROJECT_DIR/etc/cleanCFDEMcoupling.sh'
|
|
|
|
#- shortcut to compile LIGGGHTS + sublibraries
|
|
alias cfdemCompLIG 'bash $CFDEM_PROJECT_DIR/etc/compileLIGGGHTS.sh'
|
|
|
|
#- shortcut to compile CFDEMcoupling +LIGGGHTS
|
|
alias cfdemCompCFDEMall 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_all.sh'
|
|
|
|
#- shortcut to compile CFDEMcoupling (src+solvers)
|
|
alias cfdemCompCFDEM 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling.sh'
|
|
|
|
#- shortcut to compile CFDEMcoupling src
|
|
alias cfdemCompCFDEMsrc 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_src.sh'
|
|
|
|
#- shortcut to compile CFDEMcoupling solvers
|
|
alias cfdemCompCFDEMsol 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_sol.sh'
|
|
|
|
#- shortcut to compile CFDEMcoupling utilities
|
|
alias cfdemCompCFDEMuti 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_uti.sh'
|
|
|
|
#- shortcut to test basic tutorials
|
|
alias cfdemTestTUT 'bash $CFDEM_PROJECT_DIR/etc/testTutorials.sh'
|
|
|
|
#- shortcut to visualize the clock model data
|
|
alias vizClock 'python $CFDEM_UT_DIR/vizClock/matPlot.py'
|
|
|
|
#- shortcut to run liggghts in serial
|
|
alias cfdemLiggghts '$CFDEM_LIGGGHTS_BIN_DIR/liggghts'
|
|
|
|
#- shortcut to run liggghts in parallel (no fcts in csh...)
|
|
alias cfdemLiggghtsPar 'echo "mpirun -np xx -machinefile mynodes $CFDEM_LIGGGHTS_BIN_DIR/liggghts < in.liggghts_init"'
|
|
|
|
#- shortcut to run liggghts in parallel
|
|
# unfortunately no functions available in csh
|
|
|
|
#- shortcut to run lpp
|
|
alias lpp 'python -i $CFDEM_LPP_DIR/lpp.py \!:1'
|
|
|
|
#- check if the user directory exists
|
|
if ( -d "$CFDEM_PROJECT_USER_DIR" ) then
|
|
:
|
|
else
|
|
if ( -d "$CFDEM_PROJECT_DIR" ) then
|
|
echo "make new dirs $CFDEM_PROJECT_USER_DIR ? (y/n)"
|
|
set YN=$<
|
|
if ( $YN == "y" ) then
|
|
mkdir -p $CFDEM_PROJECT_USER_DIR
|
|
cd $CFDEM_PROJECT_USER_DIR
|
|
mkdir run
|
|
mkdir -p log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
|
|
mkdir -p applications/solvers
|
|
else
|
|
echo "aborted by user."
|
|
exit
|
|
endif
|
|
else
|
|
echo "error in CFDEMcoupling's cshrc."
|
|
exit
|
|
endif
|
|
endif
|