diff --git a/.gitignore b/.gitignore index 032fac43eb089b64b47b60b1d344b1ce799d92de..bcbd35cfdf03627c1847f58cfd69049ec16f457c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,13 @@ # editor and misc backup files - anywhere *~ .*~ -*.orig *.bak +*.bak[0-9][0-9] +*.orig +*.orig[0-9][0-9] \#*\# + +# file-browser settings - anywhere .directory # CVS recovered versions - anywhere @@ -18,7 +22,7 @@ *.so *.jar -# ignore derived files +# derived files lex.yy.c # Corefiles @@ -30,7 +34,7 @@ core # lnInclude (symlink) folders - anywhere lnInclude -# build folder(s) - anywhere +# build folders - anywhere linux*Gcc*/ linux*Icc*/ linuxming*/ @@ -38,9 +42,6 @@ SiCortex*Gcc*/ solaris*Gcc*/ SunOS*Gcc*/ -# all of the wmake wmkdep and dirToString binaries -wmake/bin - # doxygen generated documentation doc/[Dd]oxygen/html doc/[Dd]oxygen/latex diff --git a/ReleaseNotes-1.6 b/ReleaseNotes-1.6 index 7227dac4feae386b4086c1e121aaf488ba85d479..78a3f045a74338d6449079c3593e8ce4b073b41a 100644 --- a/ReleaseNotes-1.6 +++ b/ReleaseNotes-1.6 @@ -58,6 +58,8 @@ their keywords. When searching, an exact match has priority over a regular expression match. Multiple regular expressions are matched in reverse order. + + The *new* =#includeIfPresent= directive is similar to the =#include= + directive, but does not generate an error if the file does not exist. + The default =#inputMode= is now '=merge=', which corresponds to the most general usage. The =#inputMode warn= corresponds to the previous default behaviour. diff --git a/applications/test/dictionary/testDict b/applications/test/dictionary/testDict index 7709155fecca5232fff4fdf14fce4ddfddbbbb00..6a0863a4547db87e7cf16d9a066f19f120e95523 100644 --- a/applications/test/dictionary/testDict +++ b/applications/test/dictionary/testDict @@ -78,6 +78,7 @@ boundaryField // NB: the inputMode has a global scope #inputMode merge #include "testDict2" +#includeIfPresent "SomeUnknownFile" foo { diff --git a/applications/test/mvBak/Make/files b/applications/test/mvBak/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..6cf0b98c5b5bfe7cbf88eb5f6be564f3287d5eec --- /dev/null +++ b/applications/test/mvBak/Make/files @@ -0,0 +1,3 @@ +mvBakTest.C + +EXE = $(FOAM_USER_APPBIN)/mvBakTest diff --git a/applications/test/mvBak/Make/options b/applications/test/mvBak/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..6a9e9810b3d5ce6684bdaf03143933480ff45e42 --- /dev/null +++ b/applications/test/mvBak/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/mvBak/mvBakTest.C b/applications/test/mvBak/mvBakTest.C new file mode 100644 index 0000000000000000000000000000000000000000..6580ed421c51edb0d17d94c9252e0b6bd2cefd33 --- /dev/null +++ b/applications/test/mvBak/mvBakTest.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + +\*---------------------------------------------------------------------------*/ + +#include "OSspecific.H" +#include "argList.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noBanner(); + argList::noParallel(); + argList::validArgs.insert("file .. fileN"); + argList::validOptions.erase("case"); + argList::validOptions.insert("ext", "bak"); + + argList args(argc, argv, false, true); + + if (args.additionalArgs().empty()) + { + args.printUsage(); + } + + label ok = 0; + + forAll(args.additionalArgs(), argI) + { + const string& srcFile = args.additionalArgs()[argI]; + + if (args.optionFound("ext")) + { + if (mvBak(srcFile, args.option("ext"))) + { + ok++; + } + } + else + { + if (mvBak(srcFile)) + { + ok++; + } + } + } + + Info<< "mvBak called for " << args.additionalArgs().size() + << " files (moved " << ok << ")\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/preProcessing/mapFields/UnMapped.H b/applications/utilities/preProcessing/mapFields/UnMapped.H index 0a43f1ac5a132490e24ab89c0136ae5b0ae12ebc..fe216498c58aefb0dbcc4a8b03018429a67ea791 100644 --- a/applications/utilities/preProcessing/mapFields/UnMapped.H +++ b/applications/utilities/preProcessing/mapFields/UnMapped.H @@ -47,7 +47,7 @@ void UnMapped(const IOobjectList& objects) ++fieldIter ) { - mv(fieldIter()->objectPath(), fieldIter()->objectPath() + ".unmapped"); + mvBak(fieldIter()->objectPath(), "unmapped"); } } diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 09b3182b5208e5c55ea0731af06340cfa90853b4..3f64d413c3e2f95e36e72044c58f20e5a5cfcccf 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -474,20 +474,20 @@ Foam::fileName::Type Foam::type(const fileName& name) // Does the name exist in the filing system? -bool Foam::exists(const fileName& name) +bool Foam::exists(const fileName& name, const bool checkGzip) { - return mode(name) || isFile(name); + return mode(name) || isFile(name, checkGzip); } -// Does the directory exist +// Does the directory exist? bool Foam::isDir(const fileName& name) { return S_ISDIR(mode(name)); } -// Does the file exist +// Does the file exist? bool Foam::isFile(const fileName& name, const bool checkGzip) { return S_ISREG(mode(name)) || (checkGzip && S_ISREG(mode(name + ".gz"))); @@ -757,31 +757,70 @@ bool Foam::ln(const fileName& src, const fileName& dst) // Rename srcFile dstFile -bool Foam::mv(const fileName& srcFile, const fileName& dstFile) +bool Foam::mv(const fileName& src, const fileName& dst) { if (POSIX::debug) { - Info<< "Move : " << srcFile << " to " << dstFile << endl; + Info<< "Move : " << src << " to " << dst << endl; } if ( - dstFile.type() == fileName::DIRECTORY - && srcFile.type() != fileName::DIRECTORY + dst.type() == fileName::DIRECTORY + && src.type() != fileName::DIRECTORY ) { - const fileName dstName(dstFile/srcFile.name()); + const fileName dstName(dst/src.name()); - return rename(srcFile.c_str(), dstName.c_str()) == 0; + return rename(src.c_str(), dstName.c_str()) == 0; } else { - return rename(srcFile.c_str(), dstFile.c_str()) == 0; + return rename(src.c_str(), dst.c_str()) == 0; } } -// Remove a file returning true if successful otherwise false +//- Rename to a corresponding backup file +// If the backup file already exists, attempt with "01" .. "99" index +bool Foam::mvBak(const fileName& src, const std::string& ext) +{ + if (POSIX::debug) + { + Info<< "mvBak : " << src << " to extension " << ext << endl; + } + + if (exists(src, false)) + { + const int maxIndex = 99; + char index[3]; + + for (int n = 0; n <= maxIndex; n++) + { + fileName dstName(src + "." + ext); + if (n) + { + sprintf(index, "%02d", n); + dstName += index; + } + + // avoid overwriting existing files, except for the last + // possible index where we have no choice + if (!exists(dstName, false) || n == maxIndex) + { + return rename(src.c_str(), dstName.c_str()) == 0; + } + + } + } + + // fall-through: nothing to do + return false; +} + + + +// Remove a file, returning true if successful otherwise false bool Foam::rm(const fileName& file) { if (POSIX::debug) diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 9d1daeeeef5649ebf8a7699d0a1a7db744e13ecd..8e2f04c3599fa398e25d497d425cbc68aaf61a7e 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -132,6 +132,7 @@ $(dictionaryEntry)/dictionaryEntryIO.C functionEntries = $(dictionary)/functionEntries $(functionEntries)/functionEntry/functionEntry.C $(functionEntries)/includeEntry/includeEntry.C +$(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C $(functionEntries)/inputModeEntry/inputModeEntry.C $(functionEntries)/removeEntry/removeEntry.C diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C index 2d49418fae22647e7c41ffd09072e043541d528b..66148e27f35490fd7200a65edf5b97a2216c8466 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C @@ -62,7 +62,7 @@ namespace functionEntries } } -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // +// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // Foam::fileName Foam::functionEntries::includeEntry::includeFileName ( @@ -112,6 +112,7 @@ bool Foam::functionEntries::includeEntry::execute } } + bool Foam::functionEntries::includeEntry::execute ( const dictionary& parentDict, diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H index 6fc94aa1ad6ca8255832a3981d1bd5a42bab1d10..80dcaa75afbd0f74b9c60d7ab799287caa4f85ac 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H @@ -67,15 +67,19 @@ class includeEntry { // Private Member Functions - //- Read the include fileName from Istream, expand and return - static fileName includeFileName(Istream&); - //- Disallow default bitwise copy construct includeEntry(const includeEntry&); //- Disallow default bitwise assignment void operator=(const includeEntry&); +protected: + + // Protected Member Functions + + //- Read the include fileName from Istream, expand and return + static fileName includeFileName(Istream&); + public: diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C new file mode 100644 index 0000000000000000000000000000000000000000..9fc1ea1727c4c56eedb1578a699449cec61036aa --- /dev/null +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "includeIfPresentEntry.H" +#include "dictionary.H" +#include "IFstream.H" +#include "addToMemberFunctionSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const Foam::word Foam::functionEntries::includeIfPresentEntry::typeName +( + Foam::functionEntries::includeIfPresentEntry::typeName_() +); + +// Don't lookup the debug switch here as the debug switch dictionary +// might include includeIfPresentEntry +int Foam::functionEntries::includeIfPresentEntry::debug(0); + +namespace Foam +{ +namespace functionEntries +{ + addToMemberFunctionSelectionTable + ( + functionEntry, + includeIfPresentEntry, + execute, + dictionaryIstream + ); + + addToMemberFunctionSelectionTable + ( + functionEntry, + includeIfPresentEntry, + execute, + primitiveEntryIstream + ); +} +} + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::functionEntries::includeIfPresentEntry::execute +( + dictionary& parentDict, + Istream& is +) +{ + IFstream ifs(includeFileName(is)); + + if (ifs) + { + parentDict.read(ifs); + } + + return true; +} + + +bool Foam::functionEntries::includeIfPresentEntry::execute +( + const dictionary& parentDict, + primitiveEntry& entry, + Istream& is +) +{ + IFstream ifs(includeFileName(is)); + + if (ifs) + { + entry.read(parentDict, ifs); + } + + return true; +} + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H new file mode 100644 index 0000000000000000000000000000000000000000..751de7dba24f3f00b3503804920dfd8557644580 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::functionEntries::includeIfPresentEntry + +Description + Specify a file to include if it exists. Expects a single string to follow. + + The @c \#includeIfPresent directive is similar to the @c \#include + directive, but does not generate an error if the file does not exist. + +See Also + Foam::functionEntries::includeEntry + +SourceFiles + includeIfPresentEntry.C + +\*---------------------------------------------------------------------------*/ + +#ifndef includeIfPresentEntry_H +#define includeIfPresentEntry_H + +#include "includeEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionEntries +{ + +/*---------------------------------------------------------------------------*\ + Class includeIfPresentEntry Declaration +\*---------------------------------------------------------------------------*/ + +class includeIfPresentEntry +: + public includeEntry +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + includeIfPresentEntry(const includeIfPresentEntry&); + + //- Disallow default bitwise assignment + void operator=(const includeIfPresentEntry&); + +public: + + //- Runtime type information + ClassName("includeIfPresent"); + + + // Member Functions + + //- Execute the functionEntry in a sub-dict context + static bool execute(dictionary& parentDict, Istream&); + + //- Execute the functionEntry in a primitiveEntry context + static bool execute + ( + const dictionary& parentDict, + primitiveEntry&, + Istream& + ); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace functionEntries +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/include/OSspecific.H b/src/OpenFOAM/include/OSspecific.H index d04243c23dbe9b38fa16d3395da0a5010ce7a1fb..b34d374d72fd06ccb3b9751adb1c3fad6aa46a5c 100644 --- a/src/OpenFOAM/include/OSspecific.H +++ b/src/OpenFOAM/include/OSspecific.H @@ -119,7 +119,8 @@ mode_t mode(const fileName&); fileName::Type type(const fileName&); //- Does the name exist (as DIRECTORY or FILE) in the file system? -bool exists(const fileName&); +// Optionally enable/disable check for gzip file. +bool exists(const fileName&, const bool checkGzip=true); //- Does the name exist as a DIRECTORY in the file system? bool isDir(const fileName&); @@ -143,15 +144,19 @@ fileNameList readDir ); //- Copy, recursively if necessary, the source to the destination -bool cp(const fileName& srcFile, const fileName& destFile); +bool cp(const fileName& src, const fileName& dst); + +//- Create a softlink. dst should not exist. Returns true if successful. +bool ln(const fileName& src, const fileName& dst); -//- Create a softlink. destFile should not exist. Returns true if successful. -bool ln(const fileName& srcFile, const fileName& destFile); +//- Rename src to dst +bool mv(const fileName& src, const fileName& dst); -//- Rename srcFile destFile -bool mv(const fileName& srcFile, const fileName& destFile); +//- Rename to a corresponding backup file +// If the backup file already exists, attempt with "01" .. "99" suffix +bool mvBak(const fileName&, const std::string& ext = "bak"); -//- Remove a file returning true if successful otherwise false +//- Remove a file, returning true if successful otherwise false bool rm(const fileName&); //- Remove a dirctory and its contents diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C index 74993262d4eb971ba390425264caadd830352f2c..633c39f4782b13cd273ae0ccd2eaeeb76110f326 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C @@ -928,7 +928,7 @@ Foam::labelList Foam::fvMeshDistribute::mapBoundaryData { label newFaceI = map.oldFaceMap()[oldBFaceI + map.nOldInternalFaces()]; - // Face still exists (is nessecary?) and still boundary face + // Face still exists (is necessary?) and still boundary face if (newFaceI >= 0 && newFaceI >= mesh.nInternalFaces()) { newBoundaryData[newFaceI - mesh.nInternalFaces()] = diff --git a/src/turbulenceModels/compressible/RAS/Make/files b/src/turbulenceModels/compressible/RAS/Make/files index 56644ea6d3843425c088cc9dc0412341107d1cb1..7642142d56d1e82a95537619f96d4d2291b697d4 100644 --- a/src/turbulenceModels/compressible/RAS/Make/files +++ b/src/turbulenceModels/compressible/RAS/Make/files @@ -38,7 +38,5 @@ derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLe derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C -backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C -backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C LIB = $(FOAM_LIBBIN)/libcompressibleRASModels diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C deleted file mode 100644 index 83902514a05d8e32d94c34154ed7fe04f835cadc..0000000000000000000000000000000000000000 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C +++ /dev/null @@ -1,156 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2006-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "surfaceFields.H" -#include "volFields.H" -#include "RASModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchField<scalar>(p, iF), - mixingLength_(0.001) -{} - -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -( - const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), - mixingLength_(ptf.mixingLength_) -{} - -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchField<scalar>(p, iF, dict), - mixingLength_(readScalar(dict.lookup("mixingLength"))) -{} - -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -( - const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf -) -: - fixedValueFvPatchField<scalar>(ptf), - mixingLength_(ptf.mixingLength_) -{} - -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -( - const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchField<scalar>(ptf, iF), - mixingLength_(ptf.mixingLength_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - // Lookup Cmu corresponding to the turbulence model selected - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar Cmu = readScalar(rasModel.coeffDict().lookup("Cmu")); - const scalar Cmu75 = pow(Cmu, 0.75); - - const fvPatchField<scalar>& kp = - patch().lookupPatchField<volScalarField, scalar>("k"); - - operator==(Cmu75*kp*sqrt(kp)/mixingLength_); - - fixedValueFvPatchField<scalar>::updateCoeffs(); -} - - -void backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::write -( - Ostream& os -) const -{ - // write with prefix for forwards compatibility - // mimic - fvPatchField<scalar>::write(os); - - os.writeKeyword("type") - << "compressible::" << type() << token::END_STATEMENT << nl; - - os.writeKeyword("mixingLength") - << mixingLength_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.H b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.H deleted file mode 100644 index fec530e1fcd6a5108440f488ed2a570a7d0f9663..0000000000000000000000000000000000000000 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.H +++ /dev/null @@ -1,158 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2006-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::compressible:: - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - -Description - Compatibility for the new namespace qualifier - Foam::compressible::turbulentMixingLengthDissipationRateInletFvPatchScalarField - -SourceFiles - backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C - -\*---------------------------------------------------------------------------*/ - -#ifndef backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet_H -#define backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -/*---------------------------------------------------------------------------*\ - Class backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - // Private data - - //- turbulent length scale - scalar mixingLength_; - -public: - - //- Runtime type information - TypeName("turbulentMixingLengthDissipationRateInlet"); - - - // Constructors - - //- Construct from patch and internal field - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - // onto a new patch - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - *this, - iF - ) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C deleted file mode 100644 index e9e1cd11b4d56d0bcc0736770162fabc600b7661..0000000000000000000000000000000000000000 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C +++ /dev/null @@ -1,163 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2006-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "surfaceFields.H" -#include "volFields.H" -#include "RASModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchField<scalar>(p, iF), - mixingLength_(0.0), - kName_("k") -{} - -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -( - const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), - mixingLength_(ptf.mixingLength_), - kName_(ptf.kName_) -{} - -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchField<scalar>(p, iF, dict), - mixingLength_(readScalar(dict.lookup("mixingLength"))), - kName_(dict.lookupOrDefault<word>("k", "k")) -{} - -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -( - const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& ptf -) -: - fixedValueFvPatchField<scalar>(ptf), - mixingLength_(ptf.mixingLength_), - kName_(ptf.kName_) -{} - -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField:: -backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -( - const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchField<scalar>(ptf, iF), - mixingLength_(ptf.mixingLength_), - kName_(ptf.kName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - // Lookup Cmu corresponding to the turbulence model selected - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar Cmu = readScalar(rasModel.coeffDict().lookup("Cmu")); - const scalar Cmu25 = pow(Cmu, 0.25); - - const fvPatchField<scalar>& kp = - patch().lookupPatchField<volScalarField, scalar>(kName_); - - operator==(sqrt(kp)/(Cmu25*mixingLength_)); - - fixedValueFvPatchField<scalar>::updateCoeffs(); -} - - -void backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::write -( - Ostream& os -) const -{ - // write with prefix for forwards compatibility - // mimic - fvPatchField<scalar>::write(os); - - os.writeKeyword("type") - << "compressible::" << type() << token::END_STATEMENT << nl; - - os.writeKeyword("mixingLength") - << mixingLength_ << token::END_STATEMENT << nl; - - os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.H b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.H deleted file mode 100644 index ebe6e5445e5f1c2526a1fa791c02225ed15ff65c..0000000000000000000000000000000000000000 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.H +++ /dev/null @@ -1,162 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2006-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::compressible:: - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - -Description - Compatibility for the new namespace qualifier - Foam::compressible::turbulentMixingLengthFrequencyInletFvPatchScalarField - -SourceFiles - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef compressiblebackwardsCompatibilityTurbulentMixingLengthFrequencyInlet_H -#define compressiblebackwardsCompatibilityTurbulentMixingLengthFrequencyInlet_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -/*---------------------------------------------------------------------------*\ - Class backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - // Private data - - //- Turbulent length scale - scalar mixingLength_; - - //- Name of the turbulent kinetic energy field - word kName_; - - -public: - - //- Runtime type information - TypeName("turbulentMixingLengthFrequencyInlet"); - - - // Constructors - - //- Construct from patch and internal field - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - // onto a new patch - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField - ( - *this, - iF - ) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C index 91f739abfb9d6d6624bf3e0a7413dffd58a55eaa..24c0fe8fb1c90ce1f2b9914f44a7985af2534b28 100644 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C @@ -104,7 +104,7 @@ autoCreateWallFunctionField // rename file Info<< " Backup original " << fieldName << " to " << fieldName << ".old" << endl; - mv(ioObj.objectPath(), ioObj.objectPath() + ".old"); + mvBak(ioObj.objectPath(), "old"); PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size()); diff --git a/src/turbulenceModels/incompressible/RAS/Make/files b/src/turbulenceModels/incompressible/RAS/Make/files index d5736d3064102cbea204047817324bbddfb45397..95322d4f68c38c6f66ecd763e58fbb6cfeecb1b5 100644 --- a/src/turbulenceModels/incompressible/RAS/Make/files +++ b/src/turbulenceModels/incompressible/RAS/Make/files @@ -42,6 +42,6 @@ derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFv derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C -backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C +backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C LIB = $(FOAM_LIBBIN)/libincompressibleRASModels diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C similarity index 100% rename from src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C rename to src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.H similarity index 100% rename from src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H rename to src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.H diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C similarity index 98% rename from src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C rename to src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C index 10247d493eae3d934035a20af26b8ea493a30b19..f5b057f8aae084c69f2960f50aa9f93c1f0b6091 100644 --- a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctionsTemplates.C @@ -104,7 +104,7 @@ autoCreateWallFunctionField // rename file Info<< " Backup original " << fieldName << " to " << fieldName << ".old" << endl; - mv(ioObj.objectPath(), ioObj.objectPath() + ".old"); + mvBak(ioObj.objectPath(), "old"); PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size()); diff --git a/wmake/Makefile b/wmake/Makefile index ae4fd43f1373231dc203f9f390a330707aa5038f..28b7015b71dbc899c4bb4eea9845ac53edb34683 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -29,7 +29,9 @@ # Generic Makefile used by wmake # #------------------------------------------------------------------------------ -# Set shell the Makefile uses to the Bourne shell + +#------------------------------------------------------------------------------ +# The Makefile use a POSIX shell #------------------------------------------------------------------------------ SHELL = /bin/sh diff --git a/wmake/makeWmake b/wmake/makeWmake index 30a65650955106b9a7d08087f92a7cd406493e0e..21386f41be03fd953fa8d610297fadd4ac4e6616 100755 --- a/wmake/makeWmake +++ b/wmake/makeWmake @@ -34,6 +34,6 @@ # run from this directory only cd ${0%/*} || exit 1 -( cd src && make ) +( cd src && make $@ ) #------------------------------------------------------------------------------ diff --git a/wmake/rules/General/standard b/wmake/rules/General/standard index cf698d1e1e3ec49a780349f642f774b6cb30f7bd..809f9353a2d6f179ebc3329b5c8ce67142b01af2 100644 --- a/wmake/rules/General/standard +++ b/wmake/rules/General/standard @@ -4,7 +4,7 @@ include $(GENERAL_RULES)/sourceToDep include $(GENERAL_RULES)/flex include $(GENERAL_RULES)/flex++ -#include $(GENERAL_RULES)/byacc -#include $(GENERAL_RULES)/btyacc++ +## include $(GENERAL_RULES)/byacc +## include $(GENERAL_RULES)/btyacc++ include $(GENERAL_RULES)/bison include $(GENERAL_RULES)/moc diff --git a/wmake/src/Makefile b/wmake/src/Makefile index d764aeba8801353d2d164ec88115e1ba0029ea38..a74c250f8815ba0020d9cef77f587551c725e2ad 100644 --- a/wmake/src/Makefile +++ b/wmake/src/Makefile @@ -43,7 +43,22 @@ SHELL = /bin/sh .SUFFIXES: .SUFFIXES: .o -BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER) + +#------------------------------------------------------------------------------ +# set compilation and dependency building rules +#------------------------------------------------------------------------------ + +GENERAL_RULES = $(WM_DIR)/rules/General +RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) +BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER) + +include $(RULES)/general +include $(RULES)/$(WM_LINK_LANGUAGE) + + +#------------------------------------------------------------------------------ +# targets +#------------------------------------------------------------------------------ all: $(BIN)/dirToString $(BIN)/wmkdep @@ -59,16 +74,7 @@ $(BIN)/wmkdep: wmkdep.l @mkdir -p $(BIN) flex wmkdep.l $(cc) $(cFLAGS) lex.yy.c -o $(BIN)/wmkdep + @rm -f lex.yy.c 2>/dev/null -#------------------------------------------------------------------------------ -# set compilation and dependency building rules -#------------------------------------------------------------------------------ - -GENERAL_RULES = $(WM_DIR)/rules/General -RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) - -include $(RULES)/general -include $(RULES)/$(WM_LINK_LANGUAGE) - #------------------------------------------------------------------------------ diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll index da803f288eb09092c66c0efe8eccc102fe9aff3e..fe3adbdce37d4a8bb90ce9de32de97056cb2d16d 100755 --- a/wmake/wmakeLnIncludeAll +++ b/wmake/wmakeLnIncludeAll @@ -27,38 +27,68 @@ # wmakeLnIncludeAll # # Description -# Find directories containing a Make/ directory and execute +# Find directories containing an lnInclude/ directory and execute # 'wmakeLnInclude -f' for each one # #------------------------------------------------------------------------------ -# default is pwd -if [ "$#" -eq 0 ] -then - set -- . -elif [ "$1" = "-h" -o "$1" = "-help" ] -then - echo "Usage: ${0##*/} [dir1] .. [dirN]" - echo - echo " Find directories containing a Make/ directory and" - echo " execute 'wmakeLnInclude -f' for each one" - echo +usage() { + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<<USAGE + +usage: ${0##*/} [-make] [dir1 .. dirN] + + Find directories containing an lnInclude/ directory and execute + 'wmakeLnInclude -f' for each one + +Note + Use the '-make' option to search for Make/ instead of lnInclude/ + +USAGE exit 1 -fi +} + +#------------------------------------------------------------------------------ +findName=lnInclude + +# simple parse options +while [ "$#" -gt 0 ] +do + case "$1" in + -h | -help) # provide immediate help + usage + ;; + -make) + shift + findName=Make + ;; + -*) + usage "unknown option: '$*'" + ;; + *) + break + ;; + esac +done + +# default to searching from pwd +[ "$#" -gt 0 ] || set -- . for checkDir do if [ -d $checkDir ] then - echo "searching: $checkDir for 'Make' directories" + echo "searching: $checkDir for '$findName' directories" + echo "---------" else echo "skipping non-dir: $checkDir" + echo "----------------" continue fi - find $checkDir -depth -type d -name Make -print | while read dir + find $checkDir -depth -type d -name $findName -print | while read dir do - dir=${dir%/Make} # trim /Make directory from the end + dir=${dir%/$findName} # trim findName from the end if [ -d "$dir" ] then wmakeLnInclude -f $dir