Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2009-07-21 19:06:59 +01:00
40 changed files with 564 additions and 738 deletions

13
.gitignore vendored
View File

@ -4,9 +4,13 @@
# editor and misc backup files - anywhere # editor and misc backup files - anywhere
*~ *~
.*~ .*~
*.orig
*.bak *.bak
*.bak[0-9][0-9]
*.orig
*.orig[0-9][0-9]
\#*\# \#*\#
# file-browser settings - anywhere
.directory .directory
# CVS recovered versions - anywhere # CVS recovered versions - anywhere
@ -18,7 +22,7 @@
*.so *.so
*.jar *.jar
# ignore derived files # derived files
lex.yy.c lex.yy.c
# Corefiles # Corefiles
@ -30,7 +34,7 @@ core
# lnInclude (symlink) folders - anywhere # lnInclude (symlink) folders - anywhere
lnInclude lnInclude
# build folder(s) - anywhere # build folders - anywhere
linux*Gcc*/ linux*Gcc*/
linux*Icc*/ linux*Icc*/
linuxming*/ linuxming*/
@ -38,9 +42,6 @@ SiCortex*Gcc*/
solaris*Gcc*/ solaris*Gcc*/
SunOS*Gcc*/ SunOS*Gcc*/
# all of the wmake wmkdep and dirToString binaries
wmake/bin
# doxygen generated documentation # doxygen generated documentation
doc/[Dd]oxygen/html doc/[Dd]oxygen/html
doc/[Dd]oxygen/latex doc/[Dd]oxygen/latex

View File

@ -58,6 +58,8 @@
their keywords. When searching, an exact match has priority over a regular their keywords. When searching, an exact match has priority over a regular
expression match. Multiple regular expressions are matched in reverse expression match. Multiple regular expressions are matched in reverse
order. 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 + The default =#inputMode= is now '=merge=', which corresponds to the most
general usage. The =#inputMode warn= corresponds to the previous default general usage. The =#inputMode warn= corresponds to the previous default
behaviour. behaviour.

View File

@ -78,6 +78,7 @@ boundaryField
// NB: the inputMode has a global scope // NB: the inputMode has a global scope
#inputMode merge #inputMode merge
#include "testDict2" #include "testDict2"
#includeIfPresent "SomeUnknownFile"
foo foo
{ {

View File

@ -0,0 +1,3 @@
mvBakTest.C
EXE = $(FOAM_USER_APPBIN)/mvBakTest

View File

@ -0,0 +1,2 @@
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
/* EXE_LIBS = -lfiniteVolume */

View File

@ -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;
}
// ************************************************************************* //

View File

@ -26,7 +26,14 @@ Application
redistributeMeshPar redistributeMeshPar
Description Description
Parallel redecomposition of mesh. Parallel redecomposition of mesh. Start with maximum number of processors.
Balances mesh and writes new mesh to new timedirectory.
Can also work like decomposePar:
mkdir processor0
cp -r constant processor0
mpirun -np ddd redistributeMeshPar -parallel
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -47,7 +47,7 @@ void UnMapped(const IOobjectList& objects)
++fieldIter ++fieldIter
) )
{ {
mv(fieldIter()->objectPath(), fieldIter()->objectPath() + ".unmapped"); mvBak(fieldIter()->objectPath(), "unmapped");
} }
} }

View File

@ -474,20 +474,20 @@ Foam::fileName::Type Foam::type(const fileName& name)
// Does the name exist in the filing system? // 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) bool Foam::isDir(const fileName& name)
{ {
return S_ISDIR(mode(name)); return S_ISDIR(mode(name));
} }
// Does the file exist // Does the file exist?
bool Foam::isFile(const fileName& name, const bool checkGzip) bool Foam::isFile(const fileName& name, const bool checkGzip)
{ {
return S_ISREG(mode(name)) || (checkGzip && S_ISREG(mode(name + ".gz"))); 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 // Rename srcFile dstFile
bool Foam::mv(const fileName& srcFile, const fileName& dstFile) bool Foam::mv(const fileName& src, const fileName& dst)
{ {
if (POSIX::debug) if (POSIX::debug)
{ {
Info<< "Move : " << srcFile << " to " << dstFile << endl; Info<< "Move : " << src << " to " << dst << endl;
} }
if if
( (
dstFile.type() == fileName::DIRECTORY dst.type() == fileName::DIRECTORY
&& srcFile.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 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) bool Foam::rm(const fileName& file)
{ {
if (POSIX::debug) if (POSIX::debug)

View File

@ -132,6 +132,7 @@ $(dictionaryEntry)/dictionaryEntryIO.C
functionEntries = $(dictionary)/functionEntries functionEntries = $(dictionary)/functionEntries
$(functionEntries)/functionEntry/functionEntry.C $(functionEntries)/functionEntry/functionEntry.C
$(functionEntries)/includeEntry/includeEntry.C $(functionEntries)/includeEntry/includeEntry.C
$(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C
$(functionEntries)/inputModeEntry/inputModeEntry.C $(functionEntries)/inputModeEntry/inputModeEntry.C
$(functionEntries)/removeEntry/removeEntry.C $(functionEntries)/removeEntry/removeEntry.C

View File

@ -62,7 +62,7 @@ namespace functionEntries
} }
} }
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
Foam::fileName Foam::functionEntries::includeEntry::includeFileName Foam::fileName Foam::functionEntries::includeEntry::includeFileName
( (
@ -112,6 +112,7 @@ bool Foam::functionEntries::includeEntry::execute
} }
} }
bool Foam::functionEntries::includeEntry::execute bool Foam::functionEntries::includeEntry::execute
( (
const dictionary& parentDict, const dictionary& parentDict,

View File

@ -67,15 +67,19 @@ class includeEntry
{ {
// Private Member Functions // Private Member Functions
//- Read the include fileName from Istream, expand and return
static fileName includeFileName(Istream&);
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
includeEntry(const includeEntry&); includeEntry(const includeEntry&);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const includeEntry&); void operator=(const includeEntry&);
protected:
// Protected Member Functions
//- Read the include fileName from Istream, expand and return
static fileName includeFileName(Istream&);
public: public:

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -50,8 +50,7 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
const dictionary& dict const dictionary& dict
) )
: :
functionObject(), functionObject(name),
name_(name),
time_(t), time_(t),
dict_(dict), dict_(dict),
regionName_(polyMesh::defaultRegion), regionName_(polyMesh::defaultRegion),
@ -92,7 +91,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
( (
new IOOutputFilter<OutputFilter> new IOOutputFilter<OutputFilter>
( (
name_, name(),
time_.lookupObject<objectRegistry>(regionName_), time_.lookupObject<objectRegistry>(regionName_),
dictName_ dictName_
) )
@ -104,7 +103,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
( (
new OutputFilter new OutputFilter
( (
name_, name(),
time_.lookupObject<objectRegistry>(regionName_), time_.lookupObject<objectRegistry>(regionName_),
dict_ dict_
) )

View File

@ -63,9 +63,6 @@ class OutputFilterFunctionObject
{ {
// Private data // Private data
//- Output filter name
word name_;
//- Reference to the time database //- Reference to the time database
const Time& time_; const Time& time_;
@ -121,12 +118,6 @@ public:
// Access // Access
//- Return name
virtual const word& name() const
{
return name_;
}
//- Return time database //- Return time database
virtual const Time& time() const virtual const Time& time() const
{ {

View File

@ -36,7 +36,9 @@ int Foam::functionObject::debug(Foam::debug::debugSwitch("functionObject", 0));
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObject::functionObject() Foam::functionObject::functionObject(const word& name)
:
name_(name)
{} {}
@ -103,6 +105,12 @@ Foam::functionObject::~functionObject()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word& Foam::functionObject::name() const
{
return name_;
}
bool Foam::functionObject::end() bool Foam::functionObject::end()
{ {
return execute(); return execute();

View File

@ -57,6 +57,12 @@ class Time;
class functionObject class functionObject
{ {
// Private data
//- Name
const word name_;
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
@ -88,8 +94,8 @@ public:
// Constructors // Constructors
//- Construct null //- Construct from components
functionObject(); functionObject(const word& name);
//- Return clone //- Return clone
autoPtr<functionObject> clone() const autoPtr<functionObject> clone() const
@ -137,6 +143,9 @@ public:
// Member Functions // Member Functions
//- Name
virtual const word& name() const;
//- Called at the start of the time-loop //- Called at the start of the time-loop
virtual bool start() = 0; virtual bool start() = 0;

View File

@ -133,6 +133,9 @@ public:
//- Return true if the List is empty (ie, size() is zero). //- Return true if the List is empty (ie, size() is zero).
using PtrList<functionObject>::empty; using PtrList<functionObject>::empty;
//- Access to the functionObjects
using PtrList<functionObject>::operator[];
//- Clear the list of function objects //- Clear the list of function objects
virtual void clear(); virtual void clear();

View File

@ -119,7 +119,8 @@ mode_t mode(const fileName&);
fileName::Type type(const fileName&); fileName::Type type(const fileName&);
//- Does the name exist (as DIRECTORY or FILE) in the file system? //- 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? //- Does the name exist as a DIRECTORY in the file system?
bool isDir(const fileName&); bool isDir(const fileName&);
@ -143,15 +144,19 @@ fileNameList readDir
); );
//- Copy, recursively if necessary, the source to the destination //- 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. destFile should not exist. Returns true if successful. //- Create a softlink. dst should not exist. Returns true if successful.
bool ln(const fileName& srcFile, const fileName& destFile); bool ln(const fileName& src, const fileName& dst);
//- Rename srcFile destFile //- Rename src to dst
bool mv(const fileName& srcFile, const fileName& destFile); bool mv(const fileName& src, const fileName& dst);
//- 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" suffix
bool mvBak(const fileName&, const std::string& ext = "bak");
//- Remove a file, returning true if successful otherwise false
bool rm(const fileName&); bool rm(const fileName&);
//- Remove a dirctory and its contents //- Remove a dirctory and its contents

View File

@ -928,7 +928,7 @@ Foam::labelList Foam::fvMeshDistribute::mapBoundaryData
{ {
label newFaceI = map.oldFaceMap()[oldBFaceI + map.nOldInternalFaces()]; 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()) if (newFaceI >= 0 && newFaceI >= mesh.nInternalFaces())
{ {
newBoundaryData[newFaceI - mesh.nInternalFaces()] = newBoundaryData[newFaceI - mesh.nInternalFaces()] =

View File

@ -52,6 +52,17 @@ Foam::passiveParticleCloud::passiveParticleCloud
} }
Foam::passiveParticleCloud::passiveParticleCloud
(
const polyMesh& mesh,
const word& cloudName,
const IDLList<passiveParticle>& particles
)
:
Cloud<passiveParticle>(mesh, cloudName, particles)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::passiveParticleCloud::readFields() void Foam::passiveParticleCloud::readFields()

View File

@ -63,6 +63,9 @@ class passiveParticleCloud
public: public:
//- Type of parcel the cloud was instantiated for
typedef passiveParticle parcelType;
// Constructors // Constructors
//- Construct given mesh //- Construct given mesh
@ -72,6 +75,14 @@ public:
const word& cloudName = "defaultCloud" const word& cloudName = "defaultCloud"
); );
//- Construct from mesh, cloud name, and a list of particles
passiveParticleCloud
(
const polyMesh& mesh,
const word& cloudName,
const IDLList<passiveParticle>& particles
);
// Member Functions // Member Functions

View File

@ -81,7 +81,11 @@ Foam::isoSurface::adaptPatchFields
{ {
const polyPatch& pp = patches[patchI]; const polyPatch& pp = patches[patchI];
if (isA<emptyPolyPatch>(pp)) if
(
isA<emptyPolyPatch>(pp)
&& pp.size() != sliceFld.boundaryField()[patchI].size()
)
{ {
// Clear old value. Cannot resize it since is a slice. // Clear old value. Cannot resize it since is a slice.
sliceFld.boundaryField().set(patchI, NULL); sliceFld.boundaryField().set(patchI, NULL);
@ -96,11 +100,18 @@ Foam::isoSurface::adaptPatchFields
sliceFld sliceFld
) )
); );
sliceFld.boundaryField()[patchI] ==
mesh.boundary()[patchI].patchInternalField // Note: cannot use patchInternalField since uses emptyFvPatch::size
( // Do our own internalField instead.
sliceFld const unallocLabelList& faceCells =
); mesh.boundary()[patchI].patch().faceCells();
Field<Type>& pfld = sliceFld.boundaryField()[patchI];
pfld.setSize(faceCells.size());
forAll(faceCells, i)
{
pfld[i] = sliceFld[faceCells[i]];
}
} }
else if (isA<cyclicPolyPatch>(pp)) else if (isA<cyclicPolyPatch>(pp))
{ {

View File

@ -37,7 +37,13 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(sampledCuttingPlane, 0); defineTypeNameAndDebug(sampledCuttingPlane, 0);
addNamedToRunTimeSelectionTable(sampledSurface, sampledCuttingPlane, word, cuttingPlane); addNamedToRunTimeSelectionTable
(
sampledSurface,
sampledCuttingPlane,
word,
cuttingPlane
);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -118,7 +124,7 @@ void Foam::sampledCuttingPlane::createGeometry()
// Internal field // Internal field
{ {
const pointField& cc = fvm.C(); const pointField& cc = fvm.cellCentres();
scalarField& fld = cellDistance.internalField(); scalarField& fld = cellDistance.internalField();
forAll(cc, i) forAll(cc, i)
@ -130,7 +136,37 @@ void Foam::sampledCuttingPlane::createGeometry()
// Patch fields // Patch fields
{ {
forAll(fvm.C().boundaryField(), patchI) forAll(cellDistance.boundaryField(), patchI)
{
if
(
isA<emptyFvPatchScalarField>
(
cellDistance.boundaryField()[patchI]
)
)
{
cellDistance.boundaryField().set
(
patchI,
new calculatedFvPatchScalarField
(
fvm.boundary()[patchI],
cellDistance
)
);
const polyPatch& pp = fvm.boundary()[patchI].patch();
pointField::subField cc = pp.patchSlice(fvm.faceCentres());
fvPatchScalarField& fld = cellDistance.boundaryField()[patchI];
fld.setSize(pp.size());
forAll(fld, i)
{
fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
}
}
else
{ {
const pointField& cc = fvm.C().boundaryField()[patchI]; const pointField& cc = fvm.C().boundaryField()[patchI];
fvPatchScalarField& fld = cellDistance.boundaryField()[patchI]; fvPatchScalarField& fld = cellDistance.boundaryField()[patchI];
@ -141,6 +177,7 @@ void Foam::sampledCuttingPlane::createGeometry()
} }
} }
} }
}
// On processor patches the mesh.C() will already be the cell centre // On processor patches the mesh.C() will already be the cell centre

View File

@ -38,7 +38,5 @@ derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLe
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C
backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C
LIB = $(FOAM_LIBBIN)/libcompressibleRASModels LIB = $(FOAM_LIBBIN)/libcompressibleRASModels

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -104,7 +104,7 @@ autoCreateWallFunctionField
// rename file // rename file
Info<< " Backup original " << fieldName << " to " Info<< " Backup original " << fieldName << " to "
<< fieldName << ".old" << endl; << fieldName << ".old" << endl;
mv(ioObj.objectPath(), ioObj.objectPath() + ".old"); mvBak(ioObj.objectPath(), "old");
PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size()); PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size());

View File

@ -42,6 +42,6 @@ derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFv
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
LIB = $(FOAM_LIBBIN)/libincompressibleRASModels LIB = $(FOAM_LIBBIN)/libincompressibleRASModels

View File

@ -104,7 +104,7 @@ autoCreateWallFunctionField
// rename file // rename file
Info<< " Backup original " << fieldName << " to " Info<< " Backup original " << fieldName << " to "
<< fieldName << ".old" << endl; << fieldName << ".old" << endl;
mv(ioObj.objectPath(), ioObj.objectPath() + ".old"); mvBak(ioObj.objectPath(), "old");
PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size()); PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size());

View File

@ -29,7 +29,9 @@
# Generic Makefile used by wmake # Generic Makefile used by wmake
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Set shell the Makefile uses to the Bourne shell
#------------------------------------------------------------------------------
# The Makefile use a POSIX shell
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
SHELL = /bin/sh SHELL = /bin/sh

View File

@ -34,6 +34,6 @@
# run from this directory only # run from this directory only
cd ${0%/*} || exit 1 cd ${0%/*} || exit 1
( cd src && make ) ( cd src && make $@ )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@ include $(GENERAL_RULES)/sourceToDep
include $(GENERAL_RULES)/flex include $(GENERAL_RULES)/flex
include $(GENERAL_RULES)/flex++ include $(GENERAL_RULES)/flex++
#include $(GENERAL_RULES)/byacc ## include $(GENERAL_RULES)/byacc
#include $(GENERAL_RULES)/btyacc++ ## include $(GENERAL_RULES)/btyacc++
include $(GENERAL_RULES)/bison include $(GENERAL_RULES)/bison
include $(GENERAL_RULES)/moc include $(GENERAL_RULES)/moc

View File

@ -43,8 +43,23 @@ SHELL = /bin/sh
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .o .SUFFIXES: .o
#------------------------------------------------------------------------------
# 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) BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
include $(RULES)/general
include $(RULES)/$(WM_LINK_LANGUAGE)
#------------------------------------------------------------------------------
# targets
#------------------------------------------------------------------------------
all: $(BIN)/dirToString $(BIN)/wmkdep all: $(BIN)/dirToString $(BIN)/wmkdep
clean: clean:
@ -59,16 +74,7 @@ $(BIN)/wmkdep: wmkdep.l
@mkdir -p $(BIN) @mkdir -p $(BIN)
flex wmkdep.l flex wmkdep.l
$(cc) $(cFLAGS) lex.yy.c -o $(BIN)/wmkdep $(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)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -27,38 +27,68 @@
# wmakeLnIncludeAll # wmakeLnIncludeAll
# #
# Description # Description
# Find directories containing a Make/ directory and execute # Find directories containing an lnInclude/ directory and execute
# 'wmakeLnInclude -f' for each one # 'wmakeLnInclude -f' for each one
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# default is pwd usage() {
if [ "$#" -eq 0 ] while [ "$#" -ge 1 ]; do echo "$1"; shift; done
then cat<<USAGE
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
exit 1
fi
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
}
#------------------------------------------------------------------------------
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 for checkDir
do do
if [ -d $checkDir ] if [ -d $checkDir ]
then then
echo "searching: $checkDir for 'Make' directories" echo "searching: $checkDir for '$findName' directories"
echo "---------"
else else
echo "skipping non-dir: $checkDir" echo "skipping non-dir: $checkDir"
echo "----------------"
continue continue
fi fi
find $checkDir -depth -type d -name Make -print | while read dir find $checkDir -depth -type d -name $findName -print | while read dir
do do
dir=${dir%/Make} # trim /Make directory from the end dir=${dir%/$findName} # trim findName from the end
if [ -d "$dir" ] if [ -d "$dir" ]
then then
wmakeLnInclude -f $dir wmakeLnInclude -f $dir