ENH: make dictionary of topoSet box sources consistent with searchableBox

This commit is contained in:
Mark Olesen
2018-11-06 13:25:56 +01:00
parent 72ae121558
commit 644c0f4a86
6 changed files with 36 additions and 18 deletions

View File

@ -114,11 +114,15 @@ Foam::boxToCell::boxToCell
topoSetCellSource(mesh),
bbs_()
{
// Look for 'boxes' or 'box'
// Accept 'boxes', 'box' or 'min/max'
if (!dict.readIfPresent("boxes", bbs_))
{
bbs_.resize(1);
dict.readEntry("box", bbs_.first());
if (!dict.readIfPresent("box", bbs_.first()))
{
dict.readEntry<point>("min", bbs_.first().min());
dict.readEntry<point>("max", bbs_.first().max());
}
}
}

View File

@ -30,13 +30,15 @@ Description
\heading Dictionary parameters
\table
Property | Description | Required | Default
box | A single bounding box | partly |
boxes | Multiple bounding boxes | partly |
box | A single bounding box | partly |
min | Minimum point for a single box | partly |
max | Maximum point for a single box | partly |
\endtable
Note
Must specify either "box" or "boxes".
The selection of multiple boxes has precedence.
In the order of highest to lowest precedence, must specify "boxes",
"box" or a "min/max" pair (compatibility with searchable box).
SourceFiles
boxToCell.C
@ -92,7 +94,7 @@ public:
//- Construct from dictionary
boxToCell(const polyMesh& mesh, const dictionary& dict);
//- Construct from Istream
//- Construct from stream - a single box.
boxToCell(const polyMesh& mesh, Istream& is);

View File

@ -114,11 +114,15 @@ Foam::boxToFace::boxToFace
topoSetFaceSource(mesh),
bbs_()
{
// Look for 'boxes' or 'box'
// Accept 'boxes', 'box' or 'min/max'
if (!dict.readIfPresent("boxes", bbs_))
{
bbs_.resize(1);
dict.readEntry("box", bbs_.first());
if (!dict.readIfPresent("box", bbs_.first()))
{
dict.readEntry<point>("min", bbs_.first().min());
dict.readEntry<point>("max", bbs_.first().max());
}
}
}

View File

@ -30,13 +30,15 @@ Description
\heading Dictionary parameters
\table
Property | Description | Required | Default
box | A single bounding box | partly |
boxes | Multiple bounding boxes | partly |
box | A single bounding box | partly |
min | Minimum point for a single box | partly |
max | Maximum point for a single box | partly |
\endtable
Note
Must specify either "box" or "boxes".
The selection of multiple boxes has precedence.
In the order of highest to lowest precedence, must specify "boxes",
"box" or a "min/max" pair (compatibility with searchable box).
SourceFiles
boxToFace.C
@ -92,7 +94,7 @@ public:
//- Construct from dictionary
boxToFace(const polyMesh& mesh, const dictionary& dict);
//- Construct from Istream
//- Construct from stream - a single box.
boxToFace(const polyMesh& mesh, Istream& is);

View File

@ -114,11 +114,15 @@ Foam::boxToPoint::boxToPoint
topoSetPointSource(mesh),
bbs_()
{
// Look for 'boxes' or 'box'
// Accept 'boxes', 'box' or 'min/max'
if (!dict.readIfPresent("boxes", bbs_))
{
bbs_.resize(1);
dict.readEntry("box", bbs_.first());
if (!dict.readIfPresent("box", bbs_.first()))
{
dict.readEntry<point>("min", bbs_.first().min());
dict.readEntry<point>("max", bbs_.first().max());
}
}
}

View File

@ -30,13 +30,15 @@ Description
\heading Dictionary parameters
\table
Property | Description | Required | Default
box | A single bounding box | partly |
boxes | Multiple bounding boxes | partly |
box | A single bounding box | partly |
min | Minimum point for a single box | partly |
max | Maximum point for a single box | partly |
\endtable
Note
Must specify either "box" or "boxes".
The selection of multiple boxes has precedence.
In the order of highest to lowest precedence, must specify "boxes",
"box" or a "min/max" pair (compatibility with searchable box).
SourceFiles
boxToPoint.C
@ -93,7 +95,7 @@ public:
//- Construct from dictionary
boxToPoint(const polyMesh& mesh, const dictionary& dict);
//- Construct from Istream
//- Construct from stream - a single box.
boxToPoint(const polyMesh& mesh, Istream& is);