diff --git a/src/sampling/sampledSet/array/arraySet.C b/src/sampling/sampledSet/array/arraySet.C index ca408c105e..66931ea954 100644 --- a/src/sampling/sampledSet/array/arraySet.C +++ b/src/sampling/sampledSet/array/arraySet.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018,2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,6 +56,15 @@ void Foam::arraySet::calcSamples { const meshSearch& queryMesh = searchEngine(); + if (cmptMin(pointsDensity_) < 1) + { + FatalErrorInFunction << "Illegal specification for pointsDensity " + << pointsDensity_ + << ". It specifies the number of points per coordinate axis" + << " so should contain positive integers only." + << exit(FatalError); + } + const scalar dx = spanBox_.x()/(pointsDensity_.x() + 1); const scalar dy = spanBox_.y()/(pointsDensity_.y() + 1); const scalar dz = spanBox_.z()/(pointsDensity_.z() + 1); diff --git a/src/sampling/sampledSet/array/arraySet.H b/src/sampling/sampledSet/array/arraySet.H index 394403631e..e1772e1221 100644 --- a/src/sampling/sampledSet/array/arraySet.H +++ b/src/sampling/sampledSet/array/arraySet.H @@ -39,7 +39,18 @@ Description spanBox | The sample box dimensions (vector) | yes | \endtable - The dictionary can also contain an embedded coordinateSystem specification. + The dictionary should also contain an embedded (Cartesian) coordinateSystem + specification, for example, + + \verbatim + origin (-0.05 -0.05 -0.05); + rotation + { + type axes; + e1 (1 0 0); + e2 (0 1 0); + } + \endverbatim SourceFiles arraySet.C