From 6ef91c9489103a3c985ea9633693e7ce1780fa1f Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Mon, 7 Nov 2016 14:15:27 +0000 Subject: [PATCH] ENH: cloudSet: report missing samples. (fixes #22) --- src/sampling/sampledSet/cloud/cloudSet.C | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sampling/sampledSet/cloud/cloudSet.C b/src/sampling/sampledSet/cloud/cloudSet.C index 43d7f11fe70..8ce6fb6bec0 100644 --- a/src/sampling/sampledSet/cloud/cloudSet.C +++ b/src/sampling/sampledSet/cloud/cloudSet.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -66,6 +66,16 @@ void Foam::cloudSet::calcSamples samplingCurveDist.append(1.0 * sampleI); } } + + label nTotalCells = returnReduce(samplingPts.size(), sumOp<label>()); + if (nTotalCells < sampleCoords_.size()) + { + WarningInFunction + << "For sample set " << name() + << " found only " << nTotalCells << " out of " + << sampleCoords_.size() + << " input points." << endl; + } } -- GitLab