Skip to content

Commit cf5207f

Browse files
committed
Added images
1 parent c66a1e2 commit cf5207f

File tree

7 files changed

+10
-4
lines changed

7 files changed

+10
-4
lines changed

assets/amr/result.png

42.1 KB
Loading

assets/geometry/mobius.png

22.6 KB
Loading
21.9 KB
Loading
22.6 KB
Loading

assets/geometry/nodes_nonperiodic.png

23.2 KB
Loading

src/geometry_dev.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,17 @@ writevtk(new_grid,"half_cylinder_quadratic")
295295
# 1. Standard non-periodic mesh:
296296
model = cartesian_model((0,1,0,1),(3,3))
297297
plot_node_numbering(model)
298+
# ![](../assets/geometry/nodes_nonperiodic.png)
298299

299300
# 2. Mesh with periodicity in x-direction:
300301
model = cartesian_model((0,1,0,1),(3,3),isperiodic=(true,false))
301302
plot_node_numbering(model)
303+
# ![](../assets/geometry/nodes_halfperiodic.png)
302304

303305
# 3. Mesh with periodicity in both directions:
304306
model = cartesian_model((0,1,0,1),(3,3),isperiodic=(true,true))
305307
plot_node_numbering(model)
308+
# ![](../assets/geometry/nodes_fullperiodic.png)
306309

307310
# Notice how the vertex numbers (displayed at node positions) show the topological
308311
# connectivity, while the nodes remain at their physical positions.
@@ -361,7 +364,7 @@ cell_vertex_ids = Table(cell_vertex_ids)
361364

362365
# Get coordinates for the vertices:
363366
vertex_coords = node_coords[vertex_to_node]
364-
polys = map(get_polytope,reffes)
367+
polytopes = map(get_polytope,reffes)
365368

366369
# #### Step 4: Create the Model
367370
#
@@ -385,3 +388,4 @@ mobius = UnstructuredDiscreteModel(grid,topo,labels)
385388

386389
# Visualize the vertex numbering:
387390
plot_node_numbering(mobius)
391+
# ![](../assets/geometry/mobius.png)

src/poisson_amr.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ function amr_step(model,u_exact;order=1)
137137
η = estimate(ηh,uh)
138138

139139
"Mark cells for refinement using Dörfler marking
140-
This strategy marks cells containing a fixed fraction (0.8) of the total error"
141-
m = DorflerMarking(0.8)
140+
This strategy marks cells containing a fixed fraction (0.9) of the total error"
141+
m = DorflerMarking(0.9)
142142
I = Adaptivity.mark(m,η)
143143

144144
"Refine the mesh using newest vertex bisection"
@@ -179,11 +179,13 @@ for i in 1:nsteps
179179
)
180180

181181
println("Error: $error, Error η: $(sum(η))")
182-
@test (i < 3) || (error < last_error)
183182
last_error = error
184183
model = fmodel
185184
end
186185

186+
# The final mesh gives the following result:
187+
# ![](../assets/amr/result.png)
188+
#
187189
# ## Conclusion
188190
#
189191
# In this tutorial, we have demonstrated how to:

0 commit comments

Comments
 (0)