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

This commit is contained in:
andy
2011-01-04 10:52:58 +00:00
250 changed files with 1868 additions and 1106 deletions

View File

@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR" || {
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
# wmake is required for subsequent targets
( cd wmake/src && make )

View File

@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
set -x
wmake all utilities

View File

@ -34,8 +34,8 @@ namespace XiGModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(PDRDragModel, 0);
defineRunTimeSelectionTable(PDRDragModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,8 +34,8 @@ namespace PDRDragModels
{
defineTypeNameAndDebug(basic, 0);
addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,8 +34,8 @@ namespace XiEqModels
{
defineTypeNameAndDebug(SCOPEBlend, 0);
addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(XiEqModel, 0);
defineRunTimeSelectionTable(XiEqModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(XiGModel, 0);
defineRunTimeSelectionTable(XiGModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,8 +34,8 @@ namespace XiGModels
{
defineTypeNameAndDebug(instabilityG, 0);
addToRunTimeSelectionTable(XiGModel, instabilityG, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(XiModel, 0);
defineRunTimeSelectionTable(XiModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,8 +34,8 @@ namespace XiModels
{
defineTypeNameAndDebug(fixed, 0);
addToRunTimeSelectionTable(XiModel, fixed, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -39,8 +39,8 @@ namespace combustionModels
infinitelyFastChemistry,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -39,8 +39,8 @@ namespace combustionModels
noCombustion,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -217,7 +217,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
namespace Foam
{
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchScalarField,
smoluchowskiJumpTFvPatchScalarField

View File

@ -198,7 +198,7 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchVectorField,
maxwellSlipUFvPatchVectorField

View File

@ -112,7 +112,7 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchScalarField,
fixedRhoFvPatchScalarField

View File

@ -203,7 +203,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
namespace Foam
{
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchScalarField,
solidWallHeatFluxTemperatureFvPatchScalarField

View File

@ -121,7 +121,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
namespace Foam
{
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchScalarField,
adjointOutletPressureFvPatchScalarField

View File

@ -119,7 +119,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
namespace Foam
{
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchVectorField,
adjointOutletVelocityFvPatchVectorField

View File

@ -133,7 +133,7 @@ void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchScalarField,
alphaContactAngleFvPatchScalarField

View File

@ -207,7 +207,7 @@ void tractionDisplacementFvPatchVectorField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchVectorField,
tractionDisplacementFvPatchVectorField

View File

@ -194,7 +194,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeNonTemplatedPatchTypeField
makePatchTypeField
(
fvPatchVectorField,
tractionDisplacementCorrectionFvPatchVectorField

View File

@ -9,7 +9,7 @@ set -x
$WM_THIRD_PARTY_DIR/AllwmakeLibccmio
# if the library built properly, the headers should exist too
if [ -e $FOAM_LIBBIN/libccmio.so ]
if [ -e $FOAM_EXT_LIBBIN/libccmio.so ]
then
wmake ccm26ToFoam
fi

View File

@ -1,10 +1,12 @@
LIBCCMIO_DIR = $(WM_THIRD_PARTY_DIR)/libccmio-2.6.1
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I${WM_THIRD_PARTY_DIR}/libccmio-2.6.1 \
-I${WM_THIRD_PARTY_DIR}/libccmio-2.6.1/lnInclude
-I$(LIBCCMIO_DIR) \
-I$(LIBCCMIO_DIR)/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lccmio
-L$(FOAM_EXT_LIBBIN) -lccmio

View File

@ -53,6 +53,7 @@ Description
#include "fvMeshDistribute.H"
#include "mapDistributePolyMesh.H"
#include "IOobjectList.H"
#include "globalIndex.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -107,7 +108,9 @@ autoPtr<fvMesh> createMesh
fvMesh& mesh = meshPtr();
// Determine patches.
// Sync patches
// ~~~~~~~~~~~~
if (Pstream::master())
{
// Send patches
@ -118,14 +121,14 @@ autoPtr<fvMesh> createMesh
slave++
)
{
OPstream toSlave(Pstream::blocking, slave);
OPstream toSlave(Pstream::scheduled, slave);
toSlave << mesh.boundaryMesh();
}
}
else
{
// Receive patches
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
PtrList<entry> patchEntries(fromMaster);
if (haveMesh)
@ -224,6 +227,58 @@ autoPtr<fvMesh> createMesh
}
}
// Determine zones
// ~~~~~~~~~~~~~~~
wordList pointZoneNames(mesh.pointZones().names());
Pstream::scatter(pointZoneNames);
wordList faceZoneNames(mesh.faceZones().names());
Pstream::scatter(faceZoneNames);
wordList cellZoneNames(mesh.cellZones().names());
Pstream::scatter(cellZoneNames);
if (!haveMesh)
{
// Add the zones
List<pointZone*> pz(pointZoneNames.size());
forAll(pointZoneNames, i)
{
pz[i] = new pointZone
(
pointZoneNames[i],
labelList(0),
i,
mesh.pointZones()
);
}
List<faceZone*> fz(faceZoneNames.size());
forAll(faceZoneNames, i)
{
fz[i] = new faceZone
(
faceZoneNames[i],
labelList(0),
boolList(0),
i,
mesh.faceZones()
);
}
List<cellZone*> cz(cellZoneNames.size());
forAll(cellZoneNames, i)
{
cz[i] = new cellZone
(
cellZoneNames[i],
labelList(0),
i,
mesh.cellZones()
);
}
mesh.addZones(pz, fz, cz);
}
if (!haveMesh)
{
// We created a dummy mesh file above. Delete it.
@ -236,6 +291,21 @@ autoPtr<fvMesh> createMesh
mesh.clearOut();
mesh.globalData();
// Do some checks.
// Check if the boundary definition is unique
mesh.boundaryMesh().checkDefinition(true);
// Check if the boundary processor patches are correct
mesh.boundaryMesh().checkParallelSync(true);
// Check names of zones are equal
mesh.cellZones().checkDefinition(true);
mesh.cellZones().checkParallelSync(true);
mesh.faceZones().checkDefinition(true);
mesh.faceZones().checkParallelSync(true);
mesh.pointZones().checkDefinition(true);
mesh.pointZones().checkParallelSync(true);
return meshPtr;
}
@ -292,6 +362,59 @@ void printMeshData(Ostream& os, const polyMesh& mesh)
<< " face zones: " << mesh.faceZones().size() << nl
<< " cell zones: " << mesh.cellZones().size() << nl;
}
void printMeshData(const polyMesh& mesh)
{
// Collect all data on master
globalIndex globalCells(mesh.nCells());
labelListList patchNeiProcNo(Pstream::nProcs());
labelListList patchSize(Pstream::nProcs());
const labelList& pPatches = mesh.globalData().processorPatches();
patchNeiProcNo[Pstream::myProcNo()].setSize(pPatches.size());
patchSize[Pstream::myProcNo()].setSize(pPatches.size());
forAll(pPatches, i)
{
const processorPolyPatch& ppp = refCast<const processorPolyPatch>
(
mesh.boundaryMesh()[pPatches[i]]
);
patchNeiProcNo[Pstream::myProcNo()][i] = ppp.neighbProcNo();
patchSize[Pstream::myProcNo()][i] = ppp.size();
}
Pstream::gatherList(patchNeiProcNo);
Pstream::gatherList(patchSize);
// Print stats
globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces());
for (label procI = 0; procI < Pstream::nProcs(); procI++)
{
Info<< endl
<< "Processor " << procI << nl
<< " Number of cells = " << globalCells.localSize(procI)
<< endl;
label nProcFaces = 0;
const labelList& nei = patchNeiProcNo[procI];
forAll(patchNeiProcNo[procI], i)
{
Info<< " Number of faces shared with processor "
<< patchNeiProcNo[procI][i] << " = " << patchSize[procI][i]
<< endl;
nProcFaces += patchSize[procI][i];
}
Info<< " Number of processor patches = " << nei.size() << nl
<< " Number of processor faces = " << nProcFaces << nl
<< " Number of boundary faces = "
<< globalBoundaryFaces.localSize(procI) << endl;
}
}
// Debugging: write volScalarField with decomposition for post processing.
@ -507,6 +630,7 @@ void compareFields
int main(int argc, char *argv[])
{
# include "addRegionOption.H"
# include "addOverwriteOption.H"
argList::addOption
(
"mergeTol",
@ -539,6 +663,8 @@ int main(int argc, char *argv[])
}
Info<< "Using mesh subdirectory " << meshSubDir << nl << endl;
const bool overwrite = args.optionFound("overwrite");
// Get time instance directory. Since not all processors have meshes
// just use the master one everywhere.
@ -573,9 +699,11 @@ int main(int argc, char *argv[])
);
fvMesh& mesh = meshPtr();
Pout<< "Read mesh:" << endl;
printMeshData(Pout, mesh);
Pout<< endl;
//Pout<< "Read mesh:" << endl;
//printMeshData(Pout, mesh);
//Pout<< endl;
IOdictionary decompositionDict
(
@ -618,7 +746,10 @@ int main(int argc, char *argv[])
}
// Dump decomposition to volScalarField
writeDecomposition("decomposition", mesh, finalDecomp);
if (!overwrite)
{
writeDecomposition("decomposition", mesh, finalDecomp);
}
// Create 0 sized mesh to do all the generation of zero sized
@ -796,12 +927,20 @@ int main(int argc, char *argv[])
// Print a bit
Pout<< "After distribution mesh:" << endl;
printMeshData(Pout, mesh);
Pout<< endl;
// Print some statistics
Info<< "After distribution:" << endl;
printMeshData(mesh);
runTime++;
Pout<< "Writing redistributed mesh to " << runTime.timeName() << nl << endl;
if (!overwrite)
{
runTime++;
}
else
{
mesh.setInstance(masterInstDir);
}
Info<< "Writing redistributed mesh to " << runTime.timeName() << nl << endl;
mesh.write();

View File

@ -6,8 +6,8 @@ EXE_INC = \
EXE_LIBS = \
-ltecio \
-llagrangian \
-lfiniteVolume \
-lgenericPatchFields \
-lmeshTools
-lmeshTools \
-L$(FOAM_EXT_LIBBIN) -ltecio

View File

@ -13,6 +13,9 @@ then
exit 1
fi
# ensure CMake gets the correct C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
wmake libso vtkPV3Readers
PV3blockMeshReader/Allwmake
PV3FoamReader/Allwmake

View File

@ -14,6 +14,7 @@ INCLUDE(${PARAVIEW_USE_FILE})
LINK_DIRECTORIES(
$ENV{FOAM_LIBBIN}
$ENV{FOAM_EXT_LIBBIN}
)
INCLUDE_DIRECTORIES(

View File

@ -9,4 +9,4 @@ vtkPV3FoamMeshZone.C
vtkPV3FoamUpdateInfo.C
vtkPV3FoamUtils.C
LIB = $(FOAM_LIBBIN)/libvtkPV3Foam
LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Foam

View File

@ -1,6 +1,6 @@
/* Note: enable vtkPolyhedron when available */
PARAVIEW_INC=$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
PARAVIEW_INC = $(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
@ -15,9 +15,9 @@ EXE_INC = \
)
LIB_LIBS = \
-lvtkPV3Readers \
-lmeshTools \
-lfiniteVolume \
-lgenericPatchFields \
-llagrangian \
-L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \
$(GLIBS)

View File

@ -14,6 +14,7 @@ INCLUDE(${PARAVIEW_USE_FILE})
LINK_DIRECTORIES(
$ENV{FOAM_LIBBIN}
$ENV{FOAM_EXT_LIBBIN}
)
INCLUDE_DIRECTORIES(
@ -36,7 +37,8 @@ SET(
#
# Define combined plugin
#
# Try to extend the auto-generated panel
# Extend the auto-generated panel
QT4_WRAP_CPP(MOC_SRCS pqPV3blockMeshReaderPanel.h)
ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS

View File

@ -2,4 +2,4 @@ vtkPV3blockMesh.C
vtkPV3blockMeshConvert.C
vtkPV3blockMeshUtils.C
LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh
LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3blockMesh

View File

@ -1,12 +1,14 @@
PARAVIEW_INC = $(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR) \
-I$(PARAVIEW_INC) \
-I../../vtkPV3Readers/lnInclude \
-I../PV3blockMeshReader
LIB_LIBS = \
-lvtkPV3Readers \
-lmeshTools \
-lblockMesh \
-L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \
$(GLIBS)

View File

@ -1,3 +1,3 @@
vtkPV3Readers.C
LIB = $(FOAM_LIBBIN)/libvtkPV3Readers
LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Readers

View File

@ -1,5 +1,7 @@
PARAVIEW_INC = $(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
EXE_INC = \
-I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
-I$(PARAVIEW_INC)
LIB_LIBS = \
$(GLIBS)

View File

@ -392,13 +392,17 @@ int main(int argc, char *argv[])
problemFaces.append(faceI);
}
}
OFstream str("badFaces");
Info<< "Dumping bad quality faces to " << str.name() << endl
<< "Paste this into the input for surfaceSubset" << nl
<< nl << endl;
if (!problemFaces.empty())
{
OFstream str("badFaces");
str << problemFaces;
Info<< "Dumping bad quality faces to " << str.name() << endl
<< "Paste this into the input for surfaceSubset" << nl
<< nl << endl;
str << problemFaces;
}
}
}

View File

@ -1,60 +0,0 @@
#!/bin/sh
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# foamBinDirs <packDir> <arch>
#
# Description
# Returns all directories containing binary files of OpenFOAM
#
#------------------------------------------------------------------------------
if [ $# -ne 2 ]
then
echo "Error: architecture type expected, exiting"
echo
echo "Usage : ${0##*/} <packDir> <arch>"
echo
exit 1
fi
packDir=$1
arch=$2
# base arch (w/o precision, optimization, etc)
baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
# get list of directories
(
for dir in \
$packDir/lib/$arch \
$packDir/applications/bin/$arch \
$packDir/wmake/rules \
$packDir/wmake/bin/$baseArch \
;
do
[ -d $dir ] && echo $dir
done
)
#------------------------------------------------------------------------------

View File

@ -1,9 +1,9 @@
#!/bin/sh
#---------------------------------*- sh -*-------------------------------------
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -23,47 +23,102 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPack [outputDir]
# foamPack [OPTION]
#
# Description
# Packs and compresses the OpenFOAM directory for release
# Pack and compress the OpenFOAM directory for release
#
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
packFile=${packDir}_${timeStamp}.gtgz
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION]
options:
-o <dir> specify alternative output directory
-nogit bypass using 'git archive'
* Pack and compress OpenFOAM directory for release
USAGE
exit 1
fi
}
# add optional output directory
if [ -d "$1" ]
then
packFile="$1/$packFile"
fi
unset prefix outputDir nogit
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-nogit)
nogit=true
shift
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
shift 2
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
exit 1
fi
# check for essential directories
for dir in $packDir
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
# Create time stamp file
# ~~~~~~~~~~~~~~~~~~~~~~
echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# Pack and compress the packFile
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo
echo "Packing $packDir source files into $packFile"
echo
foamPackSource $packDir $packFile
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packExt=tgz
packBase=${packDir}_${timeStamp}
# add optional output directory
[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
packFile=$packBase.$packExt
# avoid overwriting old pack file
if [ -f $packFile ]
then
echo "Error: $packFile already exists" 1>&2
exit 1
fi
# add time-stamp file before packing
echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# check for git (program and .git directory)
(cd $packDir && git branch) > /dev/null 2>&1 || nogit=true
if [ "$nogit" = true ]
then
echo "pack manually" 1>&2
$toolsDir/foamPackSource $packDir $packFile
else
echo "pack with git-archive" 1>&2
( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar
echo "add in time-stamp and lnInclude directories" 1>&2
tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build `find -H $packDir -type d -name lnInclude`
tar Af $packBase.tar $packBase.tar2
echo "gzip tar file" 1>&2
gzip -c9 $packBase.tar > $packFile
rm -f $packBase.tar $packBase.tar2 2>/dev/null
fi
#------------------------------------------------------------------------------

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) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -23,66 +23,119 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPackBin <arch> [outputDir]
# foamPackBin [OPTION] <archOptions>
#
# Description
# Packs and compresses binary version of OpenFOAM for release
# Pack and compress binary version of OpenFOAM for release
#
# Script
# foamPackThirdPartyBin [OPTION] <archOptions>
#
# Description
# Pack and compress binary version of OpenFOAM ThirdParty for release
#
#------------------------------------------------------------------------------
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
if [ $# -eq 0 ]
then
echo "Error: architecture type expected, exiting"
echo
echo "Usage : ${0##*/} <arch> [outputDir]"
echo
case "${0##*/}" in
*ThirdParty*)
# for ThirdParty
codeBase="OpenFOAM ThirdParty"
packDir=ThirdParty-$WM_PROJECT_VERSION
listBinDirs=$toolsDir/foamListThirdPartyBinDirs
;;
*)
# regular
codeBase="OpenFOAM ThirdParty"
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
listBinDirs=$toolsDir/foamListBinDirs
;;
esac
usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION] <archOptions>
options:
-o <dir> specify alternative output directory
* Pack and compress binary version of $codeBase for release
The value of 'archOptions' normally corresponds to \$WM_OPTIONS
The current value of \$WM_OPTIONS = $WM_OPTIONS
USAGE
exit 1
fi
arch=$1
}
# base arch (w/o precision, optimization, etc)
baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
timeStamp=$(date +%Y-%m-%d)
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
packFile=${packDir}.${arch}_${timeStamp}.gtgz
# add optional output directory
if [ -d "$2" ]
then
packFile="$2/$packFile"
fi
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
exit 1
fi
# check for essential directories
for dir in $packDir $packDir/lib/$arch $packDir/applications/bin/$arch
unset prefix outputDir
# parse options
while [ "$#" -gt 0 ]
do
if [ ! -d $dir ]
then
echo "Error: directory $dir does not exist"
exit 1
fi
case "$1" in
-h | -help)
usage
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
shift 2
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
[ $# -eq 1 ] || usage "Error: specify architecture"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$1"
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packExt=tgz
packBase=${packDir}.${archOptions}_${timeStamp}
# add optional output directory
[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
packFile=$packBase.$packExt
# avoid overwriting old pack file
if [ -f $packFile ]
then
echo "Error: $packFile already exists" 1>&2
exit 1
fi
#------------------------------------------------------------------------------
# get list of directories
dirList=`foamBinDirs $packDir $arch`
dirList=$( $listBinDirs $packDir $archOptions )
if [ $? -eq 0 -a -n "$dirList" ]
then
echo "Pack into $packFile" 1>&2
echo 1>&2
else
exit 1
fi
echo
echo "Packing $arch ($baseArch) port of $packDir into $packFile"
echo
tar czpf $packFile $dirList
# Clean up on Ctrl-C
trap 'rm -f $packFile 2>/dev/null' INT
tar cpzf $packFile $dirList
if [ $? -eq 0 ]
then
echo "Finished packing and compressing file $packFile"
echo "Finished packing file $packFile" 1>&2
else
echo "Error: failure packing $packFile"
echo "Error: failure packing $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi

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) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -23,24 +23,44 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPackBinAll [outputDir]
# foamPackBinAll [OPTION]
#
# Description
# Packs and compresses all binary versions of foam for release
# Pack and compress all binary versions of OpenFOAM for release
#
# Script
# foamPackThirdPartyBinAll [OPTION]
#
# Description
# Pack and compress all binary versions of OpenFOAM ThirdParty for release
#
#------------------------------------------------------------------------------
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
binDir="${0%/*}" # this script is located in the bin/ dir
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
case "${0##*/}" in
*ThirdParty*)
# for ThirdParty
packDir=ThirdParty-$WM_PROJECT_VERSION
packBin=foamPackThirdPartyBin
;;
*)
# regular
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
packBin=foamPackBin
;;
esac
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
fi
}
# obtain arch types from lib/
for bin in $packDir/lib/*
# obtain archOptions types from lib/
for archOptions in $packDir/lib/*
do
foamPackBin ${bin##*/} $@
$binDir/$packBin $@ ${archOptions##*/}
done
#------------------------------------------------------------------------------

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-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -26,39 +26,44 @@
# foamPackDoxygen [-prefix DIR] [-o outputDir]
#
# Description
# Packs and compresses the OpenFOAM doxygen html for release
# Pack and compress the OpenFOAM doxygen html for release
#
#------------------------------------------------------------------------------
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
packTag=_Doxygen.gtgz
htmlDir=doc/Doxygen/html
usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
cat <<USAGE 1>&2
Usage: ${0##*/} [-prefix DIR] [-o outputDir]
Usage: ${0##*/} [OPTION]
options:
-prefix <dir> use alternative prefix
-o <dir> specify alternative output directory
Packs and compresses the OpenFOAM doxygen html for release
* Pack and compress the OpenFOAM doxygen html for release
USAGE
exit 1
}
unset prefix outputDir
# parse options
while [ "$#" -gt 0 ]
do
case $1 in
-prefix | --prefix )
-h | -help)
usage
;;
-prefix | --prefix)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
prefix=${2%%/}
shift 2
;;
-o | -output )
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
shift 2
;;
-h | -help )
usage
;;
-*)
usage "unknown option: '$*'"
;;
@ -81,41 +86,44 @@ then
exit 1
fi
#
#------------------------------------------------------------------------------
packExt=tgz
packName=${packDir}_Doxygen
# add optional output directory
#
if [ -d "$outputDir" ]
then
packFile="$outputDir/$packDir$packTag"
else
packFile="$packDir$packTag"
fi
[ -d "$outputDir" ] && packName="$outputDir/$packName"
packFile=$packName.$packExt
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
echo "Error: $packFile already exists" 1>&2
exit 1
fi
# Pack and compress the packFile using GNU tar
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo
echo "Packing doxygen html into $packFile"
echo
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing doxygen html into $packFile
INFO
# Clean up on Ctrl-C
trap 'rm -f $packFile 2>/dev/null' INT
if [ -n "$prefix" ]
then
tar czpf $packFile --transform="s@^@$prefix/@" doc/Doxygen/html
# requires GNU tar
tar cpzf $packFile --transform="s@^@$prefix/@" $htmlDir
else
tar czpf $packFile $packDir/doc/Doxygen/html
tar cpzf $packFile $packDir/$htmlDir
fi
if [ $? -eq 0 ]
then
echo "Finished packing doxygen html into file $packFile"
echo "Finished packing doxygen html into file $packFile" 1>&2
else
echo "Error: failure packing doxygen html file $packFile"
echo "Error: failure packing doxygen html file $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi
#------------------------------------------------------------------------------

View File

@ -1,9 +1,9 @@
#!/bin/sh
#---------------------------------*- sh -*-------------------------------------
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -23,48 +23,86 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPackThirdParty [outputDir]
# foamPackThirdParty [OPTION]
#
# Description
# Packs and compresses the OpenFOAM ThirdParty directory for release
# Pack and compress the OpenFOAM ThirdParty directory for release
#
#------------------------------------------------------------------------------
packDir=ThirdParty-$WM_PROJECT_VERSION
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
timeStamp=$(date +%Y-%m-%d)
packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
packDir=${packDir##*/}
packFile=${packDir}_${timeStamp}.gtgz
usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION]
options:
-o <dir> specify alternative output directory
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
* Pack and compress ThirdParty directory for release
USAGE
exit 1
fi
}
unset prefix outputDir nogit
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-nogit)
nogit=true
shift
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
shift 2
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# check for essential directories
for dir in $packDir
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packExt=tgz
packBase=${packDir}_${timeStamp}
# add optional output directory
if [ -d "$1" ]
then
packFile="$1/$packFile"
fi
[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
packFile=$packBase.$packExt
# avoid overwriting old pack file
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
exit 1
fi
# Create time stamp file
# ~~~~~~~~~~~~~~~~~~~~~~
echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# Pack and compress the packFile
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo
echo "Packing $packDir source files into $packFile"
echo
foamPackSource $packDir $packFile
#------------------------------------------------------------------------------
# add time-stamp file before packing
echo $timeStamp 2>/dev/null > $packDir/.timeStamp
echo "pack manually" 1>&2
$toolsDir/foamPackSource $packDir $packFile
#------------------------------------------------------------------------------

View File

@ -1,88 +0,0 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPackThirdPartyBin <archOptions> [outputDir]
#
# Description
# Packs and compresses binary version of OpenFOAM ThirdParty for release
#
#------------------------------------------------------------------------------
if [ $# -eq 0 ]
then
echo "Error: archOptions type expected, exiting"
echo
echo "Usage : ${0##*/} <archOptions> [outputDir]"
echo
exit 1
fi
archOptions=$1
arch=${archOptions%%G*} # TODO: works for Gcc only
arch3264=$(echo "$arch" | sed -e 's@64@-64@')
echo "archOptions=$archOptions"
echo "arch=$arch"
echo "arch3264=$arch3264"
timeStamp=$(date +%Y-%m-%d)
packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
packDir=${packDir##*/}
packFile=${packDir}.${archOptions}_${timeStamp}.gtgz
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
exit 1
fi
# add optional output directory
if [ -d "$2" ]
then
packFile="$2/$packFile"
fi
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
exit 1
fi
# get list of directories
dirList=`find $packDir -type d -name $arch -o -type d -name $archOptions'*' -o -type l -name $arch3264`
echo
echo "Packing $archOptions port of $packDir into $packFile"
echo
tar czpf $packFile $dirList
if [ $? -eq 0 ]
then
echo "Finished packing and compressing file $packFile"
else
echo "Error: failure packing $packFile"
rm -f $packFile 2>/dev/null
fi
#------------------------------------------------------------------------------

1
bin/foamPackThirdPartyBin Symbolic link
View File

@ -0,0 +1 @@
foamPackBin

View File

@ -0,0 +1 @@
foamPackBinAll

View File

@ -1,81 +0,0 @@
#!/bin/sh
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# foamSourceFiles <directory>
#
# Description
# Returns all the .C and .H files and Make/options
# and Make/files in a given directory.
#
#------------------------------------------------------------------------------
if [ $# -ne 1 ]
then
echo "Usage : ${0##*/} directory"
echo ""
echo "Returns all .C and .H files and Make/options and Make/files."
echo ""
exit 1
fi
# canonical form (no double and no trailing dashes)
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
exit 1
fi
find -H $packDir \
! -type d \
\( -type f -o -type l \) \
! -name "*~" \
-a ! -name ".*~" \
-a ! -name "*.orig" \
-a ! -name "*.dep" \
-a ! -name "*.o" \
-a ! -name "*.so" \
-a ! -name "*.a" \
-a ! -name "*.tgz" \
-a ! -name "core" \
-a ! -name "core.[1-9]*" \
-a ! -name "libccmio*" \
| sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \
-e '\@/\.gitignore@d' \
-e '\@/\.tags/@d' \
-e '\@/\README\.org@d' \
-e '\@applications/bin/@d' \
-e '\@wmake/bin/@d' \
-e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d'\
-e '\@/platforms/@d' \
-e '\@/download/@d' \
-e '\@/libccmio-.*/@d' \
-e '\@/debian/@d'
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -25,7 +25,7 @@
# CleanFunctions
#
# Description
#
# Miscellaneous cleanup functions for tutorial cases
#------------------------------------------------------------------------------
#cleanTimeDirectories()
@ -46,15 +46,12 @@
cleanTimeDirectories()
{
echo "Cleaning $PWD case"
nZeros=0
zeros=""
while [ $nZeros -lt 8 ]
while [ ${#zeros} -lt 8 ]
do
timeDir="0.${zeros}[1-9]*"
rm -rf ${timeDir} > /dev/null 2>&1
rm -rf ./-${timeDir} > /dev/null 2>&1
zeros=`printf %0${nZeros}d 0`
nZeros=$(($nZeros + 1))
rm -rf ./${timeDir} ./-${timeDir} > /dev/null 2>&1
zeros="0$zeros"
done
rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM > /dev/null 2>&1
}

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -25,23 +25,23 @@
# RunFunctions
#
# Description
#
# Miscellaneous functions for running tutorial cases
#------------------------------------------------------------------------------
getApplication()
{
grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
sed -ne 's/^ *application *\([a-zA-Z]*\) *;.*$/\1/p' system/controlDict
}
runApplication()
{
APP_RUN=$1
APP_NAME=${1##*/}
shift
APP_NAME=${APP_RUN##*/}
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 re-run"
else
echo "Running $APP_RUN on $PWD"
$APP_RUN $* > log.$APP_NAME 2>&1
@ -51,16 +51,17 @@ runApplication()
runParallel()
{
APP_RUN=$1
APP_NAME=${1##*/}
shift
if [ -f $log.$APP_RUN ]
if [ -f log.$APP_NAME ]
then
echo "$APP_RUN already run on $PWD: remove log file to run"
echo "$APP_NAME already run on $PWD: remove log file to re-run"
else
nProcs=$1
shift
echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"
( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_RUN 2>&1 )
( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
fi
}

View File

@ -50,15 +50,30 @@ USAGE
# inlineSed <file> <sedCommand> <description>
_inlineSed()
{
backup=`tempfile`
[ -f "$1" ] || {
echo "Missing file: $1"
exit 1
}
backup="temp.$$"
cp $1 $backup
sed -i -e "$2" $1
cmp --quiet $1 $backup && usage "Failed : $3"
if cmp $1 $backup > /dev/null 2>&1
then
echo "Failed: $3 in $1"
rm $backup 2>/dev/null
exit 1
else
echo "Okay: $3 in $1"
rm $backup 2>/dev/null
fi
return 0
}
[ -f etc/bashrc -a -f etc/settings.sh ] || usage "Please run from top-level directory of installation"
[ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
unset foamInstall projectName archOption paraviewInstall
@ -66,43 +81,47 @@ unset foamInstall projectName archOption paraviewInstall
while [ "$#" -gt 0 ]
do
case "$1" in
-h | --help)
-h | -help | --help)
usage
;;
--foamInstall)
-foamInstall | --foamInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
foamInstall="$2"
# replace foamInstall=...
_inlineSed \
etc/bashrc \
'/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
"Replacing foamInstall setting by $foamInstall"
"Replacing foamInstall setting by '$foamInstall'"
shift 2
;;
--projectName)
-projectName | --projectName)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
projectName="$2"
# replace WM_PROJECT_DIR=...
_inlineSed \
etc/bashrc \
'/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
"Replacing WM_PROJECT_DIR setting by $projectName"
"Replacing WM_PROJECT_DIR setting by '$projectName'"
shift 2
;;
--archOption)
-archOption | --archOption)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
archOption="$2"
# replace WM_ARCH_OPTION=...
_inlineSed \
etc/bashrc \
'/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \
"Replacing WM_ARCH_OPTION setting by $archOption"
'/^[^#]/s@WM_ARCH_OPTION=.*@WM_ARCH_OPTION='"$archOption@" \
"Replacing WM_ARCH_OPTION setting by '$archOption'"
shift 2
;;
--paraviewInstall)
-paraviewInstall | --paraviewInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewInstall="$2"
# replace ParaView_DIR=...
_inlineSed \
etc/apps/paraview3/bashrc \
'/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \
"Replacing ParaView_DIR setting by $paraviewInstall"
"Replacing ParaView_DIR setting by '$paraviewInstall'"
shift 2
;;
*)
@ -113,18 +132,19 @@ done
[ -n "$foamInstall" -o -n "$projectName" -o -n "$archOption" -o -n "$paraviewInstall" ] || usage "Please specify at least one configure option"
#echo "Replacing WM_PROJECT setting by $projectName"
#echo "Replacing WM_PROJECT setting by '$projectName'"
#sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
# Replace the WM_MPLIB always
# Set WM_MPLIB=SYSTEMOPENMPI always
_inlineSed \
etc/bashrc \
'/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' \
"Replacing WM_MPLIB setting by SYSTEMOPENMPI"
# Replace the compilerInstall always
'/^[^#]/s@export WM_MPLIB=.*@export WM_MPLIB=SYSTEMOPENMPI@' \
"Replacing WM_MPLIB setting by 'SYSTEMOPENMPI'"
# set foamCompiler=system always
_inlineSed \
etc/settings.sh \
'/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' \
"Replacing compilerInstall setting by system"
etc/bashrc \
'/^[^#]/s@foamCompiler=.*@foamCompiler=system@' \
"Replacing foamCompiler setting by 'system'"
#------------------------------------------------------------------------------

121
bin/tools/foamListBinDirs Executable file
View File

@ -0,0 +1,121 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2011 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# foamListBinDirs <directory> <archOptions>
#
# Description
# Lists directories containing binary files of OpenFOAM
#
# Note
# Not normally called directly by the user.
#------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 2 ] || {
cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> <archOptions>
* Lists directories containing binary files for OpenFOAM
The value of 'archOptions' normally corresponds to \$WM_OPTIONS
The current value of \$WM_OPTIONS = $WM_OPTIONS
USAGE
exit 1
}
#------------------------------------------------------------------------------
packDir="$1"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$2"
# base arch (w/o precision, optimization, etc)
# same as "$WM_ARCH$WM_COMPILER"
archCompiler=$(echo "$archOptions" | sed -e 's@[DS]P.*$@@')
# same as $WM_ARCH - eg, 'linux64'
# TODO: only works for Gcc, Icc, Clang
archOS=$(echo "$archOptions" | sed -e 's@[GI]cc.*$@@' -e 's@Clang.*$@@')
# links for 32-bit version, eg convert linux64 -> linux-64
arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------
# check for essential directories
for dir in $packDir $packDir/lib/$archOptions
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
# check new/old places for executables - same as $FOAM_APPBIN
[ -d $packDir/bin/$archOptions -o -d $packDir/applications/bin/$archOptions ] || {
cat <<BIN_CHECK 1>&2
Error: no directory for executables exists:
$packDir/bin/$archOptions
$packDir/applications/bin/$archOptions
BIN_CHECK
exit 1
}
#------------------------------------------------------------------------------
# list of directories
dirList=$(
for dir in \
$packDir/bin/$archOptions \
$packDir/lib/$archOptions \
$packDir/applications/bin/$archOptions \
$packDir/wmake/bin/$archCompiler \
$packDir/wmake/bin/$archOS \
$packDir/wmake/rules/General \
$packDir/wmake/rules/$archCompiler \
$packDir/wmake/rules/$archOS \
;
do
[ -d $dir ] && echo $dir
done
)
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing $archOptions ($archCompiler) port of $packDir
archOS = $archOS
32bit archOS = $arch3264
dirs:
$(echo ${dirList:-NONE})
INFO
echo "$dirList"
#------------------------------------------------------------------------------

93
bin/tools/foamListSourceFiles Executable file
View File

@ -0,0 +1,93 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2011 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# foamListSourceFiles <directory>
#
# Description
# Lists source files and Make/{files,options} in given directory
#
# Note
# Not normally called directly by the user.
#------------------------------------------------------------------------------
[ $# -eq 1 ] || {
cat <<USAGE 1>&2
Usage : ${0##*/} directory
* Lists source files and Make/{files,options} in given directory
USAGE
exit 1
}
# canonical form (no double and no trailing dashes)
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
# check for essential directories
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
#
# list of files but excluding
# - dependent files (dep, obj, lib), archives
# - exclude Doxygen documentation etc
#
find -H $packDir \
! -type d \
\( -type f -o -type l \) \
! -name "*~" \
-a ! -name ".*~" \
-a ! -name "*.orig" \
-a ! -name "*.dep" \
-a ! -name "*.o" \
-a ! -name "*.so" \
-a ! -name "*.a" \
-a ! -name "*.tar" \
-a ! -name "*.tar.gz" \
-a ! -name "*.tgz" \
-a ! -name "core" \
-a ! -name "core.[1-9]*" \
-a ! -name "libccmio*" \
| sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \
-e '\@/\.tags/@d' \
-e '\@/README\.org@d' \
-e '\@/bin/[^/]*/@{ \@/bin/tools/@!d }' \
-e '\@/lib/@d' \
-e '\@/platforms/@d' \
-e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \
-e '\@/[Dd]oxygen/html/@d' \
-e '\@/download/@d' \
-e '\@/libccmio-.*/@d' \
-e '\@/debian/@d'
#------------------------------------------------------------------------------

View File

@ -0,0 +1,121 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2011 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# foamListThirdPartyBinDirs <directory> <archOptions>
#
# Description
# Lists directories containing binary files for OpenFOAM ThirdParty
#
# Note
# Not normally called directly by the user.
#------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 2 ] || {
cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> <archOptions>
* List directories containing binary files for OpenFOAM ThirdParty
The value of 'archOptions' normally corresponds to \$WM_OPTIONS
The current value of \$WM_OPTIONS = $WM_OPTIONS
USAGE
exit 1
}
#------------------------------------------------------------------------------
packDir="$1"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$2"
# base arch (w/o precision, optimization, etc)
# same as "$WM_ARCH$WM_COMPILER"
archCompiler=$(echo "$archOptions" | sed -e 's@[DS]P.*$@@')
# same as $WM_ARCH - eg, 'linux64'
# TODO: only works for Gcc, Icc, Clang
archOS=$(echo "$archOptions" | sed -e 's@[GI]cc.*$@@' -e 's@Clang.*$@@')
# links for 32-bit version, eg convert linux64 -> linux-64
arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------
# check for essential directories
for dir in $packDir $packDir/lib/$archOptions
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
#------------------------------------------------------------------------------
# list of directories
dirList=$(
for dir in \
$packDir/bin/$archOptions \
$packDir/bin/$archCompiler \
$packDir/bin/$archOS \
$packDir/lib/$archOptions \
$packDir/lib/$archCompiler \
$packDir/lib/$archOS \
$packDir/platforms/$archOptions \
$packDir/platforms/$archCompiler \
$packDir/platforms/$archOS \
;
do
[ -d $dir ] && echo $dir
done
# add in links for 32-bit version
if [ "$archOS" != "$arch3264" ]
then
for dir in \
$packDir/platforms/$arch3264 \
;
do
[ -d $dir -a -L $dir ] && echo $dir
done
fi
)
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing $archOptions ($archCompiler) port of $packDir
archOS = $archOS
32bit archOS = $arch3264
dirs:
$(echo ${dirList:-NONE})
INFO
echo "$dirList"
#------------------------------------------------------------------------------

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) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -26,54 +26,67 @@
# foamPackSource <directory> <tarFile>
#
# Description
# Packs and compresses the .C and .H files and Make/options
# and Make/files in a given directory.
# Pack and compress all source files from a given directory.
#
# Note
# Not normally called directly by the user
#------------------------------------------------------------------------------
tmpFile=${TMPDIR:-/tmp}/foamPackFiles.$$
toolsDir="${0%/*}" # this script is already located in the tools/ directory
if [ $# -ne 2 ]
then
echo "Usage : ${0##*/} directory tarFile"
echo ""
echo "Packs all .C and .H files and Make/options and Make/files into"
echo "<tarFile>"
echo ""
[ $# -eq 2 ] || {
cat <<USAGE 1>&2
Usage : ${0##*/} directory tarFile
* Pack and compress all source files from a given directory into <tarFile>
USAGE
exit 1
fi
}
# canonical form (no double and no trailing dashes)
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
packFile=$2
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
# check for essential directories
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
fi
}
# avoid overwriting old pack file
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
echo "Error: $packFile already exists" 1>&2
exit 1
fi
# Clean up on termination and on Ctrl-C
trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
foamSourceFiles $packDir > $tmpFile
# get all names
$toolsDir/foamListSourceFiles $packDir > $tmpFile
# provide some feedback
wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}'
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing $packDir source files into $packFile
tar czpf $packFile --files-from $tmpFile
INFO
wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}' 1>&2
# Clean up on Ctrl-C
trap 'rm -f $packFile $tmpFile 2>/dev/null' INT
tar cpzf $packFile --files-from $tmpFile
if [ $? -eq 0 ]
then
echo "Finished packing and compressing $packDir into file $packFile"
echo "Finished packing $packDir into file $packFile" 1>&2
else
echo "Error: failure packing $packDir into file $packFile"
echo "Error: failure packing $packDir into file $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi

View File

@ -11,7 +11,8 @@ div.navigation
}
div.tabs
div.tabs,
div.tabs2
{
width : 100%;
padding-top : 5px;
@ -20,7 +21,8 @@ div.tabs
border-bottom: 1px solid rgb(175,175,175);
}
div.tabs ul
div.tabs ul,
div.tabs2 ul
{
margin: 0px;
padding-left: 10px;
@ -30,26 +32,30 @@ div.tabs ul
}
div.tabs li, div.tabs form
div.tabs li, div.tabs form,
div.tabs2 li, div.tabs2 form
{
display : inline;
margin : 0px;
padding : 0px;
}
div.tabs ul li
div.tabs ul li,
div.tabs2 ul li
{
padding-top: 10px;
padding-bottom: 10px;
height: 100%;
}
div.tabs form
div.tabs form,
div.tabs2 form
{
padding : 0px 9px;
}
div.tabs a
div.tabs a,
div.tabs2 a
{
font-size : 12px;
font-weight : normal;
@ -58,7 +64,8 @@ div.tabs a
}
/* not needed - no image */
div.tabs a:hover
div.tabs a:hover,
div.tabs2 a:hover
{
background-position: 100% -150px;
}
@ -66,13 +73,18 @@ div.tabs a:hover
div.tabs a:link,
div.tabs a:visited,
div.tabs a:active,
div.tabs a:hover
div.tabs a:hover,
div.tabs2 a:link,
div.tabs2 a:visited,
div.tabs2 a:active,
div.tabs2 a:hover
{
color : #000000;
color:#555;
}
div.tabs span
div.tabs span,
div.tabs2 span
{
display : inline;
padding : 0px 9px;
@ -80,7 +92,8 @@ div.tabs span
}
/* client-side search */
div.tabs #MSearchBox
div.tabs #MSearchBox,
div.tabs2 #MSearchBox
{
float : right;
background : white;
@ -88,7 +101,8 @@ div.tabs #MSearchBox
font-size : 1em;
}
div.tabs #MSearchSelect
div.tabs #MSearchSelect,
div.tabs2 #MSearchSelect
{
float : left;
display : inline;
@ -96,14 +110,16 @@ div.tabs #MSearchSelect
}
/* old name? */
div.tabs input
div.tabs input,
div.tabs2 input
{
float : right;
display : inline;
font-size : 1em;
}
div.tabs td
div.tabs td,
div.tabs2 td
{
font-size : 80%;
font-weight : bold;
@ -120,14 +136,16 @@ div.tabs a:hover span
background-position: 0% -150px;
}
div.tabs li.current a
div.tabs li.current a,
div.tabs2 li.current a
{
border-width : 0px;
border-right: 1px solid rgb(175,175,175);
color : #555;
}
div.tabs li.current span
div.tabs li.current span,
div.tabs2 li.current span
{
padding-bottom: 0px;
white-space: nowrap;

View File

@ -26,7 +26,7 @@
#
# Description
# Setup file for paraview-3.x
# Sourced from OpenFOAM-*/etc/bashrc or from foamPV alias
# Sourced from OpenFOAM-<VERSION>/etc/bashrc or from foamPV alias
#
# Note
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
@ -38,7 +38,7 @@ cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platform
# determine the cmake to be used
unset CMAKE_HOME
for cmake in cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4
for cmake in cmake-2.8.3 cmake-2.8.1
do
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
if [ -r $cmake ]
@ -51,8 +51,14 @@ done
# set VERSION and MAJOR (version) variables
ParaView_VERSION=3.8.0
ParaView_MAJOR=unknown
if [ -z "$ParaView_VERSION" ]
then
ParaView_VERSION=3.8.0
ParaView_MAJOR=unknown
echo "Warning in app/paraview3/bashrc:" 1>&2
echo " ParaView_VERSION not set, using '$ParaView_VERSION'" 1>&2
fi
[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown
# if needed, set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
@ -76,7 +82,7 @@ if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
then
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_MAJOR:$LD_LIBRARY_PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
export PV_PLUGIN_PATH=$FOAM_EXT_LIBBIN/paraview-$ParaView_MAJOR
# add in python libraries if required
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping

View File

@ -26,7 +26,7 @@
#
# Description
# Setup file for paraview-3.x
# Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
#
# Note
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
@ -39,7 +39,7 @@ if ( $status == 0 ) setenv PATH $cleaned
# determine the cmake to be used
unsetenv CMAKE_HOME
foreach cmake ( cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
foreach cmake ( cmake-2.8.3 cmake-2.8.1 )
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
if ( -r $cmake ) then
setenv CMAKE_HOME $cmake
@ -49,8 +49,14 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
end
# set VERSION and MAJOR (version) variables
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
if ( ! $?ParaView_VERSION )
then
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
echo "Warning in app/paraview3/cshrc:"
echo " ParaView_VERSION not set, using '$ParaView_VERSION'"
fi
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
# if needed, set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
@ -74,7 +80,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}:${LD_LIBRARY_PATH}"
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
setenv PV_PLUGIN_PATH $FOAM_EXT_LIBBIN/paraview-${ParaView_MAJOR}
# add in python libraries if required
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -33,7 +33,13 @@
# during the wmake process
#------------------------------------------------------------------------------
export SCOTCH_VERSION=scotch_5.1.10b
export SCOTCH_VERSION=scotch_5.1.11
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION
# mpi-qualified include directory
export SCOTCH_MPI_INCLUDE=$SCOTCH_ARCH_PATH/include/${FOAM_MPI_LIBBIN##*/}
# mpi-qualified lib directory
export SCOTCH_MPI_LIBBIN=$SCOTCH_ARCH_PATH/lib/${FOAM_MPI_LIBBIN##*/}
# -----------------------------------------------------------------------------

View File

@ -35,24 +35,73 @@ export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=dev
################################################################################
# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
# USER EDITABLE PART: 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
# 'foamInstall' below to where OpenFOAM is installed
#
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################
# note the location for later use (eg, in job scripts)
#
# These are the defaults for this version which should generally be
# overridden from the prefs.sh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
#- ParaView version, automatically determine major version:
export ParaView_VERSION=3.8.0
export ParaView_MAJOR=unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system
#- Compiler:
# WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc)
export WM_COMPILER=Gcc
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
#- Architecture:
# WM_ARCH_OPTION = 32 | 64
export WM_ARCH_OPTION=64
#- Precision:
# WM_PRECISION_OPTION = DP | SP
export WM_PRECISION_OPTION=DP
#- Optimised, debug, profiling:
# WM_COMPILE_OPTION = Opt | Debug | Prof
export WM_COMPILE_OPTION=Opt
#- MPI implementation:
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
# | GAMMA | MPI | QSMPI
export WM_MPLIB=OPENMPI
#- Operating System:
# WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX
#- Floating-point signal handling:
# set or unset
export FOAM_SIGFPE=
#- memory initialisation:
# set or unset
#export FOAM_SETNAN=
################################################################################
# The old dirs to be cleaned from the various environment variables
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
@ -90,6 +139,7 @@ _foamSource()
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify prefs files
export FOAM_SETTINGS="$@"
while [ $# -gt 0 ]
do
@ -116,41 +166,6 @@ do
done
# Operating System/Platform
# ~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_OSTYPE = POSIX | ????
: ${WM_OSTYPE:=POSIX}; export WM_OSTYPE
# Compiler: set to Gcc, Gcc43, Gcc44, or Icc (for Intel's icc)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: ${WM_COMPILER:=Gcc}; export WM_COMPILER
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_ARCH_OPTION = 32 | 64
: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION
# WM_PRECISION_OPTION = DP | SP
: ${WM_PRECISION_OPTION:=DP}; export WM_PRECISION_OPTION
# WM_COMPILE_OPTION = Opt | Debug | Prof
: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA
# | MPI | QSMPI
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
# Run options (floating-point signal handling and memory initialisation)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export FOAM_SIGFPE=
# export FOAM_SETNAN=
# Detect system type and set environment variables appropriately
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_ARCH=`uname -s`
@ -165,7 +180,7 @@ Linux)
;;
x86_64)
case $WM_ARCH_OPTION in
case "$WM_ARCH_OPTION" in
32)
export WM_COMPILER_ARCH='-64'
export WM_CC='gcc'
@ -196,13 +211,13 @@ Linux)
mips64)
WM_ARCH=SiCortex64
WM_MPLIB=MPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
export WM_MPLIB=MPI
;;
ppc64)
@ -223,13 +238,13 @@ Linux)
SunOS)
WM_ARCH=SunOS64
WM_MPLIB=FJMPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
export WM_MPLIB=FJMPI
;;
*) # an unsupported operating system

View File

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

100
etc/cshrc
View File

@ -34,24 +34,74 @@ setenv WM_PROJECT OpenFOAM
setenv WM_PROJECT_VERSION dev
################################################################################
# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# either setenv FOAM_INST_DIR before sourcing this file or set
# foamInstall below to where OpenFOAM is installed
# either setenv FOAM_INST_DIR before sourcing this file or set
# 'foamInstall' below to where OpenFOAM is installed
#
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set foamInstall = $HOME/$WM_PROJECT
# set foamInstall = ~$WM_PROJECT
# set foamInstall = /usr/local/$WM_PROJECT
# set foamInstall = /opt/$WM_PROJECT
# set foamInstall = /usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################
# note the location for later use (eg, in job scripts)
#
# These are the defaults for this version which should generally be
# overridden from the prefs.csh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
#- ParaView version, automatically determine major version:
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
set foamCompiler=system
#- Compiler:
# WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc)
setenv WM_COMPILER Gcc
setenv WM_COMPILER_ARCH # defined but empty
setenv WM_COMPILER_LIB_ARCH # defined but empty
#
#- Architecture:
# WM_ARCH_OPTION = 32 | 64
setenv WM_ARCH_OPTION 64
#- Precision:
# WM_PRECISION_OPTION = DP | SP
setenv WM_PRECISION_OPTION DP
#- Optimised, debug, profiling:
# WM_COMPILE_OPTION = Opt | Debug | Prof
setenv WM_COMPILE_OPTION Opt
#- MPI implementation:
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
# | GAMMA | MPI | QSMPI
setenv WM_MPLIB OPENMPI
#- Operating System:
# WM_OSTYPE = POSIX | ???
setenv WM_OSTYPE POSIX
#- Floating-point signal handling:
# set or unset
setenv FOAM_SIGFPE
#- memory initialisation:
# set or unset
#setenv FOAM_SETNAN
################################################################################
# The old dirs to be cleaned from the various environment variables
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
@ -75,6 +125,7 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!*
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify prefs files
setenv FOAM_SETTINGS "${*}"
while ( $#argv > 0 )
switch ($argv[1])
@ -99,41 +150,6 @@ while ( $#argv > 0 )
end
# Operating System/Platform
# ~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_OSTYPE = POSIX | ????
if ( ! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX
# Compiler: set to Gcc, Gcc43, Gcc44 or Icc (for Intel's icc)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?WM_COMPILER ) setenv WM_COMPILER Gcc
setenv WM_COMPILER_ARCH
setenv WM_COMPILER_LIB_ARCH
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_ARCH_OPTION = 32 | 64
if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
# WM_PRECISION_OPTION = DP | SP
if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
# WM_COMPILE_OPTION = Opt | Debug | Prof
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
# Run options (floating-point signal handling and memory initialisation)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv FOAM_SIGFPE
# setenv FOAM_SETNAN
# Detect system type and set environment variables
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_ARCH `uname -s`
@ -181,13 +197,13 @@ case Linux:
case mips64:
setenv WM_ARCH SiCortex64
setenv WM_MPLIB MPI
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
setenv WM_MPLIB MPI
breaksw
case ppc64:
@ -209,13 +225,13 @@ case Linux:
case SunOS:
setenv WM_ARCH SunOS64
setenv WM_MPLIB FJMPI
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
setenv WM_MPLIB FJMPI
breaksw
default:

View File

@ -38,7 +38,7 @@
## Specify system compiler
## ~~~~~~~~~~~~~~~~~~~~~~~
#set compilerInstall=system
#set foamCompiler=system
## Specify system openmpi
## ~~~~~~~~~~~~~~~~~~~~~~

View File

@ -38,7 +38,7 @@
# Specify system compiler
# ~~~~~~~~~~~~~~~~~~~~~~~
compilerInstall=system
foamCompiler=system
# Specify system openmpi
# ~~~~~~~~~~~~~~~~~~~~~~

View File

@ -26,7 +26,7 @@
#
# Description
# Startup file for OpenFOAM
# Sourced from OpenFOAM-??/etc/cshrc
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
#
#------------------------------------------------------------------------------
@ -47,33 +47,39 @@ setenv WM_DIR $WM_PROJECT_DIR/wmake
setenv WM_LINK_LANGUAGE c++
setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
# base configuration
setenv FOAM_APP $WM_PROJECT_DIR/applications
setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
setenv FOAM_LIB $WM_PROJECT_DIR/lib
# base executables/libraries
setenv FOAM_APPBIN $WM_PROJECT_DIR/bin/$WM_OPTIONS
setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
setenv FOAM_SRC $WM_PROJECT_DIR/src
# shared site configuration - similar naming convention as ~OpenFOAM expansion
# external (ThirdParty) libraries
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
# user configuration
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
# user executables/libraries
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
# convenience
setenv FOAM_APP $WM_PROJECT_DIR/applications
setenv FOAM_LIB $WM_PROJECT_DIR/lib
setenv FOAM_SRC $WM_PROJECT_DIR/src
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
setenv FOAM_UTILITIES $FOAM_APP/utilities
setenv FOAM_SOLVERS $FOAM_APP/solvers
setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
# add OpenFOAM scripts and wmake to the path
setenv PATH ${WM_DIR}:${WM_PROJECT_DIR}/bin:${PATH}
# add wmake to the path - not required for runtime only environment
if ( -d "${WM_DIR}" ) setenv PATH ${WM_DIR}:${PATH}
# add OpenFOAM scripts to the path
setenv PATH ${WM_PROJECT_DIR}/bin:${PATH}
_foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
# Make sure to pick up dummy versions of external libraries last
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy
# Make sure to pick up dummy versions of external libraries last
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_LIBBIN}:${FOAM_LIBBIN}/dummy
# Compiler settings
# ~~~~~~~~~~~~~~~~~
@ -81,13 +87,18 @@ unset gcc_version gmp_version mpfr_version mpc_version
unsetenv MPFR_ARCH_PATH
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | system
if ( ! $?compilerInstall ) set compilerInstall=system
# Location of compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?foamCompiler ) then
then
foamCompiler=system
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " foamCompiler not set, using '$foamCompiler'"
fi
switch ("$compilerInstall")
switch ("$foamCompiler")
case OpenFOAM:
case ThirdParty:
switch ("$WM_COMPILER")
case Gcc:
case Gcc++0x:
@ -143,7 +154,7 @@ case OpenFOAM:
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " Cannot find $gccDir installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo " change the 'foamCompiler' setting to 'system'"
echo
endif
@ -181,7 +192,7 @@ case OpenFOAM:
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " Cannot find $clangDir installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo " change the 'foamCompiler' setting to 'system'"
echo
endif
@ -191,6 +202,15 @@ case OpenFOAM:
unset clang_version clangDir
breaksw
case system:
# okay, use system compiler
breaksw
default:
echo "Warn: foamCompiler='$foamCompiler' is unsupported"
echo " treating as 'system' instead"
breaksw
endsw
@ -248,7 +268,7 @@ case OPENMPI:
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/man
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
breaksw
@ -270,7 +290,7 @@ case SYSTEMOPENMPI:
_foamAddLib $libDir
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version libDir
breaksw
@ -283,7 +303,7 @@ case MPICH:
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/share/man
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
breaksw
@ -296,7 +316,7 @@ case MPICH-GM:
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddLib $GM_LIB_PATH
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpich-gm
breaksw
case HPMPI:
@ -320,22 +340,22 @@ case HPMPI:
breaksw
endsw
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/hpmpi
breaksw
case GAMMA:
setenv MPI_ARCH_PATH /usr
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/gamma
breaksw
case MPI:
setenv MPI_ARCH_PATH /opt/mpi
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi
breaksw
case FJMPI:
setenv MPI_ARCH_PATH /opt/FJSVmpi2
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
_foamAddLib /opt/FSUNf90/lib/sparcv9
@ -374,14 +394,14 @@ endif
# Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if ( -f $FOAM_LIBBIN/libhoard.so ) then
# setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
#if ( -f $FOAM_EXT_LIBBIN/libhoard.so ) then
# setenv LD_PRELOAD $FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD
#endif
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unalias _foamAddPath _foamAddLib _foamAddMan
unset compilerInstall minBufferSize
unset foamCompiler minBufferSize
# ----------------------------------------------------------------- end-of-file

View File

@ -26,7 +26,7 @@
#
# Description
# Startup file for OpenFOAM
# Sourced from OpenFOAM-??/etc/bashrc
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
#
#------------------------------------------------------------------------------
@ -70,46 +70,56 @@ export WM_DIR=$WM_PROJECT_DIR/wmake
export WM_LINK_LANGUAGE=c++
export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
# base configuration
export FOAM_APP=$WM_PROJECT_DIR/applications
export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
export FOAM_LIB=$WM_PROJECT_DIR/lib
# base executables/libraries
export FOAM_APPBIN=$WM_PROJECT_DIR/bin/$WM_OPTIONS
export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
export FOAM_SRC=$WM_PROJECT_DIR/src
# shared site configuration - similar naming convention as ~OpenFOAM expansion
# external (ThirdParty) libraries
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
# user configuration
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
# user executables/libraries
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
# convenience
export FOAM_APP=$WM_PROJECT_DIR/applications
export FOAM_LIB=$WM_PROJECT_DIR/lib
export FOAM_SRC=$WM_PROJECT_DIR/src
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
export FOAM_UTILITIES=$FOAM_APP/utilities
export FOAM_SOLVERS=$FOAM_APP/solvers
export FOAM_RUN=$WM_PROJECT_USER_DIR/run
# add OpenFOAM scripts and wmake to the path
export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH
# add wmake to the path - not required for runtime only environment
[ -d "$WM_DIR" ] && PATH=$WM_DIR:$PATH
# add OpenFOAM scripts to the path
export PATH=$WM_PROJECT_DIR/bin:$PATH
_foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
# Make sure to pick up dummy versions of external libraries last
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_LIBBIN/dummy
# Make sure to pick up dummy versions of external libraries last
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$FOAM_LIBBIN/dummy
# Compiler settings
# ~~~~~~~~~~~~~~~~~
unset gcc_version gmp_version mpfr_version mpc_version
unset MPFR_ARCH_PATH
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | system
: ${compilerInstall:=system}
# Location of compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if [ -z "$foamCompiler" ]
then
foamCompiler=system
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" 1>&2
echo " foamCompiler not set, using '$foamCompiler'" 1>&2
fi
case "${compilerInstall:-OpenFOAM}" in
OpenFOAM)
case "${foamCompiler}" in
OpenFOAM | ThirdParty)
case "$WM_COMPILER" in
Gcc | Gcc++0x)
gcc_version=gcc-4.4.3
@ -161,7 +171,7 @@ OpenFOAM)
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
echo " Cannot find $gccDir installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo " change the 'foamCompiler' setting to 'system'"
echo
}
@ -202,7 +212,7 @@ OpenFOAM)
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
echo " Cannot find $clangDir installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo " change the 'foamCompiler' setting to 'system'"
echo
}
@ -211,6 +221,13 @@ OpenFOAM)
fi
unset clang_version clangDir
;;
system)
# okay, use system compiler
;;
*)
echo "Warn: foamCompiler='$foamCompiler' is unsupported" 1>&2
echo " treating as 'system' instead" 1>&2
;;
esac
@ -271,7 +288,7 @@ OPENMPI)
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/man
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
;;
@ -294,7 +311,7 @@ SYSTEMOPENMPI)
_foamAddLib $libDir
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version libDir
;;
@ -307,7 +324,7 @@ MPICH)
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/share/man
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
;;
@ -320,7 +337,7 @@ MPICH-GM)
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddLib $GM_LIB_PATH
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpich-gm
;;
HPMPI)
@ -345,22 +362,22 @@ HPMPI)
;;
esac
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/hpmpi
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/hpmpi
;;
GAMMA)
export MPI_ARCH_PATH=/usr
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/gamma
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/gamma
;;
MPI)
export MPI_ARCH_PATH=/opt/mpi
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi
;;
FJMPI)
export MPI_ARCH_PATH=/opt/FJSVmpi2
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
@ -370,7 +387,7 @@ FJMPI)
QSMPI)
export MPI_ARCH_PATH=/usr/lib/mpi
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/qsmpi
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/qsmpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
@ -398,14 +415,14 @@ export MPI_BUFFER_SIZE
# Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if [ -f $FOAM_LIBBIN/libhoard.so ]
#if [ -f $FOAM_EXT_LIBBIN/libhoard.so ]
#then
# export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
# export LD_PRELOAD=$FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD
#fi
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset _foamAddPath _foamAddLib _foamAddMan compilerInstall minBufferSize
unset _foamAddPath _foamAddLib _foamAddMan foamCompiler minBufferSize
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
set -x
# update OpenFOAM version strings if required

View File

@ -50,7 +50,7 @@ const scalar
KRR4::c1X = 1.0/2.0, KRR4::c2X = -3.0/2.0, KRR4::c3X = 121.0/50.0,
KRR4::c4X = 29.0/250.0,
KRR4::a2X = 1.0, KRR4::a3X = 3.0/5.0;
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,7 +31,7 @@ defineTypeNameAndDebug(Foam::ODESolver, 0);
namespace Foam
{
defineRunTimeSelectionTable(ODESolver, ODE);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -49,7 +49,7 @@ const scalar
RK::dc1 = RK::c1 - 2825.0/27648.0, RK::dc3 = RK::c3 - 18575.0/48384.0,
RK::dc4 = RK::c4 - 13525.0/55296.0, RK::dc5 = -277.00/14336.0,
RK::dc6 = RK::c6 - 0.25;
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -42,7 +42,7 @@ namespace Foam
SIBS::redMax = 1.0e-5,
SIBS::redMin = 0.7,
SIBS::scaleMX = 0.1;
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -111,16 +111,16 @@ bool Foam::setEnv
Foam::word Foam::hostName(bool full)
{
char buf[256];
gethostname(buf, 256);
char buf[128];
gethostname(buf, sizeof(buf));
// implementation as per hostname from net-tools
if (full)
{
struct hostent *hptr = gethostbyname(buf);
if (hptr)
struct hostent *hp = gethostbyname(buf);
if (hp)
{
return hptr->h_name;
return hp->h_name;
}
}
@ -128,6 +128,27 @@ Foam::word Foam::hostName(bool full)
}
Foam::word Foam::domainName()
{
char buf[128];
gethostname(buf, sizeof(buf));
// implementation as per hostname from net-tools
struct hostent *hp = gethostbyname(buf);
if (hp)
{
char *p = strchr(hp->h_name, '.');
if (p)
{
++p;
return p;
}
}
return word::null;
}
Foam::word Foam::userName()
{
struct passwd* pw = getpwuid(getuid());
@ -201,8 +222,8 @@ Foam::fileName Foam::home(const word& userName)
Foam::fileName Foam::cwd()
{
char buf[255];
if (getcwd(buf, 255))
char buf[256];
if (getcwd(buf, sizeof(buf)))
{
return buf;
}
@ -957,8 +978,6 @@ bool Foam::ping
const label timeOut
)
{
char *serverAddress;
struct in_addr *ptr;
struct hostent *hostPtr;
volatile int sockfd;
struct sockaddr_in destAddr; // will hold the destination addr
@ -968,15 +987,13 @@ bool Foam::ping
{
FatalErrorIn
(
"Foam::ping(const word&, const label)"
"Foam::ping(const word&, ...)"
) << "gethostbyname error " << h_errno << " for host " << destName
<< abort(FatalError);
}
// Get first of the SLL of addresses
serverAddress = *(hostPtr->h_addr_list);
ptr = reinterpret_cast<struct in_addr*>(serverAddress);
addr = ptr->s_addr;
addr = (reinterpret_cast<struct in_addr*>(*(hostPtr->h_addr_list)))->s_addr;
// Allocate socket
sockfd = socket(AF_INET, SOCK_STREAM, 0);
@ -990,7 +1007,7 @@ bool Foam::ping
}
// Fill sockaddr_in structure with dest address and port
memset (reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
memset(reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
destAddr.sin_family = AF_INET;
destAddr.sin_port = htons(ushort(destPort));
destAddr.sin_addr.s_addr = addr;

View File

@ -500,20 +500,7 @@ const pointPatchField<Type>& operator+
#endif
#define makePointPatchTypeFieldTypeName(type) \
defineNamedTemplateTypeNameAndDebug(type, 0);
#define makePointPatchFieldsTypeName(type) \
makePointPatchTypeFieldTypeName(type##PointPatchScalarField); \
makePointPatchTypeFieldTypeName(type##PointPatchVectorField); \
makePointPatchTypeFieldTypeName(type##PointPatchSphericalTensorField); \
makePointPatchTypeFieldTypeName(type##PointPatchSymmTensorField); \
makePointPatchTypeFieldTypeName(type##PointPatchTensorField);
#define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
\
addToRunTimeSelectionTable \
( \
PatchTypeField, \
@ -533,46 +520,58 @@ const pointPatchField<Type>& operator+
dictionary \
);
// for non-templated patch fields
#define makeNonTemplatedPointPatchTypeField(PatchTypeField,typePatchTypeField)\
#define makePointPatchTypeField(PatchTypeField,typePatchTypeField) \
defineTypeNameAndDebug(typePatchTypeField, 0); \
addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
// for templated patch fields
#define makePointPatchTypeField(PatchTypeField, typePatchTypeField) \
#define makeTemplatePointPatchTypeField(PatchTypeField, typePatchTypeField) \
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
#define makePointPatchFields(type) \
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatchScalarField, \
type##PointPatchScalarField \
); \
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatchVectorField, \
type##PointPatchVectorField \
); \
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatchSphericalTensorField, \
type##PointPatchSphericalTensorField \
); \
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatchSymmTensorField, \
type##PointPatchSymmTensorField \
); \
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatchTensorField, \
type##PointPatchTensorField \
);
#define makePointPatchFieldsTypeName(type) \
defineNamedTemplateTypeNameAndDebug(type##PointPatchScalarField, 0); \
defineNamedTemplateTypeNameAndDebug(type##PointPatchVectorField, 0); \
defineNamedTemplateTypeNameAndDebug \
( \
type##PointPatchSphericalTensorField, 0 \
); \
defineNamedTemplateTypeNameAndDebug(type##PointPatchSymmTensorField, 0); \
defineNamedTemplateTypeNameAndDebug(type##PointPatchTensorField, 0)
#define makePointPatchFieldTypedefs(type) \
typedef type##PointPatchField<scalar> type##PointPatchScalarField; \
typedef type##PointPatchField<vector> type##PointPatchVectorField; \

View File

@ -35,7 +35,7 @@ namespace Foam
{
typedef graph::writer graphWriter;
addToRunTimeSelectionTable(graphWriter, gnuplotGraph, word);
};
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -35,7 +35,7 @@ namespace Foam
{
typedef graph::writer graphWriter;
addToRunTimeSelectionTable(graphWriter, jplotGraph, word);
};
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -35,7 +35,7 @@ namespace Foam
{
typedef graph::writer graphWriter;
addToRunTimeSelectionTable(graphWriter, rawGraph, word);
};
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -35,7 +35,7 @@ namespace Foam
{
typedef graph::writer graphWriter;
addToRunTimeSelectionTable(graphWriter, xmgrGraph, word);
};
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -67,10 +67,13 @@ string getEnv(const word&);
//- Set an environment variable
bool setEnv(const word& name, const string& value, const bool overwrite);
//- Return the system's host name
// Optionally the full name reported from gethostbyname
//- Return the system's host name, as per hostname(1)
// Optionally with the full name (as per the '-f' option)
word hostName(const bool full=false);
//- Return the system's domain name, as per hostname(1) with the '-d' option
word domainName();
//- Return the user's login name
word userName();

View File

@ -34,7 +34,7 @@ Foam::globalIndex::globalIndex(const label localSize)
labelList localSizes(Pstream::nProcs());
localSizes[Pstream::myProcNo()] = localSize;
Pstream::gatherList(localSizes);
Pstream::scatterList(localSizes); // just to balance out comms
Pstream::scatterList(localSizes);
label offset = 0;
offsets_[0] = 0;

View File

@ -307,7 +307,7 @@ Foam::mapDistribute::mapDistribute
{
label globalIndex = elements[i];
if (!globalNumbering.isLocal(globalIndex))
if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
{
label procI = globalNumbering.whichProcID(globalIndex);
nNonLocal[procI]++;
@ -329,7 +329,7 @@ Foam::mapDistribute::mapDistribute
{
label globalIndex = elements[i];
if (!globalNumbering.isLocal(globalIndex))
if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
{
label procI = globalNumbering.whichProcID(globalIndex);
label index = globalNumbering.toLocal(procI, globalIndex);
@ -452,7 +452,7 @@ Foam::mapDistribute::mapDistribute
{
label globalIndex = cCells[i];
if (!globalNumbering.isLocal(globalIndex))
if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
{
label procI = globalNumbering.whichProcID(globalIndex);
nNonLocal[procI]++;
@ -482,7 +482,7 @@ Foam::mapDistribute::mapDistribute
{
label globalIndex = cCells[i];
if (!globalNumbering.isLocal(globalIndex))
if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
{
label procI = globalNumbering.whichProcID(globalIndex);
label index = globalNumbering.toLocal(procI, globalIndex);
@ -603,6 +603,10 @@ Foam::label Foam::mapDistribute::renumber
const label globalI
)
{
if (globalI == -1)
{
return globalI;
}
if (globalNumbering.isLocal(globalI))
{
return globalNumbering.toLocal(globalI);

View File

@ -123,7 +123,7 @@ public:
);
//- Construct from list of (possibly) remote elements in globalIndex
// numbering. Determines compact numbering (see above) and
// numbering (or -1). Determines compact numbering (see above) and
// distribute map to get data into this ordering and renumbers the
// elements to be in compact numbering.
mapDistribute
@ -133,7 +133,7 @@ public:
List<Map<label> >& compactMap
);
//- Special variant that works with the into sorted into bins
//- Special variant that works with the info sorted into bins
// according to local indices. E.g. think cellCells where
// cellCells[localCellI] is a list of global cells
mapDistribute

View File

@ -156,10 +156,7 @@ inline Point Foam::tetrahedron<Point, PointRef>::circumCentre() const
if (Foam::mag(denom) < ROOTVSMALL)
{
WarningIn("Point tetrahedron<Point, PointRef>::circumCentre() const")
<< "Degenerate tetrahedron:" << nl << *this << nl
<<"Returning centre instead of circumCentre."
<< endl;
// Degenerate tetrahedron, returning centre instead of circumCentre.
return centre();
}
@ -186,11 +183,7 @@ inline Foam::scalar Foam::tetrahedron<Point, PointRef>::circumRadius() const
if (Foam::mag(denom) < ROOTVSMALL)
{
WarningIn("Point tetrahedron<Point, PointRef>::circumCentre() const")
<< "Degenerate tetrahedron:" << nl << *this << nl
<< "Returning GREAT for circumRadius."
<< endl;
// Degenerate tetrahedron, returning GREAT for circumRadius.
return GREAT;
}
@ -272,16 +265,7 @@ Foam::scalar Foam::tetrahedron<Point, PointRef>::barycentric
if (Foam::mag(detT) < SMALL)
{
WarningIn
(
"List<scalar> tetrahedron<Point, PointRef>::barycentric"
"("
"const point& pt"
") const"
)
<< "Degenerate tetrahedron:" << nl << *this << nl
<< "Returning 1/4 barycentric coordinates."
<< endl;
// Degenerate tetrahedron, returning 1/4 barycentric coordinates.
bary = List<scalar>(4, 0.25);

View File

@ -121,10 +121,7 @@ inline Point Foam::triangle<Point, PointRef>::circumCentre() const
if (Foam::mag(c) < ROOTVSMALL)
{
WarningIn("Point triangle<Point, PointRef>::circumCentre() const")
<< "Degenerate triangle:" << nl << *this << nl
<< "Returning centre instead of circumCentre."
<< endl;
// Degenerate triangle, returning centre instead of circumCentre.
return centre();
}
@ -147,10 +144,7 @@ inline Foam::scalar Foam::triangle<Point, PointRef>::circumRadius() const
if (Foam::mag(denom) < VSMALL)
{
WarningIn("scalar triangle<Point, PointRef>::circumRadius() const")
<< "Degenerate triangle:" << nl << *this << nl
<< "Returning GREAT for circumRadius."
<< endl;
// Degenerate triangle, returning GREAT for circumRadius.
return GREAT;
}
@ -266,16 +260,7 @@ Foam::scalar Foam::triangle<Point, PointRef>::barycentric
if (Foam::mag(denom) < SMALL)
{
WarningIn
(
"List<scalar> triangle<Point, PointRef>::barycentric"
"("
"const point& pt"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "Returning 1/3 barycentric coordinates."
<< endl;
// Degenerate triangle, returning 1/3 barycentric coordinates.
bary = List<scalar>(3, 1.0/3.0);
@ -540,20 +525,7 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
{
if ((d1 - d3) < ROOTVSMALL)
{
WarningIn
(
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "d1, d3: " << d1 << ", " << d3 << endl;
// For d1 = d3, a_ and b_ are likely coincident.
// Degenerate triangle, for d1 = d3, a_ and b_ are likely coincident
nearType = POINT;
nearLabel = 0;
return pointHit(false, a_, Foam::mag(a_ - p), true);
@ -589,20 +561,7 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
{
if ((d2 - d6) < ROOTVSMALL)
{
WarningIn
(
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "d2, d6: " << d2 << ", " << d6 << endl;
// For d2 = d6, a_ and c_ are likely coincident.
// Degenerate triangle, for d2 = d6, a_ and c_ are likely coincident
nearType = POINT;
nearLabel = 0;
return pointHit(false, a_, Foam::mag(a_ - p), true);
@ -624,21 +583,8 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
{
if (((d4 - d3) + (d5 - d6)) < ROOTVSMALL)
{
WarningIn
(
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "(d4 - d3), (d6 - d5): " << (d4 - d3) << ", " << (d6 - d5)
<< endl;
// For (d4 - d3) = (d6 - d5), b_ and c_ are likely coincident.
// Degenerate triangle, for (d4 - d3) = (d6 - d5), b_ and c_ are
// likely coincident
nearType = POINT;
nearLabel = 1;
return pointHit(false, b_, Foam::mag(b_ - p), true);
@ -658,19 +604,8 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
if ((va + vb + vc) < ROOTVSMALL)
{
WarningIn
(
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "va, vb, vc: " << va << ", " << vb << ", " << vc
<< endl;
// Degenerate triangle, return the centre because no edge or points are
// closest
point nearPt = centre();
nearType = NONE,
nearLabel = -1;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -490,7 +490,7 @@ unsigned Foam::Hasher
const short endianTest = 0x0100;
// yields 0x01 for big endian
if (*(reinterpret_cast<const char *>(&endianTest)))
if (*(reinterpret_cast<const char*>(&endianTest)))
{
return jenkins_hashbig(key, length, initval);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 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-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 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-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ inline uint32_t Foam::SHA1::swapBytes(uint32_t n)
const short x = 0x0100;
// yields 0x01 for big endian
if (*(reinterpret_cast<const char *>(&x)))
if (*(reinterpret_cast<const char*>(&x)))
{
return n;
}
@ -459,10 +459,5 @@ Foam::SHA1Digest Foam::SHA1::digest() const
// }
// }
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -115,10 +115,10 @@ public:
//- Construct null
inline SHA1();
//- Construct and append initial std::string
//- Construct null and append initial std::string
explicit inline SHA1(const std::string&);
//- Construct and append initial string
//- Construct null and append initial string
explicit inline SHA1(const char*);
// Member Functions
@ -145,25 +145,44 @@ public:
// Member Operators
//- Equality operator
inline bool operator==(const SHA1Digest&) const;
//- Inequality operator
inline bool operator!=(const SHA1Digest&) const;
//- Equality operator
//- Equality operator, compares %digests
inline bool operator==(const SHA1&) const;
//- Inequality operator
//- Compare %digest
inline bool operator==(const SHA1Digest&) const;
//- Compare %digest to (40-byte) text representation (eg, from sha1sum)
// An %empty string is equivalent to
// "0000000000000000000000000000000000000000"
inline bool operator==(const std::string& hexdigits) const;
//- Compare %digest to (40-byte) text representation (eg, from sha1sum)
// A %null or %empty string is equivalent to
// "0000000000000000000000000000000000000000"
inline bool operator==(const char* hexdigits) const;
//- Inequality operator, compares %digests
inline bool operator!=(const SHA1&) const;
//- Convert to a digest, calculate current digest from appended data.
//- Inequality operator, compare %digest
inline bool operator!=(const SHA1Digest&) const;
//- Inequality operator, compares %digests
inline bool operator!=(const std::string& hexdigits) const;
//- Inequality operator, compare %digest
inline bool operator!=(const char* hexdigits) const;
//- Convert to a SHA1Digest,
// calculate current %digest from appended data
inline operator SHA1Digest() const;
// Friend Functions
// Friend Operators
//- Output the %digest
inline friend Ostream& operator<<(Ostream&, const SHA1&);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -105,7 +105,7 @@ bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const
bool Foam::SHA1Digest::operator!=(const SHA1Digest& rhs) const
{
return !operator==(rhs);
return !this->operator==(rhs);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,6 +38,8 @@ SourceFiles
#ifndef SHA1Digest_H
#define SHA1Digest_H
#include <string>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -75,12 +77,33 @@ public:
//- Reset the digest to zero
void clear();
//- Return true if the digest is empty (ie, all zero).
bool empty() const;
//- Equality operator
bool operator==(const SHA1Digest&) const;
//- Compare to (40-byte) text representation (eg, from sha1sum)
// An %empty string is equivalent to
// "0000000000000000000000000000000000000000"
bool operator==(const std::string& hexdigits) const;
//- Compare to (40-byte) text representation (eg, from sha1sum)
// A %null or %empty string is equivalent to
// "0000000000000000000000000000000000000000"
bool operator==(const char* hexdigits) const;
//- Inequality operator
bool operator!=(const SHA1Digest&) const;
//- Inequality operator
bool operator!=(const std::string& hexdigits) const;
//- Inequality operator
bool operator!=(const char* hexdigits) const;
friend Ostream& operator<<(Ostream&, const SHA1Digest&);
friend Istream& operator>>(Istream&, SHA1Digest&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,9 +48,6 @@ inline Foam::SHA1::SHA1(const char* str)
}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::SHA1& Foam::SHA1::append(const char* data, size_t len)
@ -79,55 +76,66 @@ inline Foam::SHA1& Foam::SHA1::append(const char* str)
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::SHA1::operator==(const SHA1& rhs) const
{
return this->digest() == rhs.digest();
}
inline bool Foam::SHA1::operator==(const SHA1Digest& rhs) const
{
return this->digest() == rhs;
}
inline bool Foam::SHA1::operator!=(const SHA1Digest& rhs) const
inline bool Foam::SHA1::operator==(const std::string& hexdigits) const
{
return this->digest() != rhs;
return this->digest() == hexdigits;
}
inline bool Foam::SHA1::operator==(const SHA1& rhs) const
inline bool Foam::SHA1::operator==(const char* hexdigits) const
{
return digest() == rhs.digest();
return this->digest() == hexdigits;
}
inline bool Foam::SHA1::operator!=(const SHA1& rhs) const
{
return digest() != rhs.digest();
return !this->operator==(rhs);
}
inline Foam::SHA1::operator
Foam::SHA1Digest () const
inline bool Foam::SHA1::operator!=(const SHA1Digest& rhs) const
{
return !this->operator==(rhs);
}
inline bool Foam::SHA1::operator!=(const std::string& rhs) const
{
return !this->operator==(rhs);
}
inline bool Foam::SHA1::operator!=(const char* rhs) const
{
return !this->operator==(rhs);
}
inline Foam::SHA1::operator Foam::SHA1Digest() const
{
return digest();
}
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
inline Foam::Ostream& Foam::operator<<(Ostream& os, const SHA1& sha)
{
return os << sha.digest();
return os << sha.digest();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -37,8 +37,8 @@ namespace solidBodyMotionFunctions
{
defineTypeNameAndDebug(SDA, 0);
addToRunTimeSelectionTable(solidBodyMotionFunction, SDA, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions
linearMotion,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

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