An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# GeometryPrimitives

[![CI](https://github.com/stevengj/GeometryPrimitives.jl/workflows/CI/badge.svg)](https://github.com/stevengj/GeometryPrimitives.jl/actions)
[![Codecov](http://codecov.io/github/stevengj/GeometryPrimitives.jl/coverage.svg?branch=master)](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.