input checking

This commit is contained in:
mattijs
2009-06-01 13:24:38 +01:00
parent da89474c3b
commit ed73a70b95

View File

@ -170,7 +170,20 @@ Foam::searchableBox::searchableBox
: :
searchableSurface(io), searchableSurface(io),
treeBoundBox(bb) 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 Foam::searchableBox::searchableBox
@ -181,7 +194,20 @@ Foam::searchableBox::searchableBox
: :
searchableSurface(io), searchableSurface(io),
treeBoundBox(dict.lookup("min"), dict.lookup("max")) 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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //