diff --git a/applications/test/HashTable4/Test-HashTable4.cxx b/applications/test/HashTable4/Test-HashTable4.cxx index e474436870..12b63ae291 100644 --- a/applications/test/HashTable4/Test-HashTable4.cxx +++ b/applications/test/HashTable4/Test-HashTable4.cxx @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) #endif loopInsert(map, nElem); - (void)timer.cpuTimeIncrement(); + timer.resetCpuTimeIncrement(); unsigned long sum = 0; for (label loopi = 0; loopi < nFind*nLoops; ++loopi) @@ -268,7 +268,7 @@ int main(int argc, char *argv[]) HashSet> map(32); loopInsert(map, nElem); - (void)timer.cpuTimeIncrement(); + timer.resetCpuTimeIncrement(); unsigned long sum = 0; for (label loopi = 0; loopi < nFind*nLoops; ++loopi) diff --git a/applications/test/nullObject/Make/files b/applications/test/nullObject/Make/files index dffa06d747..fdd71c155e 100644 --- a/applications/test/nullObject/Make/files +++ b/applications/test/nullObject/Make/files @@ -1,3 +1,3 @@ -Test-nullObject.C +Test-nullObject.cxx EXE = $(FOAM_USER_APPBIN)/Test-nullObject diff --git a/applications/test/nullObject/Test-nullObject.C b/applications/test/nullObject/Test-nullObject.cxx similarity index 92% rename from applications/test/nullObject/Test-nullObject.C rename to applications/test/nullObject/Test-nullObject.cxx index 0f7cd10dad..475a4e55b0 100644 --- a/applications/test/nullObject/Test-nullObject.C +++ b/applications/test/nullObject/Test-nullObject.cxx @@ -37,6 +37,7 @@ Description #include "HashSet.H" #include "faceList.H" #include "pointField.H" +#include "globalIndex.H" #include "IOstreams.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -150,6 +151,18 @@ int main() NullObject::nullObject = "hello world"; NullObject::nullObject = Foam::identity(5); + + { + const auto& gi = globalIndex::null(); + Info<< "globalIndex::null() => " + << " empty: " << gi.empty() + << " nProcs: " << gi.nProcs() + << " total-size: " << gi.totalSize() << nl; + + // Even this works + Info<< " offsets: " << gi.offsets() << nl; + } + Info<< nl; return 0; diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 7c08c679a5..64011258c6 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -123,6 +123,7 @@ Usage \*---------------------------------------------------------------------------*/ #include "argList.H" +#include "clockTime.H" #include "timeSelector.H" #include "IOobjectList.H" #include "fvMesh.H" @@ -147,6 +148,24 @@ Usage using namespace Foam; +// Slightly messy way of handling timing, but since the timing points +// are scattered between 'main()' and other local functions... + +clockTime timer; + +// Timing categories +enum TimingType +{ + READ_MESH, // Reading mesh + READ_FIELDS, // Reading fields + DECOMPOSE, // Domain decomposition (if any) + CELL_CELLS, // globalMeshData::calcCellCells + RENUMBER, // The renumberMethod + REORDER, // Mesh reordering (topoChange) + WRITING, // Writing mesh/fields +}; +FixedList timings; + // Create named field from labelList for post-processing tmp createScalarField @@ -205,8 +224,8 @@ void getBand scalar& sumSqrIntersect // scalar to avoid overflow ) { - labelList cellBandwidth(nCells, Zero); - scalarField nIntersect(nCells, Zero); + labelList cellBandwidth(nCells, Foam::zero{}); + scalarField nIntersect(nCells, Foam::zero{}); forAll(neighbour, facei) { @@ -627,8 +646,33 @@ CompactListList