diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ac593a..557bdaa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ - Bug fixes - Fix accuracy of 3x3 SVD ``wp.svd3`` with fp64 numbers ([GH-281](https://github.com/NVIDIA/warp/issues/281)). - Fix module hashing when a kernel argument contained a struct array ([GH-287](https://github.com/NVIDIA/warp/issues/287)). - - Fix a bug in `wp.bvh_query_aabb()` where the direction instead of the reciprocal direction was used + - Fix a bug in `wp.bvh_query_ray()` where the direction instead of the reciprocal direction was used ([GH-288](https://github.com/NVIDIA/warp/issues/288)). - Fix errors when launching a CUDA graph after a module is reloaded. Modules that were used during graph capture will no longer be unloaded before the graph is released. @@ -18,10 +18,11 @@ - Fix `ModelBuilder.collapse_fixed_joints()` to correctly update the body centers of mass and the `ModelBuilder.articulation_start` array. - Fix precedence of closure constants over global constants. + - Fix quadrature point indexing in `wp.fem.ExplicitQuadrature` (regression from 1.3.0). - Documentation improvements - Add missing return types for built-in functions. - Clarify that atomic operations also return the previous value. - - Clarify that `wp.bvh_query_aabb` returns parts that overlap the bounding volume. + - Clarify that `wp.bvh_query_aabb()` returns parts that overlap the bounding volume. ## [1.3.1] - 2024-07-27 diff --git a/exts/omni.warp.core/docs/CHANGELOG.md b/exts/omni.warp.core/docs/CHANGELOG.md index e7ac593a..557bdaa5 100644 --- a/exts/omni.warp.core/docs/CHANGELOG.md +++ b/exts/omni.warp.core/docs/CHANGELOG.md @@ -5,7 +5,7 @@ - Bug fixes - Fix accuracy of 3x3 SVD ``wp.svd3`` with fp64 numbers ([GH-281](https://github.com/NVIDIA/warp/issues/281)). - Fix module hashing when a kernel argument contained a struct array ([GH-287](https://github.com/NVIDIA/warp/issues/287)). - - Fix a bug in `wp.bvh_query_aabb()` where the direction instead of the reciprocal direction was used + - Fix a bug in `wp.bvh_query_ray()` where the direction instead of the reciprocal direction was used ([GH-288](https://github.com/NVIDIA/warp/issues/288)). - Fix errors when launching a CUDA graph after a module is reloaded. Modules that were used during graph capture will no longer be unloaded before the graph is released. @@ -18,10 +18,11 @@ - Fix `ModelBuilder.collapse_fixed_joints()` to correctly update the body centers of mass and the `ModelBuilder.articulation_start` array. - Fix precedence of closure constants over global constants. + - Fix quadrature point indexing in `wp.fem.ExplicitQuadrature` (regression from 1.3.0). - Documentation improvements - Add missing return types for built-in functions. - Clarify that atomic operations also return the previous value. - - Clarify that `wp.bvh_query_aabb` returns parts that overlap the bounding volume. + - Clarify that `wp.bvh_query_aabb()` returns parts that overlap the bounding volume. ## [1.3.1] - 2024-07-27 diff --git a/exts/omni.warp/docs/CHANGELOG.md b/exts/omni.warp/docs/CHANGELOG.md index e7ac593a..557bdaa5 100644 --- a/exts/omni.warp/docs/CHANGELOG.md +++ b/exts/omni.warp/docs/CHANGELOG.md @@ -5,7 +5,7 @@ - Bug fixes - Fix accuracy of 3x3 SVD ``wp.svd3`` with fp64 numbers ([GH-281](https://github.com/NVIDIA/warp/issues/281)). - Fix module hashing when a kernel argument contained a struct array ([GH-287](https://github.com/NVIDIA/warp/issues/287)). - - Fix a bug in `wp.bvh_query_aabb()` where the direction instead of the reciprocal direction was used + - Fix a bug in `wp.bvh_query_ray()` where the direction instead of the reciprocal direction was used ([GH-288](https://github.com/NVIDIA/warp/issues/288)). - Fix errors when launching a CUDA graph after a module is reloaded. Modules that were used during graph capture will no longer be unloaded before the graph is released. @@ -18,10 +18,11 @@ - Fix `ModelBuilder.collapse_fixed_joints()` to correctly update the body centers of mass and the `ModelBuilder.articulation_start` array. - Fix precedence of closure constants over global constants. + - Fix quadrature point indexing in `wp.fem.ExplicitQuadrature` (regression from 1.3.0). - Documentation improvements - Add missing return types for built-in functions. - Clarify that atomic operations also return the previous value. - - Clarify that `wp.bvh_query_aabb` returns parts that overlap the bounding volume. + - Clarify that `wp.bvh_query_aabb()` returns parts that overlap the bounding volume. ## [1.3.1] - 2024-07-27 diff --git a/warp/fem/quadrature/quadrature.py b/warp/fem/quadrature/quadrature.py index 15009209..c342b177 100644 --- a/warp/fem/quadrature/quadrature.py +++ b/warp/fem/quadrature/quadrature.py @@ -336,6 +336,7 @@ def max_points_per_element(self): @cache.cached_arg_value def arg_value(self, device): arg = self.Arg() + arg.points_per_cell = self._points_per_cell arg.points = self._points.to(device) arg.weights = self._weights.to(device) diff --git a/warp/tests/test_fem.py b/warp/tests/test_fem.py index b993f24b..5c8e6e2c 100644 --- a/warp/tests/test_fem.py +++ b/warp/tests/test_fem.py @@ -1252,6 +1252,8 @@ def test_particle_quadratures(test, device): geo = fem.Grid2D(res=wp.vec2i(2)) domain = fem.Cells(geo) + + # Explicit quadrature points, weights = domain.reference_element().instantiate_quadrature(order=4, family=fem.Polynomial.GAUSS_LEGENDRE) points_per_cell = len(points) @@ -1266,9 +1268,16 @@ def test_particle_quadratures(test, device): test.assertEqual(explicit_quadrature.max_points_per_element(), points_per_cell) test.assertEqual(explicit_quadrature.total_point_count(), points_per_cell * geo.cell_count()) + # test integration accuracy val = fem.integrate(_bicubic, quadrature=explicit_quadrature) test.assertAlmostEqual(val, 1.0 / 16, places=5) + # test indexing validity + arr = wp.empty(explicit_quadrature.total_point_count(), dtype=float) + fem.interpolate(_piecewise_constant, dest=arr, quadrature=explicit_quadrature) + assert_np_equal(arr.numpy(), np.arange(geo.cell_count()).repeat(points_per_cell)) + + # PIC quadrature element_indices = wp.array([3, 3, 2], dtype=int, device=device) element_coords = wp.array( [ @@ -1286,6 +1295,7 @@ def test_particle_quadratures(test, device): test.assertEqual(pic_quadrature.total_point_count(), 3) test.assertEqual(pic_quadrature.active_cell_count(), 2) + # Test integration accuracy val = fem.integrate(_piecewise_constant, quadrature=pic_quadrature) test.assertAlmostEqual(val, 1.25, places=5)