From ed73a70b95d09932b923ec463b321dcf3d40a39b Mon Sep 17 00:00:00 2001 From: mattijs <mattijs@hunt.opencfd.co.uk> Date: Mon, 1 Jun 2009 13:24:38 +0100 Subject: [PATCH] input checking --- .../searchableSurface/searchableBox.C | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/meshTools/searchableSurface/searchableBox.C b/src/meshTools/searchableSurface/searchableBox.C index cb9ca7e4426..8b4c0f5c76c 100644 --- a/src/meshTools/searchableSurface/searchableBox.C +++ b/src/meshTools/searchableSurface/searchableBox.C @@ -170,7 +170,20 @@ Foam::searchableBox::searchableBox : searchableSurface(io), treeBoundBox(bb) -{} +{ + if (!contains(midpoint())) + { + FatalErrorIn + ( + "Foam::searchableBox::searchableBox\n" + "(\n" + " const IOobject& io,\n" + " const treeBoundBox& bb\n" + ")\n" + ) << "Illegal bounding box specification : " + << static_cast<const treeBoundBox>(*this) << exit(FatalError); + } +} Foam::searchableBox::searchableBox @@ -181,7 +194,20 @@ Foam::searchableBox::searchableBox : searchableSurface(io), treeBoundBox(dict.lookup("min"), dict.lookup("max")) -{} +{ + if (!contains(midpoint())) + { + FatalErrorIn + ( + "Foam::searchableBox::searchableBox\n" + "(\n" + " const IOobject& io,\n" + " const treeBoundBox& bb\n" + ")\n" + ) << "Illegal bounding box specification : " + << static_cast<const treeBoundBox>(*this) << exit(FatalError); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -- GitLab