- The code create a box with a (0,0,0) point.
The new definition is more logical and makes it very easy to grow
the bounding box to include new points. It also simplifies much of
the logic in the constructors.
- Use ROOTVGREAT instead of VGREAT for sizing greatBox and invertedBox.
Avoids some overflow issues reported by Mattijs (thus GREAT has been
used in treeBoundBox), but might still need further revision.
- Constructor for bounding box of a single point.
- add(boundBox), add(point) ...
-> Extend box to enclose the second box or point(s).
Eg,
bb.add(pt);
vs.
bb.min() = Foam::min(bb.min(), pt);
bb.max() = Foam::max(bb.max(), pt);
Also works with other bounding boxes.
Eg,
bb.add(bb2);
// OR
bb += bb2;
vs.
bb.min() = Foam::min(bb.min(), bb2.min());
bb.max() = Foam::max(bb.max(), bb2.max());
'+=' operator allows the reduction to be used in parallel
gather/scatter operations.
A global '+' operator is not currently needed.
Note: may be useful in the future to have a 'clear()' method
that resets to a zero-sized (inverted) box.
STYLE: make many bounding box constructors explicit
- extend the sampling concept to include surfMeshes and surfFields
for storage.
- Note the createOnRead switch in surfMeshSamplers can be desirable in
some situations to force creation of the surface faces within the
constructor.
- all sampled surface types now consistently use the same storage,
which allows some more simplifications in the future.
- before/after comparison of the sampledTriSurfaceMesh tested with
motorbike passenger helmet (serial and parallel). Use the newly added
'keepIds' functionality to retain the original ids, and can also
compare them to the original obj file with "GenerateIds" in paraview.
- this makes it easier to reuse the code, and sampledSurface expect
a face (not a labelledFace), so this also eliminates a translation
level and simplifies memory management.
- before/after comparison of the sampled iso-surfaces tested with
iso-surfaces from interFoam/RAS/angledDuct tutorial (serial and
parallel)
For example,
surfaces
(
helmet
{
type sampledTriSurfaceMesh;
surface motorBike-passenger-helmet.obj;
source cells;
keepIds true; <<-- NEW
}
);
This will create an additional "Ids" field that can be used to sort
or as a faceMap to recover the original face order.
- identical code was present in surfaceCheck (original source),
and isoSurface, isoSurfaceCell (copies).
- add in a MeshedSurface<face> variant as well, since this will likely
be needed in the near future
- make top-level Sf(), magSf(), Cf() pure virtual since the
sub-classes will always be providing the face/point storage,
with either triSurface or MeshedSurface in the background
- Use ensightCase for case writing.
Rebase ensightPartCells/ensightPartFaces on
ensightCells/ensightFaces routines.
- Greatly reduces code duplication potential source of errors.
- For merging meshedSurf content from parallel sources.
Ensures zoneIds are properly preserved for sampling in parallel.
Current state
~~~~~~~~~~~~~
Current producers of the region information:
* sampledTriSurfaceMesh
Current consumers of the region information:
* nastran writer. The zone ids passed through as PSHELL Ids (with offset 1).
Limitations
The per-face region association is preserved, but the face/element
sort order gets lost in reconstruction. Would need to attach
additional information to the sampled surface and use that for
sorting, but this would also imply that sampled values be written
indirectly (or resorted) too to match the order. Zone ids are passed
through, but not their names. After reconstruction, zone ids are no
longer contiguous. Re-sorting (as mentioned above) would solve this
too, but again at the cost of more complexity when writing.
- Allows passing of additional information (per-face zone ids) or possibly
other things, while reducing the number of arguments to pass.
- In sampledTriSurfaceMesh, preserve the region information that was
read in, passing it onwards via the UnsortedMeshSurface content.
The Nastran surface writer is currently the only writer making use
of this per-face zone information.
Passing it through as a PSHELL attribute, which should retain the
distinction for parts. (issue #204)
- use surfFaces() to return the templated list of faces.
This frees up the method 'faces()' to be used as a virtual method,
which will be needed at a later stage.