diff --git a/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C b/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C index 297e918ca0..f9b26cf9b9 100644 --- a/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C +++ b/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -924,8 +924,8 @@ int main(int argc, char *argv[]) runTime++; } - Info<< "Writing mesh without blockedCells to time " << runTime.value() - << endl; + Info<< "Writing mesh without blockedCells to time " + << runTime.userTimeName() << endl; // Subsetting adds 'subset' prefix. Rename field to be like original. forAll(scalarFlds, i) @@ -1147,8 +1147,8 @@ int main(int argc, char *argv[]) subsetter.subMesh().movePoints(map().preMotionPoints()); } - Info<< "Writing mesh with split blockedFaces to time " << runTime.value() - << endl; + Info<< "Writing mesh with split blockedFaces to time " + << runTime.userTimeName() << endl; subsetter.subMesh().write(); diff --git a/applications/utilities/postProcessing/miscellaneous/temporalInterpolate/temporalInterpolate.C b/applications/utilities/postProcessing/miscellaneous/temporalInterpolate/temporalInterpolate.C index 7857a15b0a..e5d1ccbc05 100644 --- a/applications/utilities/postProcessing/miscellaneous/temporalInterpolate/temporalInterpolate.C +++ b/applications/utilities/postProcessing/miscellaneous/temporalInterpolate/temporalInterpolate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,11 +136,6 @@ void fieldInterpolator::interpolate() UIndirectList(timeNames_, indices)() ); - // Info<< "For time " << runTime_.value() - // << " need times " << selectedTimeNames - // << " need weights " << weights << endl; - - // Read on the objectRegistry all the required fields ReadFields ( diff --git a/applications/utilities/preProcessing/mapFields/setTimeIndex.H b/applications/utilities/preProcessing/mapFields/setTimeIndex.H index 20012e3d20..18c60c6175 100644 --- a/applications/utilities/preProcessing/mapFields/setTimeIndex.H +++ b/applications/utilities/preProcessing/mapFields/setTimeIndex.H @@ -1,4 +1,13 @@ +{ instantList sourceTimes = runTimeSource.times(); + + if (sourceTimes.empty()) + { + FatalErrorInFunction << "No result times in source " + << runTimeSource.caseName() + << exit(FatalError); + } + label sourceTimeIndex = runTimeSource.timeIndex(); if (args.optionFound("sourceTime")) { @@ -20,12 +29,13 @@ sourceTimeIndex = Time::findClosestTimeIndex ( sourceTimes, - runTimeTarget.time().value() + runTimeTarget.time().userTimeValue() ); } runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex); - Info<< "\nSource time: " << runTimeSource.value() - << "\nTarget time: " << runTimeTarget.value() + Info<< "\nSource time: " << runTimeSource.userTimeName() + << "\nTarget time: " << runTimeTarget.userTimeName() << endl; +} diff --git a/applications/utilities/preProcessing/mapFieldsPar/setTimeIndex.H b/applications/utilities/preProcessing/mapFieldsPar/setTimeIndex.H index e1ca52e097..18c60c6175 100644 --- a/applications/utilities/preProcessing/mapFieldsPar/setTimeIndex.H +++ b/applications/utilities/preProcessing/mapFieldsPar/setTimeIndex.H @@ -29,13 +29,13 @@ sourceTimeIndex = Time::findClosestTimeIndex ( sourceTimes, - runTimeTarget.time().value() + runTimeTarget.time().userTimeValue() ); } runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex); - Info<< "\nSource time: " << runTimeSource.value() - << "\nTarget time: " << runTimeTarget.value() + Info<< "\nSource time: " << runTimeSource.userTimeName() + << "\nTarget time: " << runTimeTarget.userTimeName() << endl; } diff --git a/applications/utilities/surface/surfaceMeshTriangulate/surfaceMeshTriangulate.C b/applications/utilities/surface/surfaceMeshTriangulate/surfaceMeshTriangulate.C index fc8bca4d3f..c0ca1f4eeb 100644 --- a/applications/utilities/surface/surfaceMeshTriangulate/surfaceMeshTriangulate.C +++ b/applications/utilities/surface/surfaceMeshTriangulate/surfaceMeshTriangulate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) Info<< "Excluding all processor patches." << nl << endl; } - Info<< "Reading mesh from time " << runTime.value() << endl; + Info<< "Reading mesh from time " << runTime.userTimeName() << endl; #include "createNamedPolyMesh.H" diff --git a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C index 2cd7da6e4c..f9ded505ed 100644 --- a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C +++ b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -324,7 +324,8 @@ int main(int argc, char *argv[]) runTime++; // Write resulting mesh - Info<< "Writing modified mesh to time " << runTime.value() << endl; + Info<< "Writing modified mesh to time " + << runTime.userTimeName() << endl; mesh.write(); } diff --git a/src/OpenFOAM/db/Time/timeSelector.C b/src/OpenFOAM/db/Time/timeSelector.C index f9d2362b1f..31a54737eb 100644 --- a/src/OpenFOAM/db/Time/timeSelector.C +++ b/src/OpenFOAM/db/Time/timeSelector.C @@ -304,7 +304,7 @@ Foam::instantList Foam::timeSelector::selectIfPresent 1, instant ( - runTime.timeToUserTime(runTime.value()), + runTime.userTimeValue(), runTime.timeName() ) ); diff --git a/src/sampling/probes/patchProbesTemplates.C b/src/sampling/probes/patchProbesTemplates.C index 95751702ed..ead33fb1c4 100644 --- a/src/sampling/probes/patchProbesTemplates.C +++ b/src/sampling/probes/patchProbesTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ void Foam::patchProbes::sampleAndWrite probeStream << setw(w) - << vField.time().timeToUserTime(vField.time().value()); + << vField.time().userTimeValue(); forAll(values, probei) { @@ -71,7 +71,7 @@ void Foam::patchProbes::sampleAndWrite probeStream << setw(w) - << sField.time().timeToUserTime(sField.time().value()); + << sField.time().userTimeValue(); forAll(values, probei) { diff --git a/src/sampling/probes/probesTemplates.C b/src/sampling/probes/probesTemplates.C index f1713ccf0a..ec93bc0be0 100644 --- a/src/sampling/probes/probesTemplates.C +++ b/src/sampling/probes/probesTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,7 +76,7 @@ void Foam::probes::sampleAndWrite const unsigned int w = IOstream::defaultPrecision() + 7; OFstream& os = *probeFilePtrs_[vField.name()]; - os << setw(w) << vField.time().timeToUserTime(vField.time().value()); + os << setw(w) << vField.time().userTimeValue(); forAll(values, probei) { @@ -102,7 +102,7 @@ void Foam::probes::sampleAndWrite const unsigned int w = IOstream::defaultPrecision() + 7; OFstream& os = *probeFilePtrs_[sField.name()]; - os << sField.time().timeToUserTime(sField.time().value()); + os << sField.time().userTimeValue(); forAll(values, probei) { diff --git a/tutorials/combustion/XiFoam/RAS/kivaTest/system/controlDict b/tutorials/combustion/XiFoam/RAS/kivaTest/system/controlDict index 658df7d2d9..70ca38c095 100644 --- a/tutorials/combustion/XiFoam/RAS/kivaTest/system/controlDict +++ b/tutorials/combustion/XiFoam/RAS/kivaTest/system/controlDict @@ -70,7 +70,7 @@ functions codeExecute #{ const Time& runTime = mesh().time(); - if (runTime.timeToUserTime(runTime.value()) >= -15.0) + if (runTime.userTimeValue() >= -15.0) { const_cast(runTime).setDeltaT (