From 325b003b6e7c11ee60a53757f4805858f7ef6ebf Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 31 Dec 2014 19:02:52 +0000 Subject: [PATCH] Added and verified support for 64bit labels To compile with 64bit labels set WM_LABEL_SIZE=64 in ~/OpenFOAM/dev/prefs.sh source ~/.bashrc then Allwmake in OpenFOAM-dev. This will build into for example OpenFOAM-dev/platforms/linux64ClangDPInt64Opt If WM_LABEL_SIZE is unset or set to 32: WM_LABEL_SIZE=32 the build would be placed into OpenFOAM-dev/platforms/linux64ClangDPInt32Opt Thus both 32bit and 64bit label builds can coexist without problem. --- .../DelaunayMesh/DelaunayMesh.H | 2 +- .../DelaunayMesh/DelaunayMeshIO.C | 4 +- .../DelaunayMesh/DistributedDelaunayMesh.C | 4 +- .../searchableSurfaceControl.C | 2 +- .../conformalVoronoiMesh.H | 1 - .../conformalVoronoiMeshCalcDualMesh.C | 14 +- .../conformalVoronoiMeshFeaturePoints.C | 2 +- .../conformalVoronoiMeshI.H | 6 +- .../conformalVoronoiMeshIO.C | 10 +- .../conformalVoronoiMeshTemplates.C | 2 +- .../conformalVoronoiMeshZones.C | 4 +- .../featurePointConformerSpecialisations.C | 4 +- .../indexedCell/indexedCell.H | 6 +- .../indexedCell/indexedCellI.H | 4 +- .../indexedVertex/indexedVertex.H | 10 +- .../indexedVertex/indexedVertexI.H | 8 +- .../autoDensity/autoDensity.C | 2 +- .../searchableBoxFeatures.C | 4 +- .../searchablePlateFeatures.C | 2 +- .../mesh/generation/foamyQuadMesh/CV2D.C | 1 - .../mesh/manipulation/setSet/writeFuns.C | 32 +- .../mesh/manipulation/setSet/writeFuns.H | 49 ++- .../PV3FoamReader/CMakeLists.txt | 1 + .../vtkPV3Foam/vtkPV3FoamMeshVolume.C | 1 - .../PV3blockMeshReader/CMakeLists.txt | 1 + .../PV4FoamReader/CMakeLists.txt | 1 + .../vtkPV4Foam/vtkPV4FoamMeshVolume.C | 1 - .../PV4blockMeshReader/CMakeLists.txt | 1 + etc/bashrc | 4 + etc/config/CGAL.csh | 2 +- etc/config/CGAL.sh | 2 +- etc/config/scotch.sh | 2 +- etc/config/settings.csh | 3 +- etc/config/settings.sh | 3 +- etc/cshrc | 4 + src/OSspecific/POSIX/fileMonitor.C | 2 +- src/OpenFOAM/Make/files | 13 +- .../linkTypes/DLListBase/DLListBase.C | 1 - src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H | 7 +- .../db/IOstreams/Pstreams/UOPstream.C | 10 +- .../db/IOstreams/Pstreams/UOPstream.H | 7 +- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C | 7 +- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H | 2 +- src/OpenFOAM/db/IOstreams/Pstreams/exchange.C | 16 +- src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C | 19 +- src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C | 10 +- src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H | 7 +- .../db/IOstreams/Sstreams/prefixOSstream.C | 9 +- .../db/IOstreams/Sstreams/prefixOSstream.H | 7 +- .../dlLibraryTable/dlLibraryTable.C | 12 +- .../fields/Fields/Field/FieldFunctions.C | 8 +- .../fields/Fields/Field/FieldFunctions.H | 8 +- src/OpenFOAM/include/OSspecific.H | 1 - .../lduInterface/processorLduInterface.H | 2 +- .../processorLduInterfaceField.H | 2 +- .../GAMGAgglomerateLduAddressing.C | 2 +- .../GAMGAgglomeration/GAMGAgglomeration.H | 2 +- .../GAMGAgglomerationTemplates.C | 5 +- .../GAMGProcAgglomeration.C | 2 +- .../GAMGProcAgglomeration.H | 2 +- .../eagerGAMGProcAgglomeration.C | 2 +- .../masterCoarsestGAMGProcAgglomeration.C | 2 +- .../procFacesGAMGProcAgglomeration.C | 4 +- .../lduMatrix/solvers/GAMG/GAMGSolver.C | 2 +- .../lduMatrix/solvers/GAMG/GAMGSolver.H | 6 +- .../GAMG/GAMGSolverAgglomerateMatrix.C | 12 +- .../processorGAMGInterfaceField.H | 2 +- .../processorGAMGInterface.H | 2 +- src/OpenFOAM/meshes/lduMesh/lduMesh.H | 2 +- .../primitives/contiguous/contiguous.H | 59 ++-- src/OpenFOAM/primitives/ints/int/int.H | 34 +- src/OpenFOAM/primitives/ints/int/intIO.C | 70 +--- src/OpenFOAM/primitives/ints/int32/int32.C | 50 +++ src/OpenFOAM/primitives/ints/int32/int32.H | 137 ++++++++ .../ints/{ulong/ulongIO.C => int32/int32IO.C} | 39 ++- src/OpenFOAM/primitives/ints/int64/int64.C | 50 +++ src/OpenFOAM/primitives/ints/int64/int64.H | 137 ++++++++ .../ints/{long/longIO.C => int64/int64IO.C} | 38 ++- src/OpenFOAM/primitives/ints/label/label.C | 76 +---- src/OpenFOAM/primitives/ints/label/label.H | 300 ++---------------- .../{long/long.H => label/labelSpecific.H} | 51 ++- .../primitives/ints/longLong/longLongIO.C | 131 -------- src/OpenFOAM/primitives/ints/uLabel/uLabel.C | 70 ++-- src/OpenFOAM/primitives/ints/uLabel/uLabel.H | 163 ++-------- .../primitives/ints/uLabel/uLabelSpecific.H | 0 src/OpenFOAM/primitives/ints/uint/uint.H | 36 ++- src/OpenFOAM/primitives/ints/uint/uintIO.C | 64 +--- .../ints/{ulong/ulong.H => uint32/uint32.C} | 55 ++-- src/OpenFOAM/primitives/ints/uint32/uint32.H | 137 ++++++++ .../primitives/ints/uint32/uint32IO.C | 102 ++++++ .../{longLong/longLong.H => uint64/uint64.C} | 56 ++-- src/OpenFOAM/primitives/ints/uint64/uint64.H | 137 ++++++++ .../primitives/ints/uint64/uint64IO.C | 102 ++++++ src/Pstream/gamma/IPread.C | 5 +- src/Pstream/gamma/OPwrite.C | 10 +- src/Pstream/mpi/UPstream.C | 8 +- src/Pstream/mpi/allReduce.H | 2 +- src/Pstream/mpi/allReduceTemplates.C | 2 +- .../metisDecomp/dummyMetisDecomp.C | 12 +- .../ptscotchDecomp/dummyPtscotchDecomp.C | 26 +- .../scotchDecomp/dummyScotchDecomp.C | 14 +- .../processor/processorFvPatchField.H | 2 +- src/finiteVolume/fvMesh/fvMesh.H | 2 +- .../constraint/processor/processorFvPatch.H | 2 +- .../autoHexMeshDriver/autoSnapDriver.C | 21 +- .../autoHexMeshDriver/autoSnapDriverFeature.C | 2 +- .../meshRefinement/meshRefinementBaffles.C | 2 +- .../PatchEdgeFaceWave/PatchEdgeFaceWave.H | 2 +- .../searchableSurface/searchableSurface.C | 9 +- .../decompose/metisDecomp/metisDecomp.C | 24 +- .../decompose/metisDecomp/metisDecomp.H | 6 +- .../decompose/ptscotchDecomp/ptscotchDecomp.C | 50 +-- .../decompose/ptscotchDecomp/ptscotchDecomp.H | 16 +- .../decompose/scotchDecomp/scotchDecomp.C | 36 +-- .../decompose/scotchDecomp/scotchDecomp.H | 12 +- wmake/rules/General/general | 2 +- 116 files changed, 1515 insertions(+), 1242 deletions(-) create mode 100644 src/OpenFOAM/primitives/ints/int32/int32.C create mode 100644 src/OpenFOAM/primitives/ints/int32/int32.H rename src/OpenFOAM/primitives/ints/{ulong/ulongIO.C => int32/int32IO.C} (69%) create mode 100644 src/OpenFOAM/primitives/ints/int64/int64.C create mode 100644 src/OpenFOAM/primitives/ints/int64/int64.H rename src/OpenFOAM/primitives/ints/{long/longIO.C => int64/int64IO.C} (68%) rename src/OpenFOAM/primitives/ints/{long/long.H => label/labelSpecific.H} (71%) delete mode 100644 src/OpenFOAM/primitives/ints/longLong/longLongIO.C create mode 100644 src/OpenFOAM/primitives/ints/uLabel/uLabelSpecific.H rename src/OpenFOAM/primitives/ints/{ulong/ulong.H => uint32/uint32.C} (60%) create mode 100644 src/OpenFOAM/primitives/ints/uint32/uint32.H create mode 100644 src/OpenFOAM/primitives/ints/uint32/uint32IO.C rename src/OpenFOAM/primitives/ints/{longLong/longLong.H => uint64/uint64.C} (58%) create mode 100644 src/OpenFOAM/primitives/ints/uint64/uint64.H create mode 100644 src/OpenFOAM/primitives/ints/uint64/uint64IO.C diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.H index 0bf843f1c9..211bd75d39 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.H @@ -115,7 +115,7 @@ private: { typedef typename Triangulation::Geom_traits Gt; - typedef std::pair + typedef std::pair Point_3; struct Less_x_3 diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C index d987a8ad4f..f429112ed5 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C @@ -450,7 +450,7 @@ Foam::DelaunayMesh::createMesh } label faceI = 0; - labelList verticesOnTriFace(3, -1); + labelList verticesOnTriFace(3, label(-1)); face newFace(verticesOnTriFace); for @@ -461,7 +461,7 @@ Foam::DelaunayMesh::createMesh ) { const Cell_handle c1(fit->first); - const int oppositeVertex = fit->second; + const label oppositeVertex = fit->second; const Cell_handle c2(c1->neighbor(oppositeVertex)); // Do not output if face has neither opposite vertex as an internal diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C index b598a7f5de..322dc3f343 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C @@ -287,7 +287,7 @@ void Foam::DistributedDelaunayMesh::findProcessorBoundaryCells // Cell_handle cit = *vcit; // // // Index of infinite vertex in this cell. -// int i = cit->index(Triangulation::infinite_vertex()); +// label i = cit->index(Triangulation::infinite_vertex()); // // Cell_handle c = cit->neighbor(i); // @@ -333,7 +333,7 @@ void Foam::DistributedDelaunayMesh::findProcessorBoundaryCells if (Triangulation::is_infinite(cit)) { // Index of infinite vertex in this cell. - int i = cit->index(Triangulation::infinite_vertex()); + label i = cit->index(Triangulation::infinite_vertex()); Cell_handle c = cit->neighbor(i); diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C index 49fc665e93..5866652b79 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C @@ -497,7 +497,7 @@ void Foam::searchableSurfaceControl::cellSizeFunctionVertices List infoList(1, pointIndexHit()); vectorField normals(1); - labelList region(1, -1); + labelList region(1, label(-1)); forAll(points, pI) { diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index 2996493dbe..3fd302935a 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -43,7 +43,6 @@ SourceFiles #include "CGALTriangulation3Ddefs.H" #include "uint.H" -#include "ulong.H" #include "searchableSurfaces.H" #include "conformationSurfaces.H" #include "cellShapeControl.H" diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index df2c8c2f65..17dac1c349 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -172,7 +172,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh label faceI = 0; - labelList verticesOnTriFace(3, -1); + labelList verticesOnTriFace(3, label(-1)); face newFace(verticesOnTriFace); @@ -184,7 +184,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh ) { const Cell_handle c1(fit->first); - const int oppositeVertex = fit->second; + const label oppositeVertex = fit->second; const Cell_handle c2(c1->neighbor(oppositeVertex)); if (c1->hasFarPoint() && c2->hasFarPoint()) @@ -347,7 +347,7 @@ Foam::label Foam::conformalVoronoiMesh::mergeIdenticalDualVertices ) { const Cell_handle c1(fit->first); - const int oppositeVertex = fit->second; + const label oppositeVertex = fit->second; const Cell_handle c2(c1->neighbor(oppositeVertex)); if (is_infinite(c1) || is_infinite(c2)) @@ -1070,7 +1070,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality // Check for cells with one internal face only - labelList nInternalFaces(pMesh.nCells(), 0); + labelList nInternalFaces(pMesh.nCells(), label(0)); for (label fI = 0; fI < pMesh.nInternalFaces(); fI++) { @@ -1737,7 +1737,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches const label nPatches = patchNames.size(); - labelList procNeighbours(nPatches, -1); + labelList procNeighbours(nPatches, label(-1)); forAll(procNeighbours, patchI) { if (patchDicts[patchI].found("neighbProcNo")) @@ -2580,7 +2580,7 @@ void Foam::conformalVoronoiMesh::removeUnusedPoints label pointI = 0; - labelList oldToNew(pts.size(), -1); + labelList oldToNew(pts.size(), label(-1)); // Move all of the used points to the start of the pointField and // truncate it @@ -2637,7 +2637,7 @@ Foam::labelList Foam::conformalVoronoiMesh::removeUnusedCells label cellI = 0; - labelList oldToNew(cellUsed.size(), -1); + labelList oldToNew(cellUsed.size(), label(-1)); // Move all of the used cellCentres to the start of the pointField and // truncate it diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C index f142470106..f9d2e68981 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C @@ -922,7 +922,7 @@ void Foam::conformalVoronoiMesh::createMultipleEdgePointGroup const List& normalVolumeTypes = feMesh.normalVolumeTypes(); - labelList nNormalTypes(4, 0); + labelList nNormalTypes(4, label(0)); forAll(edNormalIs, edgeNormalI) { diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H index 7d35594258..e6896463d1 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H @@ -90,7 +90,7 @@ inline Foam::scalar Foam::conformalVoronoiMesh::averageAnyCellSize label nProducts = 0; const Cell_handle c(fit->first); - const int oppositeVertex = fit->second; + const label oppositeVertex = fit->second; for (label i = 0; i < 3; i++) { @@ -456,7 +456,7 @@ inline Foam::List Foam::conformalVoronoiMesh::processorsAttached DynamicList