Merge branch 'olesenm'

This commit is contained in:
andy
2011-03-08 13:59:37 +00:00
43 changed files with 285 additions and 195 deletions

View File

@ -33,10 +33,20 @@ writeInterval #codeStream
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
#}; #};
localCode
#{
static int someCode()
{
Info<<"called someCode\n";
return 10;
}
#};
code code
#{ #{
label interval = ($endIter - $begIter); label interval = ($endIter - $begIter);
label nDumps = $nDumps; // label nDumps = $nDumps;
label nDumps = someCode();
os << (interval / nDumps); os << (interval / nDumps);
#}; #};
}; };

View File

@ -8,4 +8,3 @@ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lfiniteVolume \ -lfiniteVolume \
-lcompressibleRASModels -lcompressibleRASModels

View File

@ -34,26 +34,37 @@ Description
${codeInclude} ${codeInclude}
//}}} end codeInclude //}}} end codeInclude
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // namespace Foam
{
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
//{{{ begin localCode
${localCode}
//}}} end localCode
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
extern "C" extern "C"
{ {
void ${typeName} void ${typeName}
( (
Ostream& os, Ostream& os,
const dictionary& dict const dictionary& dict
) )
{ {
//{{{ begin code //{{{ begin code
${code}; ${code}
//}}} end code //}}} end code
}
} }
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -38,6 +38,13 @@ ${codeInclude}
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
//{{{ begin localCode
${localCode}
//}}} end localCode
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
extern "C" extern "C"
@ -60,6 +67,17 @@ extern "C"
} }
} }
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeRemovablePatchTypeField
(
fvPatchScalarField,
${typeName}FixedValueFvPatchScalarField
);
const char* ${typeName}FixedValueFvPatchScalarField::SHA1sum = "${SHA1sum}";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -177,22 +195,13 @@ void ${typeName}FixedValueFvPatchScalarField::updateCoeffs()
} }
//{{{ begin code //{{{ begin code
${code}; ${code}
//}}} end code //}}} end code
fixedValueFvPatchScalarField::updateCoeffs(); fixedValueFvPatchScalarField::updateCoeffs();
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeRemovablePatchTypeField
(
fvPatchScalarField,
${typeName}FixedValueFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -55,6 +55,9 @@ class ${typeName}FixedValueFvPatchScalarField
public: public:
//- Information about the SHA1 of the code itself
static const char* SHA1sum;
//- Runtime type information //- Runtime type information
TypeName("${typeName}"); TypeName("${typeName}");

View File

@ -64,8 +64,8 @@ set foamCompiler=system
# WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc) # WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc)
setenv WM_COMPILER Gcc setenv WM_COMPILER Gcc
setenv WM_COMPILER_ARCH # defined but empty setenv WM_COMPILER_ARCH # defined but empty
setenv WM_COMPILER_LIB_ARCH # defined but empty unsetenv WM_COMPILER_LIB_ARCH
#
#- Architecture: #- Architecture:
# WM_ARCH_OPTION = 32 | 64 # WM_ARCH_OPTION = 32 | 64
setenv WM_ARCH_OPTION 64 setenv WM_ARCH_OPTION 64

View File

@ -164,18 +164,19 @@ case ThirdParty:
_foamAddMan $gccDir/man _foamAddMan $gccDir/man
_foamAddPath $gccDir/bin _foamAddPath $gccDir/bin
# add compiler libraries to run-time environment
# 64-bit needs lib64, but 32-bit needs lib (not lib32) # 64-bit needs lib64, but 32-bit needs lib (not lib32)
if ($WM_ARCH_OPTION == 64) then if ($WM_ARCH_OPTION == 64 && $?WM_COMPILER_LIB_ARCH) then
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
else else
_foamAddLib $gccDir/lib _foamAddLib $gccDir/lib
endif endif
# add in gmp/mpfr libraries # add gmp/mpfr libraries to run-time environment
_foamAddLib $gmpDir/lib _foamAddLib $gmpDir/lib
_foamAddLib $mpfrDir/lib _foamAddLib $mpfrDir/lib
# add in mpc libraries (not need for older gcc) # add mpc libraries (not need for older gcc) to run-time environment
if ( $?mpc_version ) then if ( $?mpc_version ) then
_foamAddLib $mpcDir/lib _foamAddLib $mpcDir/lib
endif endif

View File

@ -182,6 +182,7 @@ OpenFOAM | ThirdParty)
_foamAddMan $gccDir/man _foamAddMan $gccDir/man
_foamAddPath $gccDir/bin _foamAddPath $gccDir/bin
# add compiler libraries to run-time environment
# 64-bit needs lib64, but 32-bit needs lib (not lib32) # 64-bit needs lib64, but 32-bit needs lib (not lib32)
if [ "$WM_ARCH_OPTION" = 64 ] if [ "$WM_ARCH_OPTION" = 64 ]
then then
@ -190,11 +191,12 @@ OpenFOAM | ThirdParty)
_foamAddLib $gccDir/lib _foamAddLib $gccDir/lib
fi fi
# add in gmp/mpfr libraries
# add gmp/mpfr libraries to run-time environment
_foamAddLib $gmpDir/lib _foamAddLib $gmpDir/lib
_foamAddLib $mpfrDir/lib _foamAddLib $mpfrDir/lib
# add in mpc libraries (not need for older gcc) # add mpc libraries (not need for older gcc) to run-time environment
if [ -n "$mpc_version" ] if [ -n "$mpc_version" ]
then then
_foamAddLib $mpcDir/lib _foamAddLib $mpcDir/lib

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
wmakeCheckPwd "$WM_PROJECT_DIR/src" || { wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
echo "Error: Current directory is not \$WM_PROJECT_DIR/src" echo "Error: Current directory is not \$WM_PROJECT_DIR/src"
@ -25,49 +25,49 @@ wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX}
Pstream/Allwmake $* Pstream/Allwmake $*
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake OSspecific/${WM_OSTYPE:-POSIX}/Allwmake
wmake $makeOption OpenFOAM wmake $makeType OpenFOAM
wmake $makeOption fileFormats wmake $makeType fileFormats
wmake $makeOption triSurface wmake $makeType triSurface
wmake $makeOption meshTools wmake $makeType meshTools
wmake $makeOption edgeMesh wmake $makeType edgeMesh
wmake $makeOption surfMesh wmake $makeType surfMesh
# Decomposition methods needed by dummyThirdParty # Decomposition methods needed by dummyThirdParty
parallel/decompose/AllwmakeLnInclude parallel/decompose/AllwmakeLnInclude
# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools # dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
dummyThirdParty/Allwmake $* dummyThirdParty/Allwmake $*
wmake $makeOption finiteVolume wmake $makeType finiteVolume
wmake $makeOption lagrangian/basic wmake $makeType lagrangian/basic
wmake $makeOption lagrangian/distributionModels wmake $makeType lagrangian/distributionModels
wmake $makeOption genericPatchFields wmake $makeType genericPatchFields
# Build the proper scotchDecomp, metisDecomp etc. # Build the proper scotchDecomp, metisDecomp etc.
parallel/Allwmake $* parallel/Allwmake $*
wmake $makeOption conversion wmake $makeType conversion
wmake $makeOption sampling wmake $makeType sampling
wmake $makeOption dynamicMesh wmake $makeType dynamicMesh
wmake $makeOption dynamicFvMesh wmake $makeType dynamicFvMesh
wmake $makeOption topoChangerFvMesh wmake $makeType topoChangerFvMesh
wmake $makeOption ODE wmake $makeType ODE
wmake $makeOption randomProcesses wmake $makeType randomProcesses
thermophysicalModels/Allwmake $* thermophysicalModels/Allwmake $*
transportModels/Allwmake $* transportModels/Allwmake $*
turbulenceModels/Allwmake $* turbulenceModels/Allwmake $*
wmake $makeOption surfaceFilmModels wmake $makeType surfaceFilmModels
lagrangian/Allwmake $* lagrangian/Allwmake $*
postProcessing/Allwmake $* postProcessing/Allwmake $*
mesh/Allwmake $* mesh/Allwmake $*
fvAgglomerationMethods/Allwmake $* fvAgglomerationMethods/Allwmake $*
wmake $makeOption fvMotionSolver wmake $makeType fvMotionSolver
wmake $makeOption engine wmake $makeType engine
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -373,6 +373,7 @@ void Foam::dynamicCode::setFilterContext
const dynamicCodeContext& context const dynamicCodeContext& context
) )
{ {
filterVars_.set("localCode", context.localCode());
filterVars_.set("code", context.code()); filterVars_.set("code", context.code());
filterVars_.set("codeInclude", context.include()); filterVars_.set("codeInclude", context.include());
filterVars_.set("SHA1sum", context.sha1().str()); filterVars_.set("SHA1sum", context.sha1().str());
@ -523,7 +524,7 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
bool Foam::dynamicCode::wmakeLibso() const bool Foam::dynamicCode::wmakeLibso() const
{ {
const Foam::string wmakeCmd("wmake libso " + this->codeRelPath()); const Foam::string wmakeCmd("wmake -s libso " + this->codeRelPath());
Info<< "Invoking " << wmakeCmd << endl; Info<< "Invoking " << wmakeCmd << endl;
if (Foam::system(wmakeCmd)) if (Foam::system(wmakeCmd))

View File

@ -35,6 +35,7 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
: :
dict_(dict), dict_(dict),
code_(stringOps::trim(dict["code"])), code_(stringOps::trim(dict["code"])),
localCode_(),
include_(), include_(),
options_() options_()
{ {
@ -45,6 +46,13 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
// - necessary for compilation options, convenient for includes // - necessary for compilation options, convenient for includes
// and body. // and body.
// optional
if (dict.found("localCode"))
{
localCode_ = stringOps::trim(dict["localCode"]);
stringOps::inplaceExpand(localCode_, dict);
}
// optional // optional
if (dict.found("codeInclude")) if (dict.found("codeInclude"))
{ {
@ -59,9 +67,9 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
stringOps::inplaceExpand(options_, dict); stringOps::inplaceExpand(options_, dict);
} }
// calculate SHA1 digest from include, options, code // calculate SHA1 digest from include, options, localCode, code
OSHA1stream os; OSHA1stream os;
os << include_ << options_ << code_; os << include_ << options_ << localCode_ << code_;
sha1_ = os.digest(); sha1_ = os.digest();
} }

View File

@ -57,6 +57,9 @@ class dynamicCodeContext
//- Mandatory "code" entry //- Mandatory "code" entry
string code_; string code_;
//- Optional "localCode" entry
string localCode_;
//- Optional "codeInclude" entry //- Optional "codeInclude" entry
string include_; string include_;
@ -99,6 +102,12 @@ public:
return code_; return code_;
} }
//- Return the local (file-scope) code
const string& localCode() const
{
return localCode_;
}
//- Return SHA1 digest calculated from include, options, code //- Return SHA1 digest calculated from include, options, code
const SHA1Digest& sha1() const const SHA1Digest& sha1() const
{ {

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption dummy wmake $makeType dummy
case "$WM_MPLIB" in case "$WM_MPLIB" in
*MPI*) *MPI*)
@ -13,11 +13,11 @@ case "$WM_MPLIB" in
echo echo
set -x set -x
# force compilation into qualified directory # force compilation into qualified directory
WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeOption mpi WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeType mpi
;; ;;
#GAMMA) #GAMMA)
# wmake $makeOption gamma # wmake $makeType gamma
# ;; # ;;
esac esac

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption wmake $makeType
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption scotchDecomp wmake $makeType scotchDecomp
wmake $makeOption ptscotchDecomp wmake $makeType ptscotchDecomp
wmake $makeOption metisDecomp wmake $makeType metisDecomp
wmake $makeOption MGridGen wmake $makeType MGridGen
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -45,6 +45,7 @@ const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateC
const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateH const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateH
= "fixedValueFvPatchScalarFieldTemplate.H"; = "fixedValueFvPatchScalarFieldTemplate.H";
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
void* Foam::codedFixedValueFvPatchScalarField::loadLibrary void* Foam::codedFixedValueFvPatchScalarField::loadLibrary
@ -352,7 +353,7 @@ codedFixedValueFvPatchScalarField
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
dict_(ptf.dict_), dict_(ptf.dict_),
redirectType_(ptf.redirectType_), redirectType_(ptf.redirectType_),
oldLibPath_(), oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_() redirectPatchFieldPtr_()
{} {}
@ -384,7 +385,7 @@ codedFixedValueFvPatchScalarField
fixedValueFvPatchField<scalar>(ptf), fixedValueFvPatchField<scalar>(ptf),
dict_(ptf.dict_), dict_(ptf.dict_),
redirectType_(ptf.redirectType_), redirectType_(ptf.redirectType_),
oldLibPath_(), oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_() redirectPatchFieldPtr_()
{} {}
@ -399,7 +400,7 @@ codedFixedValueFvPatchScalarField
fixedValueFvPatchField<scalar>(ptf, iF), fixedValueFvPatchField<scalar>(ptf, iF),
dict_(ptf.dict_), dict_(ptf.dict_),
redirectType_(ptf.redirectType_), redirectType_(ptf.redirectType_),
oldLibPath_(), oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_() redirectPatchFieldPtr_()
{} {}
@ -412,7 +413,7 @@ Foam::codedFixedValueFvPatchScalarField::redirectPatchField() const
if (!redirectPatchFieldPtr_.valid()) if (!redirectPatchFieldPtr_.valid())
{ {
// Construct a patch // Construct a patch
// Make sure to construct the patchfield with uptodate value. // Make sure to construct the patchfield with up-to-date value
OStringStream os; OStringStream os;
os.writeKeyword("type") << redirectType_ << token::END_STATEMENT os.writeKeyword("type") << redirectType_ << token::END_STATEMENT
@ -420,19 +421,6 @@ Foam::codedFixedValueFvPatchScalarField::redirectPatchField() const
static_cast<const scalarField&>(*this).writeEntry("value", os); static_cast<const scalarField&>(*this).writeEntry("value", os);
IStringStream is(os.str()); IStringStream is(os.str());
dictionary dict(is); dictionary dict(is);
// Info<< "constructing patchField from :" << dict << endl;
// if (fvPatchScalarField::dictionaryConstructorTablePtr_)
// {
// fvPatchScalarField::dictionaryConstructorPtr funcPtr =
// (
// fvPatchScalarField::dictionaryConstructorTablePtr_->
// find(redirectType_)()
// );
//
// Info<< redirectType_ << " FunctionPtr => "
// << long(funcPtr) << endl;
// }
redirectPatchFieldPtr_.set redirectPatchFieldPtr_.set
( (
@ -455,7 +443,7 @@ void Foam::codedFixedValueFvPatchScalarField::updateCoeffs()
return; return;
} }
// Make sure library containing user-defined fvPatchField is uptodate // Make sure library containing user-defined fvPatchField is up-to-date
updateLibrary(); updateLibrary();
const fvPatchScalarField& fvp = redirectPatchField(); const fvPatchScalarField& fvp = redirectPatchField();
@ -474,7 +462,7 @@ void Foam::codedFixedValueFvPatchScalarField::evaluate
const Pstream::commsTypes commsType const Pstream::commsTypes commsType
) )
{ {
// Make sure library containing user-defined fvPatchField is uptodate // Make sure library containing user-defined fvPatchField is up-to-date
updateLibrary(); updateLibrary();
const fvPatchScalarField& fvp = redirectPatchField(); const fvPatchScalarField& fvp = redirectPatchField();

View File

@ -119,6 +119,7 @@ class codedFixedValueFvPatchScalarField
//- Global loader/unloader function type //- Global loader/unloader function type
typedef void (*loaderFunctionType)(bool); typedef void (*loaderFunctionType)(bool);
//- Load specified library and execute globalFuncName(true)
static void* loadLibrary static void* loadLibrary
( (
const fileName& libPath, const fileName& libPath,
@ -126,6 +127,7 @@ class codedFixedValueFvPatchScalarField
const dictionary& contextDict const dictionary& contextDict
); );
//- Execute globalFuncName(false) and unload specified library
static void unloadLibrary static void unloadLibrary
( (
const fileName& libPath, const fileName& libPath,
@ -134,6 +136,7 @@ class codedFixedValueFvPatchScalarField
); );
//- Create library based on the dynamicCodeContext
void createLibrary(dynamicCode&, const dynamicCodeContext&) const; void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
//- Update library as required //- Update library as required

View File

@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0 export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0
if [ -d "$ParMGridGen/MGridGen/Lib" ] if [ -d "$ParMGridGen/MGridGen/Lib" ]
then then
wmake $makeOption MGridGenGamgAgglomeration wmake $makeType MGridGenGamgAgglomeration
fi fi
wmake libso pairPatchAgglomeration wmake libso pairPatchAgglomeration

View File

@ -1,15 +1,15 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption distributionModels wmake $makeType distributionModels
wmake $makeOption basic wmake $makeType basic
wmake $makeOption solidParticle wmake $makeType solidParticle
wmake $makeOption intermediate wmake $makeType intermediate
wmake $makeOption dieselSpray wmake $makeType dieselSpray
wmake $makeOption dsmc wmake $makeType dsmc
wmake $makeOption coalCombustion wmake $makeType coalCombustion
molecularDynamics/Allwmake $* molecularDynamics/Allwmake $*

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption potential wmake $makeType potential
wmake $makeOption molecularMeasurements wmake $makeType molecularMeasurements
wmake $makeOption molecule wmake $makeType molecule
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption autoMesh wmake $makeType autoMesh
wmake $makeOption blockMesh wmake $makeType blockMesh
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
decompose/Allwmake $* decompose/Allwmake $*
reconstruct/Allwmake $* reconstruct/Allwmake $*
wmake $makeOption distributed wmake $makeType distributed
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH # get SCOTCH_VERSION, SCOTCH_ARCH_PATH
settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc`
@ -17,17 +17,17 @@ set -x
wmakeLnInclude decompositionMethods wmakeLnInclude decompositionMethods
wmake $makeOption scotchDecomp wmake $makeType scotchDecomp
if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
then then
( (
WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB
wmake $makeOption ptscotchDecomp wmake $makeType ptscotchDecomp
) )
fi fi
wmake $makeOption decompositionMethods wmake $makeType decompositionMethods
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption reconstruct wmake $makeType reconstruct
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake libo postCalc wmake libo postCalc
wmake $makeOption foamCalcFunctions wmake $makeType foamCalcFunctions
functionObjects/Allwmake $* functionObjects/Allwmake $*

View File

@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption field wmake $makeType field
wmake $makeOption forces wmake $makeType forces
wmake $makeOption IO wmake $makeType IO
wmake $makeOption utilities wmake $makeType utilities
wmake $makeOption jobControl wmake $makeType jobControl
wmake $makeOption systemCall wmake $makeType systemCall
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,24 +1,24 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption specie wmake $makeType specie
wmake $makeOption solid wmake $makeType solid
wmake $makeOption thermophysicalFunctions wmake $makeType thermophysicalFunctions
./properties/Allwmake $* ./properties/Allwmake $*
wmake $makeOption basic wmake $makeType basic
wmake $makeOption reactionThermo wmake $makeType reactionThermo
wmake $makeOption laminarFlameSpeed wmake $makeType laminarFlameSpeed
wmake $makeOption chemistryModel wmake $makeType chemistryModel
wmake $makeOption barotropicCompressibilityModel wmake $makeType barotropicCompressibilityModel
wmake $makeOption thermalPorousZone wmake $makeType thermalPorousZone
wmake $makeOption SLGThermo wmake $makeType SLGThermo
# Should be combined with solids&solidMixture # Should be combined with solids&solidMixture
wmake $makeOption basicSolidThermo wmake $makeType basicSolidThermo
wmake $makeOption radiationModels wmake $makeType radiationModels
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption liquidProperties wmake $makeType liquidProperties
wmake $makeOption liquidMixtureProperties wmake $makeType liquidMixtureProperties
wmake $makeOption solidProperties wmake $makeType solidProperties
wmake $makeOption solidMixtureProperties wmake $makeType solidMixtureProperties
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption incompressible wmake $makeType incompressible
wmake $makeOption interfaceProperties wmake $makeType interfaceProperties
wmake $makeOption twoPhaseInterfaceProperties wmake $makeType twoPhaseInterfaceProperties
# wmake $makeOption compressible # wmake $makeType compressible
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmakeLnInclude ../incompressible/LES wmakeLnInclude ../incompressible/LES
wmake $makeOption LESfilters wmake $makeType LESfilters
wmake $makeOption LESdeltas wmake $makeType LESdeltas
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption turbulenceModel wmake $makeType turbulenceModel
wmake $makeOption RAS wmake $makeType RAS
wmake $makeOption LES wmake $makeType LES
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso makeType=${1:-libso}
set -x set -x
wmake $makeOption turbulenceModel wmake $makeType turbulenceModel
wmake $makeOption RAS wmake $makeType RAS
wmake $makeOption LES wmake $makeType LES
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -14,4 +14,4 @@ runApplication PDRMesh
# Run # Run
runApplication PDRFoam runApplication PDRFoam
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -8,4 +8,4 @@ Step to introduce the PDR fields:
1) Create zero-size patches for wall or/and coupled baffles in 1) Create zero-size patches for wall or/and coupled baffles in
the boundary file. the boundary file.
2) Specify the boundary contitions for these patches in the fields. 2) Specify the boundary contitions for these patches in the fields.
3) Create the new PDR mesh using the PDRMesh utility. 3) Create the new PDR mesh using the PDRMesh utility.

View File

@ -59,4 +59,4 @@ burntProducts
Ts 170.672; Ts 170.672;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -69,4 +69,4 @@ SCOPECoeffs
0 0
); );
} }
} }

View File

@ -51,4 +51,4 @@ maxCo 0.3;
maxDeltaT 1; maxDeltaT 1;
// ************************************************************************* // // ************************************************************************* //

View File

@ -82,4 +82,5 @@ fluxRequired
default no; default no;
p; p;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,4 +1,4 @@
#------------------------------------------------------------------------------ #-------------------------------*- makefile -*---------------------------------
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |

View File

@ -1,4 +1,5 @@
CPP = cpp -traditional-cpp $(GFLAGS) CPP = cpp -traditional-cpp $(GFLAGS)
PROJECT_LIBS = -l$(WM_PROJECT) -ldl PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard include $(GENERAL_RULES)/standard

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -40,6 +40,7 @@ Usage: $Script [OPTION] [dir]
$Script [OPTION] target [dir [MakeDir]] $Script [OPTION] target [dir [MakeDir]]
options: options:
-s | -silent ignored - for compatibility with wmake
-help print the usage -help print the usage
Clean up the wmake control directory Make/\$WM_OPTIONS and remove the Clean up the wmake control directory Make/\$WM_OPTIONS and remove the
@ -52,21 +53,35 @@ The targets correspond to a subset of the 'wmake' special targets:
clean Make, any *.dep files and lnInclude directories clean Make, any *.dep files and lnInclude directories
USAGE USAGE
exit 1 exit 1
} }
# provide immediate help
if [ "$1" = "-h" -o "$1" = "-help" ] # parse options
then while [ "$#" -gt 0 ]
usage do
fi case "$1" in
-h | -help)
usage
;;
-s | -silent) # ignored - for compatibility with wmake
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# check arguments and change to the directory in which to run wmake # check arguments and change to the directory in which to run wclean
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
unset dir makeOption unset dir makeType
MakeDir=Make MakeDir=Make
if [ $# -ge 1 ] if [ $# -ge 1 ]
@ -76,7 +91,7 @@ then
then then
dir=$1 dir=$1
else else
makeOption=$1 makeType=$1
fi fi
# specified directory name: # specified directory name:
@ -101,7 +116,7 @@ fi
# Recurse the directories tree # Recurse the directories tree
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if [ "$makeOption" = all ] if [ "$makeType" = all ]
then then
if [ -e Allwclean ] # consistent with Allwmake if [ -e Allwclean ] # consistent with Allwmake
then then
@ -121,8 +136,8 @@ then
fi fi
fi fi
# makeOption is not needed beyond this point # makeType is not needed beyond this point
unset makeOption unset makeType
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -40,8 +40,10 @@ Usage: $Script [OPTION] [dir]
$Script [OPTION] target [dir [MakeDir]] $Script [OPTION] target [dir [MakeDir]]
options: options:
-s | -silent invoke make in 'silent' mode (do not echo commands)
-help print the usage -help print the usage
A general, easy-to-use make system for multi-platform development A general, easy-to-use make system for multi-platform development
The 'target' is a Makefile target: The 'target' is a Makefile target:
@ -59,12 +61,28 @@ USAGE
exit 1 exit 1
} }
# provide immediate help, even if environment is not set # normally use "make"
if [ "$1" = "-h" -o "$1" = "-help" ] make="make"
then
usage
fi
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-s | -silent)
make="$make -s"
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# #
# check environment variables # check environment variables
@ -77,6 +95,7 @@ do
} }
done done
# when compiling anything but a standalone exe: # when compiling anything but a standalone exe:
# WM_PROJECT and WM_PROJECT_DIR must be set # WM_PROJECT and WM_PROJECT_DIR must be set
[ "$1" = exe -o \( "$WM_PROJECT" -a "$WM_PROJECT_DIR" \) ] || { [ "$1" = exe -o \( "$WM_PROJECT" -a "$WM_PROJECT_DIR" \) ] || {
@ -91,8 +110,6 @@ done
# Select the version of make to be used # Select the version of make to be used
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
make="make"
# set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set # set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ] if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ]
then then
@ -113,7 +130,7 @@ then
mkdir -p $lockDir mkdir -p $lockDir
fi fi
make="make --no-print-directory -j "$WM_NCOMPPROCS make="$make --no-print-directory -j "$WM_NCOMPPROCS
fi fi
fi fi
@ -122,7 +139,7 @@ fi
# check arguments and change to the directory in which to run wmake # check arguments and change to the directory in which to run wmake
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
unset dir makeOption unset dir makeType
MakeDir=Make MakeDir=Make
if [ $# -ge 1 ] if [ $# -ge 1 ]
@ -131,7 +148,7 @@ then
then then
dir=$1 dir=$1
else else
makeOption=$1 makeType=$1
fi fi
# specified directory name: # specified directory name:
@ -154,7 +171,7 @@ fi
# Recurse the application directories tree # Recurse the application directories tree
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if [ "$makeOption" = all ] if [ "$makeType" = all ]
then then
if [ -e Allwmake ] if [ -e Allwmake ]
then then
@ -187,12 +204,12 @@ fi
# transform "all" option to "libso" if that looks appropriate or remove it # transform "all" option to "libso" if that looks appropriate or remove it
# so that the call to make builds the application # so that the call to make builds the application
if [ "$makeOption" = all ] if [ "$makeType" = all ]
then then
unset makeOption unset makeType
if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1 if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1
then then
makeOption=libso makeType=libso
fi fi
fi fi
@ -226,7 +243,7 @@ OBJECTS_DIR=$MakeDir/$WM_OPTIONS
touch $OBJECTS_DIR/dontIncludeDeps touch $OBJECTS_DIR/dontIncludeDeps
case "$makeOption" in case "$makeType" in
lib | libo | libso ) lib | libo | libso )
$make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/dontIncludeDeps lnInclude/uptodate $make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/dontIncludeDeps lnInclude/uptodate
;; ;;
@ -241,7 +258,7 @@ rc=$?
# make the object files and link # make the object files and link
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cmd="$make -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/includeDeps $makeOption" cmd="$make -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/includeDeps $makeType"
# echo "cmd=$cmd" # echo "cmd=$cmd"
exec $cmd exec $cmd

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -40,10 +40,16 @@
Script=${0##*/} Script=${0##*/}
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
usage: $Script [-f] <dir> Usage: $Script [OPTION] dir
options:
-f | -force force update
-s | -silent use 'silent' mode (do not echo command)
-help print the usage
Link all the source files in the <dir> into <dir>/lnInclude Link all the source files in the <dir> into <dir>/lnInclude
@ -63,7 +69,7 @@ unset findOpt
# default 'ln' option # default 'ln' option
lnOpt="-s" lnOpt="-s"
unset forceUpdate unset forceUpdate silentOpt
# simple parse options # simple parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
@ -72,10 +78,14 @@ do
-h | -help) # provide immediate help -h | -help) # provide immediate help
usage usage
;; ;;
-f) -f | -force)
shift
forceUpdate=true forceUpdate=true
lnOpt="-sf" lnOpt="-sf"
shift
;;
-s | -silent)
silentOpt=true
shift
;; ;;
-*) -*)
usage "unknown option: '$*'" usage "unknown option: '$*'"
@ -128,10 +138,12 @@ fi
cd $incDir || exit 1 cd $incDir || exit 1
#------------------------------------------------------------------------------
# Link include files if [ "$silentOpt" != true ]
# ~~~~~~~~~~~~~~~~~~ then
echo "$Script: linking include files to $incDir" echo "$Script: linking include files to $incDir" 1>&2
fi
# #
# remove any broken links first (this helps when file locations have moved) # remove any broken links first (this helps when file locations have moved)