### 4 releases

0.2.0 | Apr 1, 2023 |
---|---|

0.1.0 | Mar 24, 2022 |

0.1.0-beta.2 | Dec 1, 2022 |

0.1.0-beta.1 | Oct 10, 2022 |

#**555** in Math

**33** downloads per month

**MIT**license

1MB

11K
SLoC

# Dzahui

Dzahui is a library oriented to real-time simulation of ODE/PDE via Finite Element Method and OpenGL providing a simple interface.

To use it, one simply creates an *.obj* file (see blender and obj files) composed of triangles representing a mesh, specifies initial and/or boundary conditions:

`let` naviers_params `=` `StokesParams``::`static_pressure`(``)``.`
`hydrostatic_pressure``(``100_``f64``)`
`.``density``(``1_``f64``)`
`.``force_function``(`
`Box``::`new`(``|``_``|` `-``10_``f64``)`
`)`
`.``build``(``)``;`

builds a window indicating the problem to solve:

`let` window_builder`:` DzahuiWindowBuilder `=` `DzahuiWindow``::`builder`(``"`./assets/1dbar.obj`"``)`
`.``solve_static_pressure``(`naviers_params`)`
`.``with_integration_iteration``(``350``)``;`
`let` window `=` window_builder`.``build``(``)``;`

and runs the window:

`window``.``run``(``)``;`

The resulting mesh will be colored from blue to red indicating speed (or pressure in the case of the hydrostatic pressure equation).

## Available equations

- 1D time-dependent diffussion equation
- 1D time-independent diffussion equation
- Hysrostatic pressure equation (Or simplified 1D time-independent Stokes)

For now, only three equations with Dirichlet boundaries are implemented, but more will be added in the future, including two an three-dimensional cases of Navier Stokes.

## How to use

Dzahui is available on crates.io. Only add it as a dependency and follow one of the many binaries available in the crate to generate a simulation.

### Controls

Dzahui has a few ways to interact with the GUI: On MacOS:

- You can press

to quit simulation`esc` - Press

to save current result`s` - Hold

to view triangles of mesh`t` - Left-click and move mouse or trackpad to move camera

## Future implementations

- Simmulate various types of curves akin to the problem being solved (like streamlines, pathlines and streaklines).
- Improve GUI by adding buttons and graphs.
- Improve method to create boundary conditions via GUI (vertex selector) and function-defined boundaries.
- Include Newmann conditions.
- Homogenize controls for view on different OS.
- Implement 2D and 3D integration algorithms.
- Improve crate structure and access modifiers.
- Improve matrix algorithms (more stable ones).
- Change/create traits to be directly implemented by the user.
- Correct some implementations to improve performance.
- Increase polynomial degree to be used on problems.
- Use macros to embed newly user-created equations into the possible equations to simmulate.

Dzahui is a project to **mayor in physics** at Facultad de Ciencias, UNAM.

## License

#### Dependencies

~12–16MB

~265K SLoC