From 59228f8c9a7b1a0284d0157ba1392399c65732fe Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 4 Jan 2011 15:27:00 +0100 Subject: [PATCH 01/16] STYLE: Minor code formatting changes --- src/OpenFOAM/global/argList/argList.H | 10 ++++++---- src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C | 3 +-- .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index 7865f645e6..a8ad105b05 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,7 +59,7 @@ Description Note - The document browser used is defined by the @b FOAM_DOC_BROWSER environment variable or the Documentation/docBrowser entry - in the ~OpenFOAM/controlDict file. + in the ~OpenFOAM/controlDict file. The \%f token is used as a placeholder for the file name. - The valid (mandatory) arguments can be adjusted by directly manipulating the argList::validArgs static member. @@ -94,7 +94,9 @@ SourceFiles namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +/*---------------------------------------------------------------------------*\ + Class argList Declaration +\*---------------------------------------------------------------------------*/ class argList { @@ -165,7 +167,7 @@ public: //- Max screen width for displaying usage (default: 80) static string::size_type usageMax; - //! @cond ignoreDocumentation + //! @cond internalClass class initValidTables { public: diff --git a/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C b/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C index 82eeb67a64..59f7e6a2ab 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C +++ b/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,6 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - template Foam::boundBox::boundBox ( diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index bdac848e51..02c3f0f811 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -390,7 +390,7 @@ void LaunderGibsonRSTM::correct() const volSymmTensorField reflect ( - C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P) + C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P) ); tmp REqn From fd7bf0fa8f00cca3d58815a67aa7d27e2613b108 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 4 Jan 2011 18:47:59 +0100 Subject: [PATCH 02/16] STYLE: forgot to commit changes to SHA1Digest.C in e14521b5b3f8d0dbd3b3e78585eac0746f6d3559 --- .../primitives/hashes/SHA1/SHA1Digest.C | 90 ++++++++++++++++++- 1 file changed, 87 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C index 7b5d16d722..113fc5a001 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C @@ -31,8 +31,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // //! @cond fileScope -const char hexChars[] = "0123456789abcdef"; -//! @endcond fileScope +static const char hexChars[] = "0123456789abcdef"; +//! @endcond // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -87,6 +87,20 @@ void Foam::SHA1Digest::clear() } +bool Foam::SHA1Digest::empty() const +{ + for (unsigned i = 0; i < length; ++i) + { + if (v_[i]) + { + return false; + } + } + + return true; +} + + // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const @@ -103,9 +117,79 @@ bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const } +bool Foam::SHA1Digest::operator==(const std::string& hexdigits) const +{ + // null or empty string is not an error - interpret as '0000..' + if (hexdigits.empty()) + { + return empty(); + } + + // incorrect length - can never match + if (hexdigits.size() != length*2) + { + return false; + } + + for (unsigned i = 0, charI = 0; i < length; ++i, charI += 2) + { + const char c1 = hexChars[((v_[i] >> 4) & 0xF)]; + const char c2 = hexChars[(v_[i] & 0xF)]; + + if (c1 != hexdigits[charI] || c2 != hexdigits[charI+1]) + { + return false; + } + } + + return true; +} + + +bool Foam::SHA1Digest::operator==(const char* hexdigits) const +{ + // null or empty string is not an error - interpret as '0000..' + if (!hexdigits || !*hexdigits) + { + return empty(); + } + + // incorrect length - can never match + if (strlen(hexdigits) != length*2) + { + return false; + } + + for (unsigned i = 0, charI = 0; i < length; ++i, charI += 2) + { + const char c1 = hexChars[((v_[i] >> 4) & 0xF)]; + const char c2 = hexChars[(v_[i] & 0xF)]; + + if (c1 != hexdigits[charI] || c2 != hexdigits[charI+1]) + { + return false; + } + } + + return true; +} + + bool Foam::SHA1Digest::operator!=(const SHA1Digest& rhs) const { - return !this->operator==(rhs); + return !operator==(rhs); +} + + +bool Foam::SHA1Digest::operator!=(const std::string& rhs) const +{ + return !operator==(rhs); +} + + +bool Foam::SHA1Digest::operator!=(const char* rhs) const +{ + return !operator==(rhs); } From 0a6d552526ed23f0ac0c4bd2be8b1d7d69095836 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 4 Jan 2011 19:35:03 +0100 Subject: [PATCH 03/16] STYLE: remove '-roots' option too with noParallel --- src/OpenFOAM/global/argList/argList.C | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 93dcdd8cb1..262d9a6518 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,10 +58,10 @@ Foam::argList::initValidTables::initValidTables() validParOptions.set("parallel", ""); argList::addOption ( - "roots", "(dir1 .. dirn)", + "roots", "(dir1 .. dirN)", "slave root directories for distributed running" ); - validParOptions.set("roots", "(dir1 .. dirn)"); + validParOptions.set("roots", "(dir1 .. dirN)"); Pstream::addValidParOptions(validParOptions); } @@ -138,8 +138,8 @@ void Foam::argList::noBanner() void Foam::argList::noParallel() { - optionUsage.erase("parallel"); - validOptions.erase("parallel"); + removeOption("parallel"); + removeOption("roots"); validParOptions.clear(); } @@ -537,10 +537,10 @@ Foam::argList::argList if (options_.found("roots")) { + source = "'-roots' option"; IStringStream str(options_["roots"]); str >> roots; dictNProcs = roots.size()+1; - source = "roots-command-line"; } else { @@ -593,7 +593,7 @@ Foam::argList::argList { forAll(roots, i) { - roots[i] = roots[i].expand(); + roots[i].expand(); } if (roots.size() != Pstream::nProcs()-1) From 09170d7715ea90db0ffa0c47ee963f83b6b274b3 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 4 Jan 2011 19:35:48 +0100 Subject: [PATCH 04/16] COMP: protect headers against multiple inclusion in POSIX/signals STYLE: report when SIGFPE handling is unsupported - move OSspecific.H include from signal headers to argList where it is more obvious --- src/OSspecific/POSIX/signals/sigFpe.C | 91 +++++++++++++++----------- src/OSspecific/POSIX/signals/sigFpe.H | 14 ++-- src/OSspecific/POSIX/signals/sigInt.C | 13 ++-- src/OSspecific/POSIX/signals/sigInt.H | 14 +++- src/OSspecific/POSIX/signals/sigQuit.C | 11 ++-- src/OSspecific/POSIX/signals/sigQuit.H | 15 ++++- src/OSspecific/POSIX/signals/sigSegv.C | 13 ++-- src/OSspecific/POSIX/signals/sigSegv.H | 15 ++++- src/OpenFOAM/global/argList/argList.H | 1 + 9 files changed, 117 insertions(+), 70 deletions(-) diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index bcf0c8e6b3..e86c206ab8 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,9 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" #include "sigFpe.H" - +#include "error.H" #include "JobInfo.H" #include "OSspecific.H" #include "IOstreams.H" @@ -52,51 +51,42 @@ License struct sigaction Foam::sigFpe::oldAction_; -#if defined(LINUX) +#ifdef LINUX -void *(*Foam::sigFpe::old_malloc_hook)(size_t, const void *) = NULL; +void *(*Foam::sigFpe::oldMallocHook_)(size_t, const void *) = NULL; -void* Foam::sigFpe::my_malloc_hook(size_t size, const void *caller) +void* Foam::sigFpe::nanMallocHook_(size_t size, const void *caller) { void *result; // Restore all old hooks - __malloc_hook = old_malloc_hook; + __malloc_hook = oldMallocHook_; // Call recursively - result = malloc (size); + result = malloc(size); - // initialize to signalling nan + // initialize to signalling NaN # ifdef WM_SP const uint32_t sNAN = 0x7ff7fffflu; - - int nScalars = size / sizeof(scalar); - uint32_t* dPtr = reinterpret_cast(result); - for (int i = 0; i < nScalars; i++) - { - *dPtr++ = sNAN; - } - # else const uint64_t sNAN = 0x7ff7ffffffffffffllu; - - int nScalars = size/sizeof(scalar); - uint64_t* dPtr = reinterpret_cast(result); - for (int i = 0; i < nScalars; i++) +# endif + + const size_t nScalars = size/sizeof(scalar); + for (size_t i = 0; i < nScalars; ++i) { *dPtr++ = sNAN; } -# endif // Restore our own hooks - __malloc_hook = my_malloc_hook; + __malloc_hook = nanMallocHook_; return result; } @@ -106,14 +96,14 @@ void* Foam::sigFpe::my_malloc_hook(size_t size, const void *caller) #ifdef LINUX_GNUC -void Foam::sigFpe::sigFpeHandler(int) +void Foam::sigFpe::sigHandler(int) { // Reset old handling if (sigaction(SIGFPE, &oldAction_, NULL) < 0) { FatalErrorIn ( - "Foam::sigSegv::sigFpeHandler()" + "Foam::sigSegv::sigHandler()" ) << "Cannot reset SIGFPE trapping" << abort(FatalError); } @@ -166,7 +156,7 @@ Foam::sigFpe::~sigFpe() // Reset to standard malloc if (oldAction_.sa_handler) { - __malloc_hook = old_malloc_hook; + __malloc_hook = oldMallocHook_; } # endif @@ -189,13 +179,10 @@ void Foam::sigFpe::set(const bool verbose) if (env("FOAM_SIGFPE")) { - if (verbose) - { - Info<< "SigFpe : Enabling floating point exception trapping" - << " (FOAM_SIGFPE)." << endl; - } + bool supported = false; # ifdef LINUX_GNUC + supported = true; feenableexcept ( @@ -205,7 +192,7 @@ void Foam::sigFpe::set(const bool verbose) ); struct sigaction newAction; - newAction.sa_handler = sigFpeHandler; + newAction.sa_handler = sigHandler; newAction.sa_flags = SA_NODEFER; sigemptyset(&newAction.sa_mask); if (sigaction(SIGFPE, &newAction, &oldAction_) < 0) @@ -219,6 +206,7 @@ void Foam::sigFpe::set(const bool verbose) # elif defined(sgiN32) || defined(sgiN32Gcc) + supported = true; sigfpe_[_DIVZERO].abort=1; sigfpe_[_OVERFL].abort=1; @@ -240,23 +228,50 @@ void Foam::sigFpe::set(const bool verbose) ); # endif + + + if (verbose) + { + if (supported) + { + Info<< "sigFpe : Enabling floating point exception trapping" + << " (FOAM_SIGFPE)." << endl; + } + else + { + Info<< "sigFpe : Floating point exception trapping" + << " - not supported on this platform" << endl; + } + } } if (env("FOAM_SETNAN")) { - if (verbose) - { - Info<< "SetNaN : Initialising allocated memory to NaN" - << " (FOAM_SETNAN)." << endl; - } + bool supported = false; # ifdef LINUX_GNUC + supported = true; // Set our malloc - __malloc_hook = Foam::sigFpe::my_malloc_hook; + __malloc_hook = Foam::sigFpe::nanMallocHook_; # endif + + + if (verbose) + { + if (supported) + { + Info<< "SetNaN : Initialising allocated memory to NaN" + << " (FOAM_SETNAN)." << endl; + } + else + { + Info<< "SetNaN : Initialise allocated memory to NaN" + << " - not supported on this platform" << endl; + } + } } } diff --git a/src/OSspecific/POSIX/signals/sigFpe.H b/src/OSspecific/POSIX/signals/sigFpe.H index 220e1fc0e0..bc31630b49 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.H +++ b/src/OSspecific/POSIX/signals/sigFpe.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,6 @@ SourceFiles #ifndef sigFpe_H #define sigFpe_H -#include "OSspecific.H" #include #if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) @@ -73,10 +72,10 @@ class sigFpe # ifdef LINUX //- Saved old malloc - static void *(*old_malloc_hook)(size_t, const void *); + static void *(*oldMallocHook_)(size_t, const void *); - //- nan malloc function. From malloc_hook manpage. - static void* my_malloc_hook(size_t size, const void *caller); + //- NaN malloc function. From malloc_hook manpage. + static void* nanMallocHook_(size_t size, const void *caller); # endif @@ -86,7 +85,7 @@ class sigFpe # ifdef LINUX_GNUC //- Handler for caught signals - static void sigFpeHandler(int); + static void sigHandler(int); # endif @@ -96,6 +95,7 @@ public: // Constructors + //- Construct null sigFpe(); @@ -105,6 +105,8 @@ public: // Member functions + //- Activate SIGFPE signal handler when FOAM_SIGFPE is %set + // Fill memory with NaN when FOAM_SETNAN is %set void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C index 429e426f6b..000d514971 100644 --- a/src/OSspecific/POSIX/signals/sigInt.C +++ b/src/OSspecific/POSIX/signals/sigInt.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,8 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" #include "sigInt.H" +#include "error.H" #include "JobInfo.H" #include "IOstreams.H" @@ -32,16 +32,17 @@ License struct sigaction Foam::sigInt::oldAction_; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::sigInt::sigIntHandler(int) +void Foam::sigInt::sigHandler(int) { // Reset old handling if (sigaction(SIGINT, &oldAction_, NULL) < 0) { FatalErrorIn ( - "Foam::sigInt::sigIntHandler()" + "Foam::sigInt::sigHandler()" ) << "Cannot reset SIGINT trapping" << abort(FatalError); } @@ -80,7 +81,7 @@ Foam::sigInt::~sigInt() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigInt::set(const bool verbose) +void Foam::sigInt::set(const bool) { if (oldAction_.sa_handler) { @@ -92,7 +93,7 @@ void Foam::sigInt::set(const bool verbose) } struct sigaction newAction; - newAction.sa_handler = sigIntHandler; + newAction.sa_handler = sigHandler; newAction.sa_flags = SA_NODEFER; sigemptyset(&newAction.sa_mask); if (sigaction(SIGINT, &newAction, &oldAction_) < 0) diff --git a/src/OSspecific/POSIX/signals/sigInt.H b/src/OSspecific/POSIX/signals/sigInt.H index 635434f12e..8a11b4f23f 100644 --- a/src/OSspecific/POSIX/signals/sigInt.H +++ b/src/OSspecific/POSIX/signals/sigInt.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,9 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#include "OSspecific.H" +#ifndef sigInt_H +#define sigInt_H + #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,13 +62,14 @@ class sigInt // Private Member Functions - static void sigIntHandler(int); + static void sigHandler(int); public: // Constructors + //- Construct null sigInt(); @@ -76,6 +79,7 @@ public: // Member functions + //- Activate SIGINT signal handler void set(const bool verbose); }; @@ -84,4 +88,8 @@ public: } // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + // ************************************************************************* // diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C index a9fee8c9d4..bd0ea7b835 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.C +++ b/src/OSspecific/POSIX/signals/sigQuit.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,8 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" #include "sigQuit.H" +#include "error.H" #include "JobInfo.H" #include "IOstreams.H" @@ -32,16 +32,17 @@ License struct sigaction Foam::sigQuit::oldAction_; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::sigQuit::sigQuitHandler(int) +void Foam::sigQuit::sigHandler(int) { // Reset old handling if (sigaction(SIGQUIT, &oldAction_, NULL) < 0) { FatalErrorIn ( - "Foam::sigQuit::sigQuitHandler()" + "Foam::sigQuit::sigHandler()" ) << "Cannot reset SIGQUIT trapping" << abort(FatalError); } @@ -94,7 +95,7 @@ void Foam::sigQuit::set(const bool verbose) } struct sigaction newAction; - newAction.sa_handler = sigQuitHandler; + newAction.sa_handler = sigHandler; newAction.sa_flags = SA_NODEFER; sigemptyset(&newAction.sa_mask); if (sigaction(SIGQUIT, &newAction, &oldAction_) < 0) diff --git a/src/OSspecific/POSIX/signals/sigQuit.H b/src/OSspecific/POSIX/signals/sigQuit.H index a7ed668f43..bc1b705048 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.H +++ b/src/OSspecific/POSIX/signals/sigQuit.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,9 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#include "OSspecific.H" +#ifndef sigQuit_H +#define sigQuit_H + #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,13 +62,15 @@ class sigQuit // Private Member Functions - static void sigQuitHandler(int); + //- Handler for caught signals + static void sigHandler(int); public: // Constructors + //- Construct null sigQuit(); @@ -76,6 +80,7 @@ public: // Member functions + //- Activate SIGQUIT signal handler void set(const bool verbose); }; @@ -84,4 +89,8 @@ public: } // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + // ************************************************************************* // diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C index 084a4df215..39688c0c00 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.C +++ b/src/OSspecific/POSIX/signals/sigSegv.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,8 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" #include "sigSegv.H" +#include "error.H" #include "JobInfo.H" #include "IOstreams.H" @@ -32,16 +32,17 @@ License struct sigaction Foam::sigSegv::oldAction_; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::sigSegv::sigSegvHandler(int) +void Foam::sigSegv::sigHandler(int) { // Reset old handling if (sigaction(SIGSEGV, &oldAction_, NULL) < 0) { FatalErrorIn ( - "Foam::sigSegv::sigSegvHandler()" + "Foam::sigSegv::sigHandler()" ) << "Cannot reset SIGSEGV trapping" << abort(FatalError); } @@ -82,7 +83,7 @@ Foam::sigSegv::~sigSegv() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigSegv::set(const bool verbose) +void Foam::sigSegv::set(const bool) { if (oldAction_.sa_handler) { @@ -94,7 +95,7 @@ void Foam::sigSegv::set(const bool verbose) } struct sigaction newAction; - newAction.sa_handler = sigSegvHandler; + newAction.sa_handler = sigHandler; newAction.sa_flags = SA_NODEFER; sigemptyset(&newAction.sa_mask); if (sigaction(SIGSEGV, &newAction, &oldAction_) < 0) diff --git a/src/OSspecific/POSIX/signals/sigSegv.H b/src/OSspecific/POSIX/signals/sigSegv.H index 5410c45ba3..f8c64022cc 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.H +++ b/src/OSspecific/POSIX/signals/sigSegv.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,9 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#include "OSspecific.H" +#ifndef sigSegv_H +#define sigSegv_H + #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,13 +62,15 @@ class sigSegv // Private Member Functions - static void sigSegvHandler(int); + //- Handler for caught signals + static void sigHandler(int); public: // Constructors + //- Construct null sigSegv(); @@ -76,6 +80,7 @@ public: // Member functions + //- Activate SIGSEGV signal handler void set(const bool verbose); }; @@ -84,4 +89,8 @@ public: } // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + // ************************************************************************* // diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index a8ad105b05..09588f8128 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -83,6 +83,7 @@ SourceFiles #include "fileName.H" #include "parRun.H" #include "IStringStream.H" +#include "OSspecific.H" #include "sigFpe.H" #include "sigInt.H" From 5e12506f8e6161eecaeb42b62b4e1acf39d97f9c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Jan 2011 07:53:54 +0100 Subject: [PATCH 05/16] ENH: improve separation of OpenFOAM and ThirdParty mpi-libraries - drop FOAM_MPI_LIBBIN variable in favour of FOAM_MPI from which two different locations can be determined. Previously there was something like this: FOAM_MPI_LIBBIN = $FOAM_LIBBIN/openmpi-1.5.1 We now instead determine the locations from the FOAM_MPI directly: FOAM_MPI=openmpi-1.5.1 $FOAM_LIBBIN/$FOAM_MPI -> OpenFOAM mpi-related $FOAM_EXT_LIBBIN/$FOAM_MPI -> ThirdPary mpi-related ENH: relocate ParaView libraries and plugins back under FOAM_LIBBIN - as discussed with Mattijs --- .../PV3FoamReader/vtkPV3Foam/Make/files | 2 +- .../PV3FoamReader/vtkPV3Foam/Make/options | 2 +- .../vtkPV3blockMesh/Make/files | 2 +- .../vtkPV3blockMesh/Make/options | 2 +- .../PV3Readers/vtkPV3Readers/Make/files | 2 +- etc/apps/paraview3/bashrc | 4 +- etc/apps/paraview3/cshrc | 4 +- etc/apps/scotch/bashrc | 5 -- etc/bashrc | 2 +- etc/cshrc | 6 +- etc/settings.csh | 57 +++++++++---------- etc/settings.sh | 53 ++++++++--------- src/Pstream/gamma/Make/files | 2 +- src/Pstream/mpi/Make/files | 2 +- src/parallel/decompose/Allwmake | 4 +- src/parallel/decompose/metisDecomp/Make/files | 2 +- .../decompose/ptscotchDecomp/Make/files | 2 +- .../decompose/ptscotchDecomp/Make/options | 4 +- .../decompose/scotchDecomp/Make/files | 2 +- 19 files changed, 71 insertions(+), 88 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files index 90ac11a3e8..e71b857bb2 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files @@ -9,4 +9,4 @@ vtkPV3FoamMeshZone.C vtkPV3FoamUpdateInfo.C vtkPV3FoamUtils.C -LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Foam +LIB = $(FOAM_LIBBIN)/libvtkPV3Foam diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options index 6d10cc1a05..b381bd7d43 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options @@ -19,5 +19,5 @@ LIB_LIBS = \ -lfiniteVolume \ -lgenericPatchFields \ -llagrangian \ - -L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \ + -L$(FOAM_LIBBIN) -lvtkPV3Readers \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files index 3d452f747a..f084cc9f28 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files @@ -2,4 +2,4 @@ vtkPV3blockMesh.C vtkPV3blockMeshConvert.C vtkPV3blockMeshUtils.C -LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3blockMesh +LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options index 1964824e54..53f300a9f7 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options @@ -10,5 +10,5 @@ EXE_INC = \ LIB_LIBS = \ -lmeshTools \ -lblockMesh \ - -L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \ + -L$(FOAM_LIBBIN) -lvtkPV3Readers \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files index c5f3c12ebd..134b8de963 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files @@ -1,3 +1,3 @@ vtkPV3Readers.C -LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Readers +LIB = $(FOAM_LIBBIN)/libvtkPV3Readers diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 1387f08d9e..7648d9bac8 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -82,7 +82,7 @@ if [ -r $ParaView_DIR -o -r $paraviewInstDir ] then export PATH=$ParaView_DIR/bin:$PATH export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_MAJOR:$LD_LIBRARY_PATH - export PV_PLUGIN_PATH=$FOAM_EXT_LIBBIN/paraview-$ParaView_MAJOR + export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR # add in python libraries if required paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 96f404db46..38ef886470 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -80,7 +80,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview- if ( -r $ParaView_DIR || -r $paraviewInstDir ) then setenv PATH ${ParaView_DIR}/bin:${PATH} setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}:${LD_LIBRARY_PATH}" - setenv PV_PLUGIN_PATH $FOAM_EXT_LIBBIN/paraview-${ParaView_MAJOR} + setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR} # add in python libraries if required set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping diff --git a/etc/apps/scotch/bashrc b/etc/apps/scotch/bashrc index fcd19bfaa3..0fb6952110 100644 --- a/etc/apps/scotch/bashrc +++ b/etc/apps/scotch/bashrc @@ -36,10 +36,5 @@ export SCOTCH_VERSION=scotch_5.1.11 export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION -# mpi-qualified include directory -export SCOTCH_MPI_INCLUDE=$SCOTCH_ARCH_PATH/include/${FOAM_MPI_LIBBIN##*/} - -# mpi-qualified lib directory -export SCOTCH_MPI_LIBBIN=$SCOTCH_ARCH_PATH/lib/${FOAM_MPI_LIBBIN##*/} # ----------------------------------------------------------------------------- diff --git a/etc/bashrc b/etc/bashrc index c95a7951bb..86fe72ff43 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/etc/cshrc b/etc/cshrc index 2a73699137..5ee5361fc3 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -256,9 +256,7 @@ if (! $?MANPATH) setenv MANPATH '' #- Clean PATH (path) set cleaned=`$foamClean "$PATH" "$foamOldDirs"` -if ( $status == 0 ) then - setenv PATH $cleaned -endif +if ( $status == 0 ) setenv PATH $cleaned #- Clean LD_LIBRARY_PATH set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` diff --git a/etc/settings.csh b/etc/settings.csh index 3ebb1939f8..b473fd0b8f 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -90,11 +90,10 @@ unsetenv MPFR_ARCH_PATH # Location of compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ( ! $?foamCompiler ) then -then foamCompiler=system echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" echo " foamCompiler not set, using '$foamCompiler'" -fi +endif switch ("$foamCompiler") case OpenFOAM: @@ -253,13 +252,13 @@ unset boost_version cgal_version # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ -unsetenv MPI_ARCH_PATH MPI_HOME +unsetenv MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN switch ("$WM_MPLIB") case OPENMPI: - #set mpi_version=openmpi-1.4.1 - set mpi_version=openmpi-1.5.1 - setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version + #setenv FOAM_MPI openmpi-1.4.1 + setenv FOAM_MPI openmpi-1.5.1 + setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI # Tell OpenMPI where to find its install directory setenv OPAL_PREFIX $MPI_ARCH_PATH @@ -267,14 +266,11 @@ case OPENMPI: _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddMan $MPI_ARCH_PATH/man - - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version - unset mpi_version breaksw case SYSTEMOPENMPI: # Use the system installed openmpi, get library directory via mpicc - set mpi_version=openmpi-system + setenv FOAM_MPI openmpi-system # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI setenv PINC "`mpicc --showme:compile`" @@ -289,25 +285,21 @@ case SYSTEMOPENMPI: endif _foamAddLib $libDir - - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version - unset mpi_version libDir + unset libDir breaksw case MPICH: - set mpi_version=mpich2-1.1.1p1 - setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version - setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version + setenv FOAM_MPI mpich2-1.1.1p1 + setenv MPI_HOME $WM_THIRD_PARTY_DIR/$FOAM_MPI + setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddMan $MPI_ARCH_PATH/share/man - - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version - unset mpi_version breaksw case MPICH-GM: + setenv FOAM_MPI mpich-gm setenv MPI_ARCH_PATH /opt/mpi setenv MPICH_PATH $MPI_ARCH_PATH setenv GM_LIB_PATH /opt/gm/lib64 @@ -315,11 +307,10 @@ case MPICH-GM: _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddLib $GM_LIB_PATH - - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpich-gm breaksw case HPMPI: + setenv FOAM_MPI hpmpi setenv MPI_HOME /opt/hpmpi setenv MPI_ARCH_PATH $MPI_HOME @@ -339,23 +330,22 @@ case HPMPI: echo Unknown processor type `uname -m` for Linux breaksw endsw - - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/hpmpi breaksw case GAMMA: + setenv FOAM_MPI gamma setenv MPI_ARCH_PATH /usr - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/gamma breaksw case MPI: + setenv FOAM_MPI mpi setenv MPI_ARCH_PATH /opt/mpi - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi breaksw case FJMPI: + setenv FOAM_MPI fjmpi setenv MPI_ARCH_PATH /opt/FJSVmpi2 - setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi + _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib/sparcv9 _foamAddLib /opt/FSUNf90/lib/sparcv9 @@ -363,20 +353,25 @@ case FJMPI: breaksw case QSMPI: + setenv FOAM_MPI qsmpi setenv MPI_ARCH_PATH /usr/lib/mpi - setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - breaksw default: - setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy + setenv FOAM_MPI dummy breaksw endsw -_foamAddLib $FOAM_MPI_LIBBIN + +# add (non-dummy) MPI implementation +# dummy MPI already added to LD_LIBRARY_PATH and has no external libraries +if ( "$FOAM_MPI" != dummy ) then + _foamAddLib ${FOAM_LIBBIN}/${FOAM_MPI}:${FOAM_EXT_LIBBIN}/${FOAM_MPI} +endif + # Set the minimum MPI buffer size (used by all platforms except SGI MPI) diff --git a/etc/settings.sh b/etc/settings.sh index b466cd4fe7..ab0f69dee7 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -273,13 +273,13 @@ unset boost_version cgal_version # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ -unset MPI_ARCH_PATH MPI_HOME +unset MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN case "$WM_MPLIB" in OPENMPI) - #mpi_version=openmpi-1.4.1 - mpi_version=openmpi-1.5.1 - export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version + #export FOAM_MPI=openmpi-1.4.1 + export FOAM_MPI=openmpi-1.5.1 + export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI # Tell OpenMPI where to find its install directory export OPAL_PREFIX=$MPI_ARCH_PATH @@ -287,14 +287,11 @@ OPENMPI) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddMan $MPI_ARCH_PATH/man - - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version - unset mpi_version ;; SYSTEMOPENMPI) # Use the system installed openmpi, get library directory via mpicc - mpi_version=openmpi-system + export FOAM_MPI=openmpi-system # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI export PINC="`mpicc --showme:compile`" @@ -310,25 +307,21 @@ SYSTEMOPENMPI) fi _foamAddLib $libDir - - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version - unset mpi_version libDir + unset libDir ;; MPICH) - mpi_version=mpich2-1.1.1p1 - export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version - export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version + export FOAM_MPI=mpich2-1.1.1p1 + export MPI_HOME=$WM_THIRD_PARTY_DIR/$FOAM_MPI + export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddMan $MPI_ARCH_PATH/share/man - - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version - unset mpi_version ;; MPICH-GM) + export FOAM_MPI=mpich-gm export MPI_ARCH_PATH=/opt/mpi export MPICH_PATH=$MPI_ARCH_PATH export GM_LIB_PATH=/opt/gm/lib64 @@ -336,11 +329,10 @@ MPICH-GM) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddLib $GM_LIB_PATH - - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpich-gm ;; HPMPI) + export FOAM_MPI=hpmpi export MPI_HOME=/opt/hpmpi export MPI_ARCH_PATH=$MPI_HOME @@ -361,23 +353,21 @@ HPMPI) echo Unknown processor type `uname -m` for Linux ;; esac - - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/hpmpi ;; GAMMA) + export FOAM_MPI=gamma export MPI_ARCH_PATH=/usr - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/gamma ;; MPI) + export FOAM_MPI=mpi export MPI_ARCH_PATH=/opt/mpi - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi ;; FJMPI) + export FOAM_MPI=fjmpi export MPI_ARCH_PATH=/opt/FJSVmpi2 - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib/sparcv9 @@ -386,20 +376,25 @@ FJMPI) ;; QSMPI) + export FOAM_MPI=qsmpi export MPI_ARCH_PATH=/usr/lib/mpi - export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/qsmpi _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - ;; *) - export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/dummy + export FOAM_MPI=dummy ;; esac -_foamAddLib $FOAM_MPI_LIBBIN +# add (non-dummy) MPI implementation +# dummy MPI already added to LD_LIBRARY_PATH and has no external libraries +if [ "$FOAM_MPI" != dummy ] +then + _foamAddLib $FOAM_LIBBIN/$FOAM_MPI:$FOAM_EXT_LIBBIN/$FOAM_MPI +fi + # Set the minimum MPI buffer size (used by all platforms except SGI MPI) diff --git a/src/Pstream/gamma/Make/files b/src/Pstream/gamma/Make/files index a0374cb9c3..a3a8fc6b60 100644 --- a/src/Pstream/gamma/Make/files +++ b/src/Pstream/gamma/Make/files @@ -3,4 +3,4 @@ Pstream.C OPwrite.C IPread.C -LIB = $(FOAM_MPI_LIBBIN)/libPstream +LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream diff --git a/src/Pstream/mpi/Make/files b/src/Pstream/mpi/Make/files index eccdf77664..c01382d678 100644 --- a/src/Pstream/mpi/Make/files +++ b/src/Pstream/mpi/Make/files @@ -3,4 +3,4 @@ UIPread.C UPstream.C PstreamGlobals.C -LIB = $(FOAM_MPI_LIBBIN)/libPstream +LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index cb053bcc3e..a1a58a2a0f 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -1,7 +1,7 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -# get SCOTCH_VERSION, SCOTCH_ARCH_PATH, SCOTCH_MPI_INCLUDE +# get SCOTCH_VERSION, SCOTCH_ARCH_PATH settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` if [ -f "$settings" ] then @@ -19,7 +19,7 @@ wmakeLnInclude decompositionMethods wmake libso scotchDecomp wmake libso metisDecomp -if [ -d "$FOAM_MPI_LIBBIN" ] +if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] then ( WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB diff --git a/src/parallel/decompose/metisDecomp/Make/files b/src/parallel/decompose/metisDecomp/Make/files index 030326722a..39ee731e4d 100644 --- a/src/parallel/decompose/metisDecomp/Make/files +++ b/src/parallel/decompose/metisDecomp/Make/files @@ -1,3 +1,3 @@ metisDecomp.C -LIB = $(FOAM_EXT_LIBBIN)/libmetisDecomp +LIB = $(FOAM_LIBBIN)/libmetisDecomp diff --git a/src/parallel/decompose/ptscotchDecomp/Make/files b/src/parallel/decompose/ptscotchDecomp/Make/files index d2494e36ba..8f83423f7e 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/files +++ b/src/parallel/decompose/ptscotchDecomp/Make/files @@ -1,3 +1,3 @@ ptscotchDecomp.C -LIB = $(FOAM_MPI_LIBBIN)/libptscotchDecomp +LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libptscotchDecomp diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options index d4f56eb39a..ea5b0c3ad8 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/options +++ b/src/parallel/decompose/ptscotchDecomp/Make/options @@ -3,9 +3,9 @@ sinclude $(RULES)/mplib$(WM_MPLIB) EXE_INC = \ $(PFLAGS) $(PINC) \ - -I$(SCOTCH_MPI_INCLUDE) \ + -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \ -I/usr/include/scotch \ -I../decompositionMethods/lnInclude LIB_LIBS = \ - -L$(FOAM_MPI_LIBBIN) -lptscotch -lptscotcherrexit -lrt + -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lrt diff --git a/src/parallel/decompose/scotchDecomp/Make/files b/src/parallel/decompose/scotchDecomp/Make/files index dbb178726c..59717fa15c 100644 --- a/src/parallel/decompose/scotchDecomp/Make/files +++ b/src/parallel/decompose/scotchDecomp/Make/files @@ -1,3 +1,3 @@ scotchDecomp.C -LIB = $(FOAM_EXT_LIBBIN)/libscotchDecomp +LIB = $(FOAM_LIBBIN)/libscotchDecomp From 5d185831014a1ad2611f9681a3553421cd9c458b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Jan 2011 08:49:42 +0100 Subject: [PATCH 06/16] ENH: collect arch-specific directly under platforms/ - platforms/WM_OPTIONS/lib old: lib/WM_OPTIONS - platforms/WM_OPTIONS/bin old: bin/WM_OPTIONS old: applications/bin/WM_OPTIONS A runtime environment nows needs - bin/ - etc/ - platforms/ --- applications/test/maxMem/Make/options | 2 +- bin/foamPack | 11 +++---- bin/foamPackBinAll | 29 ++++++++++++++---- bin/foamPackThirdParty | 11 +++---- bin/tools/foamListBinDirs | 43 +++++++++++++++++++-------- bin/tools/foamListThirdPartyBinDirs | 8 +---- etc/settings.csh | 14 ++++----- etc/settings.sh | 14 ++++----- wmake/Makefile | 9 +++--- 9 files changed, 82 insertions(+), 59 deletions(-) diff --git a/applications/test/maxMem/Make/options b/applications/test/maxMem/Make/options index 6a57715f81..1570a9377e 100644 --- a/applications/test/maxMem/Make/options +++ b/applications/test/maxMem/Make/options @@ -1 +1 @@ -EXE_LIBS = $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o +EXE_LIBS = $(FOAM_EXT_LIBBIN)/libfbsdmalloc.o diff --git a/bin/foamPack b/bin/foamPack index dd8dab951c..52b6358b84 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -73,13 +73,10 @@ do done # check for essential directories -for dir in $packDir -do - [ -d $dir ] || { - echo "Error: directory $dir does not exist" 1>&2 - exit 1 - } -done +[ -d $packDir ] || { + echo "Error: directory $packDir does not exist" 1>&2 + exit 1 +} #------------------------------------------------------------------------------ diff --git a/bin/foamPackBinAll b/bin/foamPackBinAll index 8d56e5701f..e833671dc8 100755 --- a/bin/foamPackBinAll +++ b/bin/foamPackBinAll @@ -57,10 +57,29 @@ esac } -# obtain archOptions types from lib/ -for archOptions in $packDir/lib/* -do - $binDir/$packBin $@ ${archOptions##*/} -done +if [ -d $packDir/lib ] +then + + # obtain archOptions types from lib/ + for archOptions in $packDir/lib/* + do + $binDir/$packBin $@ ${archOptions##*/} + done + +elif [ -d $packDir/platforms ] + + # obtain archOptions types from platforms//lib + for archOptions in $packDir/platforms/*/lib + do + archOptions=${archOptions%%/lib} + $binDir/$packBin $@ ${archOptions##*/} + done + +else + + echo "Error: directory $packDir does not appear packable" 1>&2 + exit 1 + +fi #------------------------------------------------------------------------------ diff --git a/bin/foamPackThirdParty b/bin/foamPackThirdParty index e0f07178d7..37625b42cd 100755 --- a/bin/foamPackThirdParty +++ b/bin/foamPackThirdParty @@ -72,13 +72,10 @@ do done # check for essential directories -for dir in $packDir -do - [ -d $dir ] || { - echo "Error: directory $dir does not exist" 1>&2 - exit 1 - } -done +[ -d $packDir ] || { + echo "Error: directory $packDir does not exist" 1>&2 + exit 1 +} #------------------------------------------------------------------------------ diff --git a/bin/tools/foamListBinDirs b/bin/tools/foamListBinDirs index ac67b796d0..cc5029a653 100755 --- a/bin/tools/foamListBinDirs +++ b/bin/tools/foamListBinDirs @@ -67,19 +67,35 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@') #------------------------------------------------------------------------------ # check for essential directories -for dir in $packDir $packDir/lib/$archOptions -do - [ -d $dir ] || { - echo "Error: directory $dir does not exist" 1>&2 - exit 1 - } -done +[ -d $packDir ] || { + echo "Error: directory $packDir does not exist" 1>&2 + exit 1 +} -# check new/old places for executables - same as $FOAM_APPBIN -[ -d $packDir/bin/$archOptions -o -d $packDir/applications/bin/$archOptions ] || { + +# +# check places for libraries - same as $FOAM_LIBBIN +# this has moved around a bit in the recent past +# +[ -d $packDir/lib/$archOptions ] || \ +[ -d $packDir/platforms/$archOptions/lib ] || { +cat <&2 +Error: no directory for libraries exists: + $packDir/lib/$archOptions + $packDir/platforms/$archOptions/lib +LIB_CHECK + exit 1 +} + +# +# check places for executables - same as $FOAM_APPBIN +# this has moved around a bit in the recent past +# +[ -d $packDir/applications/bin/$archOptions ] || \ +[ -d $packDir/platforms/$archOptions/bin ] || { cat <&2 Error: no directory for executables exists: - $packDir/bin/$archOptions + $packDir/platforms/$archOptions/bin $packDir/applications/bin/$archOptions BIN_CHECK exit 1 @@ -90,14 +106,15 @@ BIN_CHECK # list of directories dirList=$( for dir in \ - $packDir/bin/$archOptions \ - $packDir/lib/$archOptions \ - $packDir/applications/bin/$archOptions \ + $packDir/platforms/$archOptions/bin \ + $packDir/platforms/$archOptions/lib \ $packDir/wmake/bin/$archCompiler \ $packDir/wmake/bin/$archOS \ $packDir/wmake/rules/General \ $packDir/wmake/rules/$archCompiler \ $packDir/wmake/rules/$archOS \ + $packDir/applications/bin/$archOptions \ + $packDir/lib/$archOptions \ ; do [ -d $dir ] && echo $dir diff --git a/bin/tools/foamListThirdPartyBinDirs b/bin/tools/foamListThirdPartyBinDirs index 319961b944..872049628e 100755 --- a/bin/tools/foamListThirdPartyBinDirs +++ b/bin/tools/foamListThirdPartyBinDirs @@ -66,7 +66,7 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@') #------------------------------------------------------------------------------ # check for essential directories -for dir in $packDir $packDir/lib/$archOptions +for dir in $packDir $packDir/platforms/$archOptions/lib do [ -d $dir ] || { echo "Error: directory $dir does not exist" 1>&2 @@ -78,12 +78,6 @@ done # list of directories dirList=$( for dir in \ - $packDir/bin/$archOptions \ - $packDir/bin/$archCompiler \ - $packDir/bin/$archOS \ - $packDir/lib/$archOptions \ - $packDir/lib/$archCompiler \ - $packDir/lib/$archOS \ $packDir/platforms/$archOptions \ $packDir/platforms/$archCompiler \ $packDir/platforms/$archOS \ diff --git a/etc/settings.csh b/etc/settings.csh index b473fd0b8f..c38079a72f 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -48,20 +48,20 @@ setenv WM_LINK_LANGUAGE c++ setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION # base executables/libraries -setenv FOAM_APPBIN $WM_PROJECT_DIR/bin/$WM_OPTIONS -setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS +setenv FOAM_APPBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin +setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib # external (ThirdParty) libraries -setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS +setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib # shared site executables/libraries # similar naming convention as ~OpenFOAM expansion -setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS -setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS +setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin +setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib # user executables/libraries -setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/bin/$WM_OPTIONS -setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS +setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin +setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib # convenience setenv FOAM_APP $WM_PROJECT_DIR/applications diff --git a/etc/settings.sh b/etc/settings.sh index ab0f69dee7..bab62d5a68 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -71,20 +71,20 @@ export WM_LINK_LANGUAGE=c++ export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION # base executables/libraries -export FOAM_APPBIN=$WM_PROJECT_DIR/bin/$WM_OPTIONS -export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS +export FOAM_APPBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin +export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib # external (ThirdParty) libraries -export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS +export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib # shared site executables/libraries # similar naming convention as ~OpenFOAM expansion -export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS -export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS +export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin +export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib # user executables/libraries -export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/bin/$WM_OPTIONS -export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS +export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin +export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib # convenience export FOAM_APP=$WM_PROJECT_DIR/applications diff --git a/wmake/Makefile b/wmake/Makefile index 95b4b30c40..e78eef3d79 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -56,8 +56,7 @@ WM_SCRIPTS = $(WM_DIR)/scripts #------------------------------------------------------------------------------ LIB_SRC = $(WM_PROJECT_DIR)/src -LIB_DIR = $(WM_PROJECT_DIR)/lib -LIB_WM_OPTIONS_DIR = $(LIB_DIR)/$(WM_OPTIONS) +LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS) CLASSES_DIR = $(MAKE_DIR)/classes @@ -148,7 +147,7 @@ LIB_HEADER_DIRS = \ $(EXE): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(EXE) - $(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \ + $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE) exe: $(SEXE) @@ -173,7 +172,7 @@ $(LIB).$(SO): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f so_locations @cd $(OBJECTS_DIR) ; \ - $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) + $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_PLATFORMS) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) lib: $(LIB).a @echo \'$(LIB).a\' is up to date. From 4425db227d98278c0ec86fa8a3d25de611fc03eb Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 10 Jan 2011 10:42:14 +0100 Subject: [PATCH 07/16] STYLE: set ParaView_VERSION in etc/apps/paraview3/*rc only - this change was wished by Mattijs and/or Henry - allow command-line settings to retain the flexibility of 'foamPV' alias mechanism. --- etc/aliases.csh | 6 +++--- etc/aliases.sh | 9 +++------ etc/apps/paraview3/bashrc | 28 ++++++++++++++++++---------- etc/apps/paraview3/cshrc | 27 +++++++++++++++++---------- etc/bashrc | 4 ---- etc/cshrc | 4 ---- 6 files changed, 41 insertions(+), 37 deletions(-) diff --git a/etc/aliases.csh b/etc/aliases.csh index 3ee5a555a6..e65135f62a 100644 --- a/etc/aliases.csh +++ b/etc/aliases.csh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -44,9 +44,9 @@ alias wmDP 'wmSET WM_PRECISION_OPTION=DP' alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler' alias wmSchedOFF 'unsetenv WM_SCHEDULER' -# Change paraview version +# Change ParaView version # ~~~~~~~~~~~~~~~~~~~~~~~ -alias foamPV 'setenv ParaView_VERSION \!*; source $WM_PROJECT_DIR/etc/apps/paraview3/cshrc; echo paraview-$ParaView_VERSION' +alias foamPV 'source `$WM_PROJECT_DIR/etc/apps/paraview3/cshrc` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION' # Change directory aliases diff --git a/etc/aliases.sh b/etc/aliases.sh index 9755f000a5..411548482a 100644 --- a/etc/aliases.sh +++ b/etc/aliases.sh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -44,16 +44,13 @@ alias wmDP='wmSET WM_PRECISION_OPTION=DP' alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler' alias wmSchedOFF='unset WM_SCHEDULER' -# Change paraview version +# Change ParaView version # ~~~~~~~~~~~~~~~~~~~~~~~ unset foamPV foamPV() { - export ParaView_VERSION=$1 - . $WM_PROJECT_DIR/etc/apps/paraview3/bashrc + . $WM_PROJECT_DIR/etc/apps/paraview3/bashrc ParaView_VERSION=$1 echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" - echo "dir: $ParaView_DIR" - [ -d "$ParaView_DIR" ] || echo "WARNING: directory does not exist" } diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 7648d9bac8..9cd181b2a2 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -50,17 +50,25 @@ do done -# set VERSION and MAJOR (version) variables -if [ -z "$ParaView_VERSION" ] -then - ParaView_VERSION=3.8.0 - ParaView_MAJOR=unknown - echo "Warning in app/paraview3/bashrc:" 1>&2 - echo " ParaView_VERSION not set, using '$ParaView_VERSION'" 1>&2 -fi -[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown +#- ParaView version, automatically determine major version +export ParaView_VERSION=3.8.0 +export ParaView_MAJOR=detect -# if needed, set MAJOR version to correspond to VERSION + +# Evaluate command-line parameters for ParaView +while [ $# -gt 0 ] +do + case "$1" in + ParaView*=*) + # name=value -> export name=value + eval "export $1" + ;; + esac + shift +done + + +# set MAJOR version to correspond to VERSION # ParaView_MAJOR is "." from ParaView_VERSION case "$ParaView_VERSION" in "$ParaView_MAJOR".* ) diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 38ef886470..e82fc7b0c6 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -48,17 +48,24 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 ) endif end -# set VERSION and MAJOR (version) variables -if ( ! $?ParaView_VERSION ) -then - setenv ParaView_VERSION 3.8.0 - setenv ParaView_MAJOR unknown - echo "Warning in app/paraview3/cshrc:" - echo " ParaView_VERSION not set, using '$ParaView_VERSION'" -fi -if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown +#- ParaView version, automatically determine major version: +setenv ParaView_VERSION 3.8.0 +setenv ParaView_MAJOR detect -# if needed, set MAJOR version to correspond to VERSION + +# Evaluate command-line parameters for ParaView +while ( $#argv > 0 ) + switch ($argv[1]) + case ParaView*=*: + # name=value -> setenv name value + eval "setenv $argv[1]:s/=/ /" + breaksw + endsw + shift +end + + +# set MAJOR version to correspond to VERSION # ParaView_MAJOR is "." from ParaView_VERSION switch ("$ParaView_VERSION") case "$ParaView_MAJOR".*: diff --git a/etc/bashrc b/etc/bashrc index 86fe72ff43..2867309ecb 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -57,10 +57,6 @@ foamInstall=$HOME/$WM_PROJECT #- note the location for later use (eg, in job scripts) : ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR -#- ParaView version, automatically determine major version: -export ParaView_VERSION=3.8.0 -export ParaView_MAJOR=unknown - #- Compiler location: # foamCompiler= system | ThirdParty (OpenFOAM) foamCompiler=system diff --git a/etc/cshrc b/etc/cshrc index 5ee5361fc3..4dfab67cbb 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -56,10 +56,6 @@ set foamInstall = $HOME/$WM_PROJECT #- note the location for later use (eg, in job scripts) if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall -#- ParaView version, automatically determine major version: -setenv ParaView_VERSION 3.8.0 -setenv ParaView_MAJOR unknown - #- Compiler location: # foamCompiler= system | ThirdParty (OpenFOAM) set foamCompiler=system From d521850bd47c2f98db05cc5605e185ce74fd47ad Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 10 Jan 2011 11:13:32 +0100 Subject: [PATCH 08/16] STYLE: remove hoard (no longer built in ThirdParty) --- etc/settings.csh | 7 ------- etc/settings.sh | 8 -------- 2 files changed, 15 deletions(-) diff --git a/etc/settings.csh b/etc/settings.csh index 41abbbaa5f..eb31ce91c4 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -387,13 +387,6 @@ else endif -# Enable the hoard memory allocator if available -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#if ( -f $FOAM_EXT_LIBBIN/libhoard.so ) then -# setenv LD_PRELOAD $FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD -#endif - - # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ unalias _foamAddPath _foamAddLib _foamAddMan diff --git a/etc/settings.sh b/etc/settings.sh index f15cdcdb96..71f9c0bdde 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -408,14 +408,6 @@ fi export MPI_BUFFER_SIZE -# Enable the hoard memory allocator if available -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#if [ -f $FOAM_EXT_LIBBIN/libhoard.so ] -#then -# export LD_PRELOAD=$FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD -#fi - - # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ unset _foamAddPath _foamAddLib _foamAddMan foamCompiler minBufferSize From 81c385e51bf629e0d87a64995103f2e6e5ba2fbc Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 11 Jan 2011 08:42:50 +0100 Subject: [PATCH 09/16] ENH: preserve command-line arguments in etc/bashrc --- etc/bashrc | 56 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 2867309ecb..cac5a683b5 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -130,6 +130,36 @@ _foamSource() done } +# Evaluate command-line parameters +_foamEval() +{ + while [ $# -gt 0 ] + do + case "$1" in + *=) + # name= -> unset name + [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "unset ${1%=}" + eval "unset ${1%=}" + ;; + *=*) + # name=value -> export name=value + [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1" + eval "export $1" + ;; + *) + # filename: source it + if [ -f "$1" ] + then + _foamSource "$1" + else + _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"` + fi + ;; + esac + shift + done +} + # Add in preset user or site preferences: _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` @@ -137,29 +167,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` # Evaluate command-line parameters and record settings for later # these can be used to set/unset values, or specify prefs files export FOAM_SETTINGS="$@" -while [ $# -gt 0 ] -do - case "$1" in - *=) - # name= -> unset name - eval "unset ${1%=}" - ;; - *=*) - # name=value -> export name=value - eval "export $1" - ;; - *) - # filename: source it - if [ -f "$1" ] - then - _foamSource "$1" - else - _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"` - fi - ;; - esac - shift -done +_foamEval $@ # Detect system type and set environment variables appropriately @@ -307,6 +315,6 @@ fi # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ unset cleaned foamClean foamInstall foamOldDirs -unset _foamSource +unset _foamSource _foamEval # ----------------------------------------------------------------- end-of-file From 305bdb59782aa3156d016db0fc0062b15bd36f53 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 11 Jan 2011 13:09:41 +0100 Subject: [PATCH 10/16] ENH: add clear() method to coordinateSystem, coordinateRotation --- .../coordinateRotation/coordinateRotation.C | 10 +++++++++- .../coordinateRotation/coordinateRotation.H | 5 ++++- src/meshTools/coordinateSystems/coordinateSystem.C | 11 ++++++++++- src/meshTools/coordinateSystems/coordinateSystem.H | 6 +++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C index 5e4e90837e..cee40302dd 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -167,6 +167,14 @@ Foam::autoPtr Foam::coordinateRotation::New } +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::coordinateRotation::clear() +{ + this->tensor::operator=(sphericalTensor::I); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // void Foam::coordinateRotation::operator=(const dictionary& rhs) diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H index 9e5d369cdb..897f0b17d4 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,6 +165,9 @@ public: // Member Functions + //- Reset rotation to an identity rotation + virtual void clear(); + //- Return local-to-global transformation tensor const tensor& R() const { diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C index e394f89bb2..d4f088d9d4 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.C +++ b/src/meshTools/coordinateSystems/coordinateSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -290,6 +290,15 @@ Foam::tmp Foam::coordinateSystem::globalToLocal } +void Foam::coordinateSystem::clear() +{ + note_.clear(); + origin_ = point::zero; + R_.clear(); + Rtr_ = sphericalTensor::I; +} + + void Foam::coordinateSystem::write(Ostream& os) const { os << type() diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H index a5a51944e2..20106002e8 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.H +++ b/src/meshTools/coordinateSystems/coordinateSystem.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -397,6 +397,10 @@ public: return origin_; } + //- Reset origin and rotation to an identity coordinateSystem + // Also resets the note + virtual void clear(); + // Write From 589ddb0c3a7668dec641c24bcec14886b729ac96 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 11 Jan 2011 13:43:52 +0100 Subject: [PATCH 11/16] ENH: support local forces/moments calculation - can specify 'CofR', 'coordinateSystem' or implicitly (0 0 0) which increases the flexibility --- .../functionObjects/forces/forces/forces.C | 58 ++++++++++++++----- .../functionObjects/forces/forces/forces.H | 41 ++++++++----- 2 files changed, 73 insertions(+), 26 deletions(-) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index d70734069c..69ddb5e519 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -188,7 +188,7 @@ Foam::forces::forces fDName_(""), rhoRef_(VGREAT), pRef_(0), - CofR_(vector::zero), + coordSys_(), forcesFilePtr_(NULL) { // Check if the available mesh is an fvMesh otherise deactivate @@ -225,14 +225,13 @@ void Foam::forces::read(const dictionary& dict) if (active_) { log_ = dict.lookupOrDefault("log", false); + directForceDensity_ = dict.lookupOrDefault("directForceDensity", false); const fvMesh& mesh = refCast(obr_); patchSet_ = mesh.boundaryMesh().patchSet(wordList(dict.lookup("patches"))); - dict.readIfPresent("directForceDensity", directForceDensity_); - if (directForceDensity_) { // Optional entry for fDName @@ -245,8 +244,8 @@ void Foam::forces::read(const dictionary& dict) ) { active_ = false; - WarningIn("void forces::read(const dictionary& dict)") - << "Could not find " << fDName_ << " in database." << nl + WarningIn("void forces::read(const dictionary&)") + << "Could not find " << fDName_ << " in database." << nl << " De-activating forces." << endl; } @@ -272,7 +271,7 @@ void Foam::forces::read(const dictionary& dict) { active_ = false; - WarningIn("void forces::read(const dictionary& dict)") + WarningIn("void forces::read(const dictionary&)") << "Could not find " << UName_ << ", " << pName_; if (rhoName_ != "rhoInf") @@ -280,8 +279,8 @@ void Foam::forces::read(const dictionary& dict) Info<< " or " << rhoName_; } - Info<< " in database." << nl << " De-activating forces." - << endl; + Info<< " in database." << nl + << " De-activating forces." << endl; } // Reference density needed for incompressible calculations @@ -291,8 +290,14 @@ void Foam::forces::read(const dictionary& dict) pRef_ = dict.lookupOrDefault("pRef", 0.0); } + coordSys_.clear(); + // Centre of rotation for moment calculations - CofR_ = dict.lookup("CofR"); + // specified directly, from coordinate system, or implicitly (0 0 0) + if (!dict.readIfPresent("CofR", coordSys_.origin())) + { + coordSys_ = coordinateSystem(dict, obr_); + } } } @@ -345,6 +350,8 @@ void Foam::forces::writeFileHeader() forcesFilePtr_() << "# Time" << tab << "forces(pressure, viscous) moment(pressure, viscous)" + << tab + << "local forces(pressure, viscous) local moment(pressure, viscous)" << endl; } } @@ -373,13 +380,32 @@ void Foam::forces::write() if (Pstream::master()) { - forcesFilePtr_() << obr_.time().value() << tab << fm << endl; + forcesMoments fmLocal; + + fmLocal.first().first() = + coordSys_.localVector(fm.first().first()); + + fmLocal.first().second() = + coordSys_.localVector(fm.first().second()); + + fmLocal.second().first() = + coordSys_.localVector(fm.second().first()); + + fmLocal.second().second() = + coordSys_.localVector(fm.second().second()); + + forcesFilePtr_() << obr_.time().value() + << tab << fm + << tab << fmLocal << endl; if (log_) { Info<< "forces output:" << nl << " forces(pressure, viscous)" << fm.first() << nl << " moment(pressure, viscous)" << fm.second() << nl + << " local:" << nl + << " forces(pressure, viscous)" << fmLocal.first() << nl + << " moment(pressure, viscous)" << fmLocal.second() << nl << endl; } } @@ -408,7 +434,10 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const { label patchi = iter.key(); - vectorField Md(mesh.C().boundaryField()[patchi] - CofR_); + vectorField Md + ( + mesh.C().boundaryField()[patchi] - coordSys_.origin() + ); scalarField sA(mag(Sfb[patchi])); @@ -452,7 +481,10 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const { label patchi = iter.key(); - vectorField Md(mesh.C().boundaryField()[patchi] - CofR_); + vectorField Md + ( + mesh.C().boundaryField()[patchi] - coordSys_.origin() + ); vectorField pf(Sfb[patchi]*(p.boundaryField()[patchi] - pRef)); diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index f37ec3b440..a6c85f983e 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,11 +28,25 @@ Description Calculates the forces and moments by integrating the pressure and skin-friction forces over a given list of patches. - Member function calcForcesMoment()calculates and returns the forces and - moments. + Member function forces::write() calculates the forces/moments and + writes the forces/moments into the file \/forces.dat - Member function forces::write() calls calcForcesMoment() and writes the - forces and moments into the file \/forces.dat +Note + The centre of rotation for moment calculations can either be specified + by an @c CofR entry, or be taken from origin of the local coordinateSystem. + For example, + @verbatim + CofR (0 0 0); + @endverbatim + or + @verbatim + coordinateSystem + { + origin (0 0 0); + e3 (0 0 1); + e1 (1 0 0); + } + @endverbatim SourceFiles forces.C @@ -43,6 +57,8 @@ SourceFiles #ifndef forces_H #define forces_H +#include "coordinateSystem.H" +#include "coordinateSystems.H" #include "primitiveFieldsFwd.H" #include "volFieldsFwd.H" #include "HashSet.H" @@ -69,15 +85,14 @@ class forces { public: - // Tuple which holds the pressure (.first()) and viscous (.second) forces + // Tuple for pressure (.first()) and viscous (.second()) forces typedef Tuple2 pressureViscous; - // Tuple which holds the forces (.first()) and moment (.second) + // Tuple for forces (.first()) and moment (.second()) // pressure/viscous forces Tuples. typedef Tuple2 forcesMoments; - //- Sum operation class to accumulate the pressure, viscous forces - // and moments + //- Sum operation class to accumulate pressure/viscous forces and moments class sumOp { public: @@ -92,12 +107,12 @@ public: ( pressureViscous ( - fm1.first().first() + fm2.first().first(), + fm1.first().first() + fm2.first().first(), fm1.first().second() + fm2.first().second() ), pressureViscous ( - fm1.second().first() + fm2.second().first(), + fm1.second().first() + fm2.second().first(), fm1.second().second() + fm2.second().second() ) ); @@ -147,8 +162,8 @@ protected: //- Reference pressure scalar pRef_; - //- Centre of rotation - vector CofR_; + //- Coordinate system used when evaluting forces/moments + coordinateSystem coordSys_; //- Forces/moment file ptr From ae0bf2b2fec2688567357b2de81da8b57a5f96ae Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 13 Jan 2011 11:23:03 +0100 Subject: [PATCH 12/16] BUG: single instead of double quotes in git hooks message --- bin/tools/pre-commit-hook | 8 ++++---- bin/tools/pre-receive-hook | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook index 7710f0ca52..d44edba275 100755 --- a/bin/tools/pre-commit-hook +++ b/bin/tools/pre-commit-hook @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -53,7 +53,7 @@ hookName="pre-commit" die() { echo "$hookName hook failure" 1>&2 - echo '-----------------------' 1>&2 + echo '-----------------------------------' 1>&2 echo '' 1>&2 echo "$@" 1>&2 echo '' 1>&2 @@ -105,8 +105,8 @@ dieOnBadFiles() { if [ -n "$badFiles" ] then - echo '$hookName hook failure' 1>&2 - echo '-----------------------' 1>&2 + echo "$hookName hook failure" 1>&2 + echo '-----------------------------------' 1>&2 echo "$@" 1>&2 echo '' 1>&2 echo "File(s):" 1>&2 diff --git a/bin/tools/pre-receive-hook b/bin/tools/pre-receive-hook index 048feb3188..cf4dcb42be 100755 --- a/bin/tools/pre-receive-hook +++ b/bin/tools/pre-receive-hook @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -47,7 +47,7 @@ hookName="pre-receive" die() { echo "$hookName hook failure" 1>&2 - echo '-----------------------' 1>&2 + echo '-----------------------------------' 1>&2 echo '' 1>&2 echo "$@" 1>&2 echo '' 1>&2 @@ -68,8 +68,8 @@ dieOnBadFiles() { if [ -n "$badFiles" ] then - echo '$hookName hook failure' 1>&2 - echo '-----------------------' 1>&2 + echo "$hookName hook failure" 1>&2 + echo '-----------------------------------' 1>&2 echo "$@" 1>&2 echo '' 1>&2 echo "File(s):" 1>&2 From 16d8ff66dd1361ac93f3851cde83f8aab9cb4a86 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 17 Jan 2011 10:08:25 +0100 Subject: [PATCH 13/16] STYLE: uneeded typedef FaceType in triSurface - use typedef FaceType from parent (PrimitivePatch) instead --- src/triSurface/triSurface/triSurface.H | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/triSurface/triSurface/triSurface.H b/src/triSurface/triSurface/triSurface.H index 35c8e34a8d..838c4acc4d 100644 --- a/src/triSurface/triSurface/triSurface.H +++ b/src/triSurface/triSurface/triSurface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -223,9 +223,6 @@ public: // Public typedefs - //- Face type used - typedef labelledTri FaceType; - //- Placeholder only, but do not remove - it is needed for GeoMesh typedef bool BoundaryMesh; From 23aa6401ab22fbde6a8d6996a7da8be8483f1968 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 17 Jan 2011 15:23:48 +0000 Subject: [PATCH 14/16] STYLE: Updated COPYING doc copyright 1991->2004 --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 7e02780f0b..6ed54f04e3 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ GNU GENERAL PUBLIC LICENSE - OpenFOAM(R) is Copyright (C) 1991-2010 OpenCFD Ltd. + OpenFOAM(R) is Copyright (C) 2004-2010 OpenCFD Ltd. Contact: OpenCFD (enquiries@OpenCFD.co.uk) You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms From 62ca98ac38f9680712265367a694b4487b66666d Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 17 Jan 2011 15:57:07 +0000 Subject: [PATCH 15/16] BUG: (typo) one too many )'s --- .../multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index bcf535873c..593b3503e1 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -1,6 +1,6 @@ label nAlphaCorr(readLabel(piso.lookup("nAlphaCorr"))); -label nAlphaSubCycles(readLabel(piso.lookup("nAlphaSubCycles")))); +label nAlphaSubCycles(readLabel(piso.lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1) { From 3a1b70532914c15ba72c26f8a03fa10577953d98 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 17 Jan 2011 15:59:19 +0000 Subject: [PATCH 16/16] STYLE: Updated current copyright year --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 6ed54f04e3..2101277c18 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ GNU GENERAL PUBLIC LICENSE - OpenFOAM(R) is Copyright (C) 2004-2010 OpenCFD Ltd. + OpenFOAM(R) is Copyright (C) 2004-2011 OpenCFD Ltd. Contact: OpenCFD (enquiries@OpenCFD.co.uk) You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms