diff --git a/Allwmake b/Allwmake index 035b24811b..16edfd1f6f 100755 --- a/Allwmake +++ b/Allwmake @@ -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 ) diff --git a/applications/Allwmake b/applications/Allwmake index 9b8bf7d803..00bc326641 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -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 diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C index 58b39c2ec1..b21e73c3e1 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C @@ -34,8 +34,8 @@ namespace XiGModels { defineTypeNameAndDebug(basicSubGrid, 0); addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C index e75b6b0009..33e57393ab 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C @@ -31,7 +31,7 @@ namespace Foam { defineTypeNameAndDebug(PDRDragModel, 0); defineRunTimeSelectionTable(PDRDragModel, dictionary); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C index 533a10d656..021824b549 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C @@ -34,8 +34,8 @@ namespace PDRDragModels { defineTypeNameAndDebug(basic, 0); addToRunTimeSelectionTable(PDRDragModel, basic, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C index 2a1642257b..96abb4bcbe 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(SCOPEBlend, 0); addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C index 6d7a35867a..4d137ef76d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C @@ -31,7 +31,7 @@ namespace Foam { defineTypeNameAndDebug(XiEqModel, 0); defineRunTimeSelectionTable(XiEqModel, dictionary); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C index 92189df881..6d5b743a0d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C @@ -31,7 +31,7 @@ namespace Foam { defineTypeNameAndDebug(XiGModel, 0); defineRunTimeSelectionTable(XiGModel, dictionary); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C index 46182d1686..6b1386db59 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C @@ -34,8 +34,8 @@ namespace XiGModels { defineTypeNameAndDebug(instabilityG, 0); addToRunTimeSelectionTable(XiGModel, instabilityG, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C index 82f68ca6ba..8ee11fa08d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C @@ -31,7 +31,7 @@ namespace Foam { defineTypeNameAndDebug(XiModel, 0); defineRunTimeSelectionTable(XiModel, dictionary); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C b/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C index f689a6d3cb..d8568f933d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C @@ -34,8 +34,8 @@ namespace XiModels { defineTypeNameAndDebug(fixed, 0); addToRunTimeSelectionTable(XiModel, fixed, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C index cd708d8dc7..d55b91403a 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ b/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -39,8 +39,8 @@ namespace combustionModels infinitelyFastChemistry, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C b/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C index 9183844ba7..104f6940e3 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C +++ b/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C @@ -39,8 +39,8 @@ namespace combustionModels noCombustion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index 92f25ca30d..c9722f9dab 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -217,7 +217,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 85f2db8d4c..6f79dc2bac 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -198,7 +198,7 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPatchTypeField +makePatchTypeField ( fvPatchVectorField, maxwellSlipUFvPatchVectorField diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C index c3340f6932..b94f72caf9 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C @@ -112,7 +112,7 @@ void fixedRhoFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPatchTypeField +makePatchTypeField ( fvPatchScalarField, fixedRhoFvPatchScalarField diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C index 93caaf34fb..815bce3c80 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -203,7 +203,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, solidWallHeatFluxTemperatureFvPatchScalarField diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index 0d94768b23..5614578429 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C @@ -121,7 +121,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, adjointOutletPressureFvPatchScalarField diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index dbde31a88a..0f72c88e3e 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C @@ -119,7 +119,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, adjointOutletVelocityFvPatchVectorField diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 9be378e5c5..11c844f8d9 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -133,7 +133,7 @@ void alphaContactAngleFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPatchTypeField +makePatchTypeField ( fvPatchScalarField, alphaContactAngleFvPatchScalarField diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index 46a947ef0b..f3f0c0798e 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -207,7 +207,7 @@ void tractionDisplacementFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPatchTypeField +makePatchTypeField ( fvPatchVectorField, tractionDisplacementFvPatchVectorField diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index 0bf83bcca5..cbe9b31b35 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -194,7 +194,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPatchTypeField +makePatchTypeField ( fvPatchVectorField, tractionDisplacementCorrectionFvPatchVectorField diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index 2791c1121e..25800377a1 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -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 diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options index e87c735e37..e2cdbcd1c2 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options @@ -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 diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C index bc7d988358..fe7e858b9a 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C @@ -53,6 +53,7 @@ Description #include "fvMeshDistribute.H" #include "mapDistributePolyMesh.H" #include "IOobjectList.H" +#include "globalIndex.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -107,7 +108,9 @@ autoPtr createMesh fvMesh& mesh = meshPtr(); - // Determine patches. + // Sync patches + // ~~~~~~~~~~~~ + if (Pstream::master()) { // Send patches @@ -118,14 +121,14 @@ autoPtr 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 patchEntries(fromMaster); if (haveMesh) @@ -224,6 +227,58 @@ autoPtr 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 pz(pointZoneNames.size()); + forAll(pointZoneNames, i) + { + pz[i] = new pointZone + ( + pointZoneNames[i], + labelList(0), + i, + mesh.pointZones() + ); + } + List fz(faceZoneNames.size()); + forAll(faceZoneNames, i) + { + fz[i] = new faceZone + ( + faceZoneNames[i], + labelList(0), + boolList(0), + i, + mesh.faceZones() + ); + } + List 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 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 + ( + 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(); diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options index c3569ababf..97a2251f7b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options @@ -6,8 +6,8 @@ EXE_INC = \ EXE_LIBS = \ - -ltecio \ -llagrangian \ -lfiniteVolume \ -lgenericPatchFields \ - -lmeshTools + -lmeshTools \ + -L$(FOAM_EXT_LIBBIN) -ltecio diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake index cd3a58ffed..308eaaf175 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt index ea50923e6a..93dc9f702e 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt @@ -14,6 +14,7 @@ INCLUDE(${PARAVIEW_USE_FILE}) LINK_DIRECTORIES( $ENV{FOAM_LIBBIN} + $ENV{FOAM_EXT_LIBBIN} ) INCLUDE_DIRECTORIES( diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files index e71b857bb2..90ac11a3e8 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files @@ -9,4 +9,4 @@ vtkPV3FoamMeshZone.C vtkPV3FoamUpdateInfo.C vtkPV3FoamUtils.C -LIB = $(FOAM_LIBBIN)/libvtkPV3Foam +LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Foam diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options index b10a420add..6d10cc1a05 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options @@ -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) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt index 3376fa0d91..f5d9f3f867 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files index f084cc9f28..3d452f747a 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files @@ -2,4 +2,4 @@ vtkPV3blockMesh.C vtkPV3blockMeshConvert.C vtkPV3blockMeshUtils.C -LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh +LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3blockMesh diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options index 6001799a6c..1964824e54 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options @@ -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) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files index 134b8de963..c5f3c12ebd 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files @@ -1,3 +1,3 @@ vtkPV3Readers.C -LIB = $(FOAM_LIBBIN)/libvtkPV3Readers +LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Readers diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options index 55e559dd05..4b2b1a3289 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options @@ -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) diff --git a/applications/utilities/surface/surfaceCheck/surfaceCheck.C b/applications/utilities/surface/surfaceCheck/surfaceCheck.C index 1f1ef8c64f..b02c71756f 100644 --- a/applications/utilities/surface/surfaceCheck/surfaceCheck.C +++ b/applications/utilities/surface/surfaceCheck/surfaceCheck.C @@ -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; + } } } diff --git a/bin/foamBinDirs b/bin/foamBinDirs deleted file mode 100755 index ef96dee328..0000000000 --- a/bin/foamBinDirs +++ /dev/null @@ -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 . -# -# Script -# foamBinDirs -# -# Description -# Returns all directories containing binary files of OpenFOAM -# -#------------------------------------------------------------------------------ - -if [ $# -ne 2 ] -then - echo "Error: architecture type expected, exiting" - echo - echo "Usage : ${0##*/} " - 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 -) - -#------------------------------------------------------------------------------ diff --git a/bin/foamPack b/bin/foamPack index 920bfaf52b..dd8dab951c 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -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 . # # 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 <&2 +Usage: ${0##*/} [OPTION] +options: + -o 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 #------------------------------------------------------------------------------ diff --git a/bin/foamPackBin b/bin/foamPackBin index 3a6358f597..fa0fb00150 100755 --- a/bin/foamPackBin +++ b/bin/foamPackBin @@ -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 . # # Script -# foamPackBin [outputDir] +# foamPackBin [OPTION] # # Description -# Packs and compresses binary version of OpenFOAM for release +# Pack and compress binary version of OpenFOAM for release +# +# Script +# foamPackThirdPartyBin [OPTION] +# +# 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##*/} [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 <&2 +Usage: ${0##*/} [OPTION] +options: + -o 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 diff --git a/bin/foamPackBinAll b/bin/foamPackBinAll index ce16058b64..8d56e5701f 100755 --- a/bin/foamPackBinAll +++ b/bin/foamPackBinAll @@ -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 . # # 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 #------------------------------------------------------------------------------ diff --git a/bin/foamPackDoxygen b/bin/foamPackDoxygen index f93e41cd6d..c9337e972f 100755 --- a/bin/foamPackDoxygen +++ b/bin/foamPackDoxygen @@ -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 <&2 -Usage: ${0##*/} [-prefix DIR] [-o outputDir] +Usage: ${0##*/} [OPTION] +options: + -prefix use alternative prefix + -o 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 <&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 #------------------------------------------------------------------------------ diff --git a/bin/foamPackThirdParty b/bin/foamPackThirdParty index 4cd5b9c9ee..e0f07178d7 100755 --- a/bin/foamPackThirdParty +++ b/bin/foamPackThirdParty @@ -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 . # # 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 <&2 +Usage: ${0##*/} [OPTION] +options: + -o 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 #------------------------------------------------------------------------------ diff --git a/bin/foamPackThirdPartyBin b/bin/foamPackThirdPartyBin deleted file mode 100755 index 8e478ddcd4..0000000000 --- a/bin/foamPackThirdPartyBin +++ /dev/null @@ -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 . -# -# Script -# foamPackThirdPartyBin [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##*/} [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 - -#------------------------------------------------------------------------------ diff --git a/bin/foamPackThirdPartyBin b/bin/foamPackThirdPartyBin new file mode 120000 index 0000000000..4841836eb6 --- /dev/null +++ b/bin/foamPackThirdPartyBin @@ -0,0 +1 @@ +foamPackBin \ No newline at end of file diff --git a/bin/foamPackThirdPartyBinAll b/bin/foamPackThirdPartyBinAll new file mode 120000 index 0000000000..d37f60a48a --- /dev/null +++ b/bin/foamPackThirdPartyBinAll @@ -0,0 +1 @@ +foamPackBinAll \ No newline at end of file diff --git a/bin/foamSourceFiles b/bin/foamSourceFiles deleted file mode 100755 index f20e7927ce..0000000000 --- a/bin/foamSourceFiles +++ /dev/null @@ -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 . -# -# Script -# foamSourceFiles -# -# 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' - -#------------------------------------------------------------------------------ diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions index bc5c81e94d..1118564704 100644 --- a/bin/tools/CleanFunctions +++ b/bin/tools/CleanFunctions @@ -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 } diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index 20a9cd080c..bfaf58c39c 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -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 } diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths index 2b7bf40bad..acaa5455aa 100644 --- a/bin/tools/foamConfigurePaths +++ b/bin/tools/foamConfigurePaths @@ -50,15 +50,30 @@ USAGE # inlineSed _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'" #------------------------------------------------------------------------------ diff --git a/bin/tools/foamListBinDirs b/bin/tools/foamListBinDirs new file mode 100755 index 0000000000..ac67b796d0 --- /dev/null +++ b/bin/tools/foamListBinDirs @@ -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 . +# +# Script +# foamListBinDirs +# +# 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 <&2 +Usage : ${0##*/} + +* 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 <&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 <&2 +------------------------------------------------------------------------------- +Packing $archOptions ($archCompiler) port of $packDir + archOS = $archOS + 32bit archOS = $arch3264 + +dirs: + $(echo ${dirList:-NONE}) + +INFO + +echo "$dirList" + +#------------------------------------------------------------------------------ diff --git a/bin/tools/foamListSourceFiles b/bin/tools/foamListSourceFiles new file mode 100755 index 0000000000..81e299c4a1 --- /dev/null +++ b/bin/tools/foamListSourceFiles @@ -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 . +# +# Script +# foamListSourceFiles +# +# Description +# Lists source files and Make/{files,options} in given directory +# +# Note +# Not normally called directly by the user. +#------------------------------------------------------------------------------ + +[ $# -eq 1 ] || { +cat <&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' + + +#------------------------------------------------------------------------------ diff --git a/bin/tools/foamListThirdPartyBinDirs b/bin/tools/foamListThirdPartyBinDirs new file mode 100755 index 0000000000..319961b944 --- /dev/null +++ b/bin/tools/foamListThirdPartyBinDirs @@ -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 . +# +# Script +# foamListThirdPartyBinDirs +# +# 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 <&2 +Usage : ${0##*/} + +* 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 <&2 +------------------------------------------------------------------------------- +Packing $archOptions ($archCompiler) port of $packDir + archOS = $archOS + 32bit archOS = $arch3264 + +dirs: + $(echo ${dirList:-NONE}) + +INFO + +echo "$dirList" + +#------------------------------------------------------------------------------ diff --git a/bin/foamPackSource b/bin/tools/foamPackSource similarity index 61% rename from bin/foamPackSource rename to bin/tools/foamPackSource index 8305a929a8..3f6d547895 100755 --- a/bin/foamPackSource +++ b/bin/tools/foamPackSource @@ -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 # # 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 "" - echo "" +[ $# -eq 2 ] || { +cat <&2 +Usage : ${0##*/} directory tarFile + +* Pack and compress all source files from a given directory into + +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 <&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 diff --git a/doc/doxygen/css/doxyTabs.css b/doc/doxygen/css/doxyTabs.css index 1cc5525827..58f32ccf41 100644 --- a/doc/doxygen/css/doxyTabs.css +++ b/doc/doxygen/css/doxyTabs.css @@ -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; diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 5487d2e8db..1387f08d9e 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -26,7 +26,7 @@ # # Description # Setup file for paraview-3.x -# Sourced from OpenFOAM-*/etc/bashrc or from foamPV alias +# Sourced from OpenFOAM-/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 "." 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 diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 850eb78d27..96f404db46 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -26,7 +26,7 @@ # # Description # Setup file for paraview-3.x -# Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias +# Sourced from OpenFOAM-/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 "." 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 diff --git a/etc/apps/scotch/bashrc b/etc/apps/scotch/bashrc index 5058df0ed1..fcd19bfaa3 100644 --- a/etc/apps/scotch/bashrc +++ b/etc/apps/scotch/bashrc @@ -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##*/} + # ----------------------------------------------------------------------------- diff --git a/etc/bashrc b/etc/bashrc index 2b0e3d0be7..c95a7951bb 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -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 diff --git a/etc/codeTemplates/foamScript b/etc/codeTemplates/foamScript index 57c5f68d4a..21d54cf400 100644 --- a/etc/codeTemplates/foamScript +++ b/etc/codeTemplates/foamScript @@ -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 diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C index ed2b7283af..150d79e8c0 100644 --- a/etc/codeTemplates/source/_Template.C +++ b/etc/codeTemplates/source/_Template.C @@ -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 diff --git a/etc/codeTemplates/source/_Template.H b/etc/codeTemplates/source/_Template.H index 14abca0f60..f68ec751b1 100644 --- a/etc/codeTemplates/source/_Template.H +++ b/etc/codeTemplates/source/_Template.H @@ -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 diff --git a/etc/codeTemplates/source/_TemplateApp.C b/etc/codeTemplates/source/_TemplateApp.C index 15e857a6fc..58e4f49659 100644 --- a/etc/codeTemplates/source/_TemplateApp.C +++ b/etc/codeTemplates/source/_TemplateApp.C @@ -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 diff --git a/etc/codeTemplates/source/_TemplateI.H b/etc/codeTemplates/source/_TemplateI.H index fbe2570097..718179dd65 100644 --- a/etc/codeTemplates/source/_TemplateI.H +++ b/etc/codeTemplates/source/_TemplateI.H @@ -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 diff --git a/etc/codeTemplates/source/_TemplateIO.C b/etc/codeTemplates/source/_TemplateIO.C index 5ce5661915..a43b52f8d8 100644 --- a/etc/codeTemplates/source/_TemplateIO.C +++ b/etc/codeTemplates/source/_TemplateIO.C @@ -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 diff --git a/etc/codeTemplates/template/_TemplateTemplate.C b/etc/codeTemplates/template/_TemplateTemplate.C index 712ac72122..6627c3ac14 100644 --- a/etc/codeTemplates/template/_TemplateTemplate.C +++ b/etc/codeTemplates/template/_TemplateTemplate.C @@ -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 diff --git a/etc/codeTemplates/template/_TemplateTemplate.H b/etc/codeTemplates/template/_TemplateTemplate.H index fca7e2722c..52aa72647b 100644 --- a/etc/codeTemplates/template/_TemplateTemplate.H +++ b/etc/codeTemplates/template/_TemplateTemplate.H @@ -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 diff --git a/etc/codeTemplates/template/_TemplateTemplateI.H b/etc/codeTemplates/template/_TemplateTemplateI.H index fbe2570097..718179dd65 100644 --- a/etc/codeTemplates/template/_TemplateTemplateI.H +++ b/etc/codeTemplates/template/_TemplateTemplateI.H @@ -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 diff --git a/etc/codeTemplates/template/_TemplateTemplateIO.C b/etc/codeTemplates/template/_TemplateTemplateIO.C index 7da36ef885..f1ed4c1b6a 100644 --- a/etc/codeTemplates/template/_TemplateTemplateIO.C +++ b/etc/codeTemplates/template/_TemplateTemplateIO.C @@ -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 diff --git a/etc/cshrc b/etc/cshrc index 0ef3f0ce78..2a73699137 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -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: diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index 6222054e27..256381c54b 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -38,7 +38,7 @@ ## Specify system compiler ## ~~~~~~~~~~~~~~~~~~~~~~~ -#set compilerInstall=system +#set foamCompiler=system ## Specify system openmpi ## ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index 598c5710c9..60d4a21cd1 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -38,7 +38,7 @@ # Specify system compiler # ~~~~~~~~~~~~~~~~~~~~~~~ -compilerInstall=system +foamCompiler=system # Specify system openmpi # ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/settings.csh b/etc/settings.csh index 366f1e2a50..3ebb1939f8 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -26,7 +26,7 @@ # # Description # Startup file for OpenFOAM -# Sourced from OpenFOAM-??/etc/cshrc +# Sourced from OpenFOAM-/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 diff --git a/etc/settings.sh b/etc/settings.sh index 8412505be6..b466cd4fe7 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -26,7 +26,7 @@ # # Description # Startup file for OpenFOAM -# Sourced from OpenFOAM-??/etc/bashrc +# Sourced from OpenFOAM-/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 diff --git a/src/Allwmake b/src/Allwmake index 2fd099352d..f3c4420474 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -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 diff --git a/src/ODE/ODESolvers/KRR4/KRR4.C b/src/ODE/ODESolvers/KRR4/KRR4.C index 09df33ad9d..114c72980a 100644 --- a/src/ODE/ODESolvers/KRR4/KRR4.C +++ b/src/ODE/ODESolvers/KRR4/KRR4.C @@ -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 * * * * * * * * * * * * * * // diff --git a/src/ODE/ODESolvers/ODESolver/ODESolver.C b/src/ODE/ODESolvers/ODESolver/ODESolver.C index f0c04518be..0ebdf756bd 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolver.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolver.C @@ -31,7 +31,7 @@ defineTypeNameAndDebug(Foam::ODESolver, 0); namespace Foam { defineRunTimeSelectionTable(ODESolver, ODE); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/ODE/ODESolvers/RK/RK.C b/src/ODE/ODESolvers/RK/RK.C index 3b74eb8f45..2036211ef9 100644 --- a/src/ODE/ODESolvers/RK/RK.C +++ b/src/ODE/ODESolvers/RK/RK.C @@ -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 * * * * * * * * * * * * * * // diff --git a/src/ODE/ODESolvers/SIBS/SIBS.C b/src/ODE/ODESolvers/SIBS/SIBS.C index acaa5c9e76..ce7d09fcc4 100644 --- a/src/ODE/ODESolvers/SIBS/SIBS.C +++ b/src/ODE/ODESolvers/SIBS/SIBS.C @@ -42,7 +42,7 @@ namespace Foam SIBS::redMax = 1.0e-5, SIBS::redMin = 0.7, SIBS::scaleMX = 0.1; -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 380c785c0b..ec0d1e79f4 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -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(serverAddress); - addr = ptr->s_addr; + addr = (reinterpret_cast(*(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(&destAddr), '\0', sizeof(destAddr)); + memset(reinterpret_cast(&destAddr), '\0', sizeof(destAddr)); destAddr.sin_family = AF_INET; destAddr.sin_port = htons(ushort(destPort)); destAddr.sin_addr.s_addr = addr; diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index 183c2edeac..4439817ab2 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -500,20 +500,7 @@ const pointPatchField& 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& 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 type##PointPatchScalarField; \ typedef type##PointPatchField type##PointPatchVectorField; \ diff --git a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C b/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C index cb353e2e4d..32b27539bf 100644 --- a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C +++ b/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C @@ -35,7 +35,7 @@ namespace Foam { typedef graph::writer graphWriter; addToRunTimeSelectionTable(graphWriter, gnuplotGraph, word); -}; +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C b/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C index 7d7e0d5e41..4f826f3e96 100644 --- a/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C +++ b/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C @@ -35,7 +35,7 @@ namespace Foam { typedef graph::writer graphWriter; addToRunTimeSelectionTable(graphWriter, jplotGraph, word); -}; +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C b/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C index ff4de814ce..19e23098a7 100644 --- a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C +++ b/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C @@ -35,7 +35,7 @@ namespace Foam { typedef graph::writer graphWriter; addToRunTimeSelectionTable(graphWriter, rawGraph, word); -}; +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C b/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C index 00a36a8fa6..0c21dc3d8c 100644 --- a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C +++ b/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C @@ -35,7 +35,7 @@ namespace Foam { typedef graph::writer graphWriter; addToRunTimeSelectionTable(graphWriter, xmgrGraph, word); -}; +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/include/OSspecific.H b/src/OpenFOAM/include/OSspecific.H index 3ee759a596..df867a589b 100644 --- a/src/OpenFOAM/include/OSspecific.H +++ b/src/OpenFOAM/include/OSspecific.H @@ -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(); diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C index 21e97d74d4..55892869ea 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C @@ -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; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index af5b4393b8..8315d3de21 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -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); diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H index ddd0486707..86895114e4 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H @@ -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 >& 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 diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H index b6792529b8..a8bde775c7 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H @@ -156,10 +156,7 @@ inline Point Foam::tetrahedron::circumCentre() const if (Foam::mag(denom) < ROOTVSMALL) { - WarningIn("Point tetrahedron::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::circumRadius() const if (Foam::mag(denom) < ROOTVSMALL) { - WarningIn("Point tetrahedron::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::barycentric if (Foam::mag(detT) < SMALL) { - WarningIn - ( - "List tetrahedron::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(4, 0.25); diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index f7578f8ce3..6e7a0302f5 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -121,10 +121,7 @@ inline Point Foam::triangle::circumCentre() const if (Foam::mag(c) < ROOTVSMALL) { - WarningIn("Point triangle::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::circumRadius() const if (Foam::mag(denom) < VSMALL) { - WarningIn("scalar triangle::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::barycentric if (Foam::mag(denom) < SMALL) { - WarningIn - ( - "List triangle::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(3, 1.0/3.0); @@ -540,20 +525,7 @@ Foam::pointHit Foam::triangle::nearestPointClassify { if ((d1 - d3) < ROOTVSMALL) { - WarningIn - ( - "pointHit triangle::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::nearestPointClassify { if ((d2 - d6) < ROOTVSMALL) { - WarningIn - ( - "pointHit triangle::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::nearestPointClassify { if (((d4 - d3) + (d5 - d6)) < ROOTVSMALL) { - WarningIn - ( - "pointHit triangle::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::nearestPointClassify if ((va + vb + vc) < ROOTVSMALL) { - WarningIn - ( - "pointHit triangle::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; diff --git a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C index dddd523d36..9c6582fa9c 100644 --- a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C +++ b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C @@ -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(&endianTest))) + if (*(reinterpret_cast(&endianTest))) { return jenkins_hashbig(key, length, initval); } diff --git a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H index 1fa68d4919..85a7ea202c 100644 --- a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H +++ b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H @@ -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 diff --git a/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H b/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H index 96be6188a9..f5a1e8b3ff 100644 --- a/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H +++ b/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H @@ -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 diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C index d6c9983185..4a9444b6a6 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C @@ -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(&x))) + if (*(reinterpret_cast(&x))) { return n; } @@ -459,10 +459,5 @@ Foam::SHA1Digest Foam::SHA1::digest() const // } // } -// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H index 4b7080e3df..da19da2d18 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H @@ -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&); }; diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C index a270dd1d77..7b5d16d722 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C @@ -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); } diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H index 0402dc9884..19c9698d13 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H @@ -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 + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 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&); diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H index e1715bc4c1..aa05de558c 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H @@ -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(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C index fd9928066c..e35114025b 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C @@ -37,8 +37,8 @@ namespace solidBodyMotionFunctions { defineTypeNameAndDebug(SDA, 0); addToRunTimeSelectionTable(solidBodyMotionFunction, SDA, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C index 80f745e7ec..9c8ac0e115 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C @@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions linearMotion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C index 1e42e32555..9b5008498b 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C @@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions multiMotion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C index 58f384c99e..6f9e5824a4 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C @@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions oscillatingLinearMotion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C index b0bf9d6825..55520433b9 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C @@ -42,8 +42,8 @@ namespace solidBodyMotionFunctions oscillatingRotatingMotion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C index ec95e6ecdd..9472f12eda 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C @@ -42,8 +42,8 @@ namespace solidBodyMotionFunctions rotatingMotion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C index adb53704e9..e6a8c9ba86 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C @@ -45,8 +45,8 @@ namespace solidBodyMotionFunctions tabulated6DoFMotion, dictionary ); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C index a6f26df7c0..96b75f8890 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C @@ -55,7 +55,7 @@ public: j = y.rcIndex(j); } } - }; + } }; } diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C index 2f00ad181e..0b66e0e6e6 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C @@ -164,7 +164,7 @@ void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, SRFVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C index 8d97c3818c..bc8ad3410c 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C @@ -35,7 +35,11 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // makePatchFields(processorCyclic); -//makePatchTypeField(fvPatchScalarField, processorCyclicFvPatchScalarField); +// makeTemplatePatchTypeField +// ( +// fvPatchScalarField, +// processorCyclicFvPatchScalarField +// ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index 99549a8218..a2054b5f0b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -310,7 +310,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, activeBaffleVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C index cfd92b0c8d..6b3cee22e0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C @@ -145,7 +145,7 @@ void Foam::buoyantPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, buoyantPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C index 6f5d368256..271349ef29 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C @@ -161,7 +161,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, cylindricalInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index e83c36111f..9745a50715 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C @@ -264,7 +264,7 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, directMappedVelocityFluxFixedValueFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 31c51c999d..f7722670d3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class jumpCyclicFvPatch Declaration + Class fanFvPatchField Declaration \*---------------------------------------------------------------------------*/ template diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 6d41a654ea..80fff7da82 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -35,7 +35,11 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); +makeTemplatePatchTypeField +( + fvPatchScalarField, + fanFvPatchScalarField +); // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C index 1c21f64d14..ab52c30612 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C @@ -172,7 +172,7 @@ void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, fixedFluxPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C index 5dbfd69a55..e0a1e082da 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C @@ -34,8 +34,16 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makePatchTypeField(fvPatchVectorField, fixedNormalSlipFvPatchVectorField); -makePatchTypeField(fvPatchTensorField, fixedNormalSlipFvPatchTensorField); +makeTemplatePatchTypeField +( + fvPatchVectorField, + fixedNormalSlipFvPatchVectorField +); +makeTemplatePatchTypeField +( + fvPatchTensorField, + fixedNormalSlipFvPatchTensorField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C index 22fac73eeb..c5487e94fd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C @@ -137,7 +137,7 @@ void Foam::fixedPressureCompressibleDensityFvPatchScalarField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, fixedPressureCompressibleDensityFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 4d0652c665..28b28fa221 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -168,7 +168,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, flowRateInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C index bdaffac4bd..4879450a2d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C @@ -152,7 +152,7 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, fluxCorrectedVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index 65b55658f9..18d344f8d3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C @@ -144,7 +144,7 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs() namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, freestreamPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C index 04eb43c98b..149f244209 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C @@ -203,7 +203,7 @@ const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, inletOutletTotalTemperatureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C index aefa37b8f5..a9770b9867 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C @@ -148,7 +148,7 @@ void Foam::movingWallVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, movingWallVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C index 980087821c..04d7a3d67b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C @@ -218,7 +218,7 @@ void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::operator= namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, pressureDirectedInletOutletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C index 1ecafe0e09..8dd9a47481 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C @@ -204,7 +204,7 @@ void Foam::pressureDirectedInletVelocityFvPatchVectorField::operator= namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, pressureDirectedInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C index d4e4d8aa0a..6b62f901c5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C @@ -213,7 +213,7 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::operator= namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, pressureInletOutletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C index 1131b9a800..e26dde8506 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C @@ -117,7 +117,7 @@ void Foam::pressureInletUniformVelocityFvPatchVectorField::operator= namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, pressureInletUniformVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C index 6ef3ff5095..4cb8ecb67e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C @@ -166,7 +166,7 @@ void Foam::pressureInletVelocityFvPatchVectorField::operator= namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, pressureInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C index 0f1577ebcf..e634a1c044 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C @@ -187,7 +187,7 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::operator= namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, pressureNormalInletOutletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C index f32e945c9a..31cbd43150 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C @@ -134,7 +134,7 @@ void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, rotatingPressureInletOutletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C index fcde041a1b..4697d6c88e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C @@ -127,7 +127,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, rotatingTotalPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C index 5f7b493a55..21af4453ea 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C @@ -143,7 +143,7 @@ void Foam::rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, rotatingWallVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C index 785b03b2d1..664b8aa78f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C @@ -300,7 +300,7 @@ void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, supersonicFreestreamFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C index 300136c9cd..e85efa260c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C @@ -134,7 +134,7 @@ void Foam::surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, surfaceNormalFixedValueFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C index 2943d37eab..64e9b94d82 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C @@ -189,7 +189,7 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, swirlFlowRateInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index e93c26a368..281591808f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -247,7 +247,7 @@ void Foam::syringePressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, syringePressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C index cfb2db6f0e..b00a713b56 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C @@ -121,7 +121,7 @@ write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, timeVaryingFlowRateInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C index c63da946e9..a0f03b4c6b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C @@ -232,7 +232,7 @@ write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, timeVaryingUniformTotalPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index 15be1f18e1..c9890487fe 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -241,7 +241,7 @@ void Foam::totalPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, totalPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index 5a6c89ec82..5a3b0e4e1c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -190,7 +190,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, totalTemperatureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C index 01c5f1f837..3f8fcc878f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C @@ -124,7 +124,7 @@ void Foam::translatingWallVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchVectorField, translatingWallVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index 944f143c9e..4c53ea8f95 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C @@ -147,7 +147,7 @@ void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, turbulentIntensityKineticEnergyInletFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C index ae0a92c04f..564771b84c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C @@ -155,7 +155,7 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::write namespace Foam { - makeNonTemplatedPatchTypeField + makePatchTypeField ( fvPatchScalarField, uniformDensityHydrostaticPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 92f33bd79b..7d493ebe71 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -495,18 +495,6 @@ public: #endif -#define makePatchTypeFieldTypeName(type) \ - defineNamedTemplateTypeNameAndDebug(type, 0) - - -#define makePatchFieldsTypeName(type) \ - defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0); \ - defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0); \ - defineNamedTemplateTypeNameAndDebug(type##FvPatchSphericalTensorField, 0);\ - defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0); \ - defineNamedTemplateTypeNameAndDebug(type##FvPatchTensorField, 0); - - #define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \ addToRunTimeSelectionTable \ ( \ @@ -529,45 +517,53 @@ public: // for non-templated patch fields -#define makeNonTemplatedPatchTypeField(PatchTypeField, typePatchTypeField) \ +#define makePatchTypeField(PatchTypeField, typePatchTypeField) \ defineTypeNameAndDebug(typePatchTypeField, 0); \ addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) // for templated patch fields -#define makePatchTypeField(PatchTypeField, typePatchTypeField) \ +#define makeTemplatePatchTypeField(PatchTypeField, typePatchTypeField) \ defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \ addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) #define makePatchFields(type) \ - makePatchTypeField \ + makeTemplatePatchTypeField \ ( \ fvPatchScalarField, \ type##FvPatchScalarField \ ); \ - makePatchTypeField \ + makeTemplatePatchTypeField \ ( \ fvPatchVectorField, \ type##FvPatchVectorField \ ); \ - makePatchTypeField \ + makeTemplatePatchTypeField \ ( \ fvPatchSphericalTensorField, \ type##FvPatchSphericalTensorField \ ); \ - makePatchTypeField \ + makeTemplatePatchTypeField \ ( \ fvPatchSymmTensorField, \ type##FvPatchSymmTensorField \ ); \ - makePatchTypeField \ + makeTemplatePatchTypeField \ ( \ fvPatchTensorField, \ type##FvPatchTensorField \ ); +#define makePatchFieldsTypeName(type) \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0); \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0); \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchSphericalTensorField, 0);\ + defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0); \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchTensorField, 0) + + #define makePatchTypeFieldTypedefs(type) \ typedef type##FvPatchField type##FvPatchScalarField; \ typedef type##FvPatchField type##FvPatchVectorField; \ diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options index 26c2b8abfb..80b3169750 100644 --- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options +++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options @@ -12,4 +12,4 @@ EXE_INC = \ $(TYPE_REAL) LIB_LIBS = \ - -lMGridGen + -L$(FOAM_EXT_LIBBIN) -lMGridGen diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C index 786c3b6008..ca5a17e793 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C @@ -196,7 +196,7 @@ void angularOscillatingDisplacementPointPatchVectorField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPointPatchTypeField +makePointPatchTypeField ( pointPatchVectorField, angularOscillatingDisplacementPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C index aa9bce36ee..a4d4550ec8 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C @@ -201,7 +201,7 @@ void angularOscillatingVelocityPointPatchVectorField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPointPatchTypeField +makePointPatchTypeField ( pointPatchVectorField, angularOscillatingVelocityPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C index fbadba14ac..aa0674683d 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C @@ -127,7 +127,7 @@ void oscillatingDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPointPatchTypeField +makePointPatchTypeField ( pointPatchVectorField, oscillatingDisplacementPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C index 30fdf7382a..b9cbac6460 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C @@ -171,7 +171,7 @@ void oscillatingVelocityPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPointPatchTypeField +makePointPatchTypeField ( pointPatchVectorField, oscillatingVelocityPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C index f2c4ce669c..2e0bc79ba5 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C @@ -499,7 +499,7 @@ void surfaceDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPointPatchTypeField +makePointPatchTypeField ( fixedValuePointPatchVectorField, surfaceDisplacementPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C index 3eedadcc84..2c5edb340a 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C @@ -448,7 +448,7 @@ void surfaceSlipDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeNonTemplatedPointPatchTypeField +makePointPatchTypeField ( pointPatchVectorField, surfaceSlipDisplacementPointPatchVectorField diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index 15dd9027b9..f344fecc2f 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -1195,7 +1195,7 @@ void Foam::InteractionLists::sendReferredData // buffer but not block, i.e. it is calling // pBufs.finishedSends(false); wallFaceMap().send(pBufs, referredWallData_); -}; +} template diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H index cf135b3229..e39931adaa 100644 --- a/src/lagrangian/basic/Particle/ParticleI.H +++ b/src/lagrangian/basic/Particle/ParticleI.H @@ -104,7 +104,7 @@ inline Foam::scalar Foam::Particle::tetLambda if (mag(lambdaNumerator) < SMALL) { // Track starts on the face, and is potentially - // parallel to it. +-SMALL)/+-SMALL is not a good + // parallel to it. +-SMALL/+-SMALL is not a good // comparison, return 0.0, in anticipation of tet // centre correction. diff --git a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C index 5c297cb44d..ad9a2d29ff 100644 --- a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C +++ b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C @@ -25,17 +25,13 @@ License #include "passiveParticleCloud.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineParticleTypeNameAndDebug(passiveParticle, 0); -defineTemplateTypeNameAndDebug(Cloud, 0); - -}; + defineParticleTypeNameAndDebug(passiveParticle, 0); + defineTemplateTypeNameAndDebug(Cloud, 0); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C b/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C index e6aa0453e9..331ac17327 100644 --- a/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C +++ b/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C @@ -31,7 +31,7 @@ License namespace Foam { createReactingMultiphaseParcelTypes(coalParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C b/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C index 9a92dc377e..2bbd6777a2 100644 --- a/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C +++ b/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C @@ -70,7 +70,7 @@ namespace Foam makeReactingMultiphaseParcelDevolatilisationModels(coalParcel); makeReactingParcelSurfaceFilmModels(coalParcel); makeCoalParcelSurfaceReactionModels(coalParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C index 1e6a6e917b..2c3040e9ac 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C @@ -31,7 +31,7 @@ namespace Foam defineTemplateTypeNameAndDebug(Cloud, 0); defineParcelTypeNameAndDebug(DsmcCloud, 0); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C index 91fa156c63..ec18136d38 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C @@ -32,7 +32,7 @@ namespace Foam defineTypeNameAndDebug(dsmcParcel, 0); defineParticleTypeNameAndDebug(dsmcParcel, 0); defineParcelTypeNameAndDebug(dsmcParcel, 0); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C index 1e8356ef5f..f8f8d7f17a 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C @@ -52,7 +52,7 @@ namespace Foam DsmcCloud, dsmcParcel ); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C index 364f2a721f..d12204e473 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C @@ -45,7 +45,7 @@ namespace Foam DsmcCloud, dsmcParcel ); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C index 08e78b2713..6a6d389161 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C @@ -52,7 +52,7 @@ namespace Foam DsmcCloud, dsmcParcel ); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C b/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C index 4f934c892f..5ce6e87d63 100644 --- a/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C +++ b/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C @@ -39,7 +39,7 @@ namespace Foam makeIntegrationScheme(vector); makeIntegrationSchemeType(Euler, vector); makeIntegrationSchemeType(Analytical, vector); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C index 973a70dbb0..e8dfec45ac 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C @@ -31,7 +31,7 @@ License namespace Foam { createKinematicParcelTypes(basicKinematicParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C index d6c2d4532e..27c54abfd2 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C @@ -46,7 +46,7 @@ namespace Foam makeParcelPatchInteractionModels(basicKinematicParcel); makeParcelPostProcessingModels(basicKinematicParcel); makeParcelSurfaceFilmModels(basicKinematicParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C index 3c3e9fe8fa..78de4affcc 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C @@ -31,7 +31,7 @@ License namespace Foam { createReactingMultiphaseParcelTypes(basicReactingMultiphaseParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C index 490d99b116..fa38f8a5e2 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C @@ -80,7 +80,7 @@ namespace Foam ( basicReactingMultiphaseParcel ); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C index 0eb06eedd5..0b8136e808 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C @@ -31,7 +31,7 @@ License namespace Foam { createReactingParcelTypes(basicReactingParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C index cd4f0e1775..b1e3978011 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C @@ -60,7 +60,7 @@ namespace Foam makeReactingParcelCompositionModels(basicReactingParcel); makeReactingParcelPhaseChangeModels(basicReactingParcel); makeReactingParcelSurfaceFilmModels(basicReactingParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C index a98be4baad..660081b993 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C @@ -31,7 +31,7 @@ License namespace Foam { createThermoParcelTypes(basicThermoParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C index ef873cf15c..289e6d38cd 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C @@ -52,7 +52,7 @@ namespace Foam // Thermo sub-models makeParcelHeatTransferModels(basicThermoParcel); makeParcelSurfaceFilmModels(basicThermoParcel); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C b/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C index 71d7c1d05b..942229f5f3 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C +++ b/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C @@ -44,7 +44,7 @@ namespace Foam makeDataEntry(vector); makeDataEntryType(Constant, vector); makeDataEntryType(Table, vector); -}; +} // ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C index 413f0e1f22..6ed75ee923 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C @@ -35,7 +35,7 @@ namespace Foam { defineParticleTypeNameAndDebug(molecule, 0); defineTemplateTypeNameAndDebug(Cloud, 0); -}; +} // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/lagrangian/solidParticle/solidParticleCloud.C b/src/lagrangian/solidParticle/solidParticleCloud.C index cc4543cb6a..8badea136d 100644 --- a/src/lagrangian/solidParticle/solidParticleCloud.C +++ b/src/lagrangian/solidParticle/solidParticleCloud.C @@ -34,7 +34,7 @@ namespace Foam { defineParticleTypeNameAndDebug(solidParticle, 0); defineTemplateTypeNameAndDebug(Cloud, 0); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C index a6f2c72876..8c9b0eb19b 100644 --- a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C +++ b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C @@ -102,7 +102,7 @@ void Foam::blockMesh::calcMergeInfo() FatalErrorIn("blockMesh::calcMergeInfo()") << "Cannot find merge face for block " << blockPlabel << exit(FatalError); - }; + } const labelListList& blockPfaceFaces = blocks[blockPlabel].boundaryPatches()[blockPfaceLabel]; @@ -211,7 +211,7 @@ void Foam::blockMesh::calcMergeInfo() FatalErrorIn("blockMesh::calcMergeInfo()") << "Cannot find merge face for block " << blockNlabel << exit(FatalError); - }; + } const labelListList& blockNfaceFaces = blocks[blockNlabel].boundaryPatches()[blockNfaceLabel]; @@ -471,7 +471,7 @@ void Foam::blockMesh::calcMergeInfo() FatalErrorIn("blockMesh::calcMergeInfo()") << "Cannot find merge face for block " << blockPlabel << exit(FatalError); - }; + } foundFace = false; label blockNfaceLabel; @@ -498,7 +498,7 @@ void Foam::blockMesh::calcMergeInfo() FatalErrorIn("blockMesh::calcMergeInfo()") << "Cannot find merge face for block " << blockNlabel << exit(FatalError); - }; + } const labelListList& blockPfaceFaces = blocks[blockPlabel].boundaryPatches()[blockPfaceLabel]; diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index 22515e65d2..cb053bcc3e 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -1,7 +1,7 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -# get SCOTCH_VERSION, SCOTCH_ARCH_PATH +# get SCOTCH_VERSION, SCOTCH_ARCH_PATH, SCOTCH_MPI_INCLUDE settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` if [ -f "$settings" ] then diff --git a/src/parallel/decompose/metisDecomp/Make/files b/src/parallel/decompose/metisDecomp/Make/files index 39ee731e4d..030326722a 100644 --- a/src/parallel/decompose/metisDecomp/Make/files +++ b/src/parallel/decompose/metisDecomp/Make/files @@ -1,3 +1,3 @@ metisDecomp.C -LIB = $(FOAM_LIBBIN)/libmetisDecomp +LIB = $(FOAM_EXT_LIBBIN)/libmetisDecomp diff --git a/src/parallel/decompose/metisDecomp/Make/options b/src/parallel/decompose/metisDecomp/Make/options index 00bdb28b59..a6a0f1433e 100644 --- a/src/parallel/decompose/metisDecomp/Make/options +++ b/src/parallel/decompose/metisDecomp/Make/options @@ -4,5 +4,4 @@ EXE_INC = \ -I../decompositionMethods/lnInclude LIB_LIBS = \ - -lmetis \ - -lGKlib + -L$(FOAM_EXT_LIBBIN) -lmetis -lGKlib diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options index 17e6ea5ced..d4f56eb39a 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/options +++ b/src/parallel/decompose/ptscotchDecomp/Make/options @@ -3,7 +3,7 @@ sinclude $(RULES)/mplib$(WM_MPLIB) EXE_INC = \ $(PFLAGS) $(PINC) \ - -I$(SCOTCH_ARCH_PATH)/include \ + -I$(SCOTCH_MPI_INCLUDE) \ -I/usr/include/scotch \ -I../decompositionMethods/lnInclude diff --git a/src/parallel/decompose/scotchDecomp/Make/files b/src/parallel/decompose/scotchDecomp/Make/files index 59717fa15c..dbb178726c 100644 --- a/src/parallel/decompose/scotchDecomp/Make/files +++ b/src/parallel/decompose/scotchDecomp/Make/files @@ -1,3 +1,3 @@ scotchDecomp.C -LIB = $(FOAM_LIBBIN)/libscotchDecomp +LIB = $(FOAM_EXT_LIBBIN)/libscotchDecomp diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options index c832cc0b7c..8397463ae5 100644 --- a/src/parallel/decompose/scotchDecomp/Make/options +++ b/src/parallel/decompose/scotchDecomp/Make/options @@ -4,4 +4,4 @@ EXE_INC = \ -I../decompositionMethods/lnInclude LIB_LIBS = \ - -lscotch -lscotcherrexit -lrt + -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index e7262bcbd7..b569b0bae5 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -108,8 +108,8 @@ License #include "addToRunTimeSelectionTable.H" #include "floatScalar.H" #include "Time.H" -#include "cyclicPolyPatch.H" #include "OFstream.H" +#include "globalIndex.H" extern "C" { @@ -162,7 +162,6 @@ void Foam::scotchDecomp::check(const int retVal, const char* str) } -// Call scotch with options from dictionary. Foam::label Foam::scotchDecomp::decompose ( const fileName& meshPath, @@ -172,6 +171,128 @@ Foam::label Foam::scotchDecomp::decompose List& finalDecomp ) +{ + if (!Pstream::parRun()) + { + decomposeOneProc + ( + meshPath, + adjncy, + xadj, + cWeights, + finalDecomp + ); + } + else + { + if (debug) + { + Info<< "scotchDecomp : running in parallel." + << " Decomposing all of graph on master processor." << endl; + } + globalIndex globalCells(xadj.size()-1); + label nTotalConnections = returnReduce(adjncy.size(), sumOp