@@ -44,7 +44,7 @@ grid points. Lets construct a level-set equation with an advection term:
4444
4545``` @example advection-term
4646ϕ₀ = LevelSet(x -> sqrt(x[1]^2 + x[2]^2) - 0.5, grid)
47- eq = LevelSetEquation(; terms = (AdvectionTerm(𝐮),), levelset = ϕ₀, bc = PeriodicBC ())
47+ eq = LevelSetEquation(; terms = (AdvectionTerm(𝐮),), ic = ϕ₀, bc = NeumannBC ())
4848```
4949
5050To see how the advection term affects the level-set, we can solve the equation for a few
@@ -71,7 +71,7 @@ have instead a time-dependent velocity field, we could pass a function to the
7171
7272``` @example advection-term
7373ϕ₀ = LevelSet(x -> sqrt(x[1]^2 + x[2]^2) - 0.5, grid)
74- eq = LevelSetEquation(; terms = (AdvectionTerm((x,t) -> SVector(x[1]^2, 0)),), levelset = ϕ₀, bc = PeriodicBC ())
74+ eq = LevelSetEquation(; terms = (AdvectionTerm((x,t) -> SVector(x[1]^2, 0)),), ic = ϕ₀, bc = NeumannBC ())
7575fig = Figure(; size = (1200, 300))
7676# create a 2 x 2 figure
7777for (n,t) in enumerate([0.0, 0.5, 0.75, 1.0])
@@ -102,8 +102,8 @@ let us compare both schemes for a purely rotational velocity field:
102102𝐮 = MeshField(grid) do (x,y)
103103 SVector(-y, x)
104104end
105- eq_upwind = LevelSetEquation(; terms = AdvectionTerm(𝐮, Upwind()), levelset = deepcopy(ϕ₀), bc = PeriodicBC ())
106- eq_weno = LevelSetEquation(; terms = AdvectionTerm(𝐮), levelset = deepcopy(ϕ₀), bc = PeriodicBC ())
105+ eq_upwind = LevelSetEquation(; terms = AdvectionTerm(𝐮, Upwind()), ic = deepcopy(ϕ₀), bc = NeumannBC ())
106+ eq_weno = LevelSetEquation(; terms = AdvectionTerm(𝐮), ic = deepcopy(ϕ₀), bc = NeumannBC ())
107107fig = Figure(size = (1000, 400))
108108ax = Axis(fig[1,1], title = "Initial")
109109plot!(ax, eq_upwind)
@@ -134,7 +134,7 @@ using LevelSetMethods
134134using GLMakie
135135grid = CartesianGrid((-2,-2), (2,2), (100, 100))
136136ϕ = LevelSetMethods.star(grid)
137- eq = LevelSetEquation(; terms = (NormalMotionTerm((x,t) -> 0.5),), levelset = ϕ, bc = PeriodicBC ())
137+ eq = LevelSetEquation(; terms = (NormalMotionTerm((x,t) -> 0.5),), ic = ϕ, bc = NeumannBC ())
138138fig = Figure(; size = (1200, 300))
139139for (n,t) in enumerate([0.0, 0.5, 0.75, 1.0])
140140 integrate!(eq, t)
@@ -185,7 +185,7 @@ where ``\kappa = \nabla \cdot (\nabla \phi / |\nabla \phi|)`` is the mean curvat
185185coefficient `` b `` should be negative; a positive value of `` b `` would yield an ill-posed
186186evolution problem (akin to a negative diffusion coefficient).
187187
188- Here is the classic example of motion by mean curavature for a spiral-like level-set:
188+ Here is the classic example of motion by mean curvature for a spiral-like level-set:
189189
190190``` @example curvature-term
191191using LevelSetMethods, GLMakie
@@ -208,7 +208,7 @@ M = R * [1/0.06^2 0; 0 1/(4π^2)] * R'
208208 end
209209 return result
210210end
211- eq = LevelSetEquation(; terms = (CurvatureTerm((x,t) -> -0.1),), levelset = ϕ, bc = PeriodicBC ())
211+ eq = LevelSetEquation(; terms = (CurvatureTerm((x,t) -> -0.1),), ic = ϕ, bc = NeumannBC ())
212212fig = Figure(; size = (1200, 300))
213213for (n,t) in enumerate([0.0, 0.1, 0.2, 0.3])
214214 integrate!(eq, t)
253253We will now evolve the level-set using the reinitialization term:
254254
255255``` @example reinitialization-term
256- eq = LevelSetEquation(; terms = (EikonalReinitializationTerm(),), levelset = deepcopy(ϕ), bc = PeriodicBC ())
256+ eq = LevelSetEquation(; terms = (EikonalReinitializationTerm(),), ic = deepcopy(ϕ), bc = NeumannBC ())
257257fig = Figure(; size = (1200, 300))
258258for (n,t) in enumerate([0.0, 0.25, 0.5, 0.75])
259259 integrate!(eq, t)
@@ -274,7 +274,7 @@ Alternatively, you can use a modified reinitialization term that applies the sig
274274To enable this behavior, simply pass a ` LevelSet ` object to the ` EikonalReinitializationTerm ` :
275275
276276``` @example reinitialization-term
277- eq = LevelSetEquation(; terms = (EikonalReinitializationTerm(ϕ),), levelset = deepcopy(ϕ), bc = PeriodicBC ())
277+ eq = LevelSetEquation(; terms = (EikonalReinitializationTerm(ϕ),), ic = deepcopy(ϕ), bc = NeumannBC ())
278278fig = Figure(; size = (1200, 300))
279279for (n,t) in enumerate([0.0, 0.25, 0.5, 0.75])
280280 integrate!(eq, t)
0 commit comments