Skip to content

Commit

Permalink
MAINT: example 3 is in place
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarDuran committed Sep 19, 2024
1 parent 8b31524 commit 17f6629
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
12 changes: 6 additions & 6 deletions examples/cosserat_elasticity/cosserat_error_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,21 +773,21 @@ def render_figures_example_3(d=2):
painter.build_inset_var_k_order(k, d, methods[1], conv_type, rate, 0.0, -0.2)
painter.save_figure()

painter.ordinate_range = (0.0000005, 0.01)
painter.ordinate_range = (0.00000005, 0.01)
conv_type = "super"
painter.file_name = "superconvergence_example_3_" + str(d) + "d.pdf"
painter.color_canvas_with_variable_k(d, methods, conv_type)
k = 0
rate = k + 2
painter.build_inset_var_k_order(k, d, methods[1], conv_type, rate, 0.0, -0.2)
painter.build_inset_var_k_order(k, d, methods[1], conv_type, rate, 0.0, -0.5)
k = 1
rate = k + 2
painter.build_inset_var_k_order(k, d, methods[1], conv_type, rate, 0.0, -0.2)
painter.build_inset_var_k_order(k, d, methods[1], conv_type, rate, 0.0, -0.5)
painter.save_figure()


# Only figure range is adjusted for 3d.
dim = 2
render_figures_example_1(d=dim)
dim = 3
# render_figures_example_1(d=dim)
# render_figures_example_2(d=dim)
# render_figures_example_3(d=dim)
render_figures_example_3(d=dim)
4 changes: 2 additions & 2 deletions examples/cosserat_elasticity/cosserat_iteration_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,6 @@ def render_figures_example_3(d=2):


dim = 3
render_figures_example_1(d=dim)
render_figures_example_2(d=dim)
# render_figures_example_1(d=dim)
# render_figures_example_2(d=dim)
render_figures_example_3(d=dim)
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def paint_on_canvas(crinkle_q):
canvas = paint_on_canvas(False)
canvas.save_graphic("figures/function_epsilon_example_3.eps")
canvas.save_graphic("figures/function_epsilon_example_3.pdf")
canvas.save_graphic("figures/function_epsilon_example_3.png")

# canvas = paint_on_canvas(True)
# canvas.save_graphic("figures/function_epsilon_crinkle_example_3.eps")
Expand Down
10 changes: 5 additions & 5 deletions examples/cosserat_elasticity/graphical_example_3_epsilon_jan.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def epsilon(x, y):
Z = epsilon(X, Y)
fig, ax = plt.subplots(1, 1, subplot_kw=dict(aspect="equal"))
cp = ax.contourf(X, Y, Z, cmap="gray", extend="both", alpha=0.5, levels=15)
ax.annotate(r"$\epsilon = 1$", xy=(0.75, 0.75), xycoords="data", fontsize=12)
ax.annotate(r"$\epsilon = 0$", xy=(0.15, 0.15), xycoords="data", fontsize=12)
ax.annotate(r"$\epsilon = x_1$", xy=(0.45, 0.15), xycoords="data", fontsize=12)
ax.annotate(r"$\epsilon = x_2$", xy=(0.15, 0.5), xycoords="data", fontsize=12)
ax.annotate(r"$\ell = 1$", xy=(0.75, 0.75), xycoords="data", fontsize=12)
ax.annotate(r"$\ell = 0$", xy=(0.15, 0.15), xycoords="data", fontsize=12)
ax.annotate(r"$\ell = x_1$", xy=(0.45, 0.15), xycoords="data", fontsize=12)
ax.annotate(r"$\ell = x_2$", xy=(0.15, 0.5), xycoords="data", fontsize=12)
plt.xticks([])
plt.yticks([])

plt.savefig("figures/figure_spatial_epsilon.pdf", bbox_inches="tight")
plt.savefig("figures/figure_spatial_ell.pdf", bbox_inches="tight")
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,9 @@ def method_definition(k_order):

methods = [method_1, method_2, method_3, method_4]
method_names = ["sc_rt", "sc_bdm", "wc_rt", "wc_bdm"]

methods = [method_3]
method_names = ["wc_rt"]
return zip(method_names, methods)


Expand Down Expand Up @@ -1187,15 +1190,17 @@ def material_data_definition():
"l": 1.0e-4,
}
cases = [case_0, case_1, case_2]

cases = [case_2]
return cases


def main():
approximation_q = True
postprocessing_q = True
refinements = {0: 4, 1: 4}
refinements = {0: 2, 1: 4}
case_data = material_data_definition()
for k in [0, 1]:
for k in [0]:
methods = method_definition(k)
for i, method in enumerate(methods):
for material_data in case_data:
Expand Down

0 comments on commit 17f6629

Please sign in to comment.