Skip to content

Commit

Permalink
Merge branch 'fem_dev' into 'main'
Browse files Browse the repository at this point in the history
warp.fem: Variable nodes per element, global lookups, 3d streamlines example

See merge request omniverse/warp!554
  • Loading branch information
mmacklin committed Jul 3, 2024
2 parents e33ccab + d96c48d commit 015f1c7
Show file tree
Hide file tree
Showing 54 changed files with 2,837 additions and 1,632 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
- Sparse matrix allocations (from `bsr_from_triplets`, `bsr_axpy`, etc) can now be captured in CUDA graphs; exact number of non-zeros can be optionally requested asynchronously.
- `bsr_assign` now supports changing block shape (including CSR/BSR conversions)
- Add Python operator overloads for common sparse matrix operations, e.g `A += 0.5 * B`, `y = x @ C`
- `warp.fem` new features and fixes:
- Support for variable number of nodes per element
- Global `wp.fem.lookup()` operator now supports `wp.fem.Tetmesh` and `wp.fem.Trimesh2D` geometries
- Simplified defining custom subdomains (`wp.fem.Subdomain`), free-slip boundary conditions
- New `streamlines` example, updated `mixed_elasticity` to use a nonlinear model
- Fixed edge cases with Nanovdb function spaces

## [1.2.1] - 2024-06-14

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,28 +149,28 @@ Built-in unit tests can be run from the command-line as follows:
<table>
<tbody>
<tr>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_apic_fluid.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_apic_fluid.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_convection_diffusion.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_convection_diffusion.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_diffusion_3d.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_diffusion_3d.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_diffusion.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_diffusion.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_mixed_elasticity.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_mixed_elasticity.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_apic_fluid.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_apic_fluid.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_streamlines.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_streamlines.png"></a></td>
</tr>
<tr>
<td align="center">apic fluid</td>
<td align="center">convection diffusion</td>
<td align="center">diffusion 3d</td>
<td align="center">diffusion</td>
<td align="center">mixed elasticity</td>
<td align="center">apic fluid</td>
<td align="center">streamlines</td>
</tr>
<tr>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_mixed_elasticity.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_mixed_elasticity.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_convection_diffusion.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_convection_diffusion.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_navier_stokes.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_navier_stokes.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_stokes_transfer.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_stokes_transfer.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_stokes.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_stokes.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_burgers.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_burgers.png"></a></td>
<td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_deformed_geometry.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_deformed_geometry.png"></a></td>
</tr>
<tr>
<td align="center">mixed elasticity</td>
<td align="center">convection diffusion</td>
<td align="center">navier stokes</td>
<td align="center">stokes transfer</td>
<td align="center">stokes</td>
<td align="center">burgers</td>
<td align="center">deformed geometry</td>
</tr>
</tbody>
</table>
Expand Down
Binary file added docs/img/examples/fem_burgers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/examples/fem_deformed_geometry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/examples/fem_mixed_elasticity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/examples/fem_navier_stokes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/examples/fem_streamlines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions docs/modules/fem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ The main mechanism is the :py:func:`.integrand` decorator, for instance: ::
@integrand
def linear_form(
s: Sample,
domain: Domain,
v: Field,
):
return v(s)
x = domain(s)
return v(s) * wp.max(0.0, 1.0 - wp.length(x))


@integrand
Expand All @@ -31,7 +33,7 @@ The main mechanism is the :py:func:`.integrand` decorator, for instance: ::
grad(v, s),
)

Integrands are normal Warp kernels, meaning any usual Warp function can be used.
Integrands are normal Warp kernels, meaning that they may contain arbitrary Warp functions.
However, they accept a few special parameters:

- :class:`.Sample` contains information about the current integration sample point, such as the element index and coordinates in element.
Expand Down Expand Up @@ -123,7 +125,8 @@ Introductory examples
- ``example_burgers.py``: 2D inviscid Burgers using Discontinuous Galerkin with upwind transport and slope limiter
- ``example_stokes.py``: 2D incompressible Stokes flow using mixed :math:`P_k/P_{k-1}` or :math:`Q_k/P_{(k-1)d}` elements
- ``example_navier_stokes.py``: 2D Navier-Stokes flow using mixed :math:`P_k/P_{k-1}` elements
- ``example_mixed_elasticity.py``: 2D linear elasticity using mixed continuous/discontinuous :math:`S_k/P_{(k-1)d}` elements
- ``example_mixed_elasticity.py``: 2D nonlinear elasticity using mixed continuous/discontinuous :math:`S_k/P_{(k-1)d}` elements
- ``example_streamlines.py``: Using the :func:`lookup` operator to trace through a velocity field


Advanced usages
Expand Down Expand Up @@ -269,6 +272,9 @@ Geometry
.. autoclass:: FrontierSides
:show-inheritance:

.. autoclass:: Subdomain
:show-inheritance:

.. autoclass:: Polynomial
:members:

Expand Down
Loading

0 comments on commit 015f1c7

Please sign in to comment.