Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-07-26 13:49:17 +01:00
7 changed files with 93 additions and 34 deletions

View File

@ -246,6 +246,12 @@ bool merge
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addOption
(
"dict",
"file",
"specify an alternative to system/changeDictionaryDict"
);
argList::addOption argList::addOption
( (
"instance", "instance",
@ -268,6 +274,18 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word dictName("changeDictionaryDict");
fileName dictPath = dictName;
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
const bool literalRE = args.optionFound("literalRE"); const bool literalRE = args.optionFound("literalRE");
if (literalRE) if (literalRE)
@ -313,15 +331,26 @@ int main(int argc, char *argv[])
// Get the replacement rules from a dictionary // Get the replacement rules from a dictionary
IOdictionary dict IOdictionary dict
( (
IOobject
( (
"changeDictionaryDict", args.optionFound("dict")
runTime.system(), ? IOobject
mesh, (
IOobject::MUST_READ_IF_MODIFIED, dictPath,
IOobject::NO_WRITE mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
: IOobject
(
dictName,
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
) )
); );
const dictionary& replaceDicts = dict.subDict("dictionaryReplacement"); const dictionary& replaceDicts = dict.subDict("dictionaryReplacement");
Info<< "Read dictionary " << dict.name() Info<< "Read dictionary " << dict.name()
<< " with replacements for dictionaries " << " with replacements for dictionaries "

View File

@ -44,7 +44,7 @@
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
usage() { usage() {
[ "${quietOpt:-$silentOpt}" = true ] && exit 1 [ "${optQuiet:-$optSilent}" = true ] && exit 1
exec 1>&2 exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -53,6 +53,7 @@ usage() {
Usage: ${0##*/} [OPTION] fileName Usage: ${0##*/} [OPTION] fileName
${0##*/} [OPTION] -list ${0##*/} [OPTION] -list
options: options:
-all return all files (otherwise stop after the first match)
-list list the directories to be searched -list list the directories to be searched
-mode <mode> any combination of u(user), g(group), o(other) -mode <mode> any combination of u(user), g(group), o(other)
-prefix <dir> specify an alternative installation prefix -prefix <dir> specify an alternative installation prefix
@ -129,7 +130,7 @@ esac
# default mode is 'ugo' # default mode is 'ugo'
mode=ugo mode=ugo
unset listOpt quietOpt silentOpt unset optAll optList optQuiet optSilent
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
@ -138,8 +139,11 @@ do
-h | -help) -h | -help)
usage usage
;; ;;
-a | -all)
optAll=true
;;
-l | -list) -l | -list)
listOpt=true optList=true
;; ;;
-m | -mode) -m | -mode)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
@ -161,10 +165,10 @@ do
shift shift
;; ;;
-q | -quiet) -q | -quiet)
quietOpt=true optQuiet=true
;; ;;
-s | -silent) -s | -silent)
silentOpt=true optSilent=true
;; ;;
-v | -version) -v | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
@ -239,14 +243,15 @@ set -- $dirList
# The main routine # The main routine
# #
if [ "$listOpt" = true ] exitCode=0
if [ "$optList" = true ]
then then
# list directories, or potential file locations # list directories, or potential file locations
[ "$nArgs" -le 1 ] || usage [ "$nArgs" -le 1 ] || usage
# a silly combination, but -quiet does have precedence # a silly combination, but -quiet does have precedence
[ "$quietOpt" = true ] && exit 0 [ "$optQuiet" = true ] && exit 0
for dir for dir
do do
@ -257,25 +262,32 @@ then
echo "$dir" echo "$dir"
fi fi
done done
exit 0
else else
[ "$nArgs" -eq 1 ] || usage [ "$nArgs" -eq 1 ] || usage
# general error, eg file not found
exitCode=2
for dir for dir
do do
if [ -f "$dir/$fileName" ] if [ -f "$dir/$fileName" ]
then then
[ "$quietOpt" = true ] || echo "$dir/$fileName" exitCode=0
exit 0 if [ "$optQuiet" = true ]
then
break
else
echo "$dir/$fileName"
[ "$optAll" = true ] || break
fi
fi fi
done done
fi fi
# general error, eg file not found exit $exitCode
exit 2
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -97,6 +97,9 @@ cleanCase()
cellToRegion cellLevel* pointLevel* \ cellToRegion cellLevel* pointLevel* \
> /dev/null 2>&1 \ > /dev/null 2>&1 \
) )
rm -rf constant/tetDualMesh > /dev/null 2>&1
rm -rf VTK > /dev/null 2>&1 rm -rf VTK > /dev/null 2>&1
rm -f 0/cellLevel 0/pointLevel rm -f 0/cellLevel 0/pointLevel

View File

@ -141,10 +141,15 @@ public:
) )
) )
{ {
if (!schemeData.eof()) if (!schemeData.eof())
{ {
IOWarningIn("linearUpwind(const fvMesh&, Istream&)", schemeData) IOWarningIn
<< "unexpected additional entries in stream." << nl (
"linearUpwind(const fvMesh&, "
"const surfaceScalarField& faceFlux, Istream&)",
schemeData
) << "unexpected additional entries in stream." << nl
<< " Only the name of the gradient scheme in the" << " Only the name of the gradient scheme in the"
" 'gradSchemes' dictionary should be specified." " 'gradSchemes' dictionary should be specified."
<< endl; << endl;

View File

@ -111,11 +111,17 @@ public:
) )
) )
{ {
IOWarningIn("linearUpwindV(const fvMesh&, Istream&)", schemeData) if (!schemeData.eof())
<< "unexpected additional entries in stream." << nl {
<< " Only the name of the gradient scheme in the" IOWarningIn
" 'gradSchemes' dictionary should be specified." (
<< endl; "linearUpwindV(const fvMesh&, Istream&)",
schemeData
) << "unexpected additional entries in stream." << nl
<< " Only the name of the gradient scheme in the"
" 'gradSchemes' dictionary should be specified."
<< endl;
}
} }
//- Construct from faceFlux and Istream //- Construct from faceFlux and Istream
@ -137,11 +143,18 @@ public:
) )
) )
{ {
IOWarningIn("linearUpwindV(const fvMesh&, Istream&)", schemeData) if (!schemeData.eof())
<< "unexpected additional entries in stream." << nl {
<< " Only the name of the gradient scheme in the" IOWarningIn
" 'gradSchemes' dictionary should be specified." (
<< endl; "linearUpwindV(const fvMesh&, "
"const surfaceScalarField& faceFlux, Istream&)",
schemeData
) << "unexpected additional entries in stream." << nl
<< " Only the name of the gradient scheme in the"
" 'gradSchemes' dictionary should be specified."
<< endl;
}
} }

View File

@ -52,7 +52,7 @@ boundaryField
{ {
type porousBafflePressure; type porousBafflePressure;
patchType cyclic; patchType cyclic;
jump uniform 0; jump uniform 0 value uniform 0;
D 700; D 700;
I 500; I 500;
length 1.05; length 1.05;

View File

@ -1,3 +0,0 @@
faceSet cyclicFaces new boxToFace (0.3015 0.0493 -1) (0.3069 0.2077 1);
cellSet cyclicFacesSlaveCells new boxToCell (-1 0 -1) (0.305 0.31 1)
faceZoneSet cyclicZoneFaces new setsToFaceZone cyclicFaces cyclicFacesSlaveCells