https://github.com/stevengj/geometryprimitives.jl
geometric primitives for piecewise functions on grids
https://github.com/stevengj/geometryprimitives.jl
geometry julia math
Last synced: over 1 year ago
JSON representation
geometric primitives for piecewise functions on grids
- Host: GitHub
- URL: https://github.com/stevengj/geometryprimitives.jl
- Owner: stevengj
- License: other
- Created: 2016-11-02T02:40:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T22:47:32.000Z (almost 2 years ago)
- Last Synced: 2025-02-24T09:48:32.990Z (over 1 year ago)
- Topics: geometry, julia, math
- Language: Julia
- Size: 186 KB
- Stars: 18
- Watchers: 6
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GeometryPrimitives
[](https://github.com/stevengj/GeometryPrimitives.jl/actions)
[](http://codecov.io/github/stevengj/GeometryPrimitives.jl?branch=master)
This package provides a set of geometric primitive types (balls, cuboids, cylinders, and
so on) and operations on them designed to enable piecewise definition of functions,
especially for finite-difference and finite-element simulations, in the Julia language.
For example, suppose that you are discretizing a PDE like the Poisson equation āā
cāu = f,
and you want to provide a simple user interface for the user to specify the function `c(x)`.
In many applications, `c` will be piecewise constant, and you want to be able to specify
`c = 1` in one box, `c = 2` in some cylinders, etcetera. The GeometryPrimitives package
allows the user to provide a list of shapes with associated data (in this case, the value of
`c`) to define such a `c(x)`.
Furthermore, the application to discretized simulations imposes a couple of additional
requirements:
* One needs to be able to evaluate `c(x)` a huge number of times (once for every point on a
grid). So, we provide a fast O(log n) K-D tree data structure for rapid searching of shapes.
* Often, one wants to compute the *average* of `c(x)` over a voxel, so we provide routines
for rapid *approximate* voxel averages.
* Often, one needs not only the value `c(x)` but the normal vector to the nearest shape, so
we provide normal-vector computation.
This package was inspired by the geometry utilities in Steven G. Johnson's [Libctl]
(http://ab-initio.mit.edu/wiki/index.php/Libctl) package.