box now checks for min and max point consistency

This commit is contained in:
HRN 2025-02-24 14:40:29 +03:30
parent b44c4de3f6
commit 05ecf37eee
2 changed files with 18 additions and 3 deletions

View File

@ -36,7 +36,15 @@ pFlow::box::box
(
dict.getVal<realx3>("max")
)
{}
{
if( !(min_ < max_))
{
fatalErrorInFunction<<
"the corenter points of box are not set correctly"<<
" (min point is greater than max point). In dictionary "<< dict.globalName()<<endl;
fatalExit;
}
}
FUNCTION_H
pFlow::box::box
@ -58,6 +66,13 @@ bool pFlow::box::read(iIstream & is)
{
if(!is.nextData<realx3>("min", min_)) return false;
if(!is.nextData<realx3>("max", max_)) return false;
if(!(min_ < max_))
{
ioErrorInFile(is.name(), is.lineNumber())<<
"the corenter points of box are not set correctly"<<
" (min point is greater than max point). In dictionary "<<endl;
return false;
}
return true;
}

View File

@ -31,7 +31,7 @@ namespace pFlow
class box
{
protected:
private:
// - min point
realx3 min_{0,0,0};