Merge branch 'olesenm'

This commit is contained in:
andy
2010-03-17 14:58:34 +00:00
242 changed files with 1988 additions and 1026 deletions

4
.gitignore vendored
View File

@ -55,6 +55,10 @@ doc/[Dd]oxygen/man
/*.html /*.html
/doc/*.html /doc/*.html
# untracked configuration files
/etc/prefs.csh
/etc/prefs.sh
# source packages - anywhere # source packages - anywhere
*.tar.bz2 *.tar.bz2
*.tar.gz *.tar.gz

3
README
View File

@ -112,7 +112,7 @@
which may be obtained from http://gcc.gnu.org/. which may be obtained from http://gcc.gnu.org/.
Install the compiler in Install the compiler in
$WM_THIRD_PARTY_DIR/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/ $WM_THIRD_PARTY_DIR/platform/$WM_ARCH$WM_COMPILER_ARCH/gcc-<GCC_VERSION>
and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
$WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the $WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
environment variables as in section 3. environment variables as in section 3.
@ -166,6 +166,7 @@
gcc-4.3.3. Execute the following: gcc-4.3.3. Execute the following:
+ cd $WM_THIRD_PARTY_DIR + cd $WM_THIRD_PARTY_DIR
+ rm -rf paraview-3.6.1/platforms + rm -rf paraview-3.6.1/platforms
+ rm -rf platforms/*/paraview-3.6.1
+ ./makeParaView + ./makeParaView
The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled

View File

@ -87,16 +87,26 @@ Foam::ensightMesh::ensightMesh
if (args.optionFound("patches")) if (args.optionFound("patches"))
{ {
wordList patchNameList(args.optionLookup("patches")()); wordReList patterns(args.optionLookup("patches")());
if (patchNameList.empty()) if (patterns.empty())
{ {
patchNameList = allPatchNames_; forAll(allPatchNames_, nameI)
{
patchNames_.insert(allPatchNames_[nameI]);
} }
}
forAll(patchNameList, i) else
{ {
patchNames_.insert(patchNameList[i]); // Find patch names which match that requested at command-line
forAll(allPatchNames_, nameI)
{
const word& patchName = allPatchNames_[nameI];
if (findStrings(patterns, patchName))
{
patchNames_.insert(patchName);
}
}
} }
} }
} }
@ -247,19 +257,17 @@ Foam::ensightMesh::ensightMesh
// faceZones // faceZones
if (args.optionFound("faceZones")) if (args.optionFound("faceZones"))
{ {
wordList patchNameList(args.optionLookup("faceZones")()); wordReList patterns(args.optionLookup("faceZones")());
const wordList faceZoneNamesAll = mesh_.faceZones().names(); const wordList faceZoneNamesAll = mesh_.faceZones().names();
// Find out faceZone names that match with what requested at command // Find faceZone names which match that requested at command-line
// line forAll(faceZoneNamesAll, nameI)
forAll(patchNameList, i)
{ {
labelList matches = findStrings(patchNameList[i], faceZoneNamesAll); const word& zoneName = faceZoneNamesAll[nameI];
if (findStrings(patterns, zoneName))
forAll(matches, matchI)
{ {
faceZoneNames_.insert(faceZoneNamesAll[matches[matchI]]); faceZoneNames_.insert(zoneName);
} }
} }
@ -353,8 +361,8 @@ Foam::ensightMesh::ensightMesh
if if
( (
faceZoneFaceSets_[zoneI].tris.size() faceZoneFaceSets_[zoneI].tris.size()
|| faceZoneFaceSets_[zoneI].quads.size() || || faceZoneFaceSets_[zoneI].quads.size()
faceZoneFaceSets_[zoneI].polys.size() || faceZoneFaceSets_[zoneI].polys.size()
) )
{ {
nfp.nTris = faceZoneFaceSets_[zoneI].tris.size(); nfp.nTris = faceZoneFaceSets_[zoneI].tris.size();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -112,21 +112,21 @@ int main(int argc, char *argv[])
argList::addOption argList::addOption
( (
"patches", "patches",
"wordList", "wordReList",
"specify particular patches to write - eg '(inlet outlet)'. " "specify particular patches to write - eg '(outlet \"inlet.*\")'. "
"An empty list suppresses writing the internalMesh." "An empty list suppresses writing the internalMesh."
); );
argList::addOption argList::addOption
( (
"faceZones", "faceZones",
"wordList", "wordReList",
"specify faceZones to write, with wildcards - eg '(mfp-.*)'. " "specify faceZones to write - eg '( slice \"mfp-.*\" )'."
); );
# include "setRootCase.H" # include "setRootCase.H"
// Check options // Check options
bool binary = !args.optionFound("ascii"); const bool binary = !args.optionFound("ascii");
# include "createTime.H" # include "createTime.H"

View File

@ -159,13 +159,6 @@ Note
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
static const label VTK_TETRA = 10;
static const label VTK_PYRAMID = 14;
static const label VTK_WEDGE = 13;
static const label VTK_HEXAHEDRON = 12;
template<class GeoField> template<class GeoField>
void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds) void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
{ {
@ -229,10 +222,7 @@ labelList getSelectedPatches
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -285,11 +275,11 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
bool doWriteInternal = !args.optionFound("noInternal"); const bool doWriteInternal = !args.optionFound("noInternal");
bool doFaceZones = !args.optionFound("noFaceZones"); const bool doFaceZones = !args.optionFound("noFaceZones");
bool doLinks = !args.optionFound("noLinks"); const bool doLinks = !args.optionFound("noLinks");
bool binary = !args.optionFound("ascii"); const bool binary = !args.optionFound("ascii");
bool useTimeName = args.optionFound("useTimeName"); const bool useTimeName = args.optionFound("useTimeName");
if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4)) if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4))
{ {
@ -299,7 +289,7 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
bool nearCellValue = args.optionFound("nearCellValue"); const bool nearCellValue = args.optionFound("nearCellValue");
if (nearCellValue) if (nearCellValue)
{ {
@ -308,7 +298,7 @@ int main(int argc, char *argv[])
<< nl << endl; << nl << endl;
} }
bool noPointValues = args.optionFound("noPointValues"); const bool noPointValues = args.optionFound("noPointValues");
if (noPointValues) if (noPointValues)
{ {
@ -316,7 +306,7 @@ int main(int argc, char *argv[])
<< "Outputting cell values only" << nl << endl; << "Outputting cell values only" << nl << endl;
} }
bool allPatches = args.optionFound("allPatches"); const bool allPatches = args.optionFound("allPatches");
List<wordRe> excludePatches; List<wordRe> excludePatches;
if (args.optionFound("excludePatches")) if (args.optionFound("excludePatches"))
@ -392,15 +382,8 @@ int main(int argc, char *argv[])
Info<< "Time: " << runTime.timeName() << endl; Info<< "Time: " << runTime.timeName() << endl;
word timeDesc = ""; word timeDesc =
if (useTimeName) useTimeName ? runTime.timeName() : Foam::name(runTime.timeIndex());
{
timeDesc = runTime.timeName();
}
else
{
timeDesc = name(runTime.timeIndex());
}
// Check for new polyMesh/ and update mesh, fvMeshSubset and cell // Check for new polyMesh/ and update mesh, fvMeshSubset and cell
// decomposition. // decomposition.
@ -470,10 +453,7 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, runTime.timeName()); IOobjectList objects(mesh, runTime.timeName());
HashSet<word> selectedFields; HashSet<word> selectedFields;
if (args.optionFound("fields")) args.optionReadIfPresent("fields", selectedFields);
{
args.optionLookup("fields")() >> selectedFields;
}
// Construct the vol fields (on the original mesh if subsetted) // Construct the vol fields (on the original mesh if subsetted)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,10 +33,10 @@ Description
#include "polyMesh.H" #include "polyMesh.H"
#include "cellShape.H" #include "cellShape.H"
#include "cellModeller.H" #include "cellModeller.H"
#include "Swap.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::vtkTopo::vtkTopo(const polyMesh& mesh) Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
: :
mesh_(mesh), mesh_(mesh),
@ -61,6 +61,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
// Number of additional cells generated by the decomposition of polyhedra // Number of additional cells generated by the decomposition of polyhedra
label nAddCells = 0; label nAddCells = 0;
// face owner is needed to determine the face orientation
const labelList& owner = mesh.faceOwner();
// Scan for cells which need to be decomposed and count additional points // Scan for cells which need to be decomposed and count additional points
// and cells // and cells
@ -71,7 +74,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
if if
( (
model != hex model != hex
// && model != wedge // See above. // && model != wedge // See above.
&& model != prism && model != prism
&& model != pyr && model != pyr
&& model != tet && model != tet
@ -111,7 +114,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
cellTypes_.setSize(cellShapes.size() + nAddCells); cellTypes_.setSize(cellShapes.size() + nAddCells);
// Set counters for additional points and additional cells // Set counters for additional points and additional cells
label api = 0, aci = 0; label addPointI = 0, addCellI = 0;
forAll(cellShapes, cellI) forAll(cellShapes, cellI)
{ {
@ -134,15 +137,13 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
} }
else if (cellModel == prism) else if (cellModel == prism)
{ {
vtkVerts.setSize(6); // VTK has a different node order for VTK_WEDGE
vtkVerts[0] = cellShape[0]; // their triangles point outwards!
vtkVerts[1] = cellShape[2]; vtkVerts = cellShape;
vtkVerts[2] = cellShape[1];
vtkVerts[3] = cellShape[3]; Foam::Swap(vtkVerts[1], vtkVerts[2]);
vtkVerts[4] = cellShape[5]; Foam::Swap(vtkVerts[4], vtkVerts[5]);
vtkVerts[5] = cellShape[4];
// VTK calls this a wedge.
cellTypes_[cellI] = VTK_WEDGE; cellTypes_[cellI] = VTK_WEDGE;
} }
else if (cellModel == tetWedge) else if (cellModel == tetWedge)
@ -175,34 +176,28 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
// } // }
else if (cellModel == hex) else if (cellModel == hex)
{ {
vtkVerts.setSize(8); vtkVerts = cellShape;
vtkVerts[0] = cellShape[0];
vtkVerts[1] = cellShape[1];
vtkVerts[2] = cellShape[2];
vtkVerts[3] = cellShape[3];
vtkVerts[4] = cellShape[4];
vtkVerts[5] = cellShape[5];
vtkVerts[6] = cellShape[6];
vtkVerts[7] = cellShape[7];
cellTypes_[cellI] = VTK_HEXAHEDRON; cellTypes_[cellI] = VTK_HEXAHEDRON;
} }
else else
{ {
// Polyhedral cell. Decompose into tets + prisms. // Polyhedral cell. Decompose into tets + prisms.
// (see dxFoamExec/createDxConnections.C)
// Mapping from additional point to cell // Mapping from additional point to cell
addPointCellLabels_[api] = cellI; addPointCellLabels_[addPointI] = cellI;
// The new vertex from the cell-centre
const label newVertexLabel = mesh_.nPoints() + addPointI;
// Whether to insert cell in place of original or not. // Whether to insert cell in place of original or not.
bool substituteCell = true; bool substituteCell = true;
const labelList& cFaces = mesh_.cells()[cellI]; const labelList& cFaces = mesh_.cells()[cellI];
forAll(cFaces, cFaceI) forAll(cFaces, cFaceI)
{ {
const face& f = mesh_.faces()[cFaces[cFaceI]]; const face& f = mesh_.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
// Number of triangles and quads in decomposition // Number of triangles and quads in decomposition
label nTris = 0; label nTris = 0;
@ -216,75 +211,95 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
label quadi = 0; label quadi = 0;
f.trianglesQuads(mesh_.points(), trii, quadi, triFcs, quadFcs); f.trianglesQuads(mesh_.points(), trii, quadi, triFcs, quadFcs);
forAll(quadFcs, quadi) forAll(quadFcs, quadI)
{ {
label thisCellI = -1; label thisCellI;
if (substituteCell) if (substituteCell)
{ {
thisCellI = cellI; thisCellI = cellI;
substituteCell = false; substituteCell = false;
} }
else else
{ {
thisCellI = mesh_.nCells() + aci; thisCellI = mesh_.nCells() + addCellI;
superCells_[addCellI++] = cellI;
superCells_[aci] = cellI;
aci++;
} }
labelList& addVtkVerts = vertLabels_[thisCellI]; labelList& addVtkVerts = vertLabels_[thisCellI];
addVtkVerts.setSize(5); addVtkVerts.setSize(5);
const face& quad = quadFcs[quadi]; const face& quad = quadFcs[quadI];
// Ensure we have the correct orientation for the
// base of the primitive cell shape.
// If the cell is face owner, the orientation needs to be
// flipped.
// At the moment, VTK doesn't actually seem to care if
// negative cells are defined, but we'll do it anyhow
// (for safety).
if (isOwner)
{
addVtkVerts[0] = quad[3];
addVtkVerts[1] = quad[2];
addVtkVerts[2] = quad[1];
addVtkVerts[3] = quad[0];
}
else
{
addVtkVerts[0] = quad[0]; addVtkVerts[0] = quad[0];
addVtkVerts[1] = quad[1]; addVtkVerts[1] = quad[1];
addVtkVerts[2] = quad[2]; addVtkVerts[2] = quad[2];
addVtkVerts[3] = quad[3]; addVtkVerts[3] = quad[3];
addVtkVerts[4] = mesh_.nPoints() + api; }
addVtkVerts[4] = newVertexLabel;
cellTypes_[thisCellI] = VTK_PYRAMID; cellTypes_[thisCellI] = VTK_PYRAMID;
} }
forAll(triFcs, trii) forAll(triFcs, triI)
{ {
label thisCellI = -1; label thisCellI;
if (substituteCell) if (substituteCell)
{ {
thisCellI = cellI; thisCellI = cellI;
substituteCell = false; substituteCell = false;
} }
else else
{ {
thisCellI = mesh_.nCells() + aci; thisCellI = mesh_.nCells() + addCellI;
superCells_[addCellI++] = cellI;
superCells_[aci] = cellI;
aci++;
} }
labelList& addVtkVerts = vertLabels_[thisCellI]; labelList& addVtkVerts = vertLabels_[thisCellI];
const face& tri = triFcs[trii]; const face& tri = triFcs[triI];
addVtkVerts.setSize(4); addVtkVerts.setSize(4);
// See note above about the orientation.
if (isOwner)
{
addVtkVerts[0] = tri[2];
addVtkVerts[1] = tri[1];
addVtkVerts[2] = tri[0];
}
else
{
addVtkVerts[0] = tri[0]; addVtkVerts[0] = tri[0];
addVtkVerts[1] = tri[1]; addVtkVerts[1] = tri[1];
addVtkVerts[2] = tri[2]; addVtkVerts[2] = tri[2];
addVtkVerts[3] = mesh_.nPoints() + api; }
addVtkVerts[3] = newVertexLabel;
cellTypes_[thisCellI] = VTK_TETRA; cellTypes_[thisCellI] = VTK_TETRA;
} }
} }
api++; addPointI++;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -80,7 +80,7 @@ public:
// Public static data // Public static data
// this must be consistent with the enumeration in "vtkCell.H" //- equivalent to enumeration in "vtkCellType.h"
enum vtkTypes enum vtkTypes
{ {
VTK_TRIANGLE = 5, VTK_TRIANGLE = 5,
@ -88,9 +88,10 @@ public:
VTK_QUAD = 9, VTK_QUAD = 9,
VTK_TETRA = 10, VTK_TETRA = 10,
VTK_PYRAMID = 14,
VTK_WEDGE = 13,
VTK_HEXAHEDRON = 12, VTK_HEXAHEDRON = 12,
VTK_WEDGE = 13,
VTK_PYRAMID = 14,
VTK_POLYHEDRON = 42
}; };
// Constructors // Constructors

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso vtkPV3Readers
PV3blockMeshReader/Allwclean
PV3FoamReader/Allwclean
# ----------------------------------------------------------------- end-of-file

View File

@ -91,7 +91,8 @@
animateable="0"> animateable="0">
<BooleanDomain name="bool"/> <BooleanDomain name="bool"/>
<Documentation> <Documentation>
Use vtkPolyhedron instead of decomposing polyhedra Use vtkPolyhedron instead of decomposing polyhedra.
!!Actually uses vtkConvexPointSet until this is properly supported in VTK!!
</Documentation> </Documentation>
</IntVectorProperty> </IntVectorProperty>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,12 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(ParaView_DIR)/VTK \ -I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR) \
-I$(ParaView_INST_DIR) \
-I$(ParaView_INST_DIR)/VTK \
-I$(ParaView_INST_DIR)/VTK/Common \
-I$(ParaView_INST_DIR)/VTK/Filtering \
-I$(ParaView_INST_DIR)/VTK/Rendering \
-I../../vtkPV3Readers/lnInclude \ -I../../vtkPV3Readers/lnInclude \
-I../PV3FoamReader -I../PV3FoamReader

View File

@ -31,6 +31,7 @@ License
#include "fvMesh.H" #include "fvMesh.H"
#include "cellModeller.H" #include "cellModeller.H"
#include "vtkOpenFOAMPoints.H" #include "vtkOpenFOAMPoints.H"
#include "Swap.H"
// VTK includes // VTK includes
#include "vtkCellArray.h" #include "vtkCellArray.h"
@ -45,6 +46,13 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
polyDecomp& decompInfo polyDecomp& decompInfo
) )
{ {
const cellModel& tet = *(cellModeller::lookup("tet"));
const cellModel& pyr = *(cellModeller::lookup("pyr"));
const cellModel& prism = *(cellModeller::lookup("prism"));
const cellModel& wedge = *(cellModeller::lookup("wedge"));
const cellModel& tetWedge = *(cellModeller::lookup("tetWedge"));
const cellModel& hex = *(cellModeller::lookup("hex"));
vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::New(); vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::New();
if (debug) if (debug)
@ -53,36 +61,27 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
printMemory(); printMemory();
} }
const cellShapeList& cellShapes = mesh.cellShapes();
// Number of additional points needed by the decomposition of polyhedra // Number of additional points needed by the decomposition of polyhedra
label nAddPoints = 0; label nAddPoints = 0;
// Number of additional cells generated by the decomposition of polyhedra // Number of additional cells generated by the decomposition of polyhedra
label nAddCells = 0; label nAddCells = 0;
// face owner is needed to determine the face orientation
const labelList& owner = mesh.faceOwner();
labelList& superCells = decompInfo.superCells(); labelList& superCells = decompInfo.superCells();
labelList& addPointCellLabels = decompInfo.addPointCellLabels(); labelList& addPointCellLabels = decompInfo.addPointCellLabels();
const cellModel& tet = *(cellModeller::lookup("tet"));
const cellModel& pyr = *(cellModeller::lookup("pyr"));
const cellModel& prism = *(cellModeller::lookup("prism"));
const cellModel& wedge = *(cellModeller::lookup("wedge"));
const cellModel& tetWedge = *(cellModeller::lookup("tetWedge"));
const cellModel& hex = *(cellModeller::lookup("hex"));
// Scan for cells which need to be decomposed and count additional points
// and cells
if (debug)
{
Info<< "... building cell-shapes" << endl;
}
const cellShapeList& cellShapes = mesh.cellShapes();
if (debug) if (debug)
{ {
Info<< "... scanning" << endl; Info<< "... scanning" << endl;
} }
// count number of cells to decompose // Scan for cells which need to be decomposed and count additional points
// and cells
if (!reader_->GetUseVTKPolyhedron()) if (!reader_->GetUseVTKPolyhedron())
{ {
forAll(cellShapes, cellI) forAll(cellShapes, cellI)
@ -105,10 +104,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFaceI]];
label nFacePoints = f.size(); label nQuads = 0;
label nTris = 0;
f.nTrianglesQuads(mesh.points(), nTris, nQuads);
label nQuads = (nFacePoints - 2)/2;
label nTris = (nFacePoints - 2)%2;
nAddCells += nQuads + nTris; nAddCells += nQuads + nTris;
} }
@ -201,8 +200,8 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
} }
else if (cellModel == prism) else if (cellModel == prism)
{ {
// VTK has a different node order - their triangles point outwards! // VTK has a different node order for VTK_WEDGE
// their triangles point outwards!
nodeIds[0] = cellShape[0]; nodeIds[0] = cellShape[0];
nodeIds[1] = cellShape[2]; nodeIds[1] = cellShape[2];
nodeIds[2] = cellShape[1]; nodeIds[2] = cellShape[1];
@ -349,29 +348,34 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// Mapping from additional point to cell // Mapping from additional point to cell
addPointCellLabels[addPointI] = cellI; addPointCellLabels[addPointI] = cellI;
// Insert the new vertex from the cell-centre // The new vertex from the cell-centre
label newVertexLabel = mesh.nPoints() + addPointI; const label newVertexLabel = mesh.nPoints() + addPointI;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[cellI]); vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[cellI]);
// Whether to insert cell in place of original or not. // Whether to insert cell in place of original or not.
bool substituteCell = true; bool substituteCell = true;
const labelList& cFaces = mesh.cells()[cellI]; const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, cFaceI) forAll(cFaces, cFaceI)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
label nFacePoints = f.size(); // Number of triangles and quads in decomposition
label nTris = 0;
label nQuads = 0;
f.nTrianglesQuads(mesh.points(), nTris, nQuads);
label nQuads = (nFacePoints - 2)/2; // Do actual decomposition into triFcs and quadFcs.
label nTris = (nFacePoints - 2)%2; faceList triFcs(nTris);
faceList quadFcs(nQuads);
label trii = 0;
label quadi = 0;
f.trianglesQuads(mesh.points(), trii, quadi, triFcs, quadFcs);
label qpi = 0; forAll(quadFcs, quadI)
for (label quadi=0; quadi<nQuads; quadi++)
{ {
label thisCellI = -1; label thisCellI;
if (substituteCell) if (substituteCell)
{ {
@ -384,10 +388,29 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
superCells[addCellI++] = cellI; superCells[addCellI++] = cellI;
} }
nodeIds[0] = f[0]; const face& quad = quadFcs[quadI];
nodeIds[1] = f[qpi + 1];
nodeIds[2] = f[qpi + 2]; // Ensure we have the correct orientation for the
nodeIds[3] = f[qpi + 3]; // base of the primitive cell shape.
// If the cell is face owner, the orientation needs to be
// flipped.
// At the moment, VTK doesn't actually seem to care if
// negative cells are defined, but we'll do it anyhow
// (for safety).
if (isOwner)
{
nodeIds[0] = quad[3];
nodeIds[1] = quad[2];
nodeIds[2] = quad[1];
nodeIds[3] = quad[0];
}
else
{
nodeIds[0] = quad[0];
nodeIds[1] = quad[1];
nodeIds[2] = quad[2];
nodeIds[3] = quad[3];
}
nodeIds[4] = newVertexLabel; nodeIds[4] = newVertexLabel;
vtkmesh->InsertNextCell vtkmesh->InsertNextCell
( (
@ -395,13 +418,11 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
5, 5,
nodeIds nodeIds
); );
qpi += 2;
} }
if (nTris) forAll(triFcs, triI)
{ {
label thisCellI = -1; label thisCellI;
if (substituteCell) if (substituteCell)
{ {
@ -414,10 +435,23 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
superCells[addCellI++] = cellI; superCells[addCellI++] = cellI;
} }
nodeIds[0] = f[0]; const face& tri = triFcs[triI];
nodeIds[1] = f[qpi + 1];
nodeIds[2] = f[qpi + 2]; // See note above about the orientation.
if (isOwner)
{
nodeIds[0] = tri[2];
nodeIds[1] = tri[1];
nodeIds[2] = tri[0];
}
else
{
nodeIds[0] = tri[0];
nodeIds[1] = tri[1];
nodeIds[2] = tri[2];
}
nodeIds[3] = newVertexLabel; nodeIds[3] = newVertexLabel;
vtkmesh->InsertNextCell vtkmesh->InsertNextCell
( (
VTK_TETRA, VTK_TETRA,

View File

@ -1,12 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-I$(ParaView_DIR)/VTK \ -I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR) \
-I$(ParaView_INST_DIR) \
-I$(ParaView_INST_DIR)/VTK \
-I$(ParaView_INST_DIR)/VTK/Common \
-I$(ParaView_INST_DIR)/VTK/Filtering \
-I$(ParaView_INST_DIR)/VTK/Rendering \
-I../../vtkPV3Readers/lnInclude \ -I../../vtkPV3Readers/lnInclude \
-I../PV3blockMeshReader -I../PV3blockMeshReader

View File

@ -1,10 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(ParaView_DIR)/VTK \ -I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
-I$(ParaView_INST_DIR) \
-I$(ParaView_INST_DIR)/VTK \
-I$(ParaView_INST_DIR)/VTK/Common \
-I$(ParaView_INST_DIR)/VTK/Filtering \
-I$(ParaView_INST_DIR)/VTK/Rendering
LIB_LIBS = \ LIB_LIBS = \
$(GLIBS) $(GLIBS)

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -38,7 +38,7 @@ Usage: ${0##*/} [OPTION]
options: options:
-help -help
* start engrid using the paraview-$ParaView_VERSION libraries * start engrid using the paraview-$ParaView_MAJOR libraries
passes through engrid options unmodified passes through engrid options unmodified
USAGE USAGE
@ -48,13 +48,8 @@ USAGE
# report usage # report usage
[ "$1" = "-h" -o "$1" = "-help" ] && usage [ "$1" = "-h" -o "$1" = "-help" ] && usage
# set the major version "<digits>.<digits>" bindir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/engrid
ParaView_MAJOR_VERSION=$(echo $ParaView_VERSION | \ libdir="$ParaView_DIR/lib/paraview-${ParaView_MAJOR:-unknown}"
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
bindir=$WM_THIRD_PARTY_DIR/engrid/platforms/$WM_ARCH
libdir="$ParaView_DIR/lib/paraview-$ParaView_MAJOR_VERSION"
[ -x $bindir/engrid ] || usage "engrid executable not found in $bindir" [ -x $bindir/engrid ] || usage "engrid executable not found in $bindir"
[ -d $libdir ] || usage "paraview libraries not found" [ -d $libdir ] || usage "paraview libraries not found"

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -41,7 +41,11 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
cat <<USAGE 1>&2 cat <<USAGE 1>&2
Usage: ${0##*/} [-strip] path [wildcard] .. [wildcard] Usage: ${0##*/} [OPTION] path [wildcard1] .. [wildcardN]
options:
-space treat 'path' as space-delimited (eg, from C-Shell)
-strip remove inaccessible directories
-help print the usage
Prints its argument (which should be a ':' separated list) cleansed from Prints its argument (which should be a ':' separated list) cleansed from
- duplicate elements - duplicate elements
@ -53,7 +57,7 @@ USAGE
} }
unset strip unset space strip
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -61,6 +65,10 @@ do
-h | -help) -h | -help)
usage usage
;; ;;
-space)
space=true
shift
;;
-strip) -strip)
strip=true strip=true
shift shift
@ -74,7 +82,12 @@ done
[ "$#" -ge 1 ] || usage [ "$#" -ge 1 ] || usage
dirList="$1" if [ "$space" = true ]
then
dirList=$(echo "$1" | sed -e 's/ /:/g')
else
dirList="$1"
fi
shift shift
##DEBUG echo "input>$dirList<" 1>&2 ##DEBUG echo "input>$dirList<" 1>&2
@ -123,12 +136,15 @@ do
fi fi
done done
# parse on whitespace # split on whitespace
IFS=' ' IFS=' '
set -- $dirList set -- $dirList
# join on ':' # join on ':', unless -space option was specified
IFS=':' if [ "$space" != true ]
then
IFS=':'
fi
dirList="$*" dirList="$*"
# restore IFS # restore IFS

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -27,7 +27,7 @@
# foamCleanTutorials # foamCleanTutorials
# #
# Description # Description
# Run either Allclean or default cleanCase in current directory # Run either Allwclean, Allclean or default cleanCase in current directory
# and all its subdirectories. # and all its subdirectories.
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -41,24 +41,29 @@ then
thisScript="$PWD/$thisScript" thisScript="$PWD/$thisScript"
fi fi
# If an argument is supplied do not execute ./Allclean to avoid recursion # If an argument is supplied do not execute ./Allwclean or ./Allclean
if [ $# = 0 -a -f Allclean ] # (to avoid recursion)
if [ $# -eq 0 -a -f Allwclean ]
then then
# Specialised script. # Specialized script
./Allwclean
elif [ $# -eq 0 -a -f Allclean ]
then
# Specialized script
./Allclean ./Allclean
elif [ -d system ] elif [ -d system ]
then then
# Normal case. # Normal case
cleanCase cleanCase
elif [ -d Make ] elif [ -d Make ]
then then
# Normal application. # Normal application
cleanApplication cleanApplication
else else
# Recurse to subdirectories # Recurse into subdirectories
for caseDir in * for caseName in *
do do
( cd $caseDir 2>/dev/null && $thisScript ) ( cd $caseName 2>/dev/null && $thisScript )
done done
fi fi

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -34,31 +34,31 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
printUsage() usage()
{ {
echo "Usage : `basename $0` start|stop|list" echo "Usage : ${0##*/} start|stop|list"
echo "" echo ""
exit 1
} }
RSH='ssh' RSH='ssh'
if [ ! "$DISTCC_HOSTS" ]; then if [ ! "$DISTCC_HOSTS" ]
echo "`basename $0`: variable DISTCC_HOSTS not set." then
echo "`basename $0`: please set DISTCC_HOSTS to the list of hosts to use." echo "${0##*/} Warnings"
echo "`basename $0`: the format is host1:port host2:port host3:port etc." echo " variable DISTCC_HOSTS not set."
echo "" echo " please set DISTCC_HOSTS to the list of hosts to use."
echo " the format is host1:port host2:port host3:port etc."
echo
exit 1 exit 1
fi fi
if [ $# -ne 1 ]; then [ $# -eq 1 ] || usage
printUsage
exit 1
fi
if [ "$1" = 'start' ]; then case "$1" in
start)
grep -v '^#' /etc/hosts | awk '{print $1, $2 " "}' > ~/filteredHosts.txt grep -v '^#' /etc/hosts | awk '{print $1, $2 " "}' > ~/filteredHosts.txt
allowIPS='' allowIPS=''
@ -66,7 +66,8 @@ if [ "$1" = 'start' ]; then
do do
machine=`echo "$host" | awk -F: '{print $1}'` machine=`echo "$host" | awk -F: '{print $1}'`
iptest=`echo "$machine" | sed -e 's/[0-9.]//g'` iptest=`echo "$machine" | sed -e 's/[0-9.]//g'`
if [ ! "$iptest" ]; then if [ ! "$iptest" ]
then
# address only contained 0-9 and '.'. Probably ip address. # address only contained 0-9 and '.'. Probably ip address.
ip=$machine ip=$machine
else else
@ -74,7 +75,8 @@ if [ "$1" = 'start' ]; then
ip=`egrep " $machine " ~/filteredHosts.txt | awk '{print $1}'` ip=`egrep " $machine " ~/filteredHosts.txt | awk '{print $1}'`
fi fi
if [ ! "$ip" ]; then if [ ! "$ip" ]
then
echo "$0 : host specifier $host either is not an ip address or cannot be found in /etc/hosts." echo "$0 : host specifier $host either is not an ip address or cannot be found in /etc/hosts."
echo "$0 : Exiting." echo "$0 : Exiting."
exit 1 exit 1
@ -92,7 +94,8 @@ if [ "$1" = 'start' ]; then
machine=`echo "$host" | awk -F: '{print $1}'` machine=`echo "$host" | awk -F: '{print $1}'`
port=`echo "$host" | awk -F: '{print $2}'` port=`echo "$host" | awk -F: '{print $2}'`
if [ "$machine" -a "$port" ]; then if [ "$machine" -a "$port" ]
then
#echo "Machine:$machine port:$port" #echo "Machine:$machine port:$port"
echo "distccd --daemon $allowIPS --port $port"' --jobs `egrep "^processor" /proc/cpuinfo | wc -l`' echo "distccd --daemon $allowIPS --port $port"' --jobs `egrep "^processor" /proc/cpuinfo | wc -l`'
$RSH $machine "distccd --verbose --daemon $allowIPS --port $port"' --jobs `egrep "^processor" /proc/cpuinfo | wc -l`' $RSH $machine "distccd --verbose --daemon $allowIPS --port $port"' --jobs `egrep "^processor" /proc/cpuinfo | wc -l`'
@ -102,9 +105,9 @@ if [ "$1" = 'start' ]; then
exit 1 exit 1
fi fi
done done
;;
elif [ "$1" = 'stop' ]; then stop)
for host in $DISTCC_HOSTS for host in $DISTCC_HOSTS
do do
echo "" echo ""
@ -114,10 +117,9 @@ elif [ "$1" = 'stop' ]; then
$RSH $machine killall distccd $RSH $machine killall distccd
done done
;;
list)
elif [ "$1" = 'list' ]; then
for host in $DISTCC_HOSTS for host in $DISTCC_HOSTS
do do
echo "" echo ""
@ -127,12 +129,11 @@ elif [ "$1" = 'list' ]; then
$RSH $machine "ps -ef | grep distccd | grep -v grep" $RSH $machine "ps -ef | grep distccd | grep -v grep"
done done
;;
else *)
usage
printUsage ;;
exit 1 esac
fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -32,10 +32,11 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
sourcesFile=${TMPDIR:-/tmp}/sourcesFile.$$ sourcesFile=${TMPDIR:-/tmp}/sourcesFile.$$
if [ $# -ne 0 ]; then if [ $# -ne 0 ]
then
echo "Usage : ${0##*/}" echo "Usage : ${0##*/}"
echo "" echo ""
echo "Build the Ebrowse dadbase for all the .H and .C files" echo "Build the Ebrowse database for all the .H and .C files"
echo "" echo ""
exit 1 exit 1
fi fi

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -27,7 +27,7 @@
# foamNew # foamNew
# #
# Description # Description
# Create a new standard OpenFOAM source file # Create a new standard OpenFOAM source or template file
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
@ -50,11 +50,11 @@ USAGE
case "$1" in case "$1" in
source) source)
shift shift
$WM_PROJECT_DIR/bin/templates/source/foamNewSource $* $WM_PROJECT_DIR/etc/codeTemplates/source/foamNewSource $*
;; ;;
template) template)
shift shift
$WM_PROJECT_DIR/bin/templates/sourceTemplate/foamNewTemplate $* $WM_PROJECT_DIR/etc/codeTemplates/template/foamNewTemplate $*
;; ;;
*) *)
usage "unknown type" usage "unknown type"

224
bin/foamNewCase Executable file
View File

@ -0,0 +1,224 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 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
#
# Script
# foamNewCase
#
# Description
# Create a new case from a template for particular applications
# - requires rsync
#
#------------------------------------------------------------------------------
siteDir=${WM_PROJECT_INST_DIR:-unknown}/site
userDir=$HOME/.OpenFOAM
version=${WM_PROJECT_VERSION:-unknown}
templateDir="appTemplates"
#------------------------------------------------------------------------------
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: ${0##*/} [OPTION]
options:
-app <name> specify the application to use
-case <dir> specify alternative case directory, default is the cwd
-list list the applications available
-version <ver> specify an alternative version (default: '$WM_PROJECT_VERSION')
clone initial application settings to the specified case from
$userDir/$templateDir/{$version,}/<APP>
$siteDir/$templateDir/{$version,}/<APP>
USAGE
exit 1
}
#------------------------------------------------------------------------------
unset appName caseName listOpt
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-app)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
appName="$2"
shift 2
;;
-case)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
caseName="$2"
shift 2
;;
-l | -list)
listOpt=true
shift
;;
-v | -ver | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
version="$2"
shift 2
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
#------------------------------------------------------------------------------
[ -n "$version" ] || {
echo "Error: no -version specified and \$WM_PROJECT_VERSION is not set"
exit 1
}
#
# find apps in current directory
# considered an app if it has constant/ and system/ directories
#
findApps()
{
for app in $(/bin/ls -d * 2>/dev/null)
do
[ -d "$app/constant" -a -d "$app/system" ] && echo $app
done
}
appList=$(
for dir in $userDir/$templateDir $siteDir/$templateDir
do
if cd $dir 2>/dev/null
then
findApps ## generic
cd $version 2>/dev/null && findApps ## version-specific
fi
done | sort | uniq
)
listApps()
{
echo
echo "applications available:"
for i in $appList
do
echo " $i"
done
echo
}
if [ "$listOpt" = true ]
then
listApps
exit 0
elif [ "$(echo $appList | wc -w)" -eq 0 ]
then
echo "Error: no applications available"
exit 1
elif [ -z "$appName" ]
then
echo "Error: no -app specified"
listApps
exit 1
fi
# get the corresponding srcDir name
srcDir=$(
for dir in $userDir/$templateDir $siteDir/$templateDir
do
if [ -d $dir ]
then
for appDir in $dir/$version/$appName $dir/$appName
do
if [ -d $appDir -a -d $appDir/constant -a -d $appDir/system ]
then
echo "$appDir"
break 2
fi
done
fi
done
)
[ -d "$srcDir" ] || {
echo "Error: could not find template for $appName"
listApps
exit 1
}
# adjust for caseName as required
if [ -n "$caseName" ]
then
[ -d "$caseName" ] || mkdir -p "$caseName"
cd "$caseName" 2>/dev/null || usage "directory does not exist: '$caseName'"
fi
newDir=$PWD
[ -d "$newDir" -a -w "$newDir" ] || {
echo "Error: target directory does not exist or is unwritable"
echo " $newDir"
exit 1
}
# add some useful subdirs:
mkdir -p $newDir/postPro
echo " application $appName"
echo " source $srcDir"
echo " target $newDir"
echo " syncing ..."
# sync updated files only, itemize changes so we know what is going on
rsync -aui $srcDir/ $newDir
#
# reuse or create new FOAM_SETTINGS (useful for queuing systems)
#
if [ -e "$newDir/FOAM_SETTINGS" ]
then
echo " retaining FOAM_SETTINGS"
else
echo " creating FOAM_SETTINGS"
cat << SETTINGS > "$newDir/FOAM_SETTINGS"
APPLICATION=$appName
FOAM_VERSION=OpenFOAM-$version
SETTINGS
fi
echo Done
#------------------------------------------------------------------------------

View File

@ -1 +1 @@
templates/source/foamNewSource ../etc/codeTemplates/source/foamNewSource

View File

@ -1 +1 @@
templates/sourceTemplate/foamNewTemplate ../etc/codeTemplates/template/foamNewTemplate

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -29,13 +29,14 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#cleanTimeDirectories () #cleanTimeDirectories()
#{ #{
# echo "Cleaning $case case of $application application" # echo "Cleaning $case case of $application application"
# TIME_DIRS=`foamInfoExec . $1 -times | sed '1,/constant/d'` # TIME_DIRS=`foamInfoExec . $1 -times | sed '1,/constant/d'`
# for T in $TIME_DIRS # for T in $TIME_DIRS
# do # do
# if [ $T != "0" ] ; then # if [ $T != "0" ]
# then
# echo "Deleting directory $T" # echo "Deleting directory $T"
# rm -rf ${T} > /dev/null 2>&1 # rm -rf ${T} > /dev/null 2>&1
# fi # fi
@ -43,12 +44,13 @@
# rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1 # rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1
#} #}
cleanTimeDirectories () cleanTimeDirectories()
{ {
echo "Cleaning $PWD case" echo "Cleaning $PWD case"
nZeros=0 nZeros=0
zeros="" zeros=""
while [ $nZeros -lt 8 ] ; do while [ $nZeros -lt 8 ]
do
timeDir="0.${zeros}[1-9]*" timeDir="0.${zeros}[1-9]*"
rm -rf ${timeDir} > /dev/null 2>&1 rm -rf ${timeDir} > /dev/null 2>&1
rm -rf ./-${timeDir} > /dev/null 2>&1 rm -rf ./-${timeDir} > /dev/null 2>&1
@ -58,7 +60,7 @@ cleanTimeDirectories ()
rm -rf ./{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1 rm -rf ./{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1
} }
cleanCase () cleanCase()
{ {
cleanTimeDirectories cleanTimeDirectories
rm -rf processor* > /dev/null 2>&1 rm -rf processor* > /dev/null 2>&1
@ -82,23 +84,23 @@ cleanCase ()
done done
} }
removeCase () removeCase()
{ {
echo "Removing $case case" echo "Removing $case case"
rm -rf $1 rm -rf $1
} }
cleanSamples () cleanSamples()
{ {
rm -rf {sets,samples,sampleSurfaces} > /dev/null 2>&1 rm -rf {sets,samples,sampleSurfaces} > /dev/null 2>&1
} }
cleanUcomponents () cleanUcomponents()
{ {
rm -rf 0/{Ux,Uy,Uz} > /dev/null 2>&1 rm -rf 0/{Ux,Uy,Uz} > /dev/null 2>&1
} }
cleanApplication () cleanApplication()
{ {
echo "Cleaning $PWD application" echo "Cleaning $PWD application"
wclean wclean

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -29,17 +29,19 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
getApplication () getApplication()
{ {
grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/" grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
} }
runApplication () runApplication()
{ {
APP_RUN=$1; shift APP_RUN=$1
shift
APP_NAME=${APP_RUN##*/} APP_NAME=${APP_RUN##*/}
if [ -f log.$APP_NAME ] ; then if [ -f log.$APP_NAME ]
then
echo "$APP_NAME already run on $PWD: remove log file to run" echo "$APP_NAME already run on $PWD: remove log file to run"
else else
echo "Running $APP_RUN on $PWD" echo "Running $APP_RUN on $PWD"
@ -47,11 +49,13 @@ runApplication ()
fi fi
} }
runParallel () runParallel()
{ {
APP_RUN=$1; shift APP_RUN=$1
shift
if [ -f $log.$APP_RUN ] ; then if [ -f $log.$APP_RUN ]
then
echo "$APP_RUN already run on $PWD: remove log file to run" echo "$APP_RUN already run on $PWD: remove log file to run"
else else
echo "Running $APP_RUN in parallel on $PWD using $1 processes" echo "Running $APP_RUN in parallel on $PWD using $1 processes"
@ -59,15 +63,16 @@ runParallel ()
fi fi
} }
compileApplication () compileApplication()
{ {
echo "Compiling $1 application" echo "Compiling $1 application"
wmake $1 wmake $1
} }
cloneCase () cloneCase()
{ {
if [ -d $2 ] ; then if [ -d $2 ]
then
echo "Case already cloned: remove case directory $2 to clone" echo "Case already cloned: remove case directory $2 to clone"
else else
echo "Cloning $2 case from $1" echo "Cloning $2 case from $1"

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# License # License

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# License # License

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -2,8 +2,9 @@
# $0 string1 string2 file1 .. filen # $0 string1 string2 file1 .. filen
# #
if [ $# -lt 3 ]; then if [ $# -lt 3 ]
echo "Usage: `basename $0` [-f] <string1> <string2> <file1> .. <filen>" then
echo "Usage: ${0##*/} [-f] <string1> <string2> <file1> .. <filen>"
echo "" echo ""
echo "Replaces all occurrences of string1 by string2 in files." echo "Replaces all occurrences of string1 by string2 in files."
echo "(replacement of sed -i on those systems that don't support it)" echo "(replacement of sed -i on those systems that don't support it)"
@ -26,3 +27,5 @@ do
# echo "String $FROMSTRING not present in $f" # echo "String $FROMSTRING not present in $f"
#fi #fi
done done
# ----------------------------------------------------------------- end-of-file

View File

@ -1,8 +1,9 @@
#!/usr/xpg4/bin/sh #!/usr/xpg4/bin/sh
# Replace all shell script headers with # Replace all shell script headers with
if [ $# -ne 1 -o ! -d "$1" ]; then if [ $# -ne 1 -o ! -d "$1" ]
echo "Usage: `basename $0` <dir>" then
echo "Usage: ${0##*/} <dir>"
echo "" echo ""
echo "Replaces all occurrences of #!/bin/sh with #!/usr/xpg4/bin/sh inside a directory tree." echo "Replaces all occurrences of #!/bin/sh with #!/usr/xpg4/bin/sh inside a directory tree."
exit 1 exit 1
@ -13,3 +14,4 @@ fi
find $1 -exec $WM_PROJECT_DIR/bin/tools/inlineReplace '^#\!/bin/sh' '#\!/usr/xpg4/bin/sh' {} \; -print find $1 -exec $WM_PROJECT_DIR/bin/tools/inlineReplace '^#\!/bin/sh' '#\!/usr/xpg4/bin/sh' {} \; -print
# ----------------------------------------------------------------- end-of-file

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# aliases.csh # aliases.csh
# #
# Description # Description
@ -44,6 +44,11 @@ alias wmDP 'setenv WM_PRECISION_OPTION DP; source $WM_PROJECT_DIR/etc/cshrc'
alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler' alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF 'unsetenv WM_SCHEDULER' alias wmSchedOFF 'unsetenv WM_SCHEDULER'
# Change paraview version
# ~~~~~~~~~~~~~~~~~~~~~~~
alias foamPV 'setenv ParaView_VERSION \!*; source $WM_PROJECT_DIR/etc/apps/paraview3/cshrc; echo paraview-$ParaView_VERSION'
# Change directory aliases # Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~
alias src 'cd $FOAM_SRC' alias src 'cd $FOAM_SRC'

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# aliases.sh # aliases.sh
# #
# Description # Description
@ -44,6 +44,19 @@ alias wmDP='export WM_PRECISION_OPTION=DP; . $WM_PROJECT_DIR/etc/bashrc'
alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler' alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF='unset WM_SCHEDULER' alias wmSchedOFF='unset WM_SCHEDULER'
# Change paraview version
# ~~~~~~~~~~~~~~~~~~~~~~~
unset foamPV
foamPV()
{
export ParaView_VERSION=$1
. $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)"
echo "dir: $ParaView_DIR"
[ -d "$ParaView_DIR" ] || echo "WARNING: directory does not exist"
}
# Change directory aliases # Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~
alias src='cd $FOAM_SRC' alias src='cd $FOAM_SRC'

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# ensight/bashrc # ensight/bashrc
# #
# Description # Description

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# ensight/cshrc # ensight/cshrc
# #
# Description # Description

View File

@ -22,22 +22,26 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# paraview3/bashrc # paraview3/bashrc
# #
# Description # Description
# Setup file for paraview-3.x # Setup file for paraview-3.x
# Sourced from OpenFOAM-*/etc/bashrc # Sourced from OpenFOAM-*/etc/bashrc or from foamPV alias
# #
# Note # Note
# The env. variable 'ParaView_DIR' is required for building plugins # The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
# are required for building plugins
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# clean the PATH
cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"` && PATH="$cleaned"
# determine the cmake to be used # determine the cmake to be used
unset CMAKE_HOME unset CMAKE_HOME
for cmake in cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 for cmake in cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6
do do
cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
if [ -r $cmake ] if [ -r $cmake ]
then then
export CMAKE_HOME=$cmake export CMAKE_HOME=$cmake
@ -48,31 +52,45 @@ done
# set VERSION and MAJOR (version) variables if not already set # set VERSION and MAJOR (version) variables if not already set
# the major version is "<digits>.<digits>"
[ -z "$ParaView_VERSION" ] && export ParaView_VERSION=3.6.1 [ -z "$ParaView_VERSION" ] && export ParaView_VERSION=3.6.1
[ -z "$ParaView_MAJOR" ] && export ParaView_MAJOR=3.6
# if needed, set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
case "$ParaView_VERSION" in
"${ParaView_MAJOR}.*" )
# version and major appear to correspond
;;
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION *)
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER ParaView_MAJOR=`echo $ParaView_VERSION | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
;;
esac
export ParaView_MAJOR
# add in python libraries if required paraviewInstDir=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
ParaView_PYTHON_DIR=$ParaView_DIR/Utilities/VTKPythonWrapping export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
if [ -r $ParaView_PYTHON_DIR ]
then
if [ "$PYTHONPATH" ]
then
export PYTHONPATH=$PYTHONPATH:$ParaView_PYTHON_DIR:$ParaView_DIR/lib/paraview-$ParaView_MAJOR
else
export PYTHONPATH=$ParaView_PYTHON_DIR:$ParaView_DIR/lib/paraview-$ParaView_MAJOR
fi
fi
if [ -r $ParaView_DIR ] # set paths if binaries or source are present
if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
then then
export PATH=$ParaView_DIR/bin:$PATH export PATH=$ParaView_DIR/bin:$PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
# add in python libraries if required
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if [ -r $paraviewPython ]
then
if [ "$PYTHONPATH" ]
then
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_DIR/lib/paraview-$ParaView_MAJOR
else
export PYTHONPATH=$paraviewPython:$ParaView_DIR/lib/paraview-$ParaView_MAJOR
fi
fi
else
unset PV_PLUGIN_PATH
fi fi
unset cmake ParaView_PYTHON_DIR
unset cleaned cmake paraviewInstDir paraviewPython
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -22,21 +22,26 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# paraview3/cshrc # paraview3/cshrc
# #
# Description # Description
# Setup file for paraview-3.x # Setup file for paraview-3.x
# Sourced from OpenFOAM-*/etc/cshrc # Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias
# #
# Note # Note
# The env. variable 'ParaView_DIR' is required for building plugins # The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
# are required for building plugins
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# clean the PATH
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath -space "$path" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) set path=($cleaned)
# determine the cmake to be used # determine the cmake to be used
unsetenv CMAKE_HOME unsetenv CMAKE_HOME
foreach cmake ( cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 ) foreach cmake ( cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 )
set cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
if ( -r $cmake ) then if ( -r $cmake ) then
setenv CMAKE_HOME $cmake setenv CMAKE_HOME $cmake
set path=($CMAKE_HOME/bin $path) set path=($CMAKE_HOME/bin $path)
@ -45,27 +50,44 @@ foreach cmake ( cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 )
end end
# set VERSION and MAJOR (version) variables if not already set # set VERSION and MAJOR (version) variables if not already set
# the major version is "<digits>.<digits>" if ( ! $?ParaView_VERSION || "x$ParaView_VERSION" == "x" ) setenv ParaView_VERSION 3.6.1
if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.6.1 if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR 3.6
setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION # if needed, set MAJOR version to correspond to VERSION
setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION")
case "${ParaView_MAJOR}.*":
# version and major appear to correspond
breaksw
# add in python libraries if required default:
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
if ( -r $paraviewPython ) then sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
breaksw
endsw
set paraviewInstDir=$WM_THIRD_PARTY_DIR/paraview-${ParaView_VERSION}
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-${ParaView_VERSION}
# set paths if binaries or source are present
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
set path=($ParaView_DIR/bin $path)
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
# add in python libraries if required
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if ( -r $paraviewPython ) then
if ($?PYTHONPATH) then if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR} setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
else else
setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR} setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
endif endif
endif
else
unsetenv PV_PLUGIN_PATH
endif endif
if ( -r $ParaView_INST_DIR ) then
set path=($ParaView_DIR/bin $path)
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview
endif
unset cmake paraviewPython unset cleaned cmake paraviewInstDir paraviewPython
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# etc/bashrc # etc/bashrc
# #
# Description # Description
@ -36,13 +36,13 @@ export WM_PROJECT=OpenFOAM
[ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=1.6 [ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=1.6
################################################################################ ################################################################################
# USER EDITABLE PART # USER EDITABLE PART. Note changes made here may be lost with the next upgrade
# #
# either set $FOAM_INST_DIR before sourcing this file or set # either set $FOAM_INST_DIR before sourcing this file or set
# $foamInstall below to where OpenFOAM is installed # $foamInstall below to where OpenFOAM is installed
# #
# Location of FOAM installation # Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=$HOME/$WM_PROJECT foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT # foamInstall=~$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT # foamInstall=/usr/local/$WM_PROJECT
@ -70,12 +70,28 @@ export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
# Location of third-party software # Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
# Source files, possibly with some verbosity
_foamSource()
{
while [ $# -ge 1 ]
do
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1"
. $1
shift
done
}
# Add in preset user or site preferences:
foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` && _foamSource $foamPrefs
unset foamPrefs
# Operating System/Platform # Operating System/Platform
# ~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_OSTYPE = POSIX | ???? # WM_OSTYPE = POSIX | ????
@ -86,8 +102,7 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: ${WM_COMPILER:=Gcc}; export WM_COMPILER : ${WM_COMPILER:=Gcc}; export WM_COMPILER
export WM_COMPILER_ARCH= unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
export WM_COMPILER_LIB_ARCH=
# Compilation options (architecture, precision, optimised, debug or profiling) # Compilation options (architecture, precision, optimised, debug or profiling)
@ -205,39 +220,28 @@ esac
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH) # Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
#- Clean PATH #- Clean PATH
cleanEnv=`$cleanProg "$PATH" "$foamOldDirs"` && PATH="$cleanEnv" cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
#- Clean LD_LIBRARY_PATH #- Clean LD_LIBRARY_PATH
cleanEnv=`$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleanEnv" cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleaned"
#- Clean MANPATH #- Clean MANPATH
cleanEnv=`$cleanProg "$MANPATH" "$foamCleanDirs"` && MANPATH="$cleanEnv" cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
export PATH LD_LIBRARY_PATH MANPATH export PATH LD_LIBRARY_PATH MANPATH
# Source project setup files # Source project setup files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource()
{
while [ $# -ge 1 ]
do
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1"
. $1
shift
done
}
_foamSource $WM_PROJECT_DIR/etc/settings.sh _foamSource $WM_PROJECT_DIR/etc/settings.sh
_foamSource $WM_PROJECT_DIR/etc/aliases.sh _foamSource $WM_PROJECT_DIR/etc/aliases.sh
# Source user setup files for optional packages # Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# _foamSource $WM_PROJECT_DIR/etc/apps/paraview/bashrc
_foamSource $WM_PROJECT_DIR/etc/apps/paraview3/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
_foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc
@ -245,27 +249,27 @@ _foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc
# Clean environment paths again. Only remove duplicates # Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#- Clean PATH #- Clean PATH
cleanEnv=`$cleanProg "$PATH"` && PATH="$cleanEnv" cleaned=`$foamClean "$PATH"` && PATH="$cleaned"
#- Clean LD_LIBRARY_PATH #- Clean LD_LIBRARY_PATH
cleanEnv=`$cleanProg "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleanEnv" cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"
#- Clean MANPATH #- Clean MANPATH (trailing ':' to find system pages)
cleanEnv=`$cleanProg "$MANPATH"` && MANPATH="$cleanEnv:" cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"
export PATH LD_LIBRARY_PATH MANPATH export PATH LD_LIBRARY_PATH MANPATH
#- Clean LD_PRELOAD #- Clean LD_PRELOAD
if [ "$LD_PRELOAD" != "" ] if [ -n "$LD_PRELOAD" ]
then then
cleanEnv=`$cleanProg "$LD_PRELOAD"` && LD_PRELOAD="$cleanEnv" cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
export LD_PRELOAD export LD_PRELOAD
fi fi
# cleanup environment: # cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~
unset cleanEnv cleanProg foamInstall foamOldDirs unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource unset _foamSource
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More