Skip to content

Commit

Permalink
Fix unit tests for Lineax support
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrous committed May 28, 2024
1 parent 2ad2147 commit 8c7df2b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Updec CI/CD
name: Updes CI/CD

on: [push]

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ pip install updes
```

The example below illustrates how to solve the Laplace equation with Dirichlet and Neumann boundary conditions:
$$ \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = 0 \qquad \qquad \qquad \text{in } [0,1]\times [0,1] \\
\quad \,\,\, u(x,1) = \sin(\pi x) \qquad \quad \text{on } [0,1]\times \{1\} \\
\frac{\partial u}{\partial y}(x,0) = 0 \qquad \qquad \quad \text{on } [0,1]\times \{0\} \\
\qquad u(\cdot,y) = 0 \qquad \qquad \quad \text{on } \{0,1\}\times [0,1]$$



```python
import updes
import jax.numpy as jnp
Expand Down Expand Up @@ -70,6 +77,7 @@ cloud.visualize_field(sol.vals, cmap="jet", projection="3d", title="RBF solution

## To-Dos
1. Logo, contributors guide, and developer documentation
2. Improved ill-conditioned linear systems for RBF-FD (i.e. `support_size != "max"`)
2. More introductory examples in the documentation :
- Integration with neural networks and [Equinox](https://github.com/patrick-kidger/equinox)
- Non-linear and multi-dimensional PDEs
Expand All @@ -83,7 +91,7 @@ We welcome contributions from the community. Please feel free to open an issue o


## Dependencies
- **Core**: [JAX](https://github.com/google/jax) - [GMSH](https://pypi.org/project/gmsh/) - [Matplotlib](https://github.com/matplotlib/matplotlib) - [Seaborn](https://github.com/mwaskom/seaborn) - [Scikit-Learn](https://github.com/scikit-learn/scikit-learn)
- **Core**: [JAX](https://github.com/google/jax) - [GMSH](https://pypi.org/project/gmsh/) - [Lineax](https://github.com/patrick-kidger/lineax) - [Matplotlib](https://github.com/matplotlib/matplotlib) - [Seaborn](https://github.com/mwaskom/seaborn) - [Scikit-Learn](https://github.com/scikit-learn/scikit-learn)
- **Optional**: [PyVista](https://github.com/pyvista/pyvista) - [FFMPEG](https://github.com/kkroening/ffmpeg-python) - [QuartoDoc](https://github.com/machow/quartodoc/)

See the `pyproject.toml` file the specific versions of the dependencies.
Expand Down
13 changes: 7 additions & 6 deletions demos/Laplace/30_laplace_super_scaled.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@
# RBF = partial(thin_plate, a=3)
MAX_DEGREE = 1

Nx = Ny = 15
SUPPORT_SIZE = "max"
# SUPPORT_SIZE = 50*1
Nx = Ny = 50
# SUPPORT_SIZE = "max"
SUPPORT_SIZE = 2
facet_types={"South":"d", "West":"d", "North":"d", "East":"d"}

start = time.time()

## benchmarking with cprofile
res = cProfile.run("cloud = SquareCloud(Nx=Nx, Ny=Ny, facet_types=facet_types, support_size=SUPPORT_SIZE)")
# res = cProfile.run("cloud = SquareCloud(Nx=Nx, Ny=Ny, facet_types=facet_types, support_size=SUPPORT_SIZE)")
cloud = SquareCloud(Nx=Nx, Ny=Ny, facet_types=facet_types, support_size=SUPPORT_SIZE)

## Print results sorted by cumulative time
p = pstats.Stats(res)
p.sort_stats('cumulative').print_stats(10)
# p = pstats.Stats(res)
# p.sort_stats('cumulative').print_stats(10)


## Only print the top 10 high-level function
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/NextRelease.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
For the next release v1.1.0
For the next release v1.0.2
- [X] Added colorbar to animate fields
- [X] Fixed the args inputs to construct the local matrix for nodal_div_grad: (if array, else, etc.)
- [X] Implemented the Darcy flow problem
- [X] Faster linear solves with Lineax
2 changes: 1 addition & 1 deletion docs/assets/README_PyPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cloud.visualize_field(sol.vals, cmap="jet", projection="3d", title="RBF solution


## Dependencies
- **Core**: JAX - GMSH - Matplotlib - Seaborn - Scikit-Learn
- **Core**: JAX - GMSH - Lineax - Matplotlib - Seaborn - Scikit-Learn
- **Optional**: PyVista - FFMPEG - QuartoDoc

See the `pyproject.toml` file the specific versions of the dependencies.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ keywords = [

dependencies = [
"jax >= 0.3.4",
"lineax",
"gmsh",
"pytest",
"matplotlib>=3.4.0",
Expand Down

0 comments on commit 8c7df2b

Please sign in to comment.