Commit f0375fc3 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents 0f6f3e3c 8752f77a
...@@ -41,7 +41,7 @@ isTest() ...@@ -41,7 +41,7 @@ isTest()
getNumberOfProcessors() getNumberOfProcessors()
{ {
if [ -f $1 ] if [ -f "$1" ]
then then
expandDictionary $1 | sed -ne 's/^numberOfSubdomains\s*\(.*\);/\1/p' expandDictionary $1 | sed -ne 's/^numberOfSubdomains\s*\(.*\);/\1/p'
fi fi
...@@ -166,7 +166,7 @@ compileApplication() ...@@ -166,7 +166,7 @@ compileApplication()
cloneCase() cloneCase()
{ {
if [ -d $2 ] if [ -d "$2" ]
then then
echo "Case already cloned: remove case directory $2 to clone" echo "Case already cloned: remove case directory $2 to clone"
else else
...@@ -175,9 +175,22 @@ cloneCase() ...@@ -175,9 +175,22 @@ cloneCase()
cpfiles="0 system constant" cpfiles="0 system constant"
for f in $cpfiles for f in $cpfiles
do do
cp -r $1/$f $2 \cp -r $1/$f $2
done done
fi fi
} }
# Overwrite 0/ with the contents of 0.org/ if it exists
restore0Dir()
{
echo "Restore 0/ from 0.org/"
if [ -d 0.org ]
then
\rm -rf 0
\cp -r 0.org 0 > /dev/null 2>&1
else
echo " Warning: no 0.org/ found"
fi
}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -180,6 +180,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight` ...@@ -180,6 +180,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW`
# Clean environment paths again. Only remove duplicates # Clean environment paths again. Only remove duplicates
......
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config.sh/FFTW
#
# Description
# Setup file for FFTW include/libraries.
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
#
# If using system-wide installations, use the following settings:
#
# fftw_version=fftw-system
#
# If the system fftw is unusable (eg, too old) and you don't
# have or want a ThirdParty installation:
#
# fftw_version=fftw-none
#
# If using a central installation, but not located under ThirdParty:
# - specify fftw-system
# - provide full paths for FFTW_ARCH_PATH
#
# Note
# When building OpenFOAM, any changes made here MUST be made in the
# equivalent config.sh version too, since that is the one which will
# be used during the build process.
#
#------------------------------------------------------------------------------
set fftw_version=fftw-system
setenv FFTW_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
#------------------------------------------------------------------------------
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using fftw ($fftw_version) -> $FFTW_ARCH_PATH"
endif
# If FFTW_ARCH_PATH does not end with '-system' or '-none',
# it is either located within ThirdParty, or a central installation
# outside of ThirdParty and must be added to the lib-path.
set ending="${FFTW_ARCH_PATH:t}"
if ( "$ending" != "fftw-none" && "$ending" != "fftw-system" ) then
_foamAddLib $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
endif
unset fftw_version ending
#------------------------------------------------------------------------------
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config.sh/FFTW
#
# Description
# Setup file for FFTW include/libraries.
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
#
# If using system-wide installations, use the following settings:
#
# fftw_version=fftw-system
#
# If the system fftw is unusable (eg, too old) and you don't
# have or want a ThirdParty installation:
#
# fftw_version=fftw-none
#
# If using a central installation, but not located under ThirdParty:
# - specify fftw-system
# - provide full paths for FFTW_ARCH_PATH
#
# Note
# When _foamAddLib is unset (eg, called from makeFFTW):
# - fftw_version variable is retained.
# - the LD_LIBRARY_PATH is not adjusted.
#------------------------------------------------------------------------------
fftw_version=fftw-system
export FFTW_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
#------------------------------------------------------------------------------
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using fftw ($fftw_version) -> $FFTW_ARCH_PATH" 1>&2
fi
if type _foamAddLib > /dev/null 2>&1 # normal sourcing
then
# If FFTW_ARCH_PATH does not end with '-system' or '-none',
# it is either located within ThirdParty, or a central installation
# outside of ThirdParty and must be added to the lib-path.
ending="${FFTW_ARCH_PATH_PATH##*-}"
if [ "$ending" != none -a "$ending" != system ]
then
_foamAddLib $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
fi
unset fftw_version ending
fi
#------------------------------------------------------------------------------
...@@ -211,6 +211,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi` ...@@ -211,6 +211,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/paraview` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/paraview`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/FFTW`
# Clean environment paths again. Only remove duplicates # Clean environment paths again. Only remove duplicates
......
...@@ -369,8 +369,10 @@ void Foam::profiling::Information::update(const scalar& elapsed) ...@@ -369,8 +369,10 @@ void Foam::profiling::Information::update(const scalar& elapsed)
bool Foam::profiling::writeData(Ostream& os) const bool Foam::profiling::writeData(Ostream& os) const
{ {
os << indent << "profiling" << nl os.beginBlock("profiling") << nl; // FUTURE: without nl
<< indent << token::BEGIN_LIST << incrIndent << nl;
// Add extra new line between entries
label nTrigger = 0;
// write on-stack items // write on-stack items
// newest is first on the stack, top-level is at the end // newest is first on the stack, top-level is at the end
...@@ -382,6 +384,10 @@ bool Foam::profiling::writeData(Ostream& os) const ...@@ -382,6 +384,10 @@ bool Foam::profiling::writeData(Ostream& os) const
const Information *info = *iter; const Information *info = *iter;
scalar elapsed = timers_[info->id()]->elapsedTime(); scalar elapsed = timers_[info->id()]->elapsedTime();
if (nTrigger++)
{
os << nl;
}
info->write(os, true, elapsed, oldElapsed); info->write(os, true, elapsed, oldElapsed);
oldElapsed = elapsed; oldElapsed = elapsed;
} }
...@@ -406,13 +412,15 @@ bool Foam::profiling::writeData(Ostream& os) const ...@@ -406,13 +412,15 @@ bool Foam::profiling::writeData(Ostream& os) const
forAllConstIter(LookupContainer, lookup, iter) forAllConstIter(LookupContainer, lookup, iter)
{ {
if (nTrigger++)
{
os << nl;
}
iter()->write(os); iter()->write(os);
} }
} }
os << decrIndent os.endBlock() << nl; // FUTURE: without nl
<< indent << token::END_LIST << token::END_STATEMENT << nl;
if (sysInfo_) if (sysInfo_)
{ {
...@@ -528,8 +536,7 @@ Foam::Ostream& Foam::profiling::Information::write ...@@ -528,8 +536,7 @@ Foam::Ostream& Foam::profiling::Information::write
{ {
// write in dictionary format // write in dictionary format
// os.beginBlock("_" + Foam::name(id_)) << nl; os.beginBlock("trigger" + Foam::name(id_)) << nl; // FUTURE: without nl
os.beginBlock() << nl; // FUTURE: without nl
// FUTURE: os.writeEntry(key, value); // FUTURE: os.writeEntry(key, value);
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name # Get application name
application=`getApplication` application=$(getApplication)
runApplication blockMesh runApplication blockMesh
runApplication boxTurb runApplication boxTurb
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name # Get application name
application=`getApplication` application=$(getApplication)
runAnsysToFoam() runAnsysToFoam()
{ {
......
...@@ -4,9 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -4,9 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication` application=$(getApplication)
cp -r 0.org 0 > /dev/null 2>&1 restore0Dir
runApplication blockMesh runApplication blockMesh
runApplication $application -withFunctionObjects -writePhi -writep runApplication $application -withFunctionObjects -writePhi -writep
runApplication streamFunction runApplication streamFunction
......
...@@ -4,9 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -4,9 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication` application=$(getApplication)
cp -r 0.org 0 > /dev/null 2>&1 restore0Dir
runApplication blockMesh runApplication blockMesh
runApplication $application -writePhi -writep runApplication $application -writePhi -writep
runApplication streamFunction runApplication streamFunction
......
...@@ -5,8 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,8 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -rf 0 restore0Dir
cp -r 0.org 0
runApplication blockMesh runApplication blockMesh
runApplication changeDictionary runApplication changeDictionary
runApplication topoSet runApplication topoSet
...@@ -14,6 +13,6 @@ runApplication topoSet ...@@ -14,6 +13,6 @@ runApplication topoSet
runApplication PDRMesh -overwrite runApplication PDRMesh -overwrite
# Run # Run
runApplication `getApplication` runApplication $(getApplication)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -6,12 +6,12 @@ cd ${0%/*} || exit 1 ...@@ -6,12 +6,12 @@ cd ${0%/*} || exit 1
./Allrun.mesh ./Allrun.mesh
rm -rf 0 && cp -r 0.org 0 restore0Dir
runApplication decomposePar -force runApplication decomposePar -force
runParallel potentialFoam -pName pPotential -initialiseUBCs runParallel potentialFoam -pName pPotential -initialiseUBCs
rm -f processor*/0/phi \rm -f processor*/0/phi
runParallel XiDyMFoam runParallel XiDyMFoam
...@@ -33,7 +33,7 @@ cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2 ...@@ -33,7 +33,7 @@ cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2
cp -r ../moriyoshiHomogeneous/0.005 . cp -r ../moriyoshiHomogeneous/0.005 .
setControlDict setControlDict
runApplication `getApplication` runApplication $(getApplication)
) )
# Clone case for hydrogen # Clone case for hydrogen
...@@ -48,7 +48,7 @@ cloneCase moriyoshiHomogeneous moriyoshiHomogeneousHydrogen ...@@ -48,7 +48,7 @@ cloneCase moriyoshiHomogeneous moriyoshiHomogeneousHydrogen
constant/thermophysicalProperties.propane constant/thermophysicalProperties.propane
mv constant/thermophysicalProperties.hydrogen \ mv constant/thermophysicalProperties.hydrogen \
constant/thermophysicalProperties constant/thermophysicalProperties
runApplication `getApplication` runApplication $(getApplication)
) )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name # Set application name
application=`getApplication` application=$(getApplication)
runApplication $application runApplication $application
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name # Set application name
application=`getApplication` application=$(getApplication)
runApplication $application runApplication $application
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name # Set application name
application=`getApplication` application=$(getApplication)
runApplication $application runApplication $application
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name # Set application name
application=`getApplication` application=$(getApplication)
runApplication $application runApplication $application
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name # Get application name
application=`getApplication` application=$(getApplication)
runApplication kivaToFoam -file otape17 runApplication kivaToFoam -file otape17
......
...@@ -34,7 +34,7 @@ rm log.createPatch ...@@ -34,7 +34,7 @@ rm log.createPatch
runApplication createPatch -region filmRegion -overwrite runApplication createPatch -region filmRegion -overwrite
# Run # Run
runApplication `getApplication` runApplication $(getApplication)
paraFoam -touchAll paraFoam -touchAll
......
...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name # Set application name
application=`getApplication` application=$(getApplication)
runApplication blockMesh runApplication blockMesh
...@@ -34,7 +34,7 @@ runApplication -s panelRegion \ ...@@ -34,7 +34,7 @@ runApplication -s panelRegion \
runApplication -s fields \ runApplication -s fields \
decomposePar -fields decomposePar -fields
runParallel `getApplication` runParallel $(getApplication)
paraFoam -touch paraFoam -touch
paraFoam -touch -region panelRegion paraFoam -touch -region panelRegion
......
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