Skip to content

Commit 888c5b1

Browse files
authored
Merge pull request #41 from maltezfaria/doc-review
Doc review
2 parents 5697ae9 + b5bcfcb commit 888c5b1

27 files changed

+179
-614
lines changed

.all-contributorsrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ MakieExt = "Makie"
2020
[compat]
2121
julia = "1.9"
2222
LinearAlgebra = "1"
23+
Makie = "0.21"
2324
MarchingCubes = "0.1.10"
2425
StaticArrays = "1"
26+
MMG_jll = "5"

README.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,11 @@
77
[![Lint workflow Status](https://github.com/maltezfaria/LevelSetMethods.jl/actions/workflows/Lint.yml/badge.svg?branch=main)](https://github.com/maltezfaria/LevelSetMethods.jl/actions/workflows/Lint.yml?query=branch%3Amain)
88
[![Docs workflow Status](https://github.com/maltezfaria/LevelSetMethods.jl/actions/workflows/Docs.yml/badge.svg?branch=main)](https://github.com/maltezfaria/LevelSetMethods.jl/actions/workflows/Docs.yml?query=branch%3Amain)
99
[![Coverage](https://codecov.io/gh/maltezfaria/LevelSetMethods.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/maltezfaria/LevelSetMethods.jl)
10-
[![DOI](https://zenodo.org/badge/DOI/FIXME)](https://doi.org/FIXME)
11-
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
12-
[![All Contributors](https://img.shields.io/github/all-contributors/maltezfaria/LevelSetMethods.jl?labelColor=5e1ec7&color=c0ffee&style=flat-square)](#contributors)
1310
[![BestieTemplate](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/JuliaBesties/BestieTemplate.jl/main/docs/src/assets/badge.json)](https://github.com/JuliaBesties/BestieTemplate.jl)
1411

15-
## How to Cite
12+
This package provides tools to solve level-set equations on cartesian meshes. It closely
13+
follows the book [Level Set Methods and Dynamic Implicit
14+
Surfaces](https://link.springer.com/book/10.1007/b98879) by Stanley Osher and Ronald Fedkiw.
1615

17-
If you use LevelSetMethods.jl in your work, please cite using the reference given in [CITATION.cff](https://github.com/maltezfaria/LevelSetMethods.jl/blob/main/CITATION.cff).
18-
19-
## Contributing
20-
21-
If you want to make contributions of any kind, please first that a look into our [contributing guide directly on GitHub](docs/src/90-contributing.md) or the [contributing page on the website](https://maltezfaria.github.io/LevelSetMethods.jl/dev/90-contributing/)
22-
23-
---
24-
25-
### Contributors
26-
27-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
28-
<!-- prettier-ignore-start -->
29-
<!-- markdownlint-disable -->
30-
31-
<!-- markdownlint-restore -->
32-
<!-- prettier-ignore-end -->
33-
34-
<!-- ALL-CONTRIBUTORS-LIST:END -->
16+
For more details, see the [stable](https://maltezfaria.github.io/LevelSetMethods.jl/stable)
17+
or [development](https://maltezfaria.github.io/LevelSetMethods.jl/dev) documentations.

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ makedocs(;
4242
"terms.md",
4343
"time-integrators.md",
4444
"boundary-conditions.md",
45-
hide("Extensions" => "extensions.md", ["extension-makie.md", "extension-mmg.md"]),
46-
hide("Examples" => "examples.md", ["example-zalesak.md", "example-shape-optim.md"]),
45+
"Extensions" => ["extension-makie.md", "extension-mmg.md"],
46+
"Examples" => ["example-zalesak.md", "example-shape-optim.md"],
4747
numbered_pages,
4848
),
4949
pagesonly = true, # ignore .md files not in the pages list

docs/src/90-contributing.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/src/91-developer.md

Lines changed: 0 additions & 163 deletions
This file was deleted.

docs/src/example-shape-optim.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44

55
We consider in this example the *isoperimetric inequality* which states that among all closed surfaces enclosing a fixed area with volume $V_0 > 0$, the sphere is the one with minimal perimeter.
66
We show here how to demonstrate this result through numerical optimization.
7-
To do this, we first define the problem mathematically (1):
7+
8+
!!! warning
9+
This example is purely illustrative. The optimization method used here has not been extensively tested.
10+
Coupling the [LevelSetMethods](https://github.com/maltezfaria/LevelSetMethods.jl) toolbox to any simulation package makes it possible to solve PDE-constrained optimization problems (see for instance [allaire2004structural](@cite)).
11+
12+
To do this, we first define the problem mathematically:
813

914
```math
1015
\begin{array}{rl}
11-
\displaystyle\min_{\Omega \subset \mathbb{R}^N} & P(\Omega)
16+
\displaystyle\min_{\Omega \subset \mathbb{R}^d} & P(\Omega)
1217
\\
1318
\text{u.c.} & V(\Omega) = V_0
14-
\end{array},
19+
\end{array},\qquad\text{(1)}
1520
```
1621

1722
where $P(\Omega), V(\Omega)$ are the perimeter and volume of $\Omega$ defined by
@@ -23,16 +28,17 @@ where $P(\Omega), V(\Omega)$ are the perimeter and volume of $\Omega$ defined by
2328
.
2429
```
2530

26-
The optimization problem (1) can be solved using the augmented Lagrangian approach by minimizing iteratively the following functional (2):
31+
The optimization problem $\text{(1)}$ can be solved using the augmented Lagrangian approach by minimizing iteratively the following functional:
2732

2833
```math
2934
f(\Omega) = P(\Omega) + \lambda (V(\Omega) - V_0) + \frac{\mu}{2} (V(\Omega) - V_0)^2
35+
\qquad\text{(2)}
3036
```
3137

3238
where $\mu$ is a parameter updated during the course of the optimization.
33-
To minimize (2), we will use a gradient-based algorithm.
39+
To minimize $\text{(2)}$, we use a gradient-based algorithm.
3440
For this, we need to define what a *small variation* of $\Omega$ is.
35-
As such, we define for any shape $\Omega \subset \mathbb{R}^N$ its deformed configuration $\Omega_{\boldsymbol{\theta}}$ by a small vector field $\boldsymbol{\theta} \in W^{1,\infty}(\mathbb{R}^N, \mathbb{R}^N)$ as:
41+
As such, for any shape $\Omega \subset \mathbb{R}^d$ we define (following Hadamard method) its deformation $\Omega_{\boldsymbol{\theta}}$ by a small vector field $\boldsymbol{\theta} \in W^{1,\infty}(\mathbb{R}^d, \mathbb{R}^d)$ as:
3642

3743
```math
3844
\Omega_{\boldsymbol{\theta}}
@@ -60,7 +66,7 @@ In other words, using $\boldsymbol{\theta} = - (\kappa + (\lambda + \mu (V(\Omeg
6066

6167
## Numerical solution using the level-set method
6268

63-
If $\Omega$ is given by the level-set function $\phi_0 : \R^N \to \R$ then one associated with $\Omega_{\tau\boldsymbol{\theta}}$ is given by $\phi(\cdot, \tau)$ solution of
69+
If $\Omega$ is given by the level-set function $\phi_0 : \R^d \to \R$ then one associated with $\Omega_{\tau\boldsymbol{\theta}}$ is given by $\phi(\cdot, \tau)$ solution of
6470

6571
```math
6672
\partial_t \phi - \kappa |\nabla \phi| - (\lambda + \mu (V(\Omega) - V_0)) |\nabla \phi| = 0
@@ -127,3 +133,6 @@ end
127133
```
128134

129135
![Optimization](optimization.gif)
136+
137+
Different values and updates for the $\lambda$ and $\mu$ coefficients can be used to control the extent to which the optimization focuses on minimizing the objective or satisfying the constraint.
138+
Taking a smaller time step can also limit the oscillations observed at the end of optimization.

0 commit comments

Comments
 (0)