keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-boundary/plot_compar_aniso.py
.py
1,152
50
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_exact_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_exact_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_exact_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_exact_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-neutronics-2-group-adapt/plot_compar_multimesh.py
.py
924
44
# import libraries import numpy, pylab from pylab import * # name of the configuration name = "hp_iso" # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_"+name+"_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (multi)") data = numpy.loadtxt("conv_dof_"+name+"_single.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (single)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time [s]") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_"+name+"_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (multi)") data = numpy.loadtxt("conv_cpu_"+name+"_single.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (single)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-neutronics-2-group-adapt/plot_compar_hp.py
.py
1,416
56
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_hp_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_hp_anisoh_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso-h)") data = numpy.loadtxt("conv_dof_hp_anisop_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso-p)") data = numpy.loadtxt("conv_dof_hp_aniso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso-hp)") legend() # initialize new window pylab.figure() # plot CPU convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time [s]") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_hp_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_hp_anisoh_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso-h)") data = numpy.loadtxt("conv_cpu_hp_anisop_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso-p)") data = numpy.loadtxt("conv_cpu_hp_aniso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso-hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-neutronics-2-group-adapt/plot_compar_iso.py
.py
1,124
48
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1_1_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_h2_2_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_hp_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # initialize new window pylab.figure() # plot CPU convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time [s]") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1_1_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_h2_2_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_hp_iso_multi.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-stabilized-advection-reaction/conv_ex_compar.py
.py
2,058
75
# import libraries import numpy, pylab from pylab import * # initialize new window pylab.figure(figsize=(9, 7), dpi=80) # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Relative error") data = numpy.loadtxt("dgh0/conv_dof_ex_dg-upwind_h0_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=0)") data = numpy.loadtxt("dgh1/conv_dof_ex_dg-upwind_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=1)") data = numpy.loadtxt("dghp/conv_dof_ex_dg-upwind_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-DGM") data = numpy.loadtxt("supgh1/conv_dof_ex_supg_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=1)") data = numpy.loadtxt("supgh2/conv_dof_ex_supg_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=2)") data = numpy.loadtxt("supghp/conv_dof_ex_supg_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-SUPGM") legend() # initialize new window pylab.figure(figsize=(9, 7), dpi=80) # plot CPU convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time [s]") pylab.ylabel("Relative error") data = numpy.loadtxt("dgh0/conv_cpu_ex_dg-upwind_h0_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=0)") data = numpy.loadtxt("dgh1/conv_cpu_ex_dg-upwind_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=1)") data = numpy.loadtxt("dghp/conv_cpu_ex_dg-upwind_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-DGM") data = numpy.loadtxt("supgh1/conv_cpu_ex_supg_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=1)") data = numpy.loadtxt("supgh2/conv_cpu_ex_supg_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=2)") data = numpy.loadtxt("supghp/conv_cpu_ex_supg_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-SUPGM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-stabilized-advection-reaction/conv_outfl_compar.py
.py
2,094
75
# import libraries import numpy, pylab from pylab import * # initialize new window pylab.figure(figsize=(9, 7), dpi=80) # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Relative error") data = numpy.loadtxt("dgh0/conv_dof_outfl_dg-upwind_h0_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=0)") data = numpy.loadtxt("dgh1/conv_dof_outfl_dg-upwind_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=1)") data = numpy.loadtxt("dghp/conv_dof_outfl_dg-upwind_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-DGM") data = numpy.loadtxt("supgh1/conv_dof_outfl_supg_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=1)") data = numpy.loadtxt("supgh2/conv_dof_outfl_supg_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=2)") data = numpy.loadtxt("supghp/conv_dof_outfl_supg_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-SUPGM") legend() # initialize new window pylab.figure(figsize=(9, 7), dpi=80) # plot CPU convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time [s]") pylab.ylabel("Relative error") data = numpy.loadtxt("dgh0/conv_cpu_outfl_dg-upwind_h0_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=0)") data = numpy.loadtxt("dgh1/conv_cpu_outfl_dg-upwind_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=1)") data = numpy.loadtxt("dghp/conv_cpu_outfl_dg-upwind_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-DGM") data = numpy.loadtxt("supgh1/conv_cpu_outfl_supg_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=1)") data = numpy.loadtxt("supgh2/conv_cpu_outfl_supg_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=2)") data = numpy.loadtxt("supghp/conv_cpu_outfl_supg_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-SUPGM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-stabilized-advection-reaction/conv_est_compar.py
.py
2,070
75
# import libraries import numpy, pylab from pylab import * # initialize new window pylab.figure(figsize=(9, 7), dpi=80) # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Relative error") data = numpy.loadtxt("dgh0/conv_dof_est_dg-upwind_h0_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=0)") data = numpy.loadtxt("dgh1/conv_dof_est_dg-upwind_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=1)") data = numpy.loadtxt("dghp/conv_dof_est_dg-upwind_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-DGM") data = numpy.loadtxt("supgh1/conv_dof_est_supg_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=1)") data = numpy.loadtxt("supgh2/conv_dof_est_supg_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=2)") data = numpy.loadtxt("supghp/conv_dof_est_supg_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-SUPGM") legend() # initialize new window pylab.figure(figsize=(9, 7), dpi=80) # plot CPU convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time [s]") pylab.ylabel("Relative error") data = numpy.loadtxt("dgh0/conv_cpu_est_dg-upwind_h0_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=0)") data = numpy.loadtxt("dgh1/conv_cpu_est_dg-upwind_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-DGM (p=1)") data = numpy.loadtxt("dghp/conv_cpu_est_dg-upwind_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-DGM") data = numpy.loadtxt("supgh1/conv_cpu_est_supg_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=1)") data = numpy.loadtxt("supgh2/conv_cpu_est_supg_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-SUPGM (p=2)") data = numpy.loadtxt("supghp/conv_cpu_est_supg_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-SUPGM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-smooth-iso/plot_graph_cpu.py
.py
558
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_exact_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_exact_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-smooth-iso/plot_graph_dof.py
.py
568
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_exact_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_exact_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/nonsym-check/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/nonsym-check/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/nonsym-check/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-smooth-aniso-x/plot_graph_cpu.py
.py
917
38
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h1-FEM (aniso)") data = numpy.loadtxt("conv_cpu_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h1-FEM (iso)") data = numpy.loadtxt("conv_cpu_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h2-FEM (aniso)") data = numpy.loadtxt("conv_cpu_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h2-FEM (iso)") data = numpy.loadtxt("conv_cpu_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso)") data = numpy.loadtxt("conv_cpu_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-smooth-aniso-x/plot_graph_dof.py
.py
927
38
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h1-FEM (aniso)") data = numpy.loadtxt("conv_dof_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h1-FEM (iso)") data = numpy.loadtxt("conv_dof_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h2-FEM (aniso)") data = numpy.loadtxt("conv_dof_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h2-FEM (iso)") data = numpy.loadtxt("conv_dof_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso)") data = numpy.loadtxt("conv_dof_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-screen/plot_graph_cpu.py
.py
558
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_exact_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_exact_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-screen/plot_graph_dof.py
.py
568
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_exact_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_exact_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/neutronics/example-iron-water/plot_graph_cpu.py
.py
540
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/neutronics/example-iron-water/plot_graph_dof.py
.py
550
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/neutronics/example-saphir/plot_graph_cpu.py
.py
540
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/neutronics/example-saphir/plot_graph_dof.py
.py
550
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/advection-diffusion-reaction/example-linear-advection-diffusion/plot_compar_dof.py
.py
562
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_est_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_est_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-crack/plot_compar_dof.py
.py
459
22
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (multi)") data = numpy.loadtxt("conv_dof_hp_single.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (single)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-crack/plot_graph_cpu.py
.py
540
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-crack/plot_compar_cpu.py
.py
449
22
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (multi)") data = numpy.loadtxt("conv_cpu_hp_single.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (single)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-crack/plot_graph_dof.py
.py
550
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-bracket/plot_compar.py
.py
825
41
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (multi)") data = numpy.loadtxt("conv_dof_s.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (single)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (multi)") data = numpy.loadtxt("conv_cpu_s.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="error (single)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-bracket/plot_graph_cpu.py
.py
540
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/linear-elasticity/example-bracket/plot_graph_dof.py
.py
550
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_h2.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_hp.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/thermoelasticity/img-hollow-conductor/plot_compar_dof.py
.py
464
22
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, multi)") data = numpy.loadtxt("conv_dof_h1_s.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, single)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/thermoelasticity/img-hollow-conductor/plot_graph_cpu.py
.py
546
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_cpu_h2_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_cpu_hp_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/thermoelasticity/img-hollow-conductor/plot_compar_cpu.py
.py
454
22
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, multi)") data = numpy.loadtxt("conv_cpu_h1_s.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, single)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/thermoelasticity/img-hollow-conductor/plot_graph_dof.py
.py
556
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("conv_dof_h2_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2)") data = numpy.loadtxt("conv_dof_hp_m.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/miscellaneous/example-singular-perturbation/plot_graph_hp_dof.py
.py
459
22
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/miscellaneous/example-singular-perturbation/plot_graph_compar_dof.py
.py
582
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h1-FEM (aniso)") data = numpy.loadtxt("conv_dof_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h2-FEM (aniso)") data = numpy.loadtxt("conv_dof_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/miscellaneous/example-singular-perturbation/plot_graph_hp_cpu.py
.py
449
22
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/miscellaneous/example-singular-perturbation/plot_graph_compar_cpu.py
.py
572
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h1-FEM (aniso)") data = numpy.loadtxt("conv_cpu_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h2-FEM (aniso)") data = numpy.loadtxt("conv_cpu_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/examples/maxwell/microwave-oven/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-08/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-08/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-08/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-01/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-01/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-01/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-12/plot_compar_hp.py
.py
1,168
55
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") #data = numpy.loadtxt("conv_dof_est_hp_iso.dat") #x = data[:, 0] #y = data[:, 1] #semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") #pylab.xlim(0, 6000); legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") #data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") #x = data[:, 0] #y = data[:, 1] #semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-12/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-12/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-03/plot_compar_hp.py
.py
1,168
55
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") #data = numpy.loadtxt("conv_dof_est_hp_iso.dat") #x = data[:, 0] #y = data[:, 1] #semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") #pylab.xlim(0, 6000); legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") #data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") #x = data[:, 0] #y = data[:, 1] #semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-03/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-03/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-06/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-06/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-06/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-05/plot_compar_hp.py
.py
1,180
56
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") pylab.xlim(0, 8000); legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") pylab.xlim(0, 1500); legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-05/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-05/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-10/plot_compar_h2.py
.py
888
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, iso)") data = numpy.loadtxt("conv_dof_exact_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, iso)") data = numpy.loadtxt("conv_cpu_exact_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-10/plot_compar_h1.py
.py
888
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, iso)") data = numpy.loadtxt("conv_dof_exact_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, iso)") data = numpy.loadtxt("conv_cpu_exact_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-10/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-10/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-10/plot_compar_iso.py
.py
1,122
50
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, iso)") data = numpy.loadtxt("conv_dof_exact_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, iso)") data = numpy.loadtxt("conv_dof_exact_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, iso)") data = numpy.loadtxt("conv_cpu_exact_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, iso)") data = numpy.loadtxt("conv_cpu_exact_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-10/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-07/plot_compar_hp.py
.py
896
46
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-07/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-07/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-02/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-02/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-02/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-04/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-04/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-04/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-11/plot_compar_hp.py
.py
1,126
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-11/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-11/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-09/plot_compar_hp.py
.py
1,138
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] semilogy(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-09/plot_compar_5.py
.py
1,638
74
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_dof_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_dof_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") data = numpy.loadtxt("conv_cpu_est_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") data = numpy.loadtxt("conv_cpu_est_hp_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso hp)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-nist/nist-09/plot_compar_aniso.py
.py
1,144
54
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_dof_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_dof_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # initialize new window pylab.figure() axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_est_h1_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, aniso)") data = numpy.loadtxt("conv_cpu_est_h2_aniso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, aniso)") data = numpy.loadtxt("conv_cpu_est_hp_anisoh.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (aniso h)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
doc/exts/youtube.py
.py
1,356
40
from docutils import nodes from docutils.parsers.rst import directives CODE = """\ <iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/%(yid)s" frameborder="0"> </iframe> """ PARAM = """\n <param name="%s" value="%s"></param>""" def youtube(name, args, options, content, lineno, contentOffset, blockText, state, stateMachine): """ Restructured text extension for inserting youtube embedded videos """ if len(content) == 0: return string_vars = { 'yid': content[0], 'width': 528, 'height': 400, 'extra': '' } extra_args = content[1:] # Because content[0] is ID extra_args = [ea.strip().split("=") for ea in extra_args] # key=value extra_args = [ea for ea in extra_args if len(ea) == 2] # drop bad lines extra_args = dict(extra_args) if 'width' in extra_args: string_vars['width'] = extra_args.pop('width') if 'height' in extra_args: string_vars['height'] = extra_args.pop('height') if extra_args: params = [PARAM % (key, extra_args[key]) for key in extra_args] string_vars['extra'] = "".join(params) return [nodes.raw('', CODE % (string_vars), format='html')] youtube.content = True directives.register_directive('youtube', youtube) def setup(foo): pass
Python
2D
hpfem/hermes-examples
doc/exts/latexcode.py
.py
2,611
88
# -*- coding: utf-8 -*- """ The Pygments reStructuredText directive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This fragment is a Docutils_ 0.5 directive that renders source code (to HTML only, currently) via Pygments. To use it, adjust the options below and copy the code into a module that you import on initialization. The code then automatically registers a ``sourcecode`` directive that you can use instead of normal code blocks like this:: .. sourcecode:: python My code goes here. If you want to have different code styles, e.g. one with line numbers and one without, add formatters with their names in the VARIANTS dict below. You can invoke them instead of the DEFAULT one by using a directive option:: .. sourcecode:: python :linenos: My code goes here. Look at the `directive documentation`_ to get all the gory details. .. _Docutils: http://docutils.sf.net/ .. _directive documentation: http://docutils.sourceforge.net/docs/howto/rst-directives.html :copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # Options # ~~~~~~~ # Set to True if you want inline CSS styles instead of classes INLINESTYLES = True from pygments.formatters import LatexFormatter # The default formatter DEFAULT = LatexFormatter() # Add name -> formatter pairs for every variant you want to use VARIANTS = { # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), } from docutils import nodes from docutils.parsers.rst import directives, Directive from pygments import highlight from pygments.lexers import get_lexer_by_name, TextLexer, RstLexer class Pygments(Directive): """ Source code syntax hightlighting. """ required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True option_spec = dict([(key, directives.flag) for key in VARIANTS]) has_content = True def run(self): self.assert_has_content() try: lexer = get_lexer_by_name(self.arguments[0]) except ValueError: # no lexer found - use the text one instead of an exception lexer = RstLexer() # take an arbitrary option if more than one is given formatter = self.options and VARIANTS[self.options.keys()[0]] or DEFAULT parsed = highlight('\n'.join(self.content), lexer, formatter) return [nodes.raw('', parsed, format='latex')] directives.register_directive('latexcode', Pygments) def setup(foo): pass
Python
2D
hpfem/hermes-examples
doc/exts/sourcecode.py
.py
2,548
83
""" The Pygments reStructuredText directive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This fragment is a Docutils_ 0.4 directive that renders source code (to HTML only, currently) via Pygments. To use it, adjust the options below and copy the code into a module that you import on initialization. The code then automatically registers a ``code-block`` directive that you can use instead of normal code blocks like this:: .. code-block:: python My code goes here. If you want to have different code styles, e.g. one with line numbers and one without, add formatters with their names in the VARIANTS dict below. You can invoke them instead of the DEFAULT one by using a directive option:: .. code-block:: python :linenos: My code goes here. Look at the `directive documentation`_ to get all the gory details. .. _Docutils: http://docutils.sf.net/ .. _directive documentation: http://docutils.sourceforge.net/docs/howto/rst-directives.html :copyright: 2007 by Georg Brandl. :license: BSD, see LICENSE for more details. """ # Options # ~~~~~~~ # Set to True if you want inline CSS styles instead of classes INLINESTYLES = False from pygments.formatters import HtmlFormatter # The default formatter DEFAULT = HtmlFormatter(noclasses=INLINESTYLES) # Add name -> formatter pairs for every variant you want to use VARIANTS = { 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), } from docutils import nodes from docutils.parsers.rst import directives from pygments import highlight from pygments.lexers import get_lexer_by_name, TextLexer def pygments_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): try: lexer = get_lexer_by_name(arguments[0]) except ValueError: # no lexer found - use the text one instead of an exception lexer = TextLexer() # take an arbitrary option if more than one is given formatter = options and VARIANTS[options.keys()[0]] or DEFAULT parsed = highlight(u'\n'.join(content), lexer, formatter) parsed = '<div class="codeblock">%s</div>' % parsed return [nodes.raw('', parsed, format='html')] pygments_directive.arguments = (1, 0, 1) pygments_directive.content = 1 pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS]) directives.register_directive('sourcecode', pygments_directive) def setup(foo): pass
Python
2D
hpfem/hermes-examples
doc/exts/popup.py
.py
1,279
41
from docutils import nodes from docutils.parsers.rst import directives CODE = """ <p><b><a href="javascript:doNothing()" onClick="popupHandle=popup(%(name)s)"><img src="%(depth)s" width=60 height=60 align=left>Watch the Video</a></b></p> </br> """ PARAM = """\n <param name="%s" value="%s"></param>""" def popup(name, args, options, content, lineno, contentOffset, blockText, state, stateMachine): """ Restructured text extension for popups """ if len(content) == 0: return string_vars = { 'name': content[0], 'depth': content[1], 'extra': '' } #import ipdb; ipdb.set_trace() extra_args = content[1:] # Because self.content[0] is ID extra_args = [ea.strip().split("=") for ea in extra_args] # key=value extra_args = [ea for ea in extra_args if len(ea) == 2] # drop bad lines extra_args = dict(extra_args) if 'depth' in extra_args: string_vars['depth'] = extra_args.pop('depth') if extra_args: params = [PARAM % (key, extra_args[key]) for key in extra_args] string_vars['extra'] = "".join(params) return [nodes.raw('', CODE % (string_vars), format='html')] popup.content = True directives.register_directive('popup', popup) def setup(foo): pass
Python
2D
hpfem/hermes-examples
doc/exts/math_dollar.py
.py
1,813
54
import re def process_dollars(app, docname, source): r""" Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like "``$HOME``". Don't make any changes on lines starting with spaces, because those are indented and hence part of a block of code or examples. This also doesn't replaces dollar signs enclosed in curly braces, to avoid nested math environments, such as :: $f(n) = 0 \text{ if $n$ is prime}$ Thus the above line would get changed to `f(n) = 0 \text{ if $n$ is prime}` """ s = "\n".join(source) if s.find("$") == -1: return # This searches for "$blah$" inside a pair of curly braces -- # don't change these, since they're probably coming from a nested # math environment. So for each match, we replace it with a temporary # string, and later on we substitute the original back. global _data _data = {} def repl(matchobj): global _data s = matchobj.group(0) t = "___XXX_REPL_%d___" % len(_data) _data[t] = s return t s = re.sub(r"({[^{}$]*\$[^{}$]*\$[^{}]*})", repl, s) # matches $...$ dollars = re.compile(r"(?<!\$)(?<!\\)\$([^\$]+?)\$") # regular expression for \$ slashdollar = re.compile(r"\\\$") s = dollars.sub(r":math:`\1`", s) s = slashdollar.sub(r"$", s) # change the original {...} things in: for r in _data: s = s.replace(r, _data[r]) # now save results in "source" source[:] = [s] def setup(app): app.connect("source-read", process_dollars)
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/NIST-util.h
.h
867
33
#include "hermes2d.h" using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::Views; using namespace Hermes::Hermes2D::RefinementSelectors; class MySelector : public H1ProjBasedSelector<double> { public: MySelector(CandList cand_list) : H1ProjBasedSelector<double>(cand_list) { } private: void evaluate_cands_score(std::vector<Cand>& candidates, Element* e) { //calculate score of candidates Cand& unrefined = candidates[0]; const int num_cands = (int)candidates.size(); unrefined.score = 0; for (int i = 1; i < num_cands; i++) { Cand& cand = candidates[i]; if(cand.error < unrefined.error) { double delta_dof = cand.dofs - unrefined.dofs; candidates[i].score = (log10(unrefined.error) - log10(cand.error)) / delta_dof; } else candidates[i].score = 0; } } };
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-nist/NIST-util.cpp
.cpp
4,064
131
#include "NIST-util.h" const char* thresholds[7] = { "Lowest", "Lower", "Low", "Medium", "High", "Higher", "Highest" }; const double threshold_values[7] = { 0.05, 0.2, 0.4, 0.5, 0.6, 0.8, 0.95 }; extern const char* strategies[6] = { "noSelectionH", "noSelectionHP", "hXORpError", "hORpDOFs", "isoHPDOFs", "anisoHPDOFs" }; char* process_arguments_main_comparison(int argc, char* argv[], Selector<double>*& selector, AdaptivityStoppingCriterion<double>*& stoppingCriterion) { assert(argc > 2); char* toReturn = new char[1000]; int selectorIndex = atoi(argv[1]); selector = new MySelector((hpAdaptivityStrategy)selectorIndex); int stoppingCriterionIndex = atoi(argv[2]); stoppingCriterion = new AdaptStoppingCriterionSingleElement<double>(threshold_values[stoppingCriterionIndex]); sprintf(toReturn, "%s-%s", strategies[selectorIndex], thresholds[stoppingCriterionIndex]); return toReturn; } bool adaptive_step_single_space( Hermes::Mixins::Loggable* logger, MeshSharedPtr& mesh, SpaceSharedPtr<double>& space, MeshFunctionSharedPtr<double>& sln, Selector<double>* selector, unsigned int order_increase, MeshFunctionSharedPtr<double>& ref_sln, Hermes::Mixins::TimeMeasurable& cpu_time, Solver<double>& solver, Views::ScalarView& sview, Views::OrderView & oview, ErrorCalculator<double>& errorCalculator, Adapt<double>& adaptivity, int& as, double error_stop, double& error_reached, int& dof_reached, int& cache_searches, int& cache_record_found, int& cache_record_found_reinit, int& cache_record_not_found, double& exact_error_reached, double& FactorizationSize, double& PeakMemoryUsage, double& Flops, MeshFunctionSharedPtr<double>& exact_sln ) { try { // Construct globally refined reference mesh and setup reference space. Mesh::ReferenceMeshCreator refMeshCreator(mesh); MeshSharedPtr ref_mesh = refMeshCreator.create_ref_mesh(); Space<double>::ReferenceSpaceCreator refSpaceCreator(space, ref_mesh, order_increase); SpaceSharedPtr<double> ref_space = refSpaceCreator.create_ref_space(); int ndof_ref = ref_space->get_num_dofs(); logger->info("---- Adaptivity step %d (%d DOF):", as++, ndof_ref); solver.set_report_cache_hits_and_misses(); solver.set_space(ref_space); solver.solve(); // Translate the resulting coefficient vector into the instance of Solution. Solution<double>::vector_to_solution(solver.get_sln_vector(), ref_space, ref_sln); // Project the fine mesh solution onto the coarse mesh. logger->info("Calculating error estimate and exact error."); OGProjection<double>::project_global(space, ref_sln, sln); // Calculate element errors and total error estimate. double err_exact_rel; if(exact_sln) { errorCalculator.calculate_errors(sln, exact_sln, false); err_exact_rel = errorCalculator.get_total_error_squared() * 100.0; } errorCalculator.calculate_errors(sln, ref_sln); double err_est_rel = errorCalculator.get_total_error_squared() * 100.0; // Report results - skip time. cpu_time.tick(); { logger->info("ndof_coarse: %d, ndof_fine: %d", space->get_num_dofs(), ref_space->get_num_dofs()); logger->info("err_est_rel: %g%%.", err_est_rel); if(exact_sln) logger->info("err_exact_rel: %g%%.", err_exact_rel); // View the coarse mesh solution and polynomial orders. sview.show(ref_sln); oview.show(ref_space); error_reached = err_est_rel; if(exact_sln) exact_error_reached = err_exact_rel; dof_reached = ndof_ref; solver.get_cache_hits_and_misses(cache_searches, cache_record_found, cache_record_found_reinit, cache_record_not_found); } cpu_time.tick(Hermes::Mixins::TimeMeasurable::HERMES_SKIP); if (err_est_rel < error_stop) { return true; } else { adaptivity.adapt(selector); return false; } } catch(std::exception& e) { std::cout << e.what(); throw; return true; } }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/10-interior-line-singularity/definitions.h
.h
1,171
60
#include "hermes2d.h" #include "../NIST-util.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::Views; class CustomExactFunction { public: CustomExactFunction(double k, double alpha): k(k), alpha(alpha) {}; double fn(double x, double y); double k; double alpha; }; /* Right-hand side */ class CustomRightHandSide : public Hermes::Hermes2DFunction<double> { public: CustomRightHandSide(double k, double alpha); virtual double value(double x, double y) const; virtual Ord value(Ord x, Ord y) const; ~CustomRightHandSide(); CustomExactFunction* cef; double k; double alpha; }; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh, double k, double alpha); virtual double value(double x, double y) const; virtual void derivatives(double x, double y, double& dx, double& dy) const; virtual Ord ord (double x, double y) const; ~CustomExactSolution(); CustomExactFunction* cef; MeshFunction<double>* clone() const { return new CustomExactSolution(mesh, k, alpha); } double k; double alpha; };
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-nist/10-interior-line-singularity/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (exact)") data = numpy.loadtxt("conv_dof_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # initialize new window pylab.figure() # plot CPU convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_cpu_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (exact)") data = numpy.loadtxt("conv_cpu_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/10-interior-line-singularity/main.cpp
.cpp
6,903
196
#include "definitions.h" using namespace RefinementSelectors; // This is the 10th in the series of NIST benchmarks with known exact solutions. // // Reference: W. Mitchell, A Collection of 2D Elliptic Problems for Testing Adaptive Algorithms, // NIST Report 7668, February 2010. // // Compare adaptivity with isotropic and anisotropic refinements. // // PDE: -Laplace u + f = 0 where f is dictated by the exact solution. // // Exact solution: u(x,y) = cos(K*y) for x < 0, // u(x,y) = cos(K*y) + pow(x, alpha) for x > 0 where alpha > 0. // // Domain: square, see the file singpert.mesh-> // // BC: Dirichlet given by the exact solution. // // The following parameters can be changed: const double K = M_PI / 2; const double alpha = 2.01; // Initial polynomial degree of mesh elements. const int P_INIT = 2; // Number of initial uniform mesh refinements. const int INIT_REF_NUM = 0; // This is a quantitative parameter of Adaptivity. const double THRESHOLD = 0.3; // This is a stopping criterion for Adaptivity. AdaptStoppingCriterionSingleElement<double> stoppingCriterion(THRESHOLD); // Predefined list of element refinement candidates. const CandList CAND_LIST = H2D_HP_ANISO_H; // Maximum allowed level of hanging nodes. const int MESH_REGULARITY = -1; // Stopping criterion for adaptivity. const double ERR_STOP = 1e-4; const CalculatedErrorType errorType = RelativeErrorToGlobalNorm; // Newton tolerance const double NEWTON_TOLERANCE = 1e-6; bool HERMES_VISUALIZATION = false; bool VTK_VISUALIZATION = false; int main(int argc, char* argv[]) { // Load the mesh. MeshSharedPtr mesh(new Mesh); MeshReaderH2D mloader; mloader.load("square_quad.mesh", mesh); // Perform initial mesh refinement. for (int i = 0; i < INIT_REF_NUM; i++) mesh->refine_all_elements(); // Set exact solution. MeshFunctionSharedPtr<double> exact_sln(new CustomExactSolution(mesh, K, alpha)); // Define right-hand side. CustomRightHandSide f(K, alpha); // Initialize weak formulation. Hermes1DFunction<double> lambda(1.0); WeakFormSharedPtr<double> wf(new WeakFormsH1::DefaultWeakFormPoisson<double>(HERMES_ANY, &lambda, &f)); // Initialize boundary conditions DefaultEssentialBCNonConst<double> bc_essential("Bdy_dirichlet_rest", exact_sln); EssentialBCs<double> bcs(&bc_essential); // Create an H1 space with default shapeset. SpaceSharedPtr<double> space(new H1Space<double>(mesh, &bcs, P_INIT)); // Initialize approximate solution. MeshFunctionSharedPtr<double> sln(new Solution<double>()); // Initialize refinement selector. MySelector selector(CAND_LIST); // Initialize views. Views::ScalarView sview("Solution", new Views::WinGeom(0, 0, 440, 350)); sview.show_mesh(false); sview.fix_scale_width(50); Views::OrderView oview("Polynomial orders", new Views::WinGeom(450, 0, 420, 350)); // DOF and CPU convergence graphs. SimpleGraph graph_dof_est, graph_cpu_est, graph_dof_exact, graph_cpu_exact; // Time measurement. Hermes::Mixins::TimeMeasurable cpu_time; // Adaptivity loop: int as = 1; bool done = false; do { cpu_time.tick(); // Construct globally refined reference mesh and setup reference space-> Mesh::ReferenceMeshCreator refMeshCreator(mesh); MeshSharedPtr ref_mesh = refMeshCreator.create_ref_mesh(); Space<double>::ReferenceSpaceCreator refSpaceCreator(space, ref_mesh); SpaceSharedPtr<double> ref_space = refSpaceCreator.create_ref_space(); int ndof_ref = ref_space->get_num_dofs(); Hermes::Mixins::Loggable::Static::info("---- Adaptivity step %d (%d DOF):", as, ndof_ref); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Solving on reference mesh."); // Assemble the discrete problem. DiscreteProblem<double> dp(wf, ref_space); NewtonSolver<double> newton(&dp); MeshFunctionSharedPtr<double> ref_sln(new Solution<double>()); try { newton.solve(); } catch (Hermes::Exceptions::Exception e) { e.print_msg(); throw Hermes::Exceptions::Exception("Newton's iteration failed."); }; // Translate the resulting coefficient vector into the instance of Solution. Solution<double>::vector_to_solution(newton.get_sln_vector(), ref_space, ref_sln); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Solution: %g s", cpu_time.last()); // Project the fine mesh solution onto the coarse mesh. Hermes::Mixins::Loggable::Static::info("Calculating error estimate and exact error."); OGProjection<double>::project_global(space, ref_sln, sln); // Calculate element errors and total error estimate. DefaultErrorCalculator<double, HERMES_H1_NORM> error_calculator(errorType, 1); error_calculator.calculate_errors(sln, exact_sln); double err_exact_rel = error_calculator.get_total_error_squared() * 100.0; error_calculator.calculate_errors(sln, ref_sln); double err_est_rel = error_calculator.get_total_error_squared() * 100.0; Adapt<double> adaptivity(space, &error_calculator); adaptivity.set_strategy(&stoppingCriterion); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Error calculation: %g s", cpu_time.last()); // Report results. Hermes::Mixins::Loggable::Static::info("ndof_coarse: %d, ndof_fine: %d", space->get_num_dofs(), ref_space->get_num_dofs()); Hermes::Mixins::Loggable::Static::info("err_est_rel: %g%%, err_exact_rel: %g%%", err_est_rel, err_exact_rel); // Time measurement. cpu_time.tick(); double accum_time = cpu_time.accumulated(); // View the coarse mesh solution and polynomial orders. sview.show(sln); oview.show(space); // Add entry to DOF and CPU convergence graphs. graph_dof_est.add_values(space->get_num_dofs(), err_est_rel); graph_dof_est.save("conv_dof_est.dat"); graph_cpu_est.add_values(accum_time, err_est_rel); graph_cpu_est.save("conv_cpu_est.dat"); graph_dof_exact.add_values(space->get_num_dofs(), err_exact_rel); graph_dof_exact.save("conv_dof_exact.dat"); graph_cpu_exact.add_values(accum_time, err_exact_rel); graph_cpu_exact.save("conv_cpu_exact.dat"); cpu_time.tick(Hermes::Mixins::TimeMeasurable::HERMES_SKIP); // If err_est too large, adapt the mesh. The NDOF test must be here, so that the solution may be visualized // after ending due to this criterion. if (err_exact_rel < ERR_STOP) done = true; else done = adaptivity.adapt(&selector); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Adaptation: %g s", cpu_time.last()); // Increase the counter of adaptivity steps. if (done == false) as++; } while (done == false); Hermes::Mixins::Loggable::Static::info("Total running time: %g s", cpu_time.accumulated()); // Wait for all views to be closed. Views::View::wait(); return 0; }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/10-interior-line-singularity/definitions.cpp
.cpp
1,338
57
#include "definitions.h" double CustomExactFunction::fn(double x, double y) { if (x <= 0) return Hermes::cos(k * y); else return Hermes::cos(k * y) + Hermes::pow(x, alpha); } CustomRightHandSide::CustomRightHandSide(double k, double alpha) : Hermes::Hermes2DFunction<double>(), k(k), alpha(alpha) { cef = new CustomExactFunction(k, alpha); } CustomRightHandSide::~CustomRightHandSide() { delete cef; } double CustomRightHandSide::value(double x, double y) const { if (x < 0) return -cef->fn(x, y) * k * k; else return -(cef->fn(x, y) * k * k - alpha *(alpha - 1) * Hermes::pow(x, alpha - 2.) - k * k * Hermes::pow(x, alpha)); } Ord CustomRightHandSide::value(Ord x, Ord y) const { return Ord(16); } CustomExactSolution::CustomExactSolution(MeshSharedPtr mesh, double k, double alpha) : ExactSolutionScalar<double>(mesh), k(k), alpha(alpha) { cef = new CustomExactFunction(k, alpha); } CustomExactSolution::~CustomExactSolution() { delete cef; } double CustomExactSolution::value(double x, double y) const { return cef->fn(x, y); } void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { if (x <= 0) dx = 0; else dx = alpha * Hermes::pow(x, alpha - 1); dy = -Hermes::sin(k * y) * k; } Ord CustomExactSolution::ord(double x, double y) const { return Ord(16); }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/04-exponential-peak/definitions.h
.h
1,151
45
#include "hermes2d.h" #include "../NIST-util.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::Views; /* Right-hand side */ class CustomRightHandSide : public Hermes::Hermes2DFunction<double> { public: CustomRightHandSide(double alpha, double x_loc, double y_loc) : Hermes::Hermes2DFunction<double>(), alpha(alpha), x_loc(x_loc), y_loc(y_loc) {}; virtual double value(double x, double y) const; virtual Ord value (Ord x, Ord y) const; double alpha; double x_loc; double y_loc; }; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh, double alpha, double x_loc, double y_loc) : ExactSolutionScalar<double>(mesh), alpha(alpha), x_loc(x_loc), y_loc(y_loc) {}; virtual double value(double x, double y) const; virtual void derivatives(double x, double y, double& dx, double& dy) const; virtual Ord ord (double x, double y) const; MeshFunction<double>* clone() const { return new CustomExactSolution(mesh, alpha, x_loc, y_loc); } double alpha; double x_loc; double y_loc; };
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-nist/04-exponential-peak/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (exact)") data = numpy.loadtxt("conv_dof_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # initialize new window pylab.figure() # plot CPU convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_cpu_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (exact)") data = numpy.loadtxt("conv_cpu_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/04-exponential-peak/main.cpp
.cpp
7,028
195
#include "definitions.h" using namespace RefinementSelectors; // This is the fourth in the series of NIST benchmarks with known exact solutions. // // Reference: W. Mitchell, A Collection of 2D Elliptic Problems for Testing Adaptive Algorithms, // NIST Report 7668, February 2010. // // PDE: -Laplace u + f = 0. // // Known exact solution: exp(-alpha * (pow(x - x_loc, 2) + pow(y - y_loc, 2))). // See functions CustomExactSolution::value and CustomExactSolution::derivatives in "exact_solution.cpp". // // Domain: unit square (0, 1)x(0, 1), see the file "square_tri" or "square_quad.mesh". // // BC: Dirichlet, given by exact solution. // // The following parameters can be changed: // This problem has and exponential peak in the interior of the domain. // (x_loc, y_loc) is the location of the peak, and alpha determines the strenghth of the peak. double alpha = 1000; double x_loc = 0.5; double y_loc = 0.5; // Initial polynomial degree of mesh elements. const int P_INIT = 1; // Number of initial uniform mesh refinements. const int INIT_REF_NUM = 2; // This is a quantitative parameter of Adaptivity. const double THRESHOLD = 0.3; // This is a stopping criterion for Adaptivity. AdaptStoppingCriterionSingleElement<double> stoppingCriterion(THRESHOLD); // Predefined list of element refinement candidates. const CandList CAND_LIST = H2D_HP_ANISO_H; // Maximum allowed level of hanging nodes. const int MESH_REGULARITY = -1; // Stopping criterion for adaptivity. const double ERR_STOP = 1.0; const CalculatedErrorType errorType = RelativeErrorToGlobalNorm; int main(int argc, char* argv[]) { // Load the mesh. MeshSharedPtr mesh(new Mesh); MeshReaderH2D mloader; // Quadrilaterals. mloader.load("square_quad.mesh", mesh); // Triangles. // mloader.load("square_tri.mesh", mesh); // Perform initial mesh refinements. for (int i = 0; i < INIT_REF_NUM; i++) mesh->refine_all_elements(); // Set exact solution. MeshFunctionSharedPtr<double> exact_sln(new CustomExactSolution(mesh, alpha, x_loc, y_loc)); // Define right-hand side. CustomRightHandSide f(alpha, x_loc, y_loc); // Initialize weak formulation. Hermes1DFunction<double> lambda(1.0); WeakFormSharedPtr<double> wf(new WeakFormsH1::DefaultWeakFormPoisson<double>(HERMES_ANY, &lambda, &f)); // Initialize boundary conditions DefaultEssentialBCNonConst<double> bc_essential("Bdy", exact_sln); EssentialBCs<double> bcs(&bc_essential); // Create an H1 space with default shapeset. SpaceSharedPtr<double> space(new H1Space<double>(mesh, &bcs, P_INIT)); // Initialize approximate solution. MeshFunctionSharedPtr<double> sln(new Solution<double>()); // Initialize refinement selector. MySelector selector(CAND_LIST); // Initialize views. Views::ScalarView sview("Solution", new Views::WinGeom(0, 0, 440, 350)); sview.show_mesh(false); sview.fix_scale_width(50); Views::OrderView oview("Polynomial orders", new Views::WinGeom(450, 0, 420, 350)); // DOF and CPU convergence graphs. SimpleGraph graph_dof_est, graph_cpu_est, graph_dof_exact, graph_cpu_exact; // Time measurement. Hermes::Mixins::TimeMeasurable cpu_time; // Assemble the discrete problem. NewtonSolver<double> newton; newton.set_weak_formulation(wf); MeshFunctionSharedPtr<double> ref_sln(new Solution<double>()); // Adaptivity loop: int as = 1; bool done = false; do { cpu_time.tick(); // Construct globally refined reference mesh and setup reference space-> Mesh::ReferenceMeshCreator refMeshCreator(mesh); MeshSharedPtr ref_mesh = refMeshCreator.create_ref_mesh(); Space<double>::ReferenceSpaceCreator refSpaceCreator(space, ref_mesh); SpaceSharedPtr<double> ref_space = refSpaceCreator.create_ref_space(); int ndof_ref = ref_space->get_num_dofs(); Hermes::Mixins::Loggable::Static::info("---- Adaptivity step %d (%d DOF):", as, ndof_ref); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Solving on reference mesh."); newton.set_space(ref_space); try { newton.solve(); } catch (Hermes::Exceptions::Exception e) { e.print_msg(); throw Hermes::Exceptions::Exception("Newton's iteration failed."); }; // Translate the resulting coefficient vector into the instance of Solution. Solution<double>::vector_to_solution(newton.get_sln_vector(), ref_space, ref_sln); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Solution: %g s", cpu_time.last()); // Project the fine mesh solution onto the coarse mesh. Hermes::Mixins::Loggable::Static::info("Calculating error estimate and exact error."); OGProjection<double>::project_global(space, ref_sln, sln); // Calculate element errors and total error estimate. DefaultErrorCalculator<double, HERMES_H1_NORM> error_calculator(errorType, 1); error_calculator.calculate_errors(sln, exact_sln); double err_exact_rel = error_calculator.get_total_error_squared() * 100.0; error_calculator.calculate_errors(sln, ref_sln); double err_est_rel = error_calculator.get_total_error_squared() * 100.0; Adapt<double> adaptivity(space, &error_calculator); adaptivity.set_strategy(&stoppingCriterion); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Error calculation: %g s", cpu_time.last()); // Report results. Hermes::Mixins::Loggable::Static::info("ndof_coarse: %d, ndof_fine: %d", space->get_num_dofs(), ref_space->get_num_dofs()); Hermes::Mixins::Loggable::Static::info("err_est_rel: %g%%, err_exact_rel: %g%%", err_est_rel, err_exact_rel); // Time measurement. cpu_time.tick(); double accum_time = cpu_time.accumulated(); // View the coarse mesh solution and polynomial orders. sview.show(sln); oview.show(space); // Add entry to DOF and CPU convergence graphs. graph_dof_est.add_values(space->get_num_dofs(), err_est_rel); graph_dof_est.save("conv_dof_est.dat"); graph_cpu_est.add_values(accum_time, err_est_rel); graph_cpu_est.save("conv_cpu_est.dat"); graph_dof_exact.add_values(space->get_num_dofs(), err_exact_rel); graph_dof_exact.save("conv_dof_exact.dat"); graph_cpu_exact.add_values(accum_time, err_exact_rel); graph_cpu_exact.save("conv_cpu_exact.dat"); cpu_time.tick(Hermes::Mixins::TimeMeasurable::HERMES_SKIP); // If err_est too large, adapt the mesh. The NDOF test must be here, so that the solution may be visualized // after ending due to this criterion. if (err_exact_rel < ERR_STOP) done = true; else done = adaptivity.adapt(&selector); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Adaptation: %g s", cpu_time.last()); // Increase the counter of adaptivity steps. if (done == false) as++; } while (done == false); Hermes::Mixins::Loggable::Static::info("Total running time: %g s", cpu_time.accumulated()); // Wait for all views to be closed. Views::View::wait(); return 0; }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/04-exponential-peak/definitions.cpp
.cpp
857
31
#include "definitions.h" double CustomRightHandSide::value(double x, double y) const { double a_P = (-alpha * Hermes::pow((x - x_loc), 2) - alpha * Hermes::pow((y - y_loc), 2)); return (4 * exp(a_P) * alpha * (alpha * (x - x_loc) * (x - x_loc) + alpha * (y - y_loc) * (y - y_loc) - 1)); } Ord CustomRightHandSide::value(Ord x, Ord y) const { return Ord(8); } double CustomExactSolution::value(double x, double y) const { return exp(-alpha * (Hermes::pow((x - x_loc), 2) + Hermes::pow((y - y_loc), 2))); } void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { double a = -alpha * ((x - x_loc) * (x - x_loc) + (y - y_loc) * (y - y_loc)); dx = -exp(a) * (2 * alpha * (x - x_loc)); dy = -exp(a) * (2 * alpha * (y - y_loc)); } Ord CustomExactSolution::ord(double x, double y) const { return Ord(8); }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/definitions.h
.h
1,777
63
#include "hermes2d.h" #include "../NIST-util.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::Views; /* Right-hand side */ class CustomRightHandSide : public Hermes::Hermes2DFunction<double> { public: CustomRightHandSide(double alpha_w, double alpha_p, double x_w, double y_w, double r_0, double omega_c, double epsilon, double x_p, double y_p) : Hermes::Hermes2DFunction<double>(), alpha_w(alpha_w), alpha_p(alpha_p), x_w(x_w), y_w(y_w), r_0(r_0), omega_c(omega_c), epsilon(epsilon), x_p(x_p), y_p(y_p) {}; virtual double value(double x, double y) const; virtual Ord value (Ord x, Ord y) const; double alpha_w; double alpha_p; double x_w; double y_w; double r_0; double omega_c; double epsilon; double x_p; double y_p; }; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh, double alpha_w, double alpha_p, double x_w, double y_w, double r_0, double omega_c, double epsilon, double x_p, double y_p) : ExactSolutionScalar<double>(mesh), alpha_w(alpha_w), alpha_p(alpha_p), x_w(x_w), y_w(y_w), r_0(r_0), omega_c(omega_c), epsilon(epsilon), x_p(x_p), y_p(y_p) {}; virtual double value(double x, double y) const; virtual void derivatives(double x, double y, double& dx, double& dy) const; virtual Ord ord (double x, double y) const; double get_angle(double y, double x) const; MeshFunction<double>* clone() const { return new CustomExactSolution(mesh, alpha_w, alpha_p, x_w, y_w, r_0, omega_c, epsilon, x_p, y_p); } double alpha_w; double alpha_p; double x_w; double y_w; double r_0; double omega_c; double epsilon; double x_p; double y_p; };
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/generate_diff_f_y.py
.py
734
33
from sympy import var, sqrt, sin, pprint, simplify, ccode, atan2, atan, exp, S var("x y alpha_w alpha_p omega pi x_w y_w x_p y_p epsilon r0") def diff_f_y(f): return f.diff(y, 1) r = sqrt(x**2+y**2) r_w = sqrt((x-x_w)**2+(y-y_w)**2) r_p_squared = (x-x_p)**2+(y-y_p)**2 theta = atan(y/x) u = r**(pi/omega) * sin(theta * pi / omega) + atan(alpha_w * (r_w - r0)) + exp(-alpha_p*r_p_squared) + exp(-(1+y)/epsilon) params = { omega: 3*pi/2, x_w: 0, y_w: -S(3)/4, r0: S(3)/4, alpha_p: 1000, alpha_w: 200, x_p: sqrt(5)/4, y_p: -S(1)/4, epsilon: S(1)/100, } u = u.subs(params) lhs = diff_f_y(u) print "lhs, as a formula:" pprint(lhs) print print "-"*60 print "lhs, as C code:" print ccode(lhs)
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (exact)") data = numpy.loadtxt("conv_dof_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # initialize new window pylab.figure() # plot CPU convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_cpu_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (exact)") data = numpy.loadtxt("conv_cpu_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # finalize show()
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/generate_diff_f_x.py
.py
734
33
from sympy import var, sqrt, sin, pprint, simplify, ccode, atan2, atan, exp, S var("x y alpha_w alpha_p omega pi x_w y_w x_p y_p epsilon r0") def diff_f_x(f): return f.diff(x, 1) r = sqrt(x**2+y**2) r_w = sqrt((x-x_w)**2+(y-y_w)**2) r_p_squared = (x-x_p)**2+(y-y_p)**2 theta = atan(y/x) u = r**(pi/omega) * sin(theta * pi / omega) + atan(alpha_w * (r_w - r0)) + exp(-alpha_p*r_p_squared) + exp(-(1+y)/epsilon) params = { omega: 3*pi/2, x_w: 0, y_w: -S(3)/4, r0: S(3)/4, alpha_p: 1000, alpha_w: 200, x_p: sqrt(5)/4, y_p: -S(1)/4, epsilon: S(1)/100, } u = u.subs(params) lhs = diff_f_x(u) print "lhs, as a formula:" pprint(lhs) print print "-"*60 print "lhs, as C code:" print ccode(lhs)
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/main.cpp
.cpp
7,174
202
#include "definitions.h" using namespace RefinementSelectors; // This is the twelfth in the series of NIST benchmarks with known exact solutions. // // Reference: W. Mitchell, A Collection of 2D Elliptic Problems for Testing Adaptive Algorithms, // NIST Report 7668, February 2010. // // PDE: -Laplace u + f = 0 // // Known exact solution: // See the class CustomExactSolution::value in file "definitions.h" // // Domain: L-shaped domain (-1,1)x(-1,1)\(0,1)x(-1,0), see the file "lshape.mesh". // // BC: Dirichlet, given by exact solution. // // The following parameters can be changed: const double omega_c = 3.0 * M_PI / 2.0; const double x_w = 0.0; const double y_w = -3.0 / 4.0; const double r_0 = 3.0 / 4.0; const double alpha_w = 200.0; const double x_p = -Hermes::sqrt(5.0) / 4.0; const double y_p = -1.0 / 4.0; const double alpha_p = 1000.0; const double epsilon = 1.0 / 100.0; // Initial polynomial degree of mesh elements. const int P_INIT = 2; // Number of initial uniform mesh refinements. const int INIT_REF_NUM = 0; // This is a quantitative parameter of Adaptivity. const double THRESHOLD = 0.8; // This is a stopping criterion for Adaptivity. AdaptStoppingCriterionLevels<double> stoppingCriterion(THRESHOLD); // Predefined list of element refinement candidates. const CandList CAND_LIST = H2D_HP_ANISO; // Maximum allowed level of hanging nodes. const int MESH_REGULARITY = -1; // Stopping criterion for adaptivity. const double ERR_STOP = 1e-2; const CalculatedErrorType errorType = RelativeErrorToGlobalNorm; // Newton tolerance const double NEWTON_TOLERANCE = 1e-6; bool HERMES_VISUALIZATION = false; bool VTK_VISUALIZATION = false; int main(int argc, char* argv[]) { // Load the mesh. MeshSharedPtr mesh(new Mesh); MeshReaderH2D mloader; mloader.load("lshape.mesh", mesh); // Perform initial mesh refinement. for (int i = 0; i < INIT_REF_NUM; i++) mesh->refine_all_elements(); // Set exact solution. MeshFunctionSharedPtr<double> exact_sln(new CustomExactSolution(mesh, alpha_w, alpha_p, x_w, y_w, r_0, omega_c, ::epsilon, x_p, y_p)); // Define right-hand side. CustomRightHandSide f(alpha_w, alpha_p, x_w, y_w, r_0, omega_c, ::epsilon, x_p, y_p); // Initialize the weak formulation. Hermes1DFunction<double> lambda(1.0); WeakFormSharedPtr<double> wf(new WeakFormsH1::DefaultWeakFormPoisson<double>(HERMES_ANY, &lambda, &f)); // Initialize boundary conditions DefaultEssentialBCNonConst<double> bc_essential("Bdy", exact_sln); EssentialBCs<double> bcs(&bc_essential); // Create an H1 space with default shapeset. SpaceSharedPtr<double> space(new H1Space<double>(mesh, &bcs, P_INIT)); // Initialize approximate solution. MeshFunctionSharedPtr<double> sln(new Solution<double>()); // Initialize refinement selector. MySelector selector(CAND_LIST); // Initialize views. Views::ScalarView sview("Solution", new Views::WinGeom(0, 0, 440, 350)); sview.show_mesh(false); sview.fix_scale_width(50); Views::OrderView oview("Polynomial orders", new Views::WinGeom(450, 0, 420, 350)); // DOF and CPU convergence graphs. SimpleGraph graph_dof_est, graph_cpu_est, graph_dof_exact, graph_cpu_exact; // Time measurement. Hermes::Mixins::TimeMeasurable cpu_time; // Adaptivity loop: int as = 1; bool done = false; do { cpu_time.tick(); // Construct globally refined reference mesh and setup reference space-> Mesh::ReferenceMeshCreator refMeshCreator(mesh); MeshSharedPtr ref_mesh = refMeshCreator.create_ref_mesh(); Space<double>::ReferenceSpaceCreator refSpaceCreator(space, ref_mesh); SpaceSharedPtr<double> ref_space = refSpaceCreator.create_ref_space(); int ndof_ref = ref_space->get_num_dofs(); Hermes::Mixins::Loggable::Static::info("---- Adaptivity step %d (%d DOF):", as, ndof_ref); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Solving on reference mesh."); // Assemble the discrete problem. DiscreteProblem<double> dp(wf, ref_space); NewtonSolver<double> newton(&dp); MeshFunctionSharedPtr<double> ref_sln(new Solution<double>()); try { newton.solve(); } catch (Hermes::Exceptions::Exception e) { e.print_msg(); throw Hermes::Exceptions::Exception("Newton's iteration failed."); }; // Translate the resulting coefficient vector into the instance of Solution. Solution<double>::vector_to_solution(newton.get_sln_vector(), ref_space, ref_sln); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Solution: %g s", cpu_time.last()); // Project the fine mesh solution onto the coarse mesh. Hermes::Mixins::Loggable::Static::info("Calculating error estimate and exact error."); OGProjection<double>::project_global(space, ref_sln, sln); // Calculate element errors and total error estimate. DefaultErrorCalculator<double, HERMES_H1_NORM> error_calculator(errorType, 1); error_calculator.calculate_errors(sln, exact_sln); double err_exact_rel = error_calculator.get_total_error_squared() * 100.0; error_calculator.calculate_errors(sln, ref_sln); double err_est_rel = error_calculator.get_total_error_squared() * 100.0; Adapt<double> adaptivity(space, &error_calculator); adaptivity.set_strategy(&stoppingCriterion); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Error calculation: %g s", cpu_time.last()); // Report results. Hermes::Mixins::Loggable::Static::info("ndof_coarse: %d, ndof_fine: %d", space->get_num_dofs(), ref_space->get_num_dofs()); Hermes::Mixins::Loggable::Static::info("err_est_rel: %g%%, err_exact_rel: %g%%", err_est_rel, err_exact_rel); // Time measurement. cpu_time.tick(); double accum_time = cpu_time.accumulated(); // View the coarse mesh solution and polynomial orders. sview.set_linearizer_criterion(LinearizerCriterionFixed(3)); sview.show(sln); oview.show(space); // Add entry to DOF and CPU convergence graphs. graph_dof_est.add_values(space->get_num_dofs(), err_est_rel); graph_dof_est.save("conv_dof_est.dat"); graph_cpu_est.add_values(accum_time, err_est_rel); graph_cpu_est.save("conv_cpu_est.dat"); graph_dof_exact.add_values(space->get_num_dofs(), err_exact_rel); graph_dof_exact.save("conv_dof_exact.dat"); graph_cpu_exact.add_values(accum_time, err_exact_rel); graph_cpu_exact.save("conv_cpu_exact.dat"); cpu_time.tick(Hermes::Mixins::TimeMeasurable::HERMES_SKIP); // If err_est too large, adapt the mesh. The NDOF test must be here, so that the solution may be visualized // after ending due to this criterion. if (err_exact_rel < ERR_STOP) done = true; else done = adaptivity.adapt(&selector); cpu_time.tick(); Hermes::Mixins::Loggable::Static::info("Adaptation: %g s", cpu_time.last()); // Increase the counter of adaptivity steps. if (done == false) as++; } while (done == false); Hermes::Mixins::Loggable::Static::info("Total running time: %g s", cpu_time.accumulated()); // Wait for all views to be closed. Views::View::wait(); return 0; }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/generate_rhs.py
.py
747
32
from sympy import var, sqrt, sin, pprint, simplify, ccode, atan2, atan, exp, S var("x y alpha_w alpha_p omega pi x_w y_w x_p y_p epsilon r0") def laplace(f): return f.diff(x, 2) + f.diff(y, 2) r = sqrt(x**2+y**2) r_w = sqrt((x-x_w)**2+(y-y_w)**2) r_p_squared = (x-x_p)**2+(y-y_p)**2 theta = atan(y/x) u = r**(pi/omega) * sin(theta * pi / omega) + atan(alpha_w * (r_w - r0)) + exp(-alpha_p*r_p_squared) + exp(-(1+y)/epsilon) params = { omega: 3*pi/2, x_w: 0, y_w: -S(3)/4, r0: S(3)/4, alpha_p: 1000, alpha_w: 200, x_p: sqrt(5)/4, y_p: -S(1)/4, epsilon: S(1)/100, } u = u.subs(params) lhs = laplace(u) print "lhs, as a formula:" pprint(lhs) print print "-"*60 print "lhs, as C code:" print ccode(lhs)
Python
2D
hpfem/hermes-examples
2d-benchmarks-nist/12-multiple-difficulties/definitions.cpp
.cpp
3,009
77
#include "definitions.h" double CustomRightHandSide::value(double x, double y) const { //For more elegant form please execute file "generate_rhs.py" double a_P = (-alpha_p * Hermes::pow((x - x_p), 2) - alpha_p * Hermes::pow((y - y_p), 2)); double a_W = Hermes::pow(x - x_w, 2); double b_W = Hermes::pow(y - y_w, 2); double c_W = Hermes::sqrt(a_W + b_W); double d_W = ((alpha_w * x - (alpha_w * x_w)) * (2 * x - (2 * x_w))); double e_W = ((alpha_w * y - (alpha_w * y_w)) * (2 * y - (2 * y_w))); double f_W = (Hermes::pow(alpha_w * c_W - (alpha_w * r_0), 2) + 1.0); double g_W = (alpha_w * c_W - (alpha_w * r_0)); return (4 * exp(a_P) * alpha_p * (alpha_p * (x - x_p) * (x - x_p) + alpha_p * (y - y_p) * (y - y_p) - 1) + ((alpha_w / (c_W * f_W)) - (d_W / (2 * Hermes::pow(a_W + b_W, 1.5) * f_W)) - ((alpha_w * d_W * g_W) / ((a_W + b_W) * Hermes::pow(f_W, 2))) + (alpha_w / (c_W * f_W)) - (e_W / (2 * Hermes::pow(a_W + b_W, 1.5) * f_W)) - ((alpha_w * e_W * g_W) / ((a_W + b_W) * Hermes::pow(f_W, 2)))) + (1.0 / epsilon) * (1.0 / epsilon) * exp(-(1 + y) / epsilon)); } Ord CustomRightHandSide::value(Ord x, Ord y) const { return Ord(10); } double CustomExactSolution::value(double x, double y) const { double alpha_c = (M_PI / omega_c); return exp(-alpha_p * (Hermes::pow((x - x_p), 2) + Hermes::pow((y - y_p), 2))) + (Hermes::pow(Hermes::sqrt(x*x + y*y), alpha_c) * Hermes::sin(alpha_c * get_angle(y, x))) + Hermes::atan(alpha_w * (Hermes::sqrt(Hermes::pow(x - x_w, 2) + Hermes::pow(y - y_w, 2)) - r_0)) + exp(-(1 + y) / epsilon); } void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { double a_P = -alpha_p * ((x - x_p) * (x - x_p) + (y - y_p) * (y - y_p)); double alpha_c = (M_PI / omega_c); double a_C = Hermes::sqrt(x*x + y*y); double b_C = Hermes::pow(a_C, (alpha_c - 1.0)); double c_C = Hermes::pow(a_C, alpha_c); double d_C = ((y*y) / (x*x) + 1.0); double a_W = Hermes::pow(x - x_w, 2); double b_W = Hermes::pow(y - y_w, 2); double c_W = Hermes::sqrt(a_W + b_W); double d_W = (alpha_w * x - (alpha_w * x_w)); double e_W = (alpha_w * y - (alpha_w * y_w)); double f_W = (Hermes::pow(alpha_w * c_W - (alpha_w * r_0), 2) + 1.0); dx = -exp(a_P) * (2 * alpha_p * (x - x_p)) + (((alpha_c* x* Hermes::sin(alpha_c * get_angle(y, x)) *b_C) / a_C) - ((alpha_c *y *Hermes::cos(alpha_c * get_angle(y, x)) * c_C) / (Hermes::pow(x, 2.0) *d_C))) + (d_W / (c_W * f_W)); dy = -exp(a_P) * (2 * alpha_p * (y - y_p)) + (((alpha_c* Hermes::cos(alpha_c* get_angle(y, x)) *c_C) / (x * d_C)) + ((alpha_c* y* Hermes::sin(alpha_c* get_angle(y, x)) *b_C) / a_C)) + (e_W / (c_W * f_W)) + (-1) * (1.0 / epsilon) * exp(-(1 + y) / epsilon); } Ord CustomExactSolution::ord(double x, double y) const { return Ord(10); } double CustomExactSolution::get_angle(double y, double x) const { double theta = Hermes::atan2(y, x); if (theta < 0) theta += 2 * M_PI; return theta; }
C++
2D
hpfem/hermes-examples
2d-benchmarks-nist/05-battery/definitions.h
.h
4,292
146
#include "hermes2d.h" #include "../NIST-util.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::Views; using namespace Hermes::Hermes2D::RefinementSelectors; /* Weak forms */ class CustomMatrixFormVol : public MatrixFormVol<double> { public: CustomMatrixFormVol(int i, int j, MeshSharedPtr mesh) : MatrixFormVol<double>(i, j), mesh(mesh) {}; template<typename Real, typename Scalar> Scalar matrix_form(int n, double *wt, Func<Scalar> *u_ext[], Func<Real> *u, Func<Real> *v, GeomVol<Real> *e, Func<Scalar>* *ext) const; virtual double value(int n, double *wt, Func<double> *u_ext[], Func<double> *u, Func<double> *v, GeomVol<double> *e, Func<double>* *ext) const; virtual Ord ord(int n, double *wt, Func<Ord> *u_ext[], Func<Ord> *u, Func<Ord> *v, GeomVol<Ord> *e, Func<Ord>* *ext) const; MatrixFormVol<double>* clone() const; MeshSharedPtr mesh; }; class CustomVectorFormVol : public VectorFormVol<double> { public: CustomVectorFormVol(int i, MeshSharedPtr mesh) : VectorFormVol<double>(i), mesh(mesh) {}; template<typename Real, typename Scalar> Scalar vector_form(int n, double *wt, Func<Scalar> *u_ext[], Func<Real> *v, GeomVol<Real> *e, Func<Scalar>* *ext) const; virtual double value(int n, double *wt, Func<double> *u_ext[], Func<double> *v, GeomVol<double> *e, Func<double>* *ext) const; virtual Ord ord(int n, double *wt, Func<Ord> *u_ext[], Func<Ord> *v, GeomVol<Ord> *e, Func<Ord>* *ext) const; VectorFormVol<double>* clone() const; MeshSharedPtr mesh; }; class CustomMatrixFormSurf : public MatrixFormSurf<double> { public: CustomMatrixFormSurf(int i, int j, std::string marker) : MatrixFormSurf<double>(i, j) { this->set_area(marker); }; template<typename Real, typename Scalar> Scalar matrix_form(int n, double *wt, Func<Scalar> *u_ext[], Func<Real> *u, Func<Real> *v, GeomSurf<Real> *e, Func<Scalar>* *ext) const; virtual double value(int n, double *wt, Func<double> *u_ext[], Func<double> *u, Func<double> *v, GeomSurf<double> *e, Func<double>* *ext) const; virtual Ord ord(int n, double *wt, Func<Ord> *u_ext[], Func<Ord> *u, Func<Ord> *v, GeomSurf<Ord> *e, Func<Ord>* *ext) const; MatrixFormSurf<double>* clone() const; }; class CustomVectorFormSurf : public VectorFormSurf<double> { public: CustomVectorFormSurf(int i, std::string marker) : VectorFormSurf<double>(i) { this->set_area(marker); }; template<typename Real, typename Scalar> Scalar vector_form(int n, double *wt, Func<Scalar> *u_ext[], Func<Real> *v, GeomSurf<Real> *e, Func<Scalar>* *ext) const; virtual double value(int n, double *wt, Func<double> *u_ext[], Func<double> *v, GeomSurf<double> *e, Func<double>* *ext) const; virtual Ord ord(int n, double *wt, Func<Ord> *u_ext[], Func<Ord> *v, GeomSurf<Ord> *e, Func<Ord>* *ext) const; VectorFormSurf<double>* clone() const; }; class CustomWeakFormPoisson : public WeakForm<double> { public: CustomWeakFormPoisson(std::string omega_1, std::string omega_2, std::string omega_3, std::string omega_4, std::string omega_5, std::string bdy_left, std::string bdy_top, std::string bdy_right, std::string bdy_bottom, MeshSharedPtr mesh); MeshSharedPtr mesh; const std::string omega_1; const std::string omega_2; const std::string omega_3; const std::string omega_4; const std::string omega_5; const double p_1; const double p_2; const double p_3; const double p_4; const double p_5; const double q_1; const double q_2; const double q_3; const double q_4; const double q_5; const double f_1; const double f_2; const double f_3; const double f_4; const double f_5; // Boundary markers. const std::string bdy_left; const std::string bdy_top; const std::string bdy_right; const std::string bdy_bottom; // Boundary condition coefficients for the four sides. const double c_left; const double c_top; const double c_right; const double c_bottom; const double g_n_left; const double g_n_top; const double g_n_right; const double g_n_bottom; virtual WeakForm* clone() const; };
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-nist/05-battery/plot_graph.py
.py
628
32
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # initialize new window pylab.figure() # plot CPU convergence graph pylab.title("Error convergence") pylab.xlabel("CPU time (s)") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_cpu_est.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="error (est)") legend() # finalize show()
Python