mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: boundBox 'reduce' method (related to #196)
reduce()
- parallel reduction of min/max values.
Reduces coding for the callers.
Eg,
bb.reduce();
instead of the previous method:
reduce(bb.min(), minOp<point>());
reduce(bb.max(), maxOp<point>());
STYLE:
- use initializer list for creating static content
- use point::min/point::max when defining standard boxes
This commit is contained in:
@ -60,6 +60,18 @@ int main(int argc, char *argv[])
|
||||
Info<<"boundBox faces: " << boundBox::faces << endl;
|
||||
Info<<"hex faces: " << hex.modelFaces() << endl;
|
||||
|
||||
boundBox bb = boundBox::greatBox;
|
||||
Info<<"great box: " << bb << endl;
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
bb = cube(Pstream::myProcNo(), 1.1);
|
||||
Pout<<"box: " << bb << endl;
|
||||
|
||||
bb.reduce();
|
||||
Pout<<"reduced: " << bb << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user