-
Notifications
You must be signed in to change notification settings - Fork 32
Initial clipping code re-factor #1667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… into feature/gunney/initial-mesh-clipper
Arlie-Capps
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few typos and unclear spots, a possible data write conflict within a loop, and a need for refactoring three methods down to one. Let's chat about the loop: perhaps I don't understand what is going on well enough.
The refactoring three methods to one needs to happen, but we can do it when this gets moved out of experimental namespace.
Arlie-Capps
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gunney1 , I appreciate your work on this, and your fixes. As we discussed, there is work to be done in a future PR. This one looks to be in a good shape.
kennyweiss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gunney1 -- lots of good work in here.
I have some concerns related to the generality of ShapeMesh and the overlap in functionality between this and bump, but I think we'll work these out in the future when we pull this out of the experimental namespace.
In the immediate term, since you're guarding sidre in some cases, I want to make sure that this compiles properly when AXOM_ENABLE_SIDRE is off.
| /*! | ||
| * \brief Implementation of a GeometryOperatorVisitor for processing klee shape operators | ||
| * | ||
| * This class extracts the matrix form of supported operators. | ||
| * For other operators, it sets the valid flag to false. | ||
| * To use, check the \a isValid() function after visiting and then call the \a getMatrix() function. | ||
| */ | ||
| class AffineMatrixVisitor : public klee::GeometryOperatorVisitor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note (likely for a future PR) -- I think these should be available directly in Klee rather than in Quest,
e.g. here as well:
See also: #1628
| const axom::primal::BoundingBox<double, 2>& MeshClipperStrategy::getBoundingBox2D() const | ||
| { | ||
| static const axom::primal::BoundingBox<double, 2> invalidBb2d; | ||
| return invalidBb2d; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should return by value to avoid the static instance (see comment in header)
This reverts commit 02f7c01. That commit tried to update the compiler to fix a probable compiler bug, but the 6.4 may have other bugs.
Good point @kennyweiss. I fixed the new code and made an issue for an existing non-sidre build, #1708 |
Summary
This PR is an initial refactoring of the clipping code in
IntersectionShaper.IntersectionShaperhas 4 significant jobs that make it big and a bit unwieldy.IntersectionShaperto use.This PR
IntersectionShaper. The idea is to eventually remove theIntersectionShaper's clipping code and use the new clipping code instead.ArrayViewobjects, regardless of whether the mesh is Blueprint or MFEM, and stored in Sidre or Conduit. This part is a work-in-progress in that MFEM support has not started.Completed work
MeshClipperclass provides the access point for the clipping functionality.MeshClipper::clipcomputes the overlap volume for every cell in the mesh.MeshClipper::clipmethod uses fast geometry-specific operations where they are available and falls back on a general method where they aren't.IntersectionShaper. This general method is the only choice when using the currentIntersectionShaper.MeshClipperImpl, a class templated on execution-space . This class containscomputeClipVolumed3D, the code taken fromIntersectionShaper. The two other versions of this method do the same thing but on a subset of cells or tets (from cells) that excludes those outside or inside the geometry.MeshClipperStrategy.ShapeMeshencapsulates the mesh being shaped into. It provides a uniform interface for accessing the mesh data, regardless of whether the data is stored in Conduit or Sidre or by blueprint or (future) MFEM convention.ShapeMeshalso computes and caches a variety of mesh-dependent data to amortize their cost among all clipping geometries.MeshClipper.New codes are in
namespace experimental, because this is a work in progress.Dependencies
The mesh clipping refactor includes multiple PRs. Please review these before this one.