Commit 603aa1e6 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: preserve command-line settings in FOAM_SETTINGS

parent 4f2fde20
......@@ -142,14 +142,15 @@ fi
# Construct test string for remote execution.
# Source OpenFOAM settings if OpenFOAM environment not set.
# attempt to preserve the installation directory 'FOAM_INST_DIR'
# use FOAM_SETTINGS to pass command-line settings
if [ "$FOAM_INST_DIR" ]
then
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS"
else
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS"
fi
echo "**sourceFoam:$sourceFoam"
echo "**sourceFoam:$sourceFoam $FOAM_SETTINGS"
rm -f $PWD/mpirun.schema
touch $PWD/mpirun.schema
......
......@@ -89,7 +89,8 @@ _foamSource()
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
# Evaluate command-line parameters
# Evaluate command-line parameters and record settings for later
export FOAM_SETTINGS="$@"
while [ $# -gt 0 ]
do
case "$1" in
......
......@@ -74,7 +74,8 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!*
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
# Evaluate command-line parameters
# Evaluate command-line parameters and record settings for later
setenv FOAM_SETTINGS "${*}"
while ( $#argv > 0 )
switch ($argv[1])
case *=:
......
......@@ -108,19 +108,20 @@ fi
# Construct test string for remote execution.
# Source WM_PROJECT settings if WM_PROJECT environment not set.
# attempt to preserve the installation directory 'FOAM_INST_DIR'
# use FOAM_SETTINGS to pass command-line settings
case $sourceFoam in
*/bashrc)
if [ "$FOAM_INST_DIR" ]
then
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS"
else
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS"
fi
;;
*/cshrc)
# TODO: csh equivalent to bash code (preserving FOAM_INST_DIR)
sourceFoam='if ( ! $?WM_PROJECT ) source '"$sourceFoam"
sourceFoam='if ( ! $?WM_PROJECT ) source '"$sourceFoam $FOAM_SETTINGS"
;;
esac
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment