From dfdbe7efd0aa5b567d5870cb4bc5ece6b0c0e547 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 15 Jul 2022 14:43:31 +0200 Subject: [PATCH] ENH: add instance searching routines - find start index - find index range spanning a time --- applications/test/instant/Test-instant.C | 36 ++++++++++- src/OpenFOAM/db/Time/instant/Instant.H | 21 ++----- src/OpenFOAM/db/Time/instant/instant.C | 60 +++++++++++++++++- src/OpenFOAM/db/Time/instant/instant.H | 28 ++++++++- ...meVaryingMappedFixedValuePointPatchField.C | 33 +++++----- .../PatchFunction1/MappedFile/MappedFile.C | 33 +++++----- .../pointToPointPlanarInterpolation.C | 61 ------------------- .../pointToPointPlanarInterpolation.H | 10 --- .../noise/noiseModels/noiseModel/noiseModel.C | 20 ------ .../noise/noiseModels/noiseModel/noiseModel.H | 8 ++- .../noiseModels/surfaceNoise/surfaceNoise.C | 7 +-- 11 files changed, 166 insertions(+), 151 deletions(-) diff --git a/applications/test/instant/Test-instant.C b/applications/test/instant/Test-instant.C index f5d38b1ad7..4b6af1e121 100644 --- a/applications/test/instant/Test-instant.C +++ b/applications/test/instant/Test-instant.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,11 +30,31 @@ Description #include "argList.H" #include "instant.H" +#include "Pair.H" #include "fileNameInstant.H" #include "DynamicList.H" using namespace Foam; +template +Ostream& printInstant(const UList& times, const label i) +{ + if (i >= 0 && i < times.size()) + { + Info<< " (" << times[i] << ")"; + } + return Info; +} + +template +Ostream& printInstant(const UList& times, const Pair