mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
4
Allwmake
4
Allwmake
@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR" ]
|
||||
then
|
||||
echo "Error: Current directory in not \$WM_PROJECT_DIR"
|
||||
echo " The environment variable are not consistent with the installation."
|
||||
echo "Error: Current directory is not \$WM_PROJECT_DIR"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR/applications" ]
|
||||
then
|
||||
echo "Error: Current directory in not \$WM_PROJECT_DIR/applications"
|
||||
echo " The environment variable are not consistent with the installation."
|
||||
echo "Error: Current directory is not \$WM_PROJECT_DIR/applications"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
(
|
||||
"kappa",
|
||||
wallFunctionDict,
|
||||
0.4187
|
||||
0.41
|
||||
)
|
||||
);
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
(
|
||||
"E",
|
||||
wallFunctionDict,
|
||||
9.0
|
||||
9.8
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -304,7 +304,7 @@
|
||||
(
|
||||
"kappa",
|
||||
wallFunctionDict,
|
||||
0.4187
|
||||
0.41
|
||||
)
|
||||
);
|
||||
|
||||
@ -314,7 +314,7 @@
|
||||
(
|
||||
"E",
|
||||
wallFunctionDict,
|
||||
9.0
|
||||
9.8
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
#include "Xstream.H"
|
||||
#include "GLstream.H"
|
||||
#include "PSstream.H"
|
||||
#include "shapes2D.H"
|
||||
#include "IStringStream.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
int main()
|
||||
{
|
||||
colour mauve("mauve", 1, 0, 1);
|
||||
|
||||
lineStyle solid("Solid", 2.0, 2.0, IStringStream("1(1.0)")());
|
||||
lineStyle broken("Broken", 2.0, 10.0, IStringStream("4(1 1 4 1)")());
|
||||
|
||||
|
||||
//Xstream wind
|
||||
GLstream wind
|
||||
//PSstream wind
|
||||
(
|
||||
"GsTest",
|
||||
primary("Black"),
|
||||
primary("White"),
|
||||
0.5, 0.5, 0.5, 0.5, 500, 500
|
||||
);
|
||||
|
||||
do
|
||||
{
|
||||
wind << rectangle2D(point2D(0.0, 0.0), point2D(100.0, 100.0));
|
||||
|
||||
wind.setColour(mauve);
|
||||
wind.setLineStyle(solid);
|
||||
|
||||
wind << line2D(point2D(0.0, 0.0), point2D(0.0, 200.0));
|
||||
wind << line2D(point2D(0.0, 200.0), point2D(200.0, 200.0));
|
||||
|
||||
//wind.setLineStyle(broken);
|
||||
|
||||
wind << line2D(point2D(200.0, 200.0), point2D(200.0, 0.0));
|
||||
wind << line2D(point2D(200.0, 0.0), point2D(0.0, 0.0));
|
||||
|
||||
wind << string2D(point2D(200.0, 0.0), "Hi there");
|
||||
|
||||
} while (wind.waitForEvent());
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
GsTest.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/GsTest
|
||||
@ -1,2 +0,0 @@
|
||||
EXE_INC = -I$(LIB_SRC)/Gstream/lnInclude
|
||||
EXE_LIBS = -lGstream -lGL $(XLIBS)
|
||||
@ -1,229 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "fvCFD.H"
|
||||
#include "IStringStream.H"
|
||||
|
||||
#include "myBoundBox.H"
|
||||
#include "myBoundBoxList.H"
|
||||
#include "octree.H"
|
||||
#include "octreeData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validOptions.insert("x1", "X1");
|
||||
argList::validOptions.insert("y1", "Y1");
|
||||
argList::validOptions.insert("z1", "Z1");
|
||||
|
||||
argList::validOptions.insert("x2", "X2");
|
||||
argList::validOptions.insert("y2", "Y2");
|
||||
argList::validOptions.insert("z2", "Z2");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
// Calculate BB of all cells
|
||||
|
||||
|
||||
myBoundBoxList allBb(mesh.nCells());
|
||||
|
||||
const pointField& allPoints = mesh.points();
|
||||
|
||||
vectorField bbMin(mesh.nCells());
|
||||
bbMin = vector(GREAT, GREAT, GREAT);
|
||||
vectorField bbMax(mesh.nCells());
|
||||
bbMax = vector(-GREAT, -GREAT, -GREAT);
|
||||
|
||||
const labelListList& pCells = mesh.pointCells();
|
||||
|
||||
forAll(pCells, pointi)
|
||||
{
|
||||
const point& vertCoord = allPoints[pointi];
|
||||
|
||||
const labelList& cells = pCells[pointi];
|
||||
|
||||
forAll(cells, celli)
|
||||
{
|
||||
label cellNum = cells[celli];
|
||||
|
||||
bbMin[cellNum].x() = min(bbMin[cellNum].x(), vertCoord.x());
|
||||
bbMin[cellNum].y() = min(bbMin[cellNum].y(), vertCoord.y());
|
||||
bbMin[cellNum].z() = min(bbMin[cellNum].z(), vertCoord.z());
|
||||
|
||||
bbMax[cellNum].x() = max(bbMax[cellNum].x(), vertCoord.x());
|
||||
bbMax[cellNum].y() = max(bbMax[cellNum].y(), vertCoord.y());
|
||||
bbMax[cellNum].z() = max(bbMax[cellNum].z(), vertCoord.z());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
forAll(allBb, celli)
|
||||
{
|
||||
allBb[celli] = myBoundBox(bbMin[celli], bbMax[celli]);
|
||||
}
|
||||
|
||||
|
||||
myBoundBox meshBb(allPoints);
|
||||
|
||||
scalar typDim = meshBb.minDim()/111;
|
||||
|
||||
myBoundBox shiftedBb
|
||||
(
|
||||
meshBb.min(),
|
||||
point
|
||||
(
|
||||
meshBb.max().x() + typDim,
|
||||
meshBb.max().y() + typDim,
|
||||
meshBb.max().z() + typDim
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Mesh" << endl;
|
||||
Info<< " bounding box :" << shiftedBb << endl;
|
||||
Info<< " typical dimension:" << shiftedBb.typDim() << endl;
|
||||
|
||||
|
||||
/*
|
||||
* Now we have allBb and shiftedBb
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Construct table of subset of cells
|
||||
|
||||
labelList cellIndices(10);
|
||||
|
||||
cellIndices[0] = 1433;
|
||||
cellIndices[1] = 1434;
|
||||
cellIndices[2] = 1435;
|
||||
cellIndices[3] = 1436;
|
||||
cellIndices[4] = 1437;
|
||||
cellIndices[5] = 1438;
|
||||
cellIndices[6] = 1439;
|
||||
cellIndices[7] = 1440;
|
||||
cellIndices[8] = 1441;
|
||||
cellIndices[9] = 1442;
|
||||
|
||||
// Get the corresponding bounding boxes
|
||||
|
||||
forAll(cellIndices, i)
|
||||
{
|
||||
allBb[i] = allBb[cellIndices[i]];
|
||||
}
|
||||
allBb.setSize(cellIndices.size());
|
||||
|
||||
|
||||
|
||||
// Wrap indices and mesh information into helper object
|
||||
octreeData shapes(mesh, cellIndices);
|
||||
|
||||
octree oc
|
||||
(
|
||||
shiftedBb, // overall bounding box
|
||||
shapes, // all information needed to do checks on cells
|
||||
allBb, // bounding boxes of cells
|
||||
10.0 // maximum ratio of cubes v.s. cells
|
||||
);
|
||||
|
||||
// scalar x1(readScalar(IStringStream(args.options()["x1"])()));
|
||||
// scalar y1(readScalar(IStringStream(args.options()["y1"])()));
|
||||
// scalar z1(readScalar(IStringStream(args.options()["z1"])()));
|
||||
|
||||
// scalar x2(readScalar(IStringStream(args.options()["x2"])()));
|
||||
// scalar y2(readScalar(IStringStream(args.options()["y2"])()));
|
||||
// scalar z2(readScalar(IStringStream(args.options()["z2"])()));
|
||||
|
||||
|
||||
|
||||
label nFound = 0;
|
||||
|
||||
scalar x = -5.0;
|
||||
for(int i = 0; i < 100; i++)
|
||||
{
|
||||
scalar y = -7.0;
|
||||
for(int j = 0; j < 10; j++)
|
||||
{
|
||||
scalar z = -12.0;
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
point sample(x, y, z);
|
||||
|
||||
label index = oc.find(sample);
|
||||
|
||||
// Convert index into shapes back into cellindex.
|
||||
label cell;
|
||||
if (index != -1)
|
||||
{
|
||||
cell = cellIndices[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
cell = -1;
|
||||
}
|
||||
Info<< "Point:" << sample
|
||||
<< " is in cell " << cell << "(octree) "
|
||||
<< mesh.findCell(sample) << "(linear)"
|
||||
<< endl;
|
||||
|
||||
z += 1.2;
|
||||
}
|
||||
y += 0.9;
|
||||
}
|
||||
x += 0.1;
|
||||
}
|
||||
|
||||
|
||||
Info<< "nFound=" << nFound << endl;
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
Info<< "Statistics:" << endl
|
||||
<< " nCells :" << allBb.size() << endl
|
||||
<< " nNodes :" << oc.nNodes() << endl
|
||||
<< " nLeaves :" << oc.nLeaves() << endl
|
||||
<< " nEntries :" << oc.nEntries() << endl
|
||||
<< " Cells per leaf :"
|
||||
<< oc.nEntries()/oc.nLeaves()
|
||||
<< endl
|
||||
<< " Every cell in :"
|
||||
<< oc.nEntries()/allBb.size() << " cubes"
|
||||
<< endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/fvSolutionCombine/Make/files
Normal file
3
applications/test/fvSolutionCombine/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
fvSolutionCombine.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/fvSolutionCombine
|
||||
5
applications/test/fvSolutionCombine/Make/options
Normal file
5
applications/test/fvSolutionCombine/Make/options
Normal file
@ -0,0 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
229
applications/test/fvSolutionCombine/fvSolutionCombine.C
Normal file
229
applications/test/fvSolutionCombine/fvSolutionCombine.C
Normal file
@ -0,0 +1,229 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Application
|
||||
fvSolutionCombine
|
||||
|
||||
Description
|
||||
Simple utility for combining fvSolution solution entries.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "wordRe.H"
|
||||
#include "OSspecific.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// check for identical dictionary content, regardless of the order
|
||||
bool checkDictionaryContent(const dictionary& dict1, const dictionary& dict2)
|
||||
{
|
||||
// trivial cases first
|
||||
if (&dict1 == &dict2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (dict1.size() != dict2.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
forAllConstIter(dictionary, dict1, iter1)
|
||||
{
|
||||
const entry* entryPtr = dict2.lookupEntryPtr
|
||||
(
|
||||
iter1().keyword(),
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
if (!entryPtr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const entry& entry1 = iter1();
|
||||
const entry& entry2 = *entryPtr;
|
||||
|
||||
bool ok = false;
|
||||
if (entry1.isDict())
|
||||
{
|
||||
if (entry2.isDict())
|
||||
{
|
||||
ok = checkDictionaryContent(entry1.dict(), entry2.dict());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = (entry1 == entry2);
|
||||
}
|
||||
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::validOptions.insert("rewrite", "");
|
||||
argList::validOptions.insert("show", "");
|
||||
argList args(argc, argv);
|
||||
|
||||
Time runTime(args.rootPath(), args.caseName());
|
||||
|
||||
const word dictName("fvSolution");
|
||||
|
||||
bool optRewrite = args.optionFound("rewrite");
|
||||
bool optShow = args.optionFound("show");
|
||||
|
||||
IOdictionary solutionDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dictName,
|
||||
"system",
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
if (!solutionDict.found("solvers"))
|
||||
{
|
||||
Info<<"no solvers entry found in : " << dictName << endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (optRewrite && solutionDict.instance() != "system")
|
||||
{
|
||||
Info<<"instance is not 'system' "
|
||||
"- disabling rewrite for this file" << nl;
|
||||
optRewrite = false;
|
||||
}
|
||||
|
||||
dictionary& solverDict = solutionDict.subDict("solvers");
|
||||
|
||||
wordList names = solverDict.toc();
|
||||
wordList oldNames = names;
|
||||
|
||||
bool changed = false;
|
||||
for (label orig = 0; orig < names.size()-1; ++orig)
|
||||
{
|
||||
// skip patterns or entries that have already been done
|
||||
if (names[orig].empty() || wordRe::isPattern(names[orig]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const dictionary& dict1 = solverDict.subDict(names[orig]);
|
||||
|
||||
for (label check = orig+1; check < names.size(); ++check)
|
||||
{
|
||||
// skip patterns or entries that have already been done
|
||||
if (names[check].empty() || wordRe::isPattern(names[check]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const dictionary& dict2 = solverDict.subDict(names[check]);
|
||||
|
||||
// check for identical content
|
||||
if (checkDictionaryContent(dict1, dict2))
|
||||
{
|
||||
names[orig] += "|" + names[check];
|
||||
names[check].clear();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
forAll(names, nameI)
|
||||
{
|
||||
if (names[nameI].empty())
|
||||
{
|
||||
solverDict.remove(oldNames[nameI]);
|
||||
Info<<" #remove " << oldNames[nameI];
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " " << oldNames[nameI];
|
||||
|
||||
if (names[nameI] != oldNames[nameI])
|
||||
{
|
||||
// make "(abc|def)" pattern
|
||||
keyType renamed( "(" + names[nameI] + ")", true);
|
||||
|
||||
solverDict.changeKeyword(oldNames[nameI], renamed);
|
||||
|
||||
Info<< " -> " << renamed;
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
if (optRewrite)
|
||||
{
|
||||
mvBak(solutionDict.objectPath(), "orig");
|
||||
Info<< "Backup to .orig" << nl
|
||||
<< "Writing " << solutionDict.objectPath() << nl << endl;
|
||||
|
||||
solutionDict.regIOobject::write();
|
||||
}
|
||||
else if (optShow)
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
solutionDict.dictionary::write(Info, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "\nFile not rewritten" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "no changes" << endl;
|
||||
}
|
||||
|
||||
Info<< "Done\n" << endl;
|
||||
|
||||
return changed ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -7,4 +7,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,4 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools
|
||||
|
||||
@ -6,4 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -8,4 +8,5 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -33,6 +33,7 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "IFstream.H"
|
||||
#include "IOobject.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -42,13 +43,19 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noBanner();
|
||||
argList::noParallel();
|
||||
argList::validArgs.clear();
|
||||
argList::validArgs.append("inputDict");
|
||||
argList args(argc, argv);
|
||||
|
||||
IFstream dictStream(args.additionalArgs()[0]);
|
||||
dictionary inputDict(dictStream);
|
||||
Info<< inputDict << endl;
|
||||
const string& dictName = args.additionalArgs()[0];
|
||||
|
||||
Info<<"//\n// expansion of dictionary " << dictName << "\n//\n";
|
||||
|
||||
dictionary(IFstream(dictName)()).write(Info, false);
|
||||
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -6,5 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian
|
||||
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,6 +6,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -4,5 +4,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
writeFluentFields
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "writeFluentFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
#define volTypeField volScalarField
|
||||
#define TypeField scalarField
|
||||
#define nTypeComponents 1
|
||||
|
||||
#include "writeFluentTypeField.C"
|
||||
|
||||
#undef nTypeComponents
|
||||
#undef TypeField
|
||||
#undef volTypeField
|
||||
|
||||
|
||||
#define volTypeField volVectorField
|
||||
#define TypeField vectorField
|
||||
#define nTypeComponents 3
|
||||
|
||||
#include "writeFluentTypeField.C"
|
||||
|
||||
#undef nTypeComponents
|
||||
#undef TypeField
|
||||
#undef volTypeField
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lfoamCalcFunctions
|
||||
|
||||
@ -12,6 +12,7 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
-lmeshTools \
|
||||
$(GLIBS)
|
||||
|
||||
@ -5,4 +5,5 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
$(GLIBS)
|
||||
|
||||
@ -7,5 +7,6 @@ EXE_INC = \
|
||||
LIB_LIBS = \
|
||||
-lOpenFOAM \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
$(PROJECT_LIBS)
|
||||
|
||||
@ -99,4 +99,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
$(FV_LIBS) \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian
|
||||
|
||||
@ -15,4 +15,5 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,4 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lsampling
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -7,6 +7,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-ltriSurface \
|
||||
|
||||
@ -8,6 +8,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lsurfMesh \
|
||||
|
||||
@ -2,4 +2,6 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels
|
||||
|
||||
@ -7,4 +7,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -7,4 +7,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,5 +6,6 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie
|
||||
|
||||
@ -18,4 +18,5 @@ EXE_LIBS = \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -4,4 +4,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -10,5 +10,6 @@ EXE_LIBS = \
|
||||
-lcompressibleRASModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lspecie \
|
||||
-lbasicThermophysicalModels
|
||||
|
||||
@ -7,4 +7,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -9,4 +9,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lincompressibleLESModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -14,5 +14,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools \
|
||||
-lsampling
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools
|
||||
|
||||
@ -41,6 +41,11 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// turbulence constants - file-scope
|
||||
static const scalar Cmu(0.09);
|
||||
static const scalar kappa(0.41);
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validOptions.insert("ybl", "scalar");
|
||||
@ -48,7 +53,6 @@ int main(int argc, char *argv[])
|
||||
argList::validOptions.insert("writenut", "");
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
@ -117,10 +121,6 @@ int main(int argc, char *argv[])
|
||||
phi = fvc::interpolate(U) & mesh.Sf();
|
||||
phi.write();
|
||||
|
||||
// Set turbulence constants
|
||||
dimensionedScalar kappa("kappa", dimless, 0.4187);
|
||||
dimensionedScalar Cmu("Cmu", dimless, 0.09);
|
||||
|
||||
// Read and modify turbulence fields if present
|
||||
|
||||
IOobject epsilonHeader
|
||||
@ -182,11 +182,11 @@ int main(int argc, char *argv[])
|
||||
Info<< "Reading field epsilon\n" << endl;
|
||||
volScalarField epsilon(epsilonHeader, mesh);
|
||||
|
||||
scalar ck0 = ::pow(Cmu.value(), 0.25)*kappa.value();
|
||||
scalar ck0 = ::pow(Cmu, 0.25)*kappa;
|
||||
k = sqr(nut/(ck0*min(y, ybl)));
|
||||
k.correctBoundaryConditions();
|
||||
|
||||
scalar ce0 = ::pow(Cmu.value(), 0.75)/kappa.value();
|
||||
scalar ce0 = ::pow(Cmu, 0.75)/kappa;
|
||||
epsilon = ce0*k*sqrt(k)/min(y, ybl);
|
||||
epsilon.correctBoundaryConditions();
|
||||
|
||||
|
||||
@ -9,5 +9,5 @@ EXE_LIBS = \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lfiniteVolume
|
||||
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -190,13 +190,12 @@ void replaceBoundaryType
|
||||
const_cast<word&>(IOdictionary::typeName) = oldTypeName;
|
||||
const_cast<word&>(dict.type()) = dict.headerClassName();
|
||||
|
||||
// Make a backup of the old field
|
||||
word backupName(dict.name() + ".old");
|
||||
Info<< " copying " << dict.name() << " to "
|
||||
<< backupName << endl;
|
||||
IOdictionary dictOld = dict;
|
||||
dictOld.rename(backupName);
|
||||
dictOld.regIOobject::write();
|
||||
// Make a backup of the old file
|
||||
if (mvBak(dict.objectPath(), "old"))
|
||||
{
|
||||
Info<< " Backup original file to "
|
||||
<< (dict.objectPath() + ".old") << endl;
|
||||
}
|
||||
|
||||
// Loop through boundary patches and update
|
||||
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = -lfiniteVolume
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
|
||||
@ -84,11 +84,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
mv
|
||||
(
|
||||
solutionDict.objectPath(),
|
||||
solutionDict.objectPath() + ".old"
|
||||
);
|
||||
if (mvBak(solutionDict.objectPath(), "old"))
|
||||
{
|
||||
Info<< "Backup to "
|
||||
<< (solutionDict.objectPath() + ".old") << nl;
|
||||
}
|
||||
|
||||
|
||||
solutionDict.writeObject
|
||||
(
|
||||
@ -97,8 +98,8 @@ int main(int argc, char *argv[])
|
||||
IOstream::UNCOMPRESSED
|
||||
);
|
||||
|
||||
Info<< "Backup to " << (solutionDict.objectPath() + ".old") << nl
|
||||
<< "Write to " << solutionDict.objectPath() << nl << endl;
|
||||
Info<< "Write to "
|
||||
<< solutionDict.objectPath() << nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,4 +8,5 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-llagrangian \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
PROGNAME=${0##*/}
|
||||
Script=${0##*/}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#- User settings
|
||||
@ -48,9 +48,9 @@ NDAYSLIMIT=7
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#- work file
|
||||
TMPFILE=/tmp/${PROGNAME}$$.tmp
|
||||
TMPFILE=/tmp/${Script}$$.tmp
|
||||
#- work dir. Needs to be accessible for all machines
|
||||
MACHDIR=$HOME/.OpenFOAM/${PROGNAME}
|
||||
MACHDIR=$HOME/.OpenFOAM/${Script}
|
||||
DEFSTATEFILE=$HOME/.OpenFOAM/foamCheckJobs.out
|
||||
|
||||
|
||||
@ -62,6 +62,29 @@ else
|
||||
fi
|
||||
|
||||
|
||||
usage() {
|
||||
cat<<USAGE
|
||||
Usage: $Script [stateFile]
|
||||
|
||||
This program checks all the locks in the FOAM_JOB_DIR directory to see if
|
||||
their processes are still running. Processes will not release their
|
||||
lock if they exit abnormally. This program will try to obtain process
|
||||
information on the machine the process ran on and release the lock
|
||||
if the program is no longer running.
|
||||
|
||||
Note: all machines have to be reachable using ssh.
|
||||
|
||||
The output from checking all running jobs is collected in an optional
|
||||
file.
|
||||
|
||||
FILES:
|
||||
\$FOAM_JOB_DIR/runningJobs locks for running processes
|
||||
/finishedJobs locks for finished processes
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Functions
|
||||
@ -83,7 +106,8 @@ getEntry() {
|
||||
# notEmpty directory
|
||||
# Returns 0 if directory contains files/directories
|
||||
notEmpty() {
|
||||
if [ "`ls $1`" ]; then
|
||||
if [ "`ls $1`" ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@ -96,7 +120,8 @@ notEmpty() {
|
||||
# ==> 13
|
||||
dayDiff() {
|
||||
date -d "$1" > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
#- option '-d' on date not supported. Give up.
|
||||
echo "0"
|
||||
else
|
||||
@ -119,12 +144,14 @@ dayDiff() {
|
||||
# Also handles 'slaves' entries in jobInfo:
|
||||
# slaves 1 ( penfold.23766 );
|
||||
getAllJobs() {
|
||||
if notEmpty $1; then
|
||||
if notEmpty $1
|
||||
then
|
||||
jobs=$1/*
|
||||
for f in $jobs
|
||||
do
|
||||
line=`grep '^[ ]*slaves' $f 2>/dev/null`
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
slaveJobs=`echo "$line" | sed -e 's/.*(\(.*\)).*/\1/'`
|
||||
jobs="$jobs $slaveJobs"
|
||||
fi
|
||||
@ -138,34 +165,12 @@ getAllJobs() {
|
||||
# releaseLock jobId lockFile
|
||||
# Releases lock on jobId
|
||||
releaseLock () {
|
||||
if [ -f $2 ]; then
|
||||
if [ -f $2 ]
|
||||
then
|
||||
#- move lock to finishedJobs
|
||||
mv $2 $FOAM_JOB_DIR/finishedJobs/
|
||||
fi
|
||||
$ECHO "Lock on job $1 released."
|
||||
}
|
||||
|
||||
|
||||
printUsage() {
|
||||
cat << LABEL
|
||||
Usage: $PROGNAME [stateFile]
|
||||
|
||||
This program checks all the locks in the license directory to see if
|
||||
their processes are still running. Processes will not release their
|
||||
lock if they exit abnormally. This program will try to obtain process
|
||||
information on the machine the process ran on and release the lock
|
||||
if the program is no longer running.
|
||||
|
||||
Requirements: the environment variable FOAM_JOB_DIR needs to point to the
|
||||
license directory and all machines have to be reachable using ssh.
|
||||
|
||||
The output from checking all running jobs is collected in an optional
|
||||
file.
|
||||
|
||||
FILES:
|
||||
\$FOAM_JOB_DIR/runningJobs locks for running processes
|
||||
/finishedJobs ,, finished processes
|
||||
LABEL
|
||||
echo "Lock on job $1 released."
|
||||
}
|
||||
|
||||
|
||||
@ -175,39 +180,50 @@ LABEL
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#- Check a few things
|
||||
|
||||
if [ ! "$FOAM_JOB_DIR" ]; then
|
||||
$ECHO "$PROGNAME : FOAM_JOB_DIR environment variable not set."
|
||||
$ECHO "This should point to your central license directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$FOAM_JOB_DIR" ]; then
|
||||
$ECHO "$PROGNAME : The license directory accoring to FOAM_JOB_DIR is not valid."
|
||||
$ECHO "FOAM_JOB_DIR: $FOAM_JOB_DIR"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$FOAM_JOB_DIR/runningJobs" -o ! -d "$FOAM_JOB_DIR/finishedJobs" ]; then
|
||||
$ECHO "$PROGNAME : The license directory according to FOAM_JOB_DIR is not valid."
|
||||
$ECHO "FOAM_JOB_DIR: $FOAM_JOB_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
STATEFILE=$1
|
||||
elif [ $# -eq 0 ]; then
|
||||
if [ $# -eq 1 ]
|
||||
then
|
||||
if [ "$1" = "-h" -o "$1" = "-help" ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
STATEFILE="$1"
|
||||
elif [ $# -eq 0 ]
|
||||
then
|
||||
STATEFILE=${STATEFILE:-$DEFSTATEFILE}
|
||||
else
|
||||
printUsage
|
||||
usage
|
||||
fi
|
||||
|
||||
|
||||
#- Check a few things
|
||||
|
||||
if [ ! "$FOAM_JOB_DIR" ]
|
||||
then
|
||||
echo "$Script : FOAM_JOB_DIR environment variable not set."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$FOAM_JOB_DIR" ]
|
||||
then
|
||||
echo "$Script : directory does not exist."
|
||||
echo " FOAM_JOB_DIR=$FOAM_JOB_DIR"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$FOAM_JOB_DIR/runningJobs" -o ! -d "$FOAM_JOB_DIR/finishedJobs" ]
|
||||
then
|
||||
echo "$Script : invalid directory."
|
||||
echo " FOAM_JOB_DIR=$FOAM_JOB_DIR"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#- obtain rsh method
|
||||
RSH='ssh'
|
||||
echo "Using remote shell type : $RSH"
|
||||
|
||||
echo ""
|
||||
echo "Collecting information on jobs in"
|
||||
echo " $FOAM_JOB_DIR"
|
||||
@ -226,13 +242,14 @@ do
|
||||
pid=`echo $machinePid | sed -e 's/.*\.\([0-9][0-9]*\)$/\1/'`
|
||||
|
||||
fgrep "$machine" $TMPFILE >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
$ECHO "$machine" >> $TMPFILE
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "$machine" >> $TMPFILE
|
||||
fi
|
||||
done
|
||||
$ECHO "Found machines:"
|
||||
echo "Found machines:"
|
||||
cat $TMPFILE
|
||||
$ECHO ""
|
||||
echo ""
|
||||
|
||||
|
||||
|
||||
@ -243,31 +260,34 @@ cnt=1
|
||||
while true
|
||||
do
|
||||
machine=`sed -n -e "${cnt}p" $TMPFILE`
|
||||
if [ ! "$machine" ]; then
|
||||
if [ ! "$machine" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
machFile=$MACHDIR/$machine
|
||||
rm -f $machFile
|
||||
$ECHO "Contacting $machine to collect process information:"
|
||||
if [ $machine = `hostname` ]; then
|
||||
$ECHO " foamProcessInfo $machFile"
|
||||
echo "Contacting $machine to collect process information:"
|
||||
if [ $machine = `hostname` ]
|
||||
then
|
||||
echo " foamProcessInfo $machFile"
|
||||
foamProcessInfo $machFile >/dev/null 2>&1
|
||||
else
|
||||
$ECHO " $RSH $machine foamProcessInfo $machFile"
|
||||
echo " $RSH $machine foamProcessInfo $machFile"
|
||||
$RSH $machine foamProcessInfo $machFile >/dev/null 2>&1
|
||||
fi
|
||||
if [ $? -ne 0 -o ! -s $machFile ]; then
|
||||
$ECHO "** Failed collecting process information on $machine."
|
||||
$ECHO "Check $machFile and run foamProcessInfo by hand"
|
||||
if [ $? -ne 0 -o ! -s $machFile ]
|
||||
then
|
||||
echo "** Failed collecting process information on $machine."
|
||||
echo "Check $machFile and run foamProcessInfo by hand"
|
||||
rm -f $machFile
|
||||
else
|
||||
$ECHO "Succesfully collected information in $machFile ..."
|
||||
echo "Succesfully collected information in $machFile ..."
|
||||
fi
|
||||
|
||||
cnt=`expr $cnt + 1`
|
||||
done
|
||||
$ECHO ""
|
||||
echo ""
|
||||
|
||||
|
||||
#- Construct state for runningJobs; move non runnning jobs to finishedJobs
|
||||
@ -281,27 +301,32 @@ do
|
||||
pid=`echo $machinePid | sed -e 's/.*\.\([0-9][0-9]*\)$/\1/'`
|
||||
|
||||
machFile=$MACHDIR/$machine
|
||||
if [ -r $machFile ]; then
|
||||
if [ -r $machFile ]
|
||||
then
|
||||
entry=`grep "^$pid " $machFile 2>/dev/null`
|
||||
if [ $? -ne 0 -o ! "$entry" ]; then
|
||||
if [ "$releaseAll" ]; then
|
||||
if [ $? -ne 0 -o ! "$entry" ]
|
||||
then
|
||||
if [ "$releaseAll" ]
|
||||
then
|
||||
releaseLock $machinePid $f
|
||||
else
|
||||
$ECHO "Job $machinePid seems to be no longer running. Release lock? (y/a)\c"
|
||||
echo "Job $machinePid seems to be no longer running. Release lock? (y/a)\c"
|
||||
read answ
|
||||
if [ "${answ:-y}" = 'y' ]; then
|
||||
if [ "${answ:-y}" = 'y' ]
|
||||
then
|
||||
releaseLock $machinePid $f
|
||||
elif [ "${answ:-y}" = 'a' ]; then
|
||||
elif [ "${answ:-y}" = 'a' ]
|
||||
then
|
||||
releaseAll='yes'
|
||||
releaseLock $machinePid $f
|
||||
else
|
||||
state='OTHR'
|
||||
$ECHO "$machinePid $state" >> $STATEFILE
|
||||
echo "$machinePid $state" >> $STATEFILE
|
||||
fi
|
||||
fi
|
||||
else
|
||||
state=`echo "$entry" | awk '{print $2}'`
|
||||
$ECHO "$machinePid $state" >> $STATEFILE
|
||||
echo "$machinePid $state" >> $STATEFILE
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@ -314,29 +339,33 @@ OLDFILES=`find $FOAM_JOB_DIR/finishedJobs -mtime +$NDAYSLIMIT -print`
|
||||
|
||||
#- Construct state for finishedJobs and check on date of files.
|
||||
|
||||
if notEmpty $FOAM_JOB_DIR/finishedJobs; then
|
||||
if notEmpty $FOAM_JOB_DIR/finishedJobs
|
||||
then
|
||||
dateNow=`date '+%b %d %Y'`
|
||||
for f in $FOAM_JOB_DIR/finishedJobs/*
|
||||
do
|
||||
sz=`ls -s $f | awk '{print $1}'`
|
||||
if [ "$sz" -gt 0 ]; then
|
||||
if [ "$sz" -gt 0 ]
|
||||
then
|
||||
machinePid=`basename $f`
|
||||
machine=`echo $machinePid | sed -e 's/\.[0-9][0-9]*$//'`
|
||||
pid=`echo $machinePid | sed -e 's/.*\.\([0-9][0-9]*\)$/\1/'`
|
||||
|
||||
end=`getEntry $f endDate`
|
||||
if [ ! "$end" ]; then
|
||||
if [ ! "$end" ]
|
||||
then
|
||||
state='ABRT'
|
||||
else
|
||||
nDaysOld=`dayDiff "$dateNow" "$end"`
|
||||
if [ "$nDaysOld" -gt $NDAYSLIMIT ]; then
|
||||
if [ "$nDaysOld" -gt $NDAYSLIMIT ]
|
||||
then
|
||||
OLDFILES="$OLDFILES $f"
|
||||
fi
|
||||
|
||||
state='FINI'
|
||||
fi
|
||||
|
||||
$ECHO "$machinePid $state" >> $STATEFILE
|
||||
echo "$machinePid $state" >> $STATEFILE
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -345,11 +374,13 @@ fi
|
||||
#- Remove old locks
|
||||
|
||||
nOldFiles=`echo "$OLDFILES" | wc -w`
|
||||
if [ "$nOldFiles" -gt 0 ]; then
|
||||
$ECHO "You seem to have $nOldFiles locks older than $NDAYSLIMIT days in finishedJobs/"
|
||||
if [ "$nOldFiles" -gt 0 ]
|
||||
then
|
||||
echo "You seem to have $nOldFiles locks older than $NDAYSLIMIT days in finishedJobs/"
|
||||
$ECHO "Do you want to remove these? (y)\c"
|
||||
read answ
|
||||
if [ "${answ:-y}" = 'y' ]; then
|
||||
if [ "${answ:-y}" = 'y' ]
|
||||
then
|
||||
rm -f $OLDFILES
|
||||
fi
|
||||
fi
|
||||
@ -358,9 +389,9 @@ fi
|
||||
rm -f $TMPFILE
|
||||
rm -r $MACHDIR
|
||||
|
||||
$ECHO ""
|
||||
$ECHO "Updated stateFile:"
|
||||
$ECHO " $STATEFILE"
|
||||
$ECHO ""
|
||||
echo ""
|
||||
echo "Updated stateFile:"
|
||||
echo " $STATEFILE"
|
||||
echo ""
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -32,35 +32,48 @@
|
||||
# Prints its argument (which should be a ':' separated path)
|
||||
# without all
|
||||
# - duplicate elements
|
||||
# - (if '-strip') non-accessible directories
|
||||
# - elements whose start matches a wildcard
|
||||
# - inaccessible directories (with the -strip option)
|
||||
#
|
||||
# Note:
|
||||
# - this routine will fail when directories have embedded spaces
|
||||
# - false matches possible if a wildcard contains '.' (sed regex)
|
||||
#------------------------------------------------------------------------------
|
||||
if [ "$#" -lt 1 -o "$1" = "-h" -o "$1" = "-help" ]
|
||||
then
|
||||
cat <<USAGE 1>&2
|
||||
Usage: ${0##*/} [-strip] path [wildcard] .. [wildcard]
|
||||
usage() {
|
||||
cat <<USAGE 1>&2
|
||||
usage: ${0##*/} [-strip] path [wildcard] .. [wildcard]
|
||||
|
||||
Prints its argument (which should be a ':' separated list) cleansed from
|
||||
- duplicate elements
|
||||
- elements whose start matches one of the wildcard(s)
|
||||
- inaccessible directories (with the -strip option)
|
||||
|
||||
Prints its argument (which should be a ':' separated list) cleansed from
|
||||
- duplicate elements
|
||||
- elements whose start matches one of the wildcard(s)
|
||||
- (if '-strip') non-accessible directories
|
||||
USAGE
|
||||
exit 1
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
strip=''
|
||||
if [ "$1" = "-strip" ]
|
||||
then
|
||||
strip=true
|
||||
shift
|
||||
fi
|
||||
unset strip
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-strip)
|
||||
strip=true
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
[ "$#" -ge 1 ] || usage
|
||||
|
||||
dirList="$1"
|
||||
shift
|
||||
|
||||
@ -79,7 +92,7 @@ do
|
||||
wildcard=$1
|
||||
shift
|
||||
##DEBUG echo "remove>$wildcard<" 1>&2
|
||||
dirList=`echo "$dirList" | sed -e "s@${wildcard}[^:]*:@@g"`
|
||||
dirList=$(echo "$dirList" | sed -e "s@${wildcard}[^:]*:@@g")
|
||||
done
|
||||
|
||||
# split on ':' (and on space as well to avoid any surprises)
|
||||
@ -97,13 +110,13 @@ do
|
||||
if [ -e "$dir" ]
|
||||
then
|
||||
#- no duplicate dirs
|
||||
duplicate=`echo " $dirList " | sed -ne "s@ $dir @DUP@p"`
|
||||
duplicate=$(echo " $dirList " | sed -ne "s@ $dir @DUP@p")
|
||||
|
||||
if [ ! "$duplicate" ]
|
||||
then
|
||||
dirList="$dirList $dir"
|
||||
fi
|
||||
elif [ "$strip" != "true" ]
|
||||
elif [ "$strip" != true ]
|
||||
then
|
||||
# Print non-existing directories if not in 'strip' mode.
|
||||
dirList="$dirList $dir"
|
||||
|
||||
@ -29,6 +29,10 @@
|
||||
# Description
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
if (! -f "$1" ) then
|
||||
echo "No file: '$1'"
|
||||
exit 1
|
||||
endif
|
||||
|
||||
set tmpTime = newTime$$.dat
|
||||
cat $1 | grep "ExecutionTime = " | awk 'BEGIN { NENTRIES = 0 ; TPREV = 0.0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $3 - TPREV); TPREV = $3}' - > $tmpTime
|
||||
|
||||
@ -29,6 +29,10 @@
|
||||
# Description
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
if (! -f "$1" ) then
|
||||
echo "No file: '$1'"
|
||||
exit 1
|
||||
endif
|
||||
|
||||
set tmpK = newK$$.dat
|
||||
cat $1 | grep "Solving for k" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $8)}' - > $tmpK
|
||||
|
||||
@ -29,6 +29,10 @@
|
||||
# Description
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
if (! -f "$1" ) then
|
||||
echo "No file: '$1'"
|
||||
exit 1
|
||||
endif
|
||||
|
||||
set tmpU = newU$$.dat
|
||||
cat $1 | grep "Solving for Ux" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpU
|
||||
|
||||
153
bin/foamLog
153
bin/foamLog
@ -35,17 +35,11 @@
|
||||
|
||||
PROGDIR=`dirname $0`
|
||||
PROGNAME=`basename $0`
|
||||
|
||||
if [ -r $HOME/.${PROGNAME}.db ]; then
|
||||
DBFILE=$HOME/.${PROGNAME}.db
|
||||
else
|
||||
DBFILE=$PROGDIR/$PROGNAME.db
|
||||
fi
|
||||
|
||||
DBFILE=${PROGNAME}.db
|
||||
|
||||
printUsage() {
|
||||
cat <<LABUSAGE
|
||||
$PROGNAME - extracts xy files from Foam logs.
|
||||
cat <<USAGE
|
||||
$PROGNAME - extracts xy files from OpenFOAM logs.
|
||||
|
||||
Usage: $PROGNAME [-n][-s] <log>
|
||||
extracts xy files from log
|
||||
@ -54,39 +48,46 @@ Usage: $PROGNAME [-n][-s] <log>
|
||||
$PROGNAME -h
|
||||
for a help message
|
||||
|
||||
LABUSAGE
|
||||
USAGE
|
||||
}
|
||||
|
||||
|
||||
printHelp() {
|
||||
printUsage
|
||||
cat <<LABHELP
|
||||
The default is to extract for all the 'Solved for' variables the
|
||||
initial residual, the final residual and the number of iterations. On
|
||||
top of this a (user editable) database of standard non-solved for
|
||||
variables is used to extract data like Courant number, execution time.
|
||||
The default is to extract for all the 'Solved for' variables the initial
|
||||
residual, the final residual and the number of iterations. Additionally, a
|
||||
(user editable) database is used to extract data for standard non-solved for
|
||||
variables like Courant number, execution time.
|
||||
|
||||
$PROGNAME -l shows all the possible variables but does not extract them.
|
||||
$PROGNAME -l lists all the possible variables without extract them.
|
||||
|
||||
The program will generate and run an awk script which writes a set of
|
||||
files, logs/<var>_<subIter>, for every <var> specified, for every
|
||||
occurrence inside a time step.
|
||||
The program will generate and run an awk script which writes a set of files,
|
||||
logs/<var>_<subIter>, for every <var> specified, for every occurrence inside
|
||||
a time step.
|
||||
|
||||
For variables that are 'Solved for' the initial residual name will
|
||||
be <var>, the final residual will get name <var>FinalRes,
|
||||
For variables that are 'Solved for', the initial residual name will be
|
||||
<var>, the final residual receive the name <var>FinalRes,
|
||||
|
||||
The files are a simple xy format with the first column Time (default)
|
||||
and the second the extracted values. Option -n creates single column
|
||||
files with the extracted data only.
|
||||
|
||||
|
||||
The query database is a simple text format with three entries per line,
|
||||
separated with '/'. Column 1 is the name of the variable (cannot contain
|
||||
spaces), column 2 is the extended regular expression (egrep) to select
|
||||
the line and column 3 is the string (fgrep) to select the column inside the
|
||||
line. The value taken will be the first (non-space)word after this
|
||||
column. The database will either be \$HOME/.${PROGNAME}.db or if not
|
||||
found $PROGDIR/${PROGNAME}.db.
|
||||
The query database is a simple text format with three entries per line,
|
||||
separated with '/' :
|
||||
Column 1 is the name of the variable (cannot contain spaces).
|
||||
Column 2 is the extended regular expression (egrep) to select the line.
|
||||
Column 3 is the string (fgrep) to select the column inside the line.
|
||||
The value taken will be the first (non-space)word after this column.
|
||||
The database ($PROGNAME.db) will taken from these locations:
|
||||
|
||||
$HOME/.OpenFOAM/$WM_PROJECT_VERSION
|
||||
$HOME/.OpenFOAM
|
||||
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION
|
||||
$WM_PROJECT_INST_DIR/site
|
||||
$WM_PROJECT_DIR/etc
|
||||
$PROGDIR/tools
|
||||
|
||||
Option -s suppresses the default information and only prints the extracted
|
||||
variables.
|
||||
@ -95,9 +96,28 @@ LABHELP
|
||||
}
|
||||
|
||||
|
||||
# The various places to be searched:
|
||||
for i in \
|
||||
$HOME/.OpenFOAM/$WM_PROJECT_VERSION \
|
||||
$HOME/.OpenFOAM \
|
||||
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION \
|
||||
$WM_PROJECT_INST_DIR/site \
|
||||
$WM_PROJECT_DIR/etc \
|
||||
$PROGDIR/tools \
|
||||
;
|
||||
do
|
||||
if [ -r $i/$DBFILE ]
|
||||
then
|
||||
DBFILE="$i/$DBFILE"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
myEcho() {
|
||||
if [ "$VERBOSE" ]; then
|
||||
if [ "$VERBOSE" ]
|
||||
then
|
||||
echo "$*"
|
||||
fi
|
||||
}
|
||||
@ -112,7 +132,8 @@ getSolvedVars() {
|
||||
# getQueries dbFile queryName
|
||||
# Gets regular expressions for a certain queryName from the database
|
||||
getQueries() {
|
||||
if [ ! -f "$1" ]; then
|
||||
if [ ! -f "$1" ]
|
||||
then
|
||||
echo "Cannot find dbFile $1"
|
||||
exit 1
|
||||
fi
|
||||
@ -123,7 +144,8 @@ getQueries() {
|
||||
NUMQ=`grep -v '^#' $1 | awk -F '/' "/$queryName/ {if (\"$queryName\" "'!= $1) next; print $3}'`
|
||||
|
||||
#echo "For $queryName found line selection /$LINEQ/ , column selection /$NUMQ/" 1>&2
|
||||
#if [ ! "$LINEQ" -o ! "$NUMQ" ]; then
|
||||
#if [ ! "$LINEQ" -o ! "$NUMQ" ]
|
||||
#then
|
||||
# echo "Did not find query for $2 in database $1" 1>&2
|
||||
#fi
|
||||
}
|
||||
@ -164,9 +186,11 @@ getAllQueries() {
|
||||
do
|
||||
getQueries $1 "$var"
|
||||
line=`egrep "$LINEQ" $2`
|
||||
if [ "$line" ]; then
|
||||
if [ "$line" ]
|
||||
then
|
||||
column=`echo "$line" | fgrep "$NUMQ"`
|
||||
if [ "$column" ]; then
|
||||
if [ "$column" ]
|
||||
then
|
||||
queries="$queries $var"
|
||||
fi
|
||||
fi
|
||||
@ -190,18 +214,23 @@ LISTONLY=''
|
||||
while getopts nslh flags
|
||||
do
|
||||
case $flags in
|
||||
n) TIMENAME=""
|
||||
;;
|
||||
h) printHelp
|
||||
exit 0
|
||||
;;
|
||||
s) VERBOSE=""
|
||||
;;
|
||||
l) LISTONLY='yes'
|
||||
;;
|
||||
\?) printUsage
|
||||
exit 1
|
||||
;;
|
||||
n)
|
||||
TIMENAME=""
|
||||
;;
|
||||
h)
|
||||
printHelp
|
||||
exit 0
|
||||
;;
|
||||
s)
|
||||
VERBOSE=""
|
||||
;;
|
||||
l)
|
||||
LISTONLY='yes'
|
||||
;;
|
||||
\?)
|
||||
printUsage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@ -209,18 +238,22 @@ done
|
||||
# Shift options
|
||||
shift `expr $OPTIND - 1`
|
||||
|
||||
if [ ! -f $DBFILE ]; then
|
||||
if [ ! -f $DBFILE ]
|
||||
then
|
||||
echo "$PROGNAME: Cannot read database $DBFILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$LISTONLY" ]; then
|
||||
if [ $# -ne 1 ]; then
|
||||
if [ "$LISTONLY" ]
|
||||
then
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
LOG=$1;
|
||||
if [ ! -r $LOG ]; then
|
||||
if [ ! -r $LOG ]
|
||||
then
|
||||
echo "$PROGNAME: Cannot read log $LOG"
|
||||
exit 1
|
||||
fi
|
||||
@ -228,14 +261,16 @@ if [ "$LISTONLY" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CASEDIR=.
|
||||
LOG=$1
|
||||
if [ ! -r $LOG ]; then
|
||||
if [ ! -r $LOG ]
|
||||
then
|
||||
echo "$PROGNAME: Cannot read log $LOG"
|
||||
exit 1
|
||||
fi
|
||||
@ -243,17 +278,20 @@ fi
|
||||
QUERYNAMES=`getAllQueries $DBFILE $LOG`
|
||||
|
||||
|
||||
if [ ! "$CASEDIR" ]; then
|
||||
if [ ! "$CASEDIR" ]
|
||||
then
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$CASEDIR" ]; then
|
||||
if [ ! -d "$CASEDIR" ]
|
||||
then
|
||||
echo "$PROGNAME: Cannot read $CASEDIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$LOG" ]; then
|
||||
if [ ! -f "$LOG" ]
|
||||
then
|
||||
echo "$PROGNAME: Cannot read log file $LOG"
|
||||
exit 1
|
||||
fi
|
||||
@ -361,19 +399,19 @@ cat <<LABSOLVE >> $AWKFILE
|
||||
|
||||
varName=varNameVal[1]
|
||||
file=varName "_" subIter[varName]++
|
||||
file="$CASEDIR/logs/" file
|
||||
file="$CASEDIR/logs/" file
|
||||
extract(\$0, "Initial residual = ", val)
|
||||
print $TIMENAME "\t" val[1] > file
|
||||
|
||||
varName=varNameVal[1] "FinalRes"
|
||||
file=varName "_" subIter[varName]++
|
||||
file="$CASEDIR/logs/" file
|
||||
file="$CASEDIR/logs/" file
|
||||
extract(\$0, "Final residual = ", val)
|
||||
print $TIMENAME "\t" val[1] > file
|
||||
|
||||
varName=varNameVal[1] "Iters"
|
||||
file=varName "_" subIter[varName]++
|
||||
file="$CASEDIR/logs/" file
|
||||
file="$CASEDIR/logs/" file
|
||||
extract(\$0, "No Iterations ", val)
|
||||
print $TIMENAME "\t" val[1] > file
|
||||
}
|
||||
@ -384,7 +422,8 @@ LABSOLVE
|
||||
for queryName in $QUERYNAMES
|
||||
do
|
||||
getQueries $DBFILE $queryName
|
||||
if [ "$LINEQ" -a "$NUMQ" ]; then
|
||||
if [ "$LINEQ" -a "$NUMQ" ]
|
||||
then
|
||||
counter=${queryName}Cnt
|
||||
|
||||
echo "#-- Extraction of $queryName" >> $AWKFILE
|
||||
|
||||
15
bin/foamNew
15
bin/foamNew
@ -33,7 +33,6 @@
|
||||
usage() {
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} <type> {args}
|
||||
|
||||
* create a new standard OpenFOAM source or template file
|
||||
@ -44,22 +43,18 @@ USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ]
|
||||
then
|
||||
usage "wrong number of arguments, expected 2 (or more)"
|
||||
fi
|
||||
|
||||
# this implicitly covers a lone -help, but let other scripts handle the rest
|
||||
[ "$#" -gt 1 ] || usage
|
||||
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
source)
|
||||
shift
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/source/newSource $*
|
||||
$WM_PROJECT_DIR/bin/templates/source/foamNewSource $*
|
||||
;;
|
||||
template)
|
||||
shift
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/sourceTemplate/newSourceTemplate $*
|
||||
$WM_PROJECT_DIR/bin/templates/sourceTemplate/foamNewTemplate $*
|
||||
;;
|
||||
*)
|
||||
usage "unknown type"
|
||||
|
||||
1
bin/foamNewSource
Symbolic link
1
bin/foamNewSource
Symbolic link
@ -0,0 +1 @@
|
||||
templates/source/foamNewSource
|
||||
1
bin/foamNewTemplate
Symbolic link
1
bin/foamNewTemplate
Symbolic link
@ -0,0 +1 @@
|
||||
templates/sourceTemplate/foamNewTemplate
|
||||
@ -30,10 +30,8 @@
|
||||
# Uses finishedJobs/ and runningJobs/ and stateFile to print job info
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
|
||||
PROGNAME=`basename $0`
|
||||
TMPFILE=/tmp/${PROGNAME}$$.tmp
|
||||
TMPFILE2=/tmp/${PROGNAME}$$.tmp2
|
||||
JOBSTRING='%4s %8s %20s %10s %8s %4s %12s %12s %20s\n'
|
||||
DEFSTATEFILE=$HOME/.OpenFOAM/foamCheckJobs.out
|
||||
|
||||
@ -44,18 +42,19 @@ DEFSTATEFILE=$HOME/.OpenFOAM/foamCheckJobs.out
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
printUsage() {
|
||||
cat << LABEL
|
||||
Usage: $PROGNAME [stateFile]
|
||||
usage() {
|
||||
cat<<USAGE
|
||||
Usage: $Script [stateFile]
|
||||
|
||||
This program prints a table of all the running and finished jobs.
|
||||
This program prints a table of all running and finished jobs.
|
||||
|
||||
It is normally used in conjunction with foamCheckJobs which outputs
|
||||
a "stateFile" containing the actual process status of all jobs.
|
||||
|
||||
If stateFile is not supplied the default $DEFSTATEFILE
|
||||
is used.
|
||||
LABEL
|
||||
If stateFile is not supplied, the default is used:
|
||||
$DEFSTATEFILE
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +80,8 @@ getEntry() {
|
||||
# notEmpty directory
|
||||
# Returns 0 if directory contains files/directories
|
||||
notEmpty() {
|
||||
if [ "`ls $1`" ]; then
|
||||
if [ "`ls $1`" ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@ -104,37 +104,47 @@ leftStr() {
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [ ! "$FOAM_JOB_DIR" ]; then
|
||||
echo "$PROGNAME : FOAM_JOB_DIR environment variable not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$FOAM_JOB_DIR" ]; then
|
||||
echo "$PROGNAME : directory does not exist."
|
||||
echo " FOAM_JOB_DIR: $FOAM_JOB_DIR"
|
||||
fi
|
||||
if [ ! -d "$FOAM_JOB_DIR/runningJobs" -o ! -d "$FOAM_JOB_DIR/finishedJobs" ]; then
|
||||
echo "$PROGNAME : invalid directory."
|
||||
echo " FOAM_JOB_DIR: $FOAM_JOB_DIR"
|
||||
fi
|
||||
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
if [ "$1" = '-h' ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
if [ $# -eq 1 ]
|
||||
then
|
||||
if [ "$1" = "-h" -o "$1" = "-help" ]
|
||||
then
|
||||
usage
|
||||
else
|
||||
STATEFILE=$1
|
||||
STATEFILE="$1"
|
||||
fi
|
||||
elif [ $# -eq 0 ]; then
|
||||
elif [ $# -eq 0 ]
|
||||
then
|
||||
STATEFILE=${STATEFILE:-$DEFSTATEFILE}
|
||||
else
|
||||
printUsage
|
||||
usage
|
||||
fi
|
||||
|
||||
#- Check a few things
|
||||
|
||||
if [ ! "$FOAM_JOB_DIR" ]
|
||||
then
|
||||
echo "$Script : FOAM_JOB_DIR environment variable not set."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$FOAM_JOB_DIR" ]
|
||||
then
|
||||
echo "$Script : directory does not exist."
|
||||
echo " FOAM_JOB_DIR=$FOAM_JOB_DIR"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$FOAM_JOB_DIR/runningJobs" -o ! -d "$FOAM_JOB_DIR/finishedJobs" ]
|
||||
then
|
||||
echo "$Script : invalid directory."
|
||||
echo " FOAM_JOB_DIR=$FOAM_JOB_DIR"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ -f "$STATEFILE" ]; then
|
||||
if [ -f "$STATEFILE" ]
|
||||
then
|
||||
echo ""
|
||||
echo "Using process information from"
|
||||
echo " $STATEFILE"
|
||||
@ -160,7 +170,8 @@ printJob '----' '----' '----' '-------' '---' '----' '-----' '---' '----'
|
||||
|
||||
#-- print running
|
||||
echo "Running:"
|
||||
if notEmpty $FOAM_JOB_DIR/runningJobs; then
|
||||
if notEmpty $FOAM_JOB_DIR/runningJobs
|
||||
then
|
||||
for f in `ls -t $FOAM_JOB_DIR/runningJobs/*`
|
||||
do
|
||||
machinePid=`basename $f`
|
||||
@ -170,14 +181,15 @@ if notEmpty $FOAM_JOB_DIR/runningJobs; then
|
||||
|
||||
pid=`echo $machinePid | sed -e 's/.*\.\([0-9][0-9]*\)$/\1/'`
|
||||
|
||||
if [ "$STATEFILE" ]; then
|
||||
if [ "$STATEFILE" ]
|
||||
then
|
||||
stat=`getEntry $STATEFILE $machinePid`
|
||||
fi
|
||||
stat=${stat:-'UNKN'}
|
||||
|
||||
case=`getEntry $f 'case'`
|
||||
case=${case:-'---'}
|
||||
case=`echo $case | sed -e 's!/.*!!'` #strip of processorXXX ending
|
||||
case=`echo $case | sed -e 's!/.*!!'` # strip processorXXX ending
|
||||
case=`rightStr 20 "$case"`
|
||||
|
||||
start=`getEntry $f 'startDate'`
|
||||
@ -187,7 +199,8 @@ if notEmpty $FOAM_JOB_DIR/runningJobs; then
|
||||
end='---'
|
||||
|
||||
code=`getEntry $f 'code'`
|
||||
if [ "$code" ]; then
|
||||
if [ "$code" ]
|
||||
then
|
||||
code=`basename $code`
|
||||
else
|
||||
code='---'
|
||||
@ -196,7 +209,8 @@ if notEmpty $FOAM_JOB_DIR/runningJobs; then
|
||||
|
||||
nProcs=`getEntry $f 'nProcs'`
|
||||
nProcs=${nProcs:-'1'}
|
||||
if [ $nProcs -eq 1 ]; then
|
||||
if [ $nProcs -eq 1 ]
|
||||
then
|
||||
nProcs='---'
|
||||
fi
|
||||
nProcs=`rightStr 3 "$nProcs"`
|
||||
@ -213,7 +227,8 @@ fi
|
||||
#-- print finished
|
||||
echo ""
|
||||
echo "Finished:"
|
||||
if notEmpty $FOAM_JOB_DIR/finishedJobs; then
|
||||
if notEmpty $FOAM_JOB_DIR/finishedJobs
|
||||
then
|
||||
for f in `ls -t $FOAM_JOB_DIR/finishedJobs/*`
|
||||
do
|
||||
machinePid=`basename $f`
|
||||
@ -227,13 +242,14 @@ if notEmpty $FOAM_JOB_DIR/finishedJobs; then
|
||||
end=${end:-'---'}
|
||||
end=`leftStr 12 "$end"`
|
||||
|
||||
if [ "$STATEFILE" ]; then
|
||||
if [ "$STATEFILE" ]
|
||||
then
|
||||
stat=`getEntry $STATEFILE $machinePid`
|
||||
fi
|
||||
stat=${stat:-'UNKN'}
|
||||
|
||||
case=`getEntry $f case`
|
||||
case=`echo $case | sed -e 's!/.*!!'` #strip of processorXXX ending
|
||||
case=`echo $case | sed -e 's!/.*!!'` # strip processorXXX ending
|
||||
case=${case:-'---'}
|
||||
case=`rightStr 20 "$case"`
|
||||
|
||||
@ -242,7 +258,8 @@ if notEmpty $FOAM_JOB_DIR/finishedJobs; then
|
||||
start=`leftStr 12 "$start"`
|
||||
|
||||
code=`getEntry $f code`
|
||||
if [ "$code" ]; then
|
||||
if [ "$code" ]
|
||||
then
|
||||
code=`basename $code`
|
||||
else
|
||||
code='---'
|
||||
@ -251,7 +268,8 @@ if notEmpty $FOAM_JOB_DIR/finishedJobs; then
|
||||
|
||||
nProcs=`getEntry $f 'nProcs'`
|
||||
nProcs=${nProcs:-'1'}
|
||||
if [ $nProcs -eq 1 ]; then
|
||||
if [ $nProcs -eq 1 ]
|
||||
then
|
||||
nProcs='---'
|
||||
fi
|
||||
nProcs=`rightStr 3 "$nProcs"`
|
||||
|
||||
@ -24,11 +24,11 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "className.H"
|
||||
#include "CLASSNAME.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const dataType Foam::className::staticData();
|
||||
const dataType Foam::CLASSNAME::staticData();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
@ -42,21 +42,21 @@ const dataType Foam::className::staticData();
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::className::className()
|
||||
Foam::CLASSNAME::CLASSNAME()
|
||||
:
|
||||
baseClassName(),
|
||||
data_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::className::className(const dataType& data)
|
||||
Foam::CLASSNAME::CLASSNAME(const dataType& data)
|
||||
:
|
||||
baseClassName(),
|
||||
data_(data)
|
||||
{}
|
||||
|
||||
|
||||
Foam::className::className(const className&)
|
||||
Foam::CLASSNAME::CLASSNAME(const CLASSNAME&)
|
||||
:
|
||||
baseClassName(),
|
||||
data_()
|
||||
@ -65,15 +65,15 @@ Foam::className::className(const className&)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::className> Foam::className::New()
|
||||
Foam::autoPtr<Foam::CLASSNAME> Foam::CLASSNAME::New()
|
||||
{
|
||||
return autoPtr<className>(new className);
|
||||
return autoPtr<CLASSNAME>(new CLASSNAME);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::className::~className()
|
||||
Foam::CLASSNAME::~CLASSNAME()
|
||||
{}
|
||||
|
||||
|
||||
@ -82,12 +82,12 @@ Foam::className::~className()
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::className::operator=(const className& rhs)
|
||||
void Foam::CLASSNAME::operator=(const CLASSNAME& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn("Foam::className::operator=(const Foam::className&)")
|
||||
FatalErrorIn("Foam::CLASSNAME::operator=(const Foam::CLASSNAME&)")
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -23,19 +23,19 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::className
|
||||
Foam::CLASSNAME
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
classNameI.H
|
||||
className.C
|
||||
classNameIO.C
|
||||
CLASSNAMEI.H
|
||||
CLASSNAME.C
|
||||
CLASSNAMEIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef className_H
|
||||
#define className_H
|
||||
#ifndef CLASSNAME_H
|
||||
#define CLASSNAME_H
|
||||
|
||||
#include ".H"
|
||||
|
||||
@ -49,16 +49,16 @@ class Istream;
|
||||
class Ostream;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class className;
|
||||
Istream& operator>>(Istream&, className&);
|
||||
Ostream& operator<<(Ostream&, const className&);
|
||||
class CLASSNAME;
|
||||
Istream& operator>>(Istream&, CLASSNAME&);
|
||||
Ostream& operator<<(Ostream&, const CLASSNAME&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class className Declaration
|
||||
Class CLASSNAME Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class className
|
||||
class CLASSNAME
|
||||
:
|
||||
public baseClassName
|
||||
{
|
||||
@ -71,10 +71,10 @@ class className
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
className(const className&);
|
||||
CLASSNAME(const CLASSNAME&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const className&);
|
||||
void operator=(const CLASSNAME&);
|
||||
|
||||
|
||||
public:
|
||||
@ -88,26 +88,26 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
className();
|
||||
CLASSNAME();
|
||||
|
||||
//- Construct from components
|
||||
className(const dataType& data);
|
||||
CLASSNAME(const dataType& data);
|
||||
|
||||
//- Construct from Istream
|
||||
className(Istream&);
|
||||
CLASSNAME(Istream&);
|
||||
|
||||
//- Construct as copy
|
||||
className(const className&);
|
||||
CLASSNAME(const CLASSNAME&);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<className> New();
|
||||
static autoPtr<CLASSNAME> New();
|
||||
|
||||
|
||||
//- Destructor
|
||||
~className();
|
||||
~CLASSNAME();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -123,7 +123,7 @@ public:
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const className&);
|
||||
void operator=(const CLASSNAME&);
|
||||
|
||||
|
||||
// Friend Functions
|
||||
@ -132,8 +132,8 @@ public:
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>(Istream&, className&);
|
||||
friend Ostream& operator<<(Ostream&, const className&);
|
||||
friend Istream& operator>>(Istream&, CLASSNAME&);
|
||||
friend Ostream& operator<<(Ostream&, const CLASSNAME&);
|
||||
};
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "classNameI.H"
|
||||
#include "CLASSNAMEI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
className
|
||||
CLASSNAME
|
||||
|
||||
Description
|
||||
|
||||
@ -24,12 +24,12 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "className.H"
|
||||
#include "CLASSNAME.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::className::className(Istream& is)
|
||||
Foam::CLASSNAME::CLASSNAME(Istream& is)
|
||||
:
|
||||
base1(is),
|
||||
base2(is),
|
||||
@ -37,31 +37,31 @@ Foam::className::className(Istream& is)
|
||||
member2(is)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check("Foam::className::className(Foam::Istream&)");
|
||||
is.check("Foam::CLASSNAME::CLASSNAME(Foam::Istream&)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, className&)
|
||||
Foam::Istream& Foam::operator>>(Istream& is, CLASSNAME&)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check
|
||||
(
|
||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::className&)"
|
||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CLASSNAME&)"
|
||||
);
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const className&)
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const CLASSNAME&)
|
||||
{
|
||||
// Check state of Ostream
|
||||
os.check
|
||||
(
|
||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
||||
"const Foam::className&)"
|
||||
"const Foam::CLASSNAME&)"
|
||||
);
|
||||
|
||||
return os;
|
||||
@ -24,18 +24,18 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# Script
|
||||
# foamNew
|
||||
# foamNewSource
|
||||
#
|
||||
# Description
|
||||
# Create a new standard OpenFOAM source file
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
Template="$WM_PROJECT_DIR/bin/templates/source/_Template"
|
||||
|
||||
usage() {
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
usage: $Script <type> <class name>
|
||||
|
||||
* create a new standard OpenFOAM source file
|
||||
@ -46,49 +46,56 @@ USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
usage "wrong number of arguments, expected 2"
|
||||
fi
|
||||
|
||||
unset suffix fileType
|
||||
# this implicitly covers a lone -help
|
||||
[ "$#" -gt 1 ] || usage
|
||||
|
||||
className="$2"
|
||||
unset subType Type
|
||||
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
C|H)
|
||||
template=foamTemplate
|
||||
fileType=$1
|
||||
;;
|
||||
Type=".$1"
|
||||
;;
|
||||
I)
|
||||
suffix=$1
|
||||
template=foamTemplateI
|
||||
fileType=H
|
||||
;;
|
||||
Type="$1.H"
|
||||
;;
|
||||
IO)
|
||||
suffix=$1
|
||||
template=foamTemplateIO
|
||||
fileType=C
|
||||
;;
|
||||
Type="$1.C"
|
||||
;;
|
||||
app|App)
|
||||
template=foamAppTemplate
|
||||
fileType=C
|
||||
if [ ! -d Make ]; then
|
||||
echo "foamNew: Creating Make/files and Make/options"
|
||||
wmakeFilesAndOptions
|
||||
fi
|
||||
;;
|
||||
subType=App
|
||||
Type=".C"
|
||||
;;
|
||||
*)
|
||||
usage "unknown type"
|
||||
;;
|
||||
usage "unknown type"
|
||||
;;
|
||||
esac
|
||||
[ "$#" -eq 2 ] || usage "wrong number of arguments"
|
||||
shift 2
|
||||
|
||||
|
||||
fileName=$2$suffix.$fileType
|
||||
fileName="$className$Type"
|
||||
|
||||
if [ -e "$fileName" ]; then
|
||||
echo "Cannot make $fileName, file exists"
|
||||
exit 1
|
||||
|
||||
echo "$Script: Creating new interface file $fileName"
|
||||
if [ -e "$fileName" ]
|
||||
then
|
||||
echo " Error: file exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo $Script: Creating new interface file $fileName
|
||||
sed s/className/$2/g \
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/source/$template.$fileType > $fileName
|
||||
|
||||
# process class name
|
||||
sed "s/CLASSNAME/$className/g" $Template$subType$Type > $fileName
|
||||
|
||||
|
||||
if [ "$subType" = App -a ! -d Make ]
|
||||
then
|
||||
wmakeFilesAndOptions
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -24,12 +24,12 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ClassName.H"
|
||||
#include "CLASSNAME.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
const dataType Foam::ClassName<TemplateArgument>::staticData();
|
||||
const dataType Foam::CLASSNAME<TemplateArgument>::staticData();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||
@ -38,7 +38,7 @@ const dataType Foam::ClassName<TemplateArgument>::staticData();
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::ClassName<TemplateArgument>::ClassName()
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME()
|
||||
:
|
||||
baseClassName(),
|
||||
data_()
|
||||
@ -46,7 +46,7 @@ Foam::ClassName<TemplateArgument>::ClassName()
|
||||
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::ClassName<TemplateArgument>::ClassName(const dataType& data)
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME(const dataType& data)
|
||||
:
|
||||
baseClassName(),
|
||||
data_(data)
|
||||
@ -54,12 +54,12 @@ Foam::ClassName<TemplateArgument>::ClassName(const dataType& data)
|
||||
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::ClassName<TemplateArgument>::ClassName
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME
|
||||
(
|
||||
const ClassName<TemplateArgument>&
|
||||
const CLASSNAME<TemplateArgument>&
|
||||
)
|
||||
:
|
||||
baseClassName(),
|
||||
baseCLASSNAME(),
|
||||
data_()
|
||||
{}
|
||||
|
||||
@ -67,12 +67,12 @@ Foam::ClassName<TemplateArgument>::ClassName
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::autoPtr<Foam::ClassName<TemplateArgument> >
|
||||
Foam::ClassName<TemplateArgument>::New()
|
||||
Foam::autoPtr<Foam::CLASSNAME<TemplateArgument> >
|
||||
Foam::CLASSNAME<TemplateArgument>::New()
|
||||
{
|
||||
return autoPtr<ClassName<TemplateArgument> >
|
||||
return autoPtr<CLASSNAME<TemplateArgument> >
|
||||
(
|
||||
new ClassName<TemplateArgument>
|
||||
new CLASSNAME<TemplateArgument>
|
||||
);
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ Foam::ClassName<TemplateArgument>::New()
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::ClassName<TemplateArgument>::~ClassName()
|
||||
Foam::CLASSNAME<TemplateArgument>::~CLASSNAME()
|
||||
{}
|
||||
|
||||
|
||||
@ -96,9 +96,9 @@ Foam::ClassName<TemplateArgument>::~ClassName()
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
void Foam::ClassName<TemplateArgument>::operator=
|
||||
void Foam::CLASSNAME<TemplateArgument>::operator=
|
||||
(
|
||||
const ClassName<TemplateArgument>& rhs
|
||||
const CLASSNAME<TemplateArgument>& rhs
|
||||
)
|
||||
{
|
||||
// Check for assignment to self
|
||||
@ -106,8 +106,8 @@ void Foam::ClassName<TemplateArgument>::operator=
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::ClassName<TemplateArgument>::operator="
|
||||
"(const Foam::ClassName<TemplateArgument>&)"
|
||||
"Foam::CLASSNAME<TemplateArgument>::operator="
|
||||
"(const Foam::CLASSNAME<TemplateArgument>&)"
|
||||
) << "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -23,19 +23,19 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::ClassName
|
||||
Foam::CLASSNAME
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
ClassNameI.H
|
||||
ClassName.C
|
||||
ClassNameIO.C
|
||||
CLASSNAMEI.H
|
||||
CLASSNAME.C
|
||||
CLASSNAMEIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ClassName_H
|
||||
#define ClassName_H
|
||||
#ifndef CLASSNAME_H
|
||||
#define CLASSNAME_H
|
||||
|
||||
#include ".H"
|
||||
|
||||
@ -51,21 +51,21 @@ class someClass;
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
template<TemplateClassArgument>
|
||||
class ClassName;
|
||||
class CLASSNAME;
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Istream& operator>>(Istream&, ClassName<TemplateArgument>&);
|
||||
Istream& operator>>(Istream&, CLASSNAME<TemplateArgument>&);
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Ostream& operator<<(Ostream&, const ClassName<TemplateArgument>&);
|
||||
Ostream& operator<<(Ostream&, const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ClassName Declaration
|
||||
Class CLASSNAME Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<TemplateClassArgument>
|
||||
class ClassName
|
||||
class CLASSNAME
|
||||
:
|
||||
public baseClassName
|
||||
{
|
||||
@ -77,10 +77,10 @@ class ClassName
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ClassName(const ClassName<TemplateArgument>&);
|
||||
CLASSNAME(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ClassName<TemplateArgument>&);
|
||||
void operator=(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
public:
|
||||
@ -94,33 +94,33 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
ClassName();
|
||||
CLASSNAME();
|
||||
|
||||
//- Construct from components
|
||||
ClassName(const dataType& data);
|
||||
CLASSNAME(const dataType& data);
|
||||
|
||||
//- Construct from Istream
|
||||
ClassName(Istream&);
|
||||
CLASSNAME(Istream&);
|
||||
|
||||
//- Construct as copy
|
||||
ClassName(const ClassName<TemplateArgument>&);
|
||||
CLASSNAME(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<ClassName<TemplateArgument> > New();
|
||||
static autoPtr<CLASSNAME<TemplateArgument> > New();
|
||||
|
||||
|
||||
//- Destructor
|
||||
~ClassName();
|
||||
~CLASSNAME();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const ClassName<TemplateArgument>&);
|
||||
void operator=(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
// Friend Functions
|
||||
@ -130,10 +130,10 @@ public:
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>> <TemplateArgument>
|
||||
(Istream&, ClassName<TemplateArgument>&);
|
||||
(Istream&, CLASSNAME<TemplateArgument>&);
|
||||
|
||||
friend Ostream& operator<< <TemplateArgument>
|
||||
(Ostream&, const ClassName<TemplateArgument>&);
|
||||
(Ostream&, const CLASSNAME<TemplateArgument>&);
|
||||
};
|
||||
|
||||
|
||||
@ -143,12 +143,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "ClassNameI.H"
|
||||
#include "CLASSNAMEI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ClassName.C"
|
||||
# include "CLASSNAME.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -24,13 +24,13 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ClassName.H"
|
||||
#include "CLASSNAME.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::ClassName<TemplateArgument>::ClassName(Istream& is)
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME(Istream& is)
|
||||
:
|
||||
base1(is),
|
||||
base2(is),
|
||||
@ -38,7 +38,7 @@ Foam::ClassName<TemplateArgument>::ClassName(Istream& is)
|
||||
member2(is)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check("Foam::ClassName<TemplateArgument>::ClassName(Foam::Istream&)");
|
||||
is.check("Foam::CLASSNAME<TemplateArgument>::CLASSNAME(Foam::Istream&)");
|
||||
}
|
||||
|
||||
|
||||
@ -48,14 +48,14 @@ template<TemplateClassArgument>
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
ClassName<TemplateArgument>&
|
||||
CLASSNAME<TemplateArgument>&
|
||||
)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check
|
||||
(
|
||||
"Foam::Istream& Foam::operator>>"
|
||||
"(Foam::Istream&, Foam::ClassName<TemplateArgument>&)"
|
||||
"(Foam::Istream&, Foam::CLASSNAME<TemplateArgument>&)"
|
||||
);
|
||||
|
||||
return is;
|
||||
@ -66,14 +66,14 @@ template<TemplateClassArgument>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const ClassName<TemplateArgument>&
|
||||
const CLASSNAME<TemplateArgument>&
|
||||
)
|
||||
{
|
||||
// Check state of Ostream
|
||||
os.check
|
||||
(
|
||||
"Foam::Ostream& Foam::operator<<"
|
||||
"(Ostream&, const ClassName<TemplateArgument>&)"
|
||||
"(Ostream&, const CLASSNAME<TemplateArgument>&)"
|
||||
);
|
||||
|
||||
return os;
|
||||
@ -24,13 +24,14 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# Script
|
||||
# newSourceTemplate
|
||||
# foamNewTemplate
|
||||
#
|
||||
# Description
|
||||
# Create a new standard OpenFOAM templated source file
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
Template="$WM_PROJECT_DIR/bin/templates/sourceTemplate/_TemplateTemplate"
|
||||
|
||||
usage() {
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
@ -46,51 +47,50 @@ USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$#" -le 2 ]; then
|
||||
usage "wrong number of arguments, expected 3 (or more)"
|
||||
fi
|
||||
# this implicitly covers a lone -help
|
||||
[ "$#" -gt 1 ] || usage
|
||||
|
||||
|
||||
className="$2"
|
||||
unset Type
|
||||
|
||||
unset suffix fileType
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
C|H)
|
||||
Template=Template
|
||||
fileType=$1
|
||||
className=$2
|
||||
;;
|
||||
Type=".$1"
|
||||
;;
|
||||
I)
|
||||
suffix=$1
|
||||
Template=TemplateI
|
||||
fileType=H
|
||||
className=$2
|
||||
;;
|
||||
Type="$1.H"
|
||||
;;
|
||||
IO)
|
||||
suffix=$1
|
||||
Template=TemplateIO
|
||||
fileType=C
|
||||
className=$2
|
||||
;;
|
||||
Type="$1.C"
|
||||
;;
|
||||
*)
|
||||
usage "unknown type"
|
||||
;;
|
||||
usage "unknown type"
|
||||
;;
|
||||
esac
|
||||
[ "$#" -ge 3 ] || usage "wrong number of arguments"
|
||||
shift 2
|
||||
|
||||
fileName="$className$Type"
|
||||
|
||||
|
||||
fileName=$className$suffix.$fileType
|
||||
|
||||
if [ -e "$fileName" ]; then
|
||||
echo "Cannot make $fileName, file exists"
|
||||
exit 1
|
||||
echo "$Script: Creating new template interface file $fileName"
|
||||
if [ -e "$fileName" ]
|
||||
then
|
||||
echo " Error: file exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shift 2
|
||||
echo "$Script: Creating new interface file $fileName"
|
||||
|
||||
# process class name
|
||||
sed -e "s/ClassName/$className/g" \
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/sourceTemplate/foamTemplate$Template.$fileType > $fileName.1
|
||||
sed -e "s/CLASSNAME/$className/g" $Template$Type > $fileName.1
|
||||
|
||||
|
||||
# process template arguments
|
||||
for tArg in $*
|
||||
for tArg
|
||||
do
|
||||
sed -e "s/TemplateClassArgument/class $tArg, TemplateClassArgument/g" \
|
||||
-e "s/TemplateArgument/$tArg, TemplateArgument/g" \
|
||||
@ -99,7 +99,8 @@ do
|
||||
mv $fileName.2 $fileName.1
|
||||
done
|
||||
|
||||
# remove remaining ", Template argument"
|
||||
|
||||
# remove remaining ", Template .."
|
||||
sed -e "s/, TemplateClassArgument//g" \
|
||||
-e "s/, TemplateArgument//g" \
|
||||
$fileName.1 > $fileName
|
||||
@ -366,7 +366,6 @@ DebugSwitches
|
||||
directMappedVelocityFlux 0;
|
||||
directionMixed 0;
|
||||
directional 0;
|
||||
disallowDefaultFvsPatchField 0;
|
||||
disallowGenericFvPatchField 0;
|
||||
disallowGenericPointPatchField 0;
|
||||
disallowGenericPolyPatch 0;
|
||||
|
||||
@ -89,6 +89,11 @@ case OpenFOAM:
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
breaksw
|
||||
case Gcc44:
|
||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
breaksw
|
||||
case Gcc43:
|
||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
|
||||
@ -105,6 +105,11 @@ OpenFOAM)
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
;;
|
||||
Gcc44)
|
||||
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
;;
|
||||
Gcc43)
|
||||
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
|
||||
@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR/src" ]
|
||||
then
|
||||
echo "Error: Current directory in not \$WM_PROJECT_DIR/src"
|
||||
echo " The environment variable are not consistent with the installation."
|
||||
echo "Error: Current directory is not \$WM_PROJECT_DIR/src"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
fi
|
||||
@ -32,6 +32,7 @@ decompositionMethods/Allwmake
|
||||
|
||||
wmake libso meshTools
|
||||
wmake libso finiteVolume
|
||||
wmake libso genericPatchFields
|
||||
|
||||
wmake libso sampling
|
||||
|
||||
|
||||
@ -478,7 +478,6 @@ $(pointPatchFields)/pointPatchField/pointPatchFields.C
|
||||
|
||||
basicPointPatchFields = $(pointPatchFields)/basic
|
||||
$(basicPointPatchFields)/calculated/calculatedPointPatchFields.C
|
||||
$(basicPointPatchFields)/generic/genericPointPatchFields.C
|
||||
$(basicPointPatchFields)/coupled/coupledPointPatchFields.C
|
||||
$(basicPointPatchFields)/value/valuePointPatchFields.C
|
||||
$(basicPointPatchFields)/fixedValue/fixedValuePointPatchFields.C
|
||||
|
||||
@ -81,7 +81,8 @@ bool Foam::functionEntry::execute
|
||||
(
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, dictionary& parentDict, Istream&)"
|
||||
) << "Unknown functionEntry " << functionName
|
||||
) << "Unknown functionEntry '" << functionName
|
||||
<< "' in " << is.name() << " near line " << is.lineNumber()
|
||||
<< endl << endl
|
||||
<< "Valid functionEntries are :" << endl
|
||||
<< executedictionaryIstreamMemberFunctionTablePtr_->toc()
|
||||
@ -126,7 +127,8 @@ bool Foam::functionEntry::execute
|
||||
(
|
||||
"functionEntry::execute"
|
||||
"(const word&, const dictionary&, primitiveEntry&, Istream&)"
|
||||
) << "Unknown functionEntry " << functionName
|
||||
) << "Unknown functionEntry '" << functionName
|
||||
<< "' in " << is.name() << " near line " << is.lineNumber()
|
||||
<< endl << endl
|
||||
<< "Valid functionEntries are :" << endl
|
||||
<< executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
|
||||
#include "removeEntry.H"
|
||||
#include "dictionary.H"
|
||||
#include "stringListOps.H"
|
||||
#include "IStringStream.H"
|
||||
#include "OStringStream.H"
|
||||
#include "addToMemberFunctionSelectionTable.H"
|
||||
@ -64,22 +65,12 @@ bool Foam::functionEntries::removeEntry::execute
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
token currToken(is);
|
||||
is.putBack(currToken);
|
||||
wordList dictKeys = parentDict.toc();
|
||||
labelList indices = findStrings<word>(readList<wordRe>(is), dictKeys);
|
||||
|
||||
if (currToken == token::BEGIN_LIST)
|
||||
forAll(indices, indexI)
|
||||
{
|
||||
wordList keys(is);
|
||||
|
||||
forAll(keys, keyI)
|
||||
{
|
||||
parentDict.remove(keys[keyI]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
word key(is);
|
||||
parentDict.remove(key);
|
||||
parentDict.remove(dictKeys[indices[indexI]]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -28,13 +28,16 @@ Class
|
||||
Description
|
||||
Remove a dictionary entry.
|
||||
|
||||
The @c \#remove directive takes a word or a list of words. For example,
|
||||
The @c \#remove directive takes a list or a single wordRe.
|
||||
For example,
|
||||
@verbatim
|
||||
#remove entry0
|
||||
#remove ( entry1 entry2 entry3 )
|
||||
#remove ( entry1 entry2 entry3 otherEntry )
|
||||
#remove "entry[1-3]"
|
||||
#remove ( "entry[1-3]" otherEntry )
|
||||
@endverbatim
|
||||
|
||||
The removable only occurs in the current context.
|
||||
The removal only occurs in the current context.
|
||||
Removing sub-entries or parent entries is not supported.
|
||||
|
||||
SourceFiles
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user