Merged
Conversation
Collaborator
|
|
| } | ||
| case GEOM BLOCK: { | ||
| vector3 size = o.subclass.block_data->size; | ||
| double vol = size.x * size.y * size.z * fabs(matrix3x3_determinant(geometry_lattice.basis) / matrix3x3_determinant(o.subclass.block_data->projection_matrix)); |
Contributor
There was a problem hiding this comment.
The failing tests are because a size of 0 in any dimension here makes vol equal to 0.
Collaborator
Author
There was a problem hiding this comment.
For now, I'll work around this by simply not using the geometric_object_volume optimization in 1d and 2d.
bmwiedemann
added a commit
to bmwiedemann/openSUSE
that referenced
this pull request
Aug 17, 2020
https://build.opensuse.org/request/show/827344 by user badshah400 + dimstar_suse - Update Source URL, moved to https://github.com/NanoComp/libctl. - update to 4.5.0: * New `make_slanted_prism` functions to make a prism with a given sidewall angle (gh#NanoComp/libctl#53). * Defined `LIBCTL_MAJOR_VERSION` etc. in `ctlgeom.h` header file when using stand-alone libctlgeom. * Bugfix in point-in-prism test (gh#NanoComp/libctl#49). * `geom_object_volume` function to get the volume of a 3d object (accelerates `box_overlap_with_object` for objects completely within a box) (gh#NanoComp/libctl#45). * `ctl_printf_callback` so that callers can capture stdout (gh#NanoComp/libctl#39).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds new
geometric_object_volumefunction to compute the volume of a given object.Speeds up
box_overlap_with_objectwhen the object is entirely contained within the box, by using the analytical volume formula instead of numerical integration in this case.