STYLE: enforce dictionary read length for box/boxes entry

This commit is contained in:
Mark Olesen
2018-07-05 10:58:34 +02:00
parent 8431964bcb
commit 209884d39b
3 changed files with 36 additions and 21 deletions

View File

@ -85,13 +85,18 @@ Foam::boxToCell::boxToCell
)
:
topoSetSource(mesh),
bbs_
(
dict.found("box")
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
: dict.lookup("boxes")
)
{}
bbs_()
{
if (dict.found("box"))
{
bbs_.resize(1);
dict.read("box", bbs_.first());
}
else
{
dict.read("boxes", bbs_);
}
}
Foam::boxToCell::boxToCell

View File

@ -85,13 +85,18 @@ Foam::boxToFace::boxToFace
)
:
topoSetSource(mesh),
bbs_
(
dict.found("box")
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
: dict.lookup("boxes")
)
{}
bbs_()
{
if (dict.found("box"))
{
bbs_.resize(1);
dict.read("box", bbs_.first());
}
else
{
dict.read("boxes", bbs_);
}
}
Foam::boxToFace::boxToFace

View File

@ -84,13 +84,18 @@ Foam::boxToPoint::boxToPoint
)
:
topoSetSource(mesh),
bbs_
(
dict.found("box")
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
: dict.lookup("boxes")
)
{}
bbs_()
{
if (dict.found("box"))
{
bbs_.resize(1);
dict.read("box", bbs_.first());
}
else
{
dict.read("boxes", bbs_);
}
}
Foam::boxToPoint::boxToPoint