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), topoSetCellSource(mesh),
bbs_() bbs_()
{ {
// Look for 'boxes' or 'box' // Accept 'boxes', 'box' or 'min/max'
if (!dict.readIfPresent("boxes", bbs_)) if (!dict.readIfPresent("boxes", bbs_))
{ {
bbs_.resize(1); 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 \heading Dictionary parameters
\table \table
Property | Description | Required | Default Property | Description | Required | Default
box | A single bounding box | partly |
boxes | Multiple bounding boxes | 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 \endtable
Note Note
Must specify either "box" or "boxes". In the order of highest to lowest precedence, must specify "boxes",
The selection of multiple boxes has precedence. "box" or a "min/max" pair (compatibility with searchable box).
SourceFiles SourceFiles
boxToCell.C boxToCell.C
@ -92,7 +94,7 @@ public:
//- Construct from dictionary //- Construct from dictionary
boxToCell(const polyMesh& mesh, const dictionary& dict); boxToCell(const polyMesh& mesh, const dictionary& dict);
//- Construct from Istream //- Construct from stream - a single box.
boxToCell(const polyMesh& mesh, Istream& is); boxToCell(const polyMesh& mesh, Istream& is);

View File

@ -114,11 +114,15 @@ Foam::boxToFace::boxToFace
topoSetFaceSource(mesh), topoSetFaceSource(mesh),
bbs_() bbs_()
{ {
// Look for 'boxes' or 'box' // Accept 'boxes', 'box' or 'min/max'
if (!dict.readIfPresent("boxes", bbs_)) if (!dict.readIfPresent("boxes", bbs_))
{ {
bbs_.resize(1); 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 \heading Dictionary parameters
\table \table
Property | Description | Required | Default Property | Description | Required | Default
box | A single bounding box | partly |
boxes | Multiple bounding boxes | 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 \endtable
Note Note
Must specify either "box" or "boxes". In the order of highest to lowest precedence, must specify "boxes",
The selection of multiple boxes has precedence. "box" or a "min/max" pair (compatibility with searchable box).
SourceFiles SourceFiles
boxToFace.C boxToFace.C
@ -92,7 +94,7 @@ public:
//- Construct from dictionary //- Construct from dictionary
boxToFace(const polyMesh& mesh, const dictionary& dict); boxToFace(const polyMesh& mesh, const dictionary& dict);
//- Construct from Istream //- Construct from stream - a single box.
boxToFace(const polyMesh& mesh, Istream& is); boxToFace(const polyMesh& mesh, Istream& is);

View File

@ -114,11 +114,15 @@ Foam::boxToPoint::boxToPoint
topoSetPointSource(mesh), topoSetPointSource(mesh),
bbs_() bbs_()
{ {
// Look for 'boxes' or 'box' // Accept 'boxes', 'box' or 'min/max'
if (!dict.readIfPresent("boxes", bbs_)) if (!dict.readIfPresent("boxes", bbs_))
{ {
bbs_.resize(1); 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 \heading Dictionary parameters
\table \table
Property | Description | Required | Default Property | Description | Required | Default
box | A single bounding box | partly |
boxes | Multiple bounding boxes | 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 \endtable
Note Note
Must specify either "box" or "boxes". In the order of highest to lowest precedence, must specify "boxes",
The selection of multiple boxes has precedence. "box" or a "min/max" pair (compatibility with searchable box).
SourceFiles SourceFiles
boxToPoint.C boxToPoint.C
@ -93,7 +95,7 @@ public:
//- Construct from dictionary //- Construct from dictionary
boxToPoint(const polyMesh& mesh, const dictionary& dict); boxToPoint(const polyMesh& mesh, const dictionary& dict);
//- Construct from Istream //- Construct from stream - a single box.
boxToPoint(const polyMesh& mesh, Istream& is); boxToPoint(const polyMesh& mesh, Istream& is);