Skip to content
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

more prism tests #52

Open
stevengj opened this issue Jan 21, 2020 · 3 comments
Open

more prism tests #52

stevengj opened this issue Jan 21, 2020 · 3 comments

Comments

@stevengj
Copy link
Collaborator

Would be nice to add some more prism tests. There are some tests that are easier to implement if you use a fixed object (or a set of fixed objects), as a supplement to the random "fuzz testing" in the test-prism.c code.

To start with, we could use some canonical non-convex test object (including some non right-angles), e.g. a C-like shape. Then you could precompute some things like the volume, the intersection of a box with the object, the normal vector at a few points, the result of point-in-prism at a few points (near boundaries and corners), and test against these.

@smartalecH
Copy link

I've added a tarball with ~200 tests to NanoComp/meep#864

The tests come from a paper/research group that focuses on point-in-polygon methods. We can selectively choose from those.

@stevengj
Copy link
Collaborator Author

(Don't make the C shape too rounded, since rounded shapes are very special in that subsequent edges are nearly parallel.)

It should be sufficient for now to implement tests for a handful of hard-coded points. We can always add additional test cases later as issues arise.

@stevengj
Copy link
Collaborator Author

stevengj commented Jan 27, 2020

It would also be reasonable to use the 200 tabulated tests you mentioned for the 2d point-in-polygon subroutine, but we still need separate tests for polyhedra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants