Merge branch 'olesenm'

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

4
.gitignore vendored
View File

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

3
README
View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,21 +112,21 @@ int main(int argc, char *argv[])
argList::addOption
(
"patches",
"wordList",
"specify particular patches to write - eg '(inlet outlet)'. "
"wordReList",
"specify particular patches to write - eg '(outlet \"inlet.*\")'. "
"An empty list suppresses writing the internalMesh."
);
argList::addOption
(
"faceZones",
"wordList",
"specify faceZones to write, with wildcards - eg '(mfp-.*)'. "
"wordReList",
"specify faceZones to write - eg '( slice \"mfp-.*\" )'."
);
# include "setRootCase.H"
// Check options
bool binary = !args.optionFound("ascii");
const bool binary = !args.optionFound("ascii");
# 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>
void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
{
@ -229,10 +222,7 @@ labelList getSelectedPatches
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
@ -285,11 +275,11 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
bool doWriteInternal = !args.optionFound("noInternal");
bool doFaceZones = !args.optionFound("noFaceZones");
bool doLinks = !args.optionFound("noLinks");
bool binary = !args.optionFound("ascii");
bool useTimeName = args.optionFound("useTimeName");
const bool doWriteInternal = !args.optionFound("noInternal");
const bool doFaceZones = !args.optionFound("noFaceZones");
const bool doLinks = !args.optionFound("noLinks");
const bool binary = !args.optionFound("ascii");
const bool useTimeName = args.optionFound("useTimeName");
if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4))
{
@ -299,7 +289,7 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
bool nearCellValue = args.optionFound("nearCellValue");
const bool nearCellValue = args.optionFound("nearCellValue");
if (nearCellValue)
{
@ -308,7 +298,7 @@ int main(int argc, char *argv[])
<< nl << endl;
}
bool noPointValues = args.optionFound("noPointValues");
const bool noPointValues = args.optionFound("noPointValues");
if (noPointValues)
{
@ -316,7 +306,7 @@ int main(int argc, char *argv[])
<< "Outputting cell values only" << nl << endl;
}
bool allPatches = args.optionFound("allPatches");
const bool allPatches = args.optionFound("allPatches");
List<wordRe> excludePatches;
if (args.optionFound("excludePatches"))
@ -392,15 +382,8 @@ int main(int argc, char *argv[])
Info<< "Time: " << runTime.timeName() << endl;
word timeDesc = "";
if (useTimeName)
{
timeDesc = runTime.timeName();
}
else
{
timeDesc = name(runTime.timeIndex());
}
word timeDesc =
useTimeName ? runTime.timeName() : Foam::name(runTime.timeIndex());
// Check for new polyMesh/ and update mesh, fvMeshSubset and cell
// decomposition.
@ -470,10 +453,7 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, runTime.timeName());
HashSet<word> selectedFields;
if (args.optionFound("fields"))
{
args.optionLookup("fields")() >> selectedFields;
}
args.optionReadIfPresent("fields", selectedFields);
// Construct the vol fields (on the original mesh if subsetted)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,10 +33,10 @@ Description
#include "polyMesh.H"
#include "cellShape.H"
#include "cellModeller.H"
#include "Swap.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
:
mesh_(mesh),
@ -61,6 +61,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
// Number of additional cells generated by the decomposition of polyhedra
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
// and cells
@ -71,7 +74,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
if
(
model != hex
// && model != wedge // See above.
// && model != wedge // See above.
&& model != prism
&& model != pyr
&& model != tet
@ -111,7 +114,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
cellTypes_.setSize(cellShapes.size() + nAddCells);
// Set counters for additional points and additional cells
label api = 0, aci = 0;
label addPointI = 0, addCellI = 0;
forAll(cellShapes, cellI)
{
@ -134,15 +137,13 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
}
else if (cellModel == prism)
{
vtkVerts.setSize(6);
vtkVerts[0] = cellShape[0];
vtkVerts[1] = cellShape[2];
vtkVerts[2] = cellShape[1];
vtkVerts[3] = cellShape[3];
vtkVerts[4] = cellShape[5];
vtkVerts[5] = cellShape[4];
// VTK has a different node order for VTK_WEDGE
// their triangles point outwards!
vtkVerts = cellShape;
Foam::Swap(vtkVerts[1], vtkVerts[2]);
Foam::Swap(vtkVerts[4], vtkVerts[5]);
// VTK calls this a wedge.
cellTypes_[cellI] = VTK_WEDGE;
}
else if (cellModel == tetWedge)
@ -175,34 +176,28 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
// }
else if (cellModel == hex)
{
vtkVerts.setSize(8);
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];
vtkVerts = cellShape;
cellTypes_[cellI] = VTK_HEXAHEDRON;
}
else
{
// Polyhedral cell. Decompose into tets + prisms.
// (see dxFoamExec/createDxConnections.C)
// 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.
bool substituteCell = true;
const labelList& cFaces = mesh_.cells()[cellI];
forAll(cFaces, cFaceI)
{
const face& f = mesh_.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
// Number of triangles and quads in decomposition
label nTris = 0;
@ -216,75 +211,95 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
label quadi = 0;
f.trianglesQuads(mesh_.points(), trii, quadi, triFcs, quadFcs);
forAll(quadFcs, quadi)
forAll(quadFcs, quadI)
{
label thisCellI = -1;
label thisCellI;
if (substituteCell)
{
thisCellI = cellI;
substituteCell = false;
}
else
{
thisCellI = mesh_.nCells() + aci;
superCells_[aci] = cellI;
aci++;
thisCellI = mesh_.nCells() + addCellI;
superCells_[addCellI++] = cellI;
}
labelList& addVtkVerts = vertLabels_[thisCellI];
addVtkVerts.setSize(5);
const face& quad = quadFcs[quadi];
const face& quad = quadFcs[quadI];
addVtkVerts[0] = quad[0];
addVtkVerts[1] = quad[1];
addVtkVerts[2] = quad[2];
addVtkVerts[3] = quad[3];
addVtkVerts[4] = mesh_.nPoints() + api;
// 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[1] = quad[1];
addVtkVerts[2] = quad[2];
addVtkVerts[3] = quad[3];
}
addVtkVerts[4] = newVertexLabel;
cellTypes_[thisCellI] = VTK_PYRAMID;
}
forAll(triFcs, trii)
forAll(triFcs, triI)
{
label thisCellI = -1;
label thisCellI;
if (substituteCell)
{
thisCellI = cellI;
substituteCell = false;
}
else
{
thisCellI = mesh_.nCells() + aci;
superCells_[aci] = cellI;
aci++;
thisCellI = mesh_.nCells() + addCellI;
superCells_[addCellI++] = cellI;
}
labelList& addVtkVerts = vertLabels_[thisCellI];
const face& tri = triFcs[trii];
const face& tri = triFcs[triI];
addVtkVerts.setSize(4);
addVtkVerts[0] = tri[0];
addVtkVerts[1] = tri[1];
addVtkVerts[2] = tri[2];
addVtkVerts[3] = mesh_.nPoints() + api;
// 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[1] = tri[1];
addVtkVerts[2] = tri[2];
}
addVtkVerts[3] = newVertexLabel;
cellTypes_[thisCellI] = VTK_TETRA;
}
}
api++;
addPointI++;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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">
<BooleanDomain name="bool"/>
<Documentation>
Use vtkPolyhedron instead of decomposing polyhedra
Use vtkPolyhedron instead of decomposing polyhedra.
!!Actually uses vtkConvexPointSet until this is properly supported in VTK!!
</Documentation>
</IntVectorProperty>

View File

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

View File

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

View File

@ -2,12 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(ParaView_DIR)/VTK \
-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$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR) \
-I../../vtkPV3Readers/lnInclude \
-I../PV3FoamReader

View File

@ -31,6 +31,7 @@ License
#include "fvMesh.H"
#include "cellModeller.H"
#include "vtkOpenFOAMPoints.H"
#include "Swap.H"
// VTK includes
#include "vtkCellArray.h"
@ -45,6 +46,13 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
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();
if (debug)
@ -53,36 +61,27 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
printMemory();
}
const cellShapeList& cellShapes = mesh.cellShapes();
// Number of additional points needed by the decomposition of polyhedra
label nAddPoints = 0;
// Number of additional cells generated by the decomposition of polyhedra
label nAddCells = 0;
// face owner is needed to determine the face orientation
const labelList& owner = mesh.faceOwner();
labelList& superCells = decompInfo.superCells();
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)
{
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())
{
forAll(cellShapes, cellI)
@ -105,10 +104,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
{
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;
}
@ -201,8 +200,8 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
}
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[1] = cellShape[2];
nodeIds[2] = cellShape[1];
@ -349,29 +348,34 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// Mapping from additional point to cell
addPointCellLabels[addPointI] = cellI;
// Insert the new vertex from the cell-centre
label newVertexLabel = mesh.nPoints() + addPointI;
// The new vertex from the cell-centre
const label newVertexLabel = mesh.nPoints() + addPointI;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[cellI]);
// Whether to insert cell in place of original or not.
bool substituteCell = true;
const labelList& cFaces = mesh.cells()[cellI];
forAll(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;
label nTris = (nFacePoints - 2)%2;
// Do actual decomposition into triFcs and quadFcs.
faceList triFcs(nTris);
faceList quadFcs(nQuads);
label trii = 0;
label quadi = 0;
f.trianglesQuads(mesh.points(), trii, quadi, triFcs, quadFcs);
label qpi = 0;
for (label quadi=0; quadi<nQuads; quadi++)
forAll(quadFcs, quadI)
{
label thisCellI = -1;
label thisCellI;
if (substituteCell)
{
@ -384,10 +388,29 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
superCells[addCellI++] = cellI;
}
nodeIds[0] = f[0];
nodeIds[1] = f[qpi + 1];
nodeIds[2] = f[qpi + 2];
nodeIds[3] = f[qpi + 3];
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)
{
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;
vtkmesh->InsertNextCell
(
@ -395,13 +418,11 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
5,
nodeIds
);
qpi += 2;
}
if (nTris)
forAll(triFcs, triI)
{
label thisCellI = -1;
label thisCellI;
if (substituteCell)
{
@ -414,10 +435,23 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
superCells[addCellI++] = cellI;
}
nodeIds[0] = f[0];
nodeIds[1] = f[qpi + 1];
nodeIds[2] = f[qpi + 2];
const face& tri = triFcs[triI];
// 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;
vtkmesh->InsertNextCell
(
VTK_TETRA,

View File

@ -1,12 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-I$(ParaView_DIR)/VTK \
-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$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR) \
-I../../vtkPV3Readers/lnInclude \
-I../PV3blockMeshReader

View File

@ -1,10 +1,5 @@
EXE_INC = \
-I$(ParaView_DIR)/VTK \
-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$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
LIB_LIBS = \
$(GLIBS)

View File

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

View File

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

View File

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

View File

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

View File

@ -41,7 +41,11 @@
#------------------------------------------------------------------------------
usage() {
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
- duplicate elements
@ -53,7 +57,7 @@ USAGE
}
unset strip
unset space strip
# parse options
while [ "$#" -gt 0 ]
do
@ -61,6 +65,10 @@ do
-h | -help)
usage
;;
-space)
space=true
shift
;;
-strip)
strip=true
shift
@ -74,7 +82,12 @@ done
[ "$#" -ge 1 ] || usage
dirList="$1"
if [ "$space" = true ]
then
dirList=$(echo "$1" | sed -e 's/ /:/g')
else
dirList="$1"
fi
shift
##DEBUG echo "input>$dirList<" 1>&2
@ -123,12 +136,15 @@ do
fi
done
# parse on whitespace
# split on whitespace
IFS=' '
set -- $dirList
# join on ':'
IFS=':'
# join on ':', unless -space option was specified
if [ "$space" != true ]
then
IFS=':'
fi
dirList="$*"
# restore IFS

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,7 +27,7 @@
# foamNew
#
# Description
# Create a new standard OpenFOAM source file
# Create a new standard OpenFOAM source or template file
#
#------------------------------------------------------------------------------
usage() {
@ -50,11 +50,11 @@ USAGE
case "$1" in
source)
shift
$WM_PROJECT_DIR/bin/templates/source/foamNewSource $*
$WM_PROJECT_DIR/etc/codeTemplates/source/foamNewSource $*
;;
template)
shift
$WM_PROJECT_DIR/bin/templates/sourceTemplate/foamNewTemplate $*
$WM_PROJECT_DIR/etc/codeTemplates/template/foamNewTemplate $*
;;
*)
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
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,8 +2,9 @@
# $0 string1 string2 file1 .. filen
#
if [ $# -lt 3 ]; then
echo "Usage: `basename $0` [-f] <string1> <string2> <file1> .. <filen>"
if [ $# -lt 3 ]
then
echo "Usage: ${0##*/} [-f] <string1> <string2> <file1> .. <filen>"
echo ""
echo "Replaces all occurrences of string1 by string2 in files."
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"
#fi
done
# ----------------------------------------------------------------- end-of-file

View File

@ -1,8 +1,9 @@
#!/usr/xpg4/bin/sh
# Replace all shell script headers with
if [ $# -ne 1 -o ! -d "$1" ]; then
echo "Usage: `basename $0` <dir>"
if [ $# -ne 1 -o ! -d "$1" ]
then
echo "Usage: ${0##*/} <dir>"
echo ""
echo "Replaces all occurrences of #!/bin/sh with #!/usr/xpg4/bin/sh inside a directory tree."
exit 1
@ -13,3 +14,4 @@ fi
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
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License

View File

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

View File

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

View File

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

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# File
# aliases.csh
#
# 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 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
# ~~~~~~~~~~~~~~~~~~~~~~~~
alias src 'cd $FOAM_SRC'

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# File
# aliases.sh
#
# 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 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
# ~~~~~~~~~~~~~~~~~~~~~~~~
alias src='cd $FOAM_SRC'

View File

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

View File

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

View File

@ -22,22 +22,26 @@
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# File
# paraview3/bashrc
#
# Description
# Setup file for paraview-3.x
# Sourced from OpenFOAM-*/etc/bashrc
# Sourced from OpenFOAM-*/etc/bashrc or from foamPV alias
#
# 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
unset CMAKE_HOME
for cmake in cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6
do
cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
if [ -r $cmake ]
then
export CMAKE_HOME=$cmake
@ -48,31 +52,45 @@ done
# 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_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
ParaView_PYTHON_DIR=$ParaView_DIR/Utilities/VTKPythonWrapping
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
paraviewInstDir=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
if [ -r $ParaView_DIR ]
# set paths if binaries or source are present
if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
then
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
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,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# File
# paraview3/cshrc
#
# Description
# Setup file for paraview-3.x
# Sourced from OpenFOAM-*/etc/cshrc
# Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias
#
# 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
unsetenv CMAKE_HOME
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
setenv CMAKE_HOME $cmake
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
# set VERSION and MAJOR (version) variables if not already set
# the major version is "<digits>.<digits>"
if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.6.1
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR 3.6
if ( ! $?ParaView_VERSION || "x$ParaView_VERSION" == "x" ) setenv ParaView_VERSION 3.6.1
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
# if needed, set MAJOR version to correspond to VERSION
# 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
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if ( -r $paraviewPython ) then
if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
else
setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
endif
endif
default:
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
breaksw
endsw
if ( -r $ParaView_INST_DIR ) then
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
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
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
else
setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
endif
endif
else
unsetenv PV_PLUGIN_PATH
endif
unset cmake paraviewPython
unset cleaned cmake paraviewInstDir paraviewPython
# -----------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# File
# etc/bashrc
#
# Description
@ -36,13 +36,13 @@ export WM_PROJECT=OpenFOAM
[ -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
# $foamInstall below to where OpenFOAM is installed
#
# Location of FOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$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_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
# ~~~~~~~~~~~~~~~~~~~~~~~~~
# 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
export WM_COMPILER_ARCH=
export WM_COMPILER_LIB_ARCH=
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
# Compilation options (architecture, precision, optimised, debug or profiling)
@ -205,39 +220,28 @@ esac
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
#- Clean PATH
cleanEnv=`$cleanProg "$PATH" "$foamOldDirs"` && PATH="$cleanEnv"
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
#- 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
cleanEnv=`$cleanProg "$MANPATH" "$foamCleanDirs"` && MANPATH="$cleanEnv"
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
export PATH LD_LIBRARY_PATH MANPATH
# 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/aliases.sh
# 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/ensight/bashrc
@ -245,27 +249,27 @@ _foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc
# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#- Clean PATH
cleanEnv=`$cleanProg "$PATH"` && PATH="$cleanEnv"
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"
#- Clean LD_LIBRARY_PATH
cleanEnv=`$cleanProg "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleanEnv"
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"
#- Clean MANPATH
cleanEnv=`$cleanProg "$MANPATH"` && MANPATH="$cleanEnv:"
#- Clean MANPATH (trailing ':' to find system pages)
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"
export PATH LD_LIBRARY_PATH MANPATH
#- Clean LD_PRELOAD
if [ "$LD_PRELOAD" != "" ]
if [ -n "$LD_PRELOAD" ]
then
cleanEnv=`$cleanProg "$LD_PRELOAD"` && LD_PRELOAD="$cleanEnv"
cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
export LD_PRELOAD
fi
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleanEnv cleanProg foamInstall foamOldDirs
unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource
# -----------------------------------------------------------------------------

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