├── robots.txt ├── dolfin-convert ├── step_3d.xml └── cylinder_3d.xml ├── hello ├── hello_output.txt ├── hello.py └── hello.sh ├── table_io ├── i4vec_write_test.txt ├── r8vec_write_test.txt ├── i4mat_write_test.txt ├── r8mat_write_test.txt └── table_io_test.sh ├── fem1d ├── fem1d.png ├── fem1d.sh ├── fem1d_model.sh ├── fem1d_model_output.txt └── fem1d_output.txt ├── truncated_normal_rule ├── option0_r.txt ├── option1_r.txt ├── option2_r.txt ├── option3_r.txt ├── option0_w.txt ├── option0_x.txt ├── option3_w.txt ├── option3_x.txt ├── option1_w.txt ├── option1_x.txt ├── option2_w.txt ├── option2_x.txt └── truncated_normal_rule_test.sh ├── polygon_grid ├── ell.png ├── quad.png ├── triangle.png ├── polygon_grid_test.sh ├── triangle.xy ├── ell.xy └── timestamp.py ├── spiral_data ├── spiral.png ├── spiral_matplotlib.png └── spiral_commands.txt ├── timestamp ├── timestamp_output.txt └── timestamp.sh ├── wathen ├── wathen_spy.png ├── r8vec_print.py ├── nonzeros.py ├── mv_st.py ├── st_to_ge.py ├── wathen_st_size.py └── wathen_order.py ├── fem1d_classes ├── test01.png ├── fem1d_classes.sh ├── fem1d_classes_prb.sh ├── fem1d_classes_test.sh ├── fem1d_classes_prb_output.txt └── fem1d_classes_test_output.txt ├── fem_to_xml ├── cheby9_elements.txt ├── tet_mesh_elements.txt ├── tet_mesh_nodes.txt ├── cheby9_nodes.txt ├── rectangle_nodes.txt ├── rectangle_elements.txt ├── cheby9.xml └── tet_mesh.xml ├── stokes_2d_exact ├── stokes1.png ├── stokes2.png ├── stokes3.png ├── stokes1_matplotlib.png ├── stokes2_matplotlib.png ├── stokes3_matplotlib.png ├── s2de_test.sh ├── stokes1_commands.txt ├── stokes2_commands.txt └── stokes3_commands.txt ├── xml_to_fem ├── cheby9_elements.txt ├── tet_mesh_elements.txt ├── tet_mesh_nodes.txt ├── cheby9_nodes.txt ├── rectangle_nodes.txt ├── xml_to_fem_test.sh ├── rectangle_elements.txt └── cheby9.xml ├── ball_grid ├── ball_grid_points.png ├── ball_grid_display.png ├── ball_grid_test.sh └── timestamp.py ├── cube_grid ├── cube_grid_points.png ├── cube_grid_display.png ├── cube_grid_test.sh └── timestamp.py ├── ellipse_grid ├── ellipse_grid.png ├── ellipse_grid_display.png ├── ellipse_grid_test.sh └── timestamp.py ├── disk_grid ├── disk_grid_display.png ├── disk_grid_fibonacci.png ├── disk_grid_regular.png ├── disk_grid_test.sh └── timestamp.py ├── navier_stokes_2d_exact ├── lucas.png ├── spiral.png ├── taylor.png ├── lucas_matplotlib.png ├── spiral_matplotlib.png ├── taylor_matplotlib.png ├── ns2de_test.sh ├── lucas_commands.txt ├── spiral_commands.txt └── taylor_commands.txt ├── wedge_grid ├── wedge_grid_display.png ├── wedge_grid_points.png └── wedge_grid_test.sh ├── fd1d_heat_explicit ├── plot_test01.png ├── plot_test02.png ├── plot_test03.png ├── plot_g_test02.png ├── x_test03.txt ├── x_test01.txt ├── x_test02.txt ├── t_test02.txt ├── t_test03.txt └── fd1d_heat_explicit_test.py ├── fd1d_heat_implicit ├── plot_test01.png ├── plot_test02.png ├── plot_test03.png ├── x_test03.txt ├── x_test01.txt ├── x_test02.txt ├── t_test02.txt ├── fd1d_heat_implicit_test.sh ├── fd1d_heat_implicit_matrix.py ├── t_test03.txt └── fd1d_heat_implicit_test.py ├── fem1d_heat_explicit ├── plot_test01.png ├── plot_test02.png ├── plot_test03.png ├── x_test03.txt ├── x_test01.txt ├── x_test02.txt ├── fem1d_heat_explicit_test.sh ├── t_test02.txt └── fem1d_heat_explicit_test_output.txt ├── md └── md.sh ├── sphere_llq_grid ├── sphere_llq_grid.png └── sphere_llq_grid_test.sh ├── square_grid ├── square_grid_display.png ├── square_grid_points.png └── square_grid_test.sh ├── pyramid_grid ├── pyramid_grid_display.png ├── pyramid_grid_points.png ├── pyramid_grid_test.sh ├── pyramid_grid_points.xyz └── timestamp.py ├── triangle_grid ├── triangle_grid_points.png ├── triangle_grid_display.png └── triangle_grid_test.sh ├── ellipsoid_grid ├── ellipsoid_grid_points.png ├── ellipsoid_grid_display.png ├── ellipsoid_grid_test.sh └── ellipsoid_grid_display.m ├── py ├── hello.sh ├── main_demo.sh ├── hello_output.txt ├── suppress_spaces.sh ├── main_demo_output.txt ├── hello.py └── suppress_spaces_output.txt ├── circle_arc_grid ├── circle_arc_grid_display.png ├── circle_arc_grid_points.png ├── circle_arc_grid_test.sh └── circle_arc_grid_points.xy ├── fem1d_bvp_quadratic ├── fem1d_bvp_quadratic.png └── fem1d_bvp_quadratic.sh ├── fem2d_bvp_linear ├── square_mesh_numbered.png ├── fem2d_bvp_linear.sh ├── square_elements.txt └── square_nodes.txt ├── filum ├── filum_prb_4by5.txt ├── filum_test.sh ├── filum_test_output.txt ├── filum_test.py └── timestamp.py ├── args ├── args.sh ├── args_output.txt ├── function_args.sh └── args.py ├── tetrahedron_grid ├── tetrahedron_grid_display.png ├── tetrahedron_grid_points.png ├── tetrahedron_grid_test.sh └── tetrahedron_grid_points.xyz ├── quad_serial ├── quad_serial.sh └── quad_serial_output.txt ├── sparse_grid ├── pysg_test.sh └── pysg_test_output.txt ├── prime_serial ├── prime_serial.sh └── prime_serial_output.txt ├── search_mpi └── search_mpi.sh ├── search_serial └── search_serial.sh ├── quad_mpi ├── quad_mpi.sh └── quad_mpi_output.txt ├── sphere_fibonacci_grid ├── sphere_fibonacci_grid_display.png └── sphere_fibonacci_grid_test.sh ├── hello_mpi ├── hello_mpi.sh ├── hello_mpi_output.txt └── hello_mpi.py ├── prime_mpi └── prime_mpi.sh ├── fd1d_advection_lax_wendroff ├── fd1d_advection_lax_wendroff.png ├── fd1d_advection_lax_wendroff.sh └── fd1d_advection_lax_wendroff_output.txt ├── LICENSE ├── dolfin ├── reaction_diffusion_mesh.pvd ├── reaction_diffusion_solution.pvd └── reaction_diffusion.py ├── bvec ├── bvec_test.sh └── timestamp.py ├── c4lib ├── c4lib_test.sh └── timestamp.py ├── c8lib ├── c8lib_test.sh └── timestamp.py ├── i4lib ├── i4lib_test.sh ├── i4_huge.py └── timestamp.py ├── r4lib ├── r4lib_test.sh └── r4lib_test.py ├── r8lib ├── r8lib_test.sh ├── r8_tiny.py ├── r8_print.py ├── r8_pi_sqrt.py ├── r8_in_01.py ├── r8_is_int.py ├── r8_sqrt_i4.py ├── r8_degrees.py ├── r8_radians.py ├── r8_sign_char.py ├── r8_divide_i4.py ├── r8_aint.py ├── r8_sign_match_strict.py ├── r8_asin.py ├── r8_sech.py ├── r8_unswap3.py ├── r8_sign3.py ├── r8_log_10.py ├── r8_sign_match.py ├── r8_sign_opposite.py ├── r8_insignificant.py ├── r8_sign_opposite_strict.py ├── r8_hypot.py ├── r8vec_step.py ├── r8_floor.py ├── r8_pythag.py ├── r8_round.py ├── r8_csc.py ├── r8_to_dhms.py ├── r8_fraction.py ├── r8_round_i4.py └── timestamp.py ├── sobol └── sobol_test.sh ├── timer ├── timer_test.sh └── timer_test.py ├── wtime ├── wtime_test.sh └── wtime_test.py ├── cauchy_principal_value ├── cpv_test.sh └── cpv_test.py ├── normal ├── normal_test.sh └── timestamp.py ├── polpak ├── polpak_test.sh └── timestamp.py ├── rnglib ├── rnglib_test.sh ├── cgn_get.py ├── cgn_set.py ├── initialized_set.py ├── antithetic_set.py ├── antithetic_get.py ├── lg_set.py ├── ig_set.py ├── initialized_get.py ├── cg_set.py ├── cg_get.py ├── ig_get.py ├── lg_get.py ├── initialized_memory.py ├── rnglib_test.py └── cgn_memory.py ├── subset ├── subset_test.sh └── i4_huge.py ├── four_fifths ├── four_fifths.sh └── four_fifths_output.txt ├── legendre_product_polynomial ├── lpp_test.sh └── perm_check0.py ├── machine ├── machine_test.sh └── machine_test.py ├── sort_rc ├── sort_rc_test.sh └── sort_rc_test.py ├── uniform ├── uniform_test.sh └── i4_huge.py ├── monomial └── monomial_test.sh ├── navier_stokes_3d_exact └── ns3de_test.sh ├── quadrule ├── quadrule_test.sh └── timestamp.py ├── test_mat └── test_mat_test.sh ├── line_grid ├── line_grid_test.sh ├── line_grid_test.py └── timestamp.py ├── polynomial ├── polynomial_test.sh └── perm_check0.py ├── latin_random └── latin_random_test.sh ├── bellman_ford └── bellman_ford_test.sh ├── cycle_brent ├── cycle_brent_test.sh ├── f4.py ├── f5.py ├── f3.py ├── f2.py ├── f1.py ├── cycle_brent_test02.py ├── cycle_brent_test03.py ├── cycle_brent_test04.py ├── cycle_brent_test.py ├── cycle_brent_test05.py └── cycle_brent_test01.py ├── cycle_floyd ├── cycle_floyd_test.sh ├── f4.py ├── f5.py ├── f3.py ├── f2.py ├── f1.py ├── cycle_floyd_test02.py ├── cycle_floyd_test03.py ├── cycle_floyd_test04.py ├── cycle_floyd_test05.py ├── cycle_floyd_test.py └── cycle_floyd_test01.py ├── hypercube_grid ├── hypercube_grid_points_test01.xyz ├── hypercube_grid_test.sh ├── hypercube_grid_points_test03.xyz └── hypercube_grid_points_test02.xyz ├── test_values └── test_values_test.sh ├── simplex_grid └── simplex_grid_test.sh ├── monomial_value └── monomial_value_test.sh ├── sphere_llt_grid └── sphere_llt_grid_test.sh ├── fem1d_bvp_linear └── fem1d_bvp_linear_test.sh ├── truncated_normal └── truncated_normal_test.sh ├── triangle_integrals └── triangle_integrals_test.sh ├── triangle01_integrals └── triangle01_integrals_test.sh ├── rkf45 └── f_lor.py ├── kronrod ├── f.py ├── kronrod_test.py └── kronrod_test02.py ├── snakes_and_ladders └── average_length.py └── freefem++_msh_io ├── input.msh └── output.msh /robots.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dolfin-convert/step_3d.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dolfin-convert/cylinder_3d.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hello/hello_output.txt: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | -------------------------------------------------------------------------------- /table_io/i4vec_write_test.txt: -------------------------------------------------------------------------------- 1 | 11 2 | 22 3 | 33 4 | 44 5 | 55 6 | -------------------------------------------------------------------------------- /table_io/r8vec_write_test.txt: -------------------------------------------------------------------------------- 1 | 1.1 2 | 2.2 3 | 3.3 4 | 4.4 5 | 5.5 6 | -------------------------------------------------------------------------------- /fem1d/fem1d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem1d/fem1d.png -------------------------------------------------------------------------------- /hello/hello.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | 5 | print "Hello, world!" 6 | -------------------------------------------------------------------------------- /truncated_normal_rule/option0_r.txt: -------------------------------------------------------------------------------- 1 | -1.797693134862316e+308 2 | 1.797693134862316e+308 3 | -------------------------------------------------------------------------------- /truncated_normal_rule/option1_r.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1.797693134862316e+308 3 | -------------------------------------------------------------------------------- /truncated_normal_rule/option2_r.txt: -------------------------------------------------------------------------------- 1 | -1.797693134862316e+308 2 | 3 3 | -------------------------------------------------------------------------------- /truncated_normal_rule/option3_r.txt: -------------------------------------------------------------------------------- 1 | 50 2 | 150 3 | -------------------------------------------------------------------------------- /polygon_grid/ell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/polygon_grid/ell.png -------------------------------------------------------------------------------- /polygon_grid/quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/polygon_grid/quad.png -------------------------------------------------------------------------------- /spiral_data/spiral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/spiral_data/spiral.png -------------------------------------------------------------------------------- /timestamp/timestamp_output.txt: -------------------------------------------------------------------------------- 1 | 1169822146.28 2 | Fri Jan 26 09:35:46 2007 3 | Wed Dec 31 19:00:00 1969 4 | -------------------------------------------------------------------------------- /wathen/wathen_spy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/wathen/wathen_spy.png -------------------------------------------------------------------------------- /fem1d_classes/test01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem1d_classes/test01.png -------------------------------------------------------------------------------- /polygon_grid/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/polygon_grid/triangle.png -------------------------------------------------------------------------------- /fem_to_xml/cheby9_elements.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 | 1 2 3 | 2 3 4 | 3 4 5 | 4 5 6 | 5 6 7 | 6 7 8 | 7 8 9 | -------------------------------------------------------------------------------- /stokes_2d_exact/stokes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/stokes_2d_exact/stokes1.png -------------------------------------------------------------------------------- /stokes_2d_exact/stokes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/stokes_2d_exact/stokes2.png -------------------------------------------------------------------------------- /stokes_2d_exact/stokes3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/stokes_2d_exact/stokes3.png -------------------------------------------------------------------------------- /table_io/i4mat_write_test.txt: -------------------------------------------------------------------------------- 1 | 11 12 13 2 | 21 22 23 3 | 31 32 33 4 | 41 42 43 5 | 51 52 53 6 | -------------------------------------------------------------------------------- /xml_to_fem/cheby9_elements.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 | 1 2 3 | 2 3 4 | 3 4 5 | 4 5 6 | 5 6 7 | 6 7 8 | 7 8 9 | -------------------------------------------------------------------------------- /ball_grid/ball_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/ball_grid/ball_grid_points.png -------------------------------------------------------------------------------- /cube_grid/cube_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/cube_grid/cube_grid_points.png -------------------------------------------------------------------------------- /ellipse_grid/ellipse_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/ellipse_grid/ellipse_grid.png -------------------------------------------------------------------------------- /ball_grid/ball_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/ball_grid/ball_grid_display.png -------------------------------------------------------------------------------- /cube_grid/cube_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/cube_grid/cube_grid_display.png -------------------------------------------------------------------------------- /disk_grid/disk_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/disk_grid/disk_grid_display.png -------------------------------------------------------------------------------- /disk_grid/disk_grid_fibonacci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/disk_grid/disk_grid_fibonacci.png -------------------------------------------------------------------------------- /disk_grid/disk_grid_regular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/disk_grid/disk_grid_regular.png -------------------------------------------------------------------------------- /fem1d/fem1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python fem1d.py > fem1d_output.txt 4 | # 5 | echo "The fem1d script has been executed." 6 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/lucas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/navier_stokes_2d_exact/lucas.png -------------------------------------------------------------------------------- /navier_stokes_2d_exact/spiral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/navier_stokes_2d_exact/spiral.png -------------------------------------------------------------------------------- /navier_stokes_2d_exact/taylor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/navier_stokes_2d_exact/taylor.png -------------------------------------------------------------------------------- /spiral_data/spiral_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/spiral_data/spiral_matplotlib.png -------------------------------------------------------------------------------- /wedge_grid/wedge_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/wedge_grid/wedge_grid_display.png -------------------------------------------------------------------------------- /wedge_grid/wedge_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/wedge_grid/wedge_grid_points.png -------------------------------------------------------------------------------- /fd1d_heat_explicit/plot_test01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_explicit/plot_test01.png -------------------------------------------------------------------------------- /fd1d_heat_explicit/plot_test02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_explicit/plot_test02.png -------------------------------------------------------------------------------- /fd1d_heat_explicit/plot_test03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_explicit/plot_test03.png -------------------------------------------------------------------------------- /fd1d_heat_implicit/plot_test01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_implicit/plot_test01.png -------------------------------------------------------------------------------- /fd1d_heat_implicit/plot_test02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_implicit/plot_test02.png -------------------------------------------------------------------------------- /fd1d_heat_implicit/plot_test03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_implicit/plot_test03.png -------------------------------------------------------------------------------- /fem1d_heat_explicit/plot_test01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem1d_heat_explicit/plot_test01.png -------------------------------------------------------------------------------- /fem1d_heat_explicit/plot_test02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem1d_heat_explicit/plot_test02.png -------------------------------------------------------------------------------- /fem1d_heat_explicit/plot_test03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem1d_heat_explicit/plot_test03.png -------------------------------------------------------------------------------- /md/md.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python md.py > md_output.txt 4 | # 5 | rm *.pyc 6 | # 7 | echo "Output written to md_output.txt." 8 | -------------------------------------------------------------------------------- /sphere_llq_grid/sphere_llq_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/sphere_llq_grid/sphere_llq_grid.png -------------------------------------------------------------------------------- /square_grid/square_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/square_grid/square_grid_display.png -------------------------------------------------------------------------------- /square_grid/square_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/square_grid/square_grid_points.png -------------------------------------------------------------------------------- /table_io/r8mat_write_test.txt: -------------------------------------------------------------------------------- 1 | 1.1 1.2 1.3 2 | 2.1 2.2 2.3 3 | 3.1 3.2 3.3 4 | 4.1 4.2 4.3 5 | 5.1 5.2 5.3 6 | -------------------------------------------------------------------------------- /ellipse_grid/ellipse_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/ellipse_grid/ellipse_grid_display.png -------------------------------------------------------------------------------- /fd1d_heat_explicit/plot_g_test02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_heat_explicit/plot_g_test02.png -------------------------------------------------------------------------------- /fem_to_xml/tet_mesh_elements.txt: -------------------------------------------------------------------------------- 1 | 3 2 4 0 2 | 3 1 4 0 3 | 3 6 2 4 4 | 3 6 7 4 5 | 3 5 1 4 6 | 3 5 7 4 7 | -------------------------------------------------------------------------------- /pyramid_grid/pyramid_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/pyramid_grid/pyramid_grid_display.png -------------------------------------------------------------------------------- /pyramid_grid/pyramid_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/pyramid_grid/pyramid_grid_points.png -------------------------------------------------------------------------------- /stokes_2d_exact/stokes1_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/stokes_2d_exact/stokes1_matplotlib.png -------------------------------------------------------------------------------- /stokes_2d_exact/stokes2_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/stokes_2d_exact/stokes2_matplotlib.png -------------------------------------------------------------------------------- /stokes_2d_exact/stokes3_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/stokes_2d_exact/stokes3_matplotlib.png -------------------------------------------------------------------------------- /triangle_grid/triangle_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/triangle_grid/triangle_grid_points.png -------------------------------------------------------------------------------- /xml_to_fem/tet_mesh_elements.txt: -------------------------------------------------------------------------------- 1 | 3 2 4 0 2 | 3 1 4 0 3 | 3 6 2 4 4 | 3 6 7 4 5 | 3 5 1 4 6 | 3 5 7 4 7 | -------------------------------------------------------------------------------- /ellipsoid_grid/ellipsoid_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/ellipsoid_grid/ellipsoid_grid_points.png -------------------------------------------------------------------------------- /fem_to_xml/tet_mesh_nodes.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 0 0 1 3 | 0 1 0 4 | 0 1 1 5 | 1 0 0 6 | 1 0 1 7 | 1 1 0 8 | 1 1 1 9 | -------------------------------------------------------------------------------- /hello/hello.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python hello.py >& hello_output.txt 4 | # 5 | echo " " 6 | echo "The hello example has been run." 7 | 8 | -------------------------------------------------------------------------------- /py/hello.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python hello.py >& hello_output.txt 4 | # 5 | echo " " 6 | echo "The hello example has been run." 7 | 8 | -------------------------------------------------------------------------------- /triangle_grid/triangle_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/triangle_grid/triangle_grid_display.png -------------------------------------------------------------------------------- /xml_to_fem/tet_mesh_nodes.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 0 0 1 3 | 0 1 0 4 | 0 1 1 5 | 1 0 0 6 | 1 0 1 7 | 1 1 0 8 | 1 1 1 9 | -------------------------------------------------------------------------------- /circle_arc_grid/circle_arc_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/circle_arc_grid/circle_arc_grid_display.png -------------------------------------------------------------------------------- /circle_arc_grid/circle_arc_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/circle_arc_grid/circle_arc_grid_points.png -------------------------------------------------------------------------------- /ellipsoid_grid/ellipsoid_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/ellipsoid_grid/ellipsoid_grid_display.png -------------------------------------------------------------------------------- /fem1d_bvp_quadratic/fem1d_bvp_quadratic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem1d_bvp_quadratic/fem1d_bvp_quadratic.png -------------------------------------------------------------------------------- /fem2d_bvp_linear/square_mesh_numbered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fem2d_bvp_linear/square_mesh_numbered.png -------------------------------------------------------------------------------- /filum/filum_prb_4by5.txt: -------------------------------------------------------------------------------- 1 | filprb 4 by 5 contains 2 | four rows of five words 3 | in every column, with words 4 | separated by blank characters. 5 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/lucas_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/navier_stokes_2d_exact/lucas_matplotlib.png -------------------------------------------------------------------------------- /args/args.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python args.py alpha fred 1.2 >& args_output.txt 4 | # 5 | echo " " 6 | echo "The args example has been run." 7 | 8 | -------------------------------------------------------------------------------- /fem1d/fem1d_model.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python fem1d_model.py > fem1d_model_output.txt 4 | # 5 | echo "The fem1d_model script has been executed." 6 | -------------------------------------------------------------------------------- /fem_to_xml/cheby9_nodes.txt: -------------------------------------------------------------------------------- 1 | -1 2 | -0.92388 3 | -0.707107 4 | -0.382683 5 | 0 6 | 0.382683 7 | 0.707107 8 | 0.92388 9 | 1 10 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/spiral_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/navier_stokes_2d_exact/spiral_matplotlib.png -------------------------------------------------------------------------------- /navier_stokes_2d_exact/taylor_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/navier_stokes_2d_exact/taylor_matplotlib.png -------------------------------------------------------------------------------- /tetrahedron_grid/tetrahedron_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/tetrahedron_grid/tetrahedron_grid_display.png -------------------------------------------------------------------------------- /tetrahedron_grid/tetrahedron_grid_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/tetrahedron_grid/tetrahedron_grid_points.png -------------------------------------------------------------------------------- /xml_to_fem/cheby9_nodes.txt: -------------------------------------------------------------------------------- 1 | -1 2 | -0.92388 3 | -0.707107 4 | -0.382683 5 | 0 6 | 0.382683 7 | 0.707107 8 | 0.92388 9 | 1 10 | -------------------------------------------------------------------------------- /py/main_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python main_demo.py >& main_demo_output.txt 4 | # 5 | echo " " 6 | echo "The main_demo example has been run." 7 | 8 | -------------------------------------------------------------------------------- /quad_serial/quad_serial.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python quad_serial.py > quad_serial_output.txt 4 | # 5 | echo "The quad_serial script has been executed." 6 | -------------------------------------------------------------------------------- /sparse_grid/pysg_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python pysg_test.py >& pysg_test_output.txt 4 | # 5 | echo " " 6 | echo "The pysg test has been run." 7 | 8 | -------------------------------------------------------------------------------- /prime_serial/prime_serial.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python prime_serial.py > prime_serial_output.txt 4 | # 5 | echo "The prime_serial script has been executed." 6 | -------------------------------------------------------------------------------- /timestamp/timestamp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python timestamp.py >& timestamp_output.txt 4 | # 5 | echo " " 6 | echo "The timestamp example has been run." 7 | 8 | -------------------------------------------------------------------------------- /search_mpi/search_mpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | mpirun -np 4 python search_mpi.py >& search_mpi_output.txt 4 | # 5 | echo "The search_mpi script has been executed." 6 | -------------------------------------------------------------------------------- /search_serial/search_serial.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python search_serial.py > search_serial_output.txt 4 | # 5 | echo "The search_serial script has been executed." 6 | -------------------------------------------------------------------------------- /quad_mpi/quad_mpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | mpirun -np 4 python quad_mpi.py >& quad_mpi_output.txt 4 | # 5 | echo " " 6 | echo "The quad_mpi example has been run." 7 | 8 | -------------------------------------------------------------------------------- /sphere_fibonacci_grid/sphere_fibonacci_grid_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/sphere_fibonacci_grid/sphere_fibonacci_grid_display.png -------------------------------------------------------------------------------- /hello_mpi/hello_mpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | mpirun -np 4 python hello_mpi.py >& hello_mpi_output.txt 4 | # 5 | echo " " 6 | echo "The hello_mpi example has been run." 7 | 8 | -------------------------------------------------------------------------------- /prime_mpi/prime_mpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | mpirun -np 4 python prime_mpi.py >& prime_mpi_output.txt 4 | # 5 | echo " " 6 | echo "The prime_mpi example has been run." 7 | 8 | -------------------------------------------------------------------------------- /fd1d_advection_lax_wendroff/fd1d_advection_lax_wendroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johannesgerer/jburkardt-py/HEAD/fd1d_advection_lax_wendroff/fd1d_advection_lax_wendroff.png -------------------------------------------------------------------------------- /fem2d_bvp_linear/fem2d_bvp_linear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python fem2d_bvp_linear.py > fem2d_bvp_linear_output.txt 4 | # 5 | echo "Output written to fem2d_bvp_linear_output.txt." 6 | -------------------------------------------------------------------------------- /py/hello_output.txt: -------------------------------------------------------------------------------- 1 | Fri Jan 26 09:36:50 2007 2 | 3 | HELLO: 4 | Python version 5 | This is how to say 6 | 7 | Hello, world! 8 | 9 | Fri Jan 26 09:36:50 2007 10 | -------------------------------------------------------------------------------- /py/suppress_spaces.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python suppress_spaces.py >& suppress_spaces_output.txt 4 | # 5 | echo " " 6 | echo "The suppress_spaces example has been run." 7 | 8 | -------------------------------------------------------------------------------- /truncated_normal_rule/option0_w.txt: -------------------------------------------------------------------------------- 1 | 0.01125741132772072 2 | 0.2220759220056126 3 | 0.5333333333333342 4 | 0.2220759220056126 5 | 0.01125741132772063 6 | -------------------------------------------------------------------------------- /truncated_normal_rule/option0_x.txt: -------------------------------------------------------------------------------- 1 | -4.71394002774561 2 | -1.711252359948533 3 | 0.9999999999999988 4 | 3.711252359948528 5 | 6.713940027745616 6 | -------------------------------------------------------------------------------- /truncated_normal_rule/option3_w.txt: -------------------------------------------------------------------------------- 1 | 0.05588832774521236 2 | 0.2429506281468174 3 | 0.4023220889180208 4 | 0.2429506276212647 5 | 0.05588832756868437 6 | -------------------------------------------------------------------------------- /truncated_normal_rule/option3_x.txt: -------------------------------------------------------------------------------- 1 | 56.47608399130631 2 | 76.34691984457419 3 | 100.0000000234972 4 | 123.6530801955886 5 | 143.5239160248527 6 | -------------------------------------------------------------------------------- /fem1d_bvp_quadratic/fem1d_bvp_quadratic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | python fem1d_bvp_quadratic.py > fem1d_bvp_quadratic_output.txt 4 | # 5 | echo "The fem1d_bvp_quadratic script has been executed." 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright John Burkardt unless indicated differently. 2 | 3 | All rights reserved 4 | 5 | Every subfolder is published under its own License found in the respective folder's *.html files 6 | -------------------------------------------------------------------------------- /py/main_demo_output.txt: -------------------------------------------------------------------------------- 1 | 2 | MAIN_DEMO: 3 | Quick demonstration for I4_POWER. 4 | which computes K = I ^ J for integers I and J. 5 | 6 | I J K 7 | 8 | 4 3 64 9 | -2 7 -128 10 | -------------------------------------------------------------------------------- /fem1d_classes/fem1d_classes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python fem1d_classes.py > fem1d_classes_output.txt 4 | # 5 | echo "The test program in fem1d_classes.py was been run." 6 | echo "The output is in fem1d_classes_output.txt" 7 | 8 | -------------------------------------------------------------------------------- /hello_mpi/hello_mpi_output.txt: -------------------------------------------------------------------------------- 1 | Hello, world, from process 2 ! 2 | Hello, world, from process 1 ! 3 | 4 | HELLO_MPI: 5 | There are 4 MPI processes running. 6 | Hello, world, from process 0 ! 7 | Hello, world, from process 3 ! 8 | -------------------------------------------------------------------------------- /args/args_output.txt: -------------------------------------------------------------------------------- 1 | 2 | ARGS 3 | Count and print the arguments. 4 | 5 | The number of arguments was 4. 6 | 7 | Arg[0] = the program name = 'args.py' 8 | Arg[1] = 'alpha' 9 | Arg[2] = 'fred' 10 | Arg[3] = '1.2' 11 | -------------------------------------------------------------------------------- /dolfin/reaction_diffusion_mesh.pvd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /fem1d_classes/fem1d_classes_prb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python fem1d_classes_prb.py > fem1d_classes_prb_output.txt 4 | # 5 | echo "The program in fem1d_classes_prb.py was been run." 6 | echo "The output is in fem1d_classes_prb_output.txt" 7 | 8 | -------------------------------------------------------------------------------- /dolfin/reaction_diffusion_solution.pvd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /fd1d_heat_explicit/x_test03.txt: -------------------------------------------------------------------------------- 1 | -5 2 | -4.5 3 | -4 4 | -3.5 5 | -3 6 | -2.5 7 | -2 8 | -1.5 9 | -1 10 | -0.5 11 | 0 12 | 0.5 13 | 1 14 | 1.5 15 | 2 16 | 2.5 17 | 3 18 | 3.5 19 | 4 20 | 4.5 21 | 5 22 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/x_test03.txt: -------------------------------------------------------------------------------- 1 | -5 2 | -4.5 3 | -4 4 | -3.5 5 | -3 6 | -2.5 7 | -2 8 | -1.5 9 | -1 10 | -0.5 11 | 0 12 | 0.5 13 | 1 14 | 1.5 15 | 2 16 | 2.5 17 | 3 18 | 3.5 19 | 4 20 | 4.5 21 | 5 22 | -------------------------------------------------------------------------------- /fem1d_classes/fem1d_classes_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python fem1d_classes_test.py > fem1d_classes_test_output.txt 4 | # 5 | echo "The program in fem1d_classes_test.py was been run." 6 | echo "The output is in fem1d_classes_test_output.txt" 7 | 8 | -------------------------------------------------------------------------------- /fem1d_heat_explicit/x_test03.txt: -------------------------------------------------------------------------------- 1 | -5 2 | -4.5 3 | -4 4 | -3.5 5 | -3 6 | -2.5 7 | -2 8 | -1.5 9 | -1 10 | -0.5 11 | 0 12 | 0.5 13 | 1 14 | 1.5 15 | 2 16 | 2.5 17 | 3 18 | 3.5 19 | 4 20 | 4.5 21 | 5 22 | -------------------------------------------------------------------------------- /filum/filum_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python filum_test.py > filum_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running filum_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Output written to filum_test_output.txt." 12 | -------------------------------------------------------------------------------- /bvec/bvec_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python bvec_test.py > bvec_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running bvec_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to bvec_test_output.txt." 12 | -------------------------------------------------------------------------------- /fd1d_heat_explicit/x_test01.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | -------------------------------------------------------------------------------- /fd1d_heat_explicit/x_test02.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/x_test01.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/x_test02.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | -------------------------------------------------------------------------------- /fem1d_heat_explicit/x_test01.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | -------------------------------------------------------------------------------- /fem1d_heat_explicit/x_test02.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | -------------------------------------------------------------------------------- /fem_to_xml/rectangle_nodes.txt: -------------------------------------------------------------------------------- 1 | 0 0 2 | 1 0 3 | 2 0 4 | 3 0 5 | 4 0 6 | 0 1 7 | 1 1 8 | 2 1 9 | 3 1 10 | 4 1 11 | 0 2 12 | 1 2 13 | 2 2 14 | 3 2 15 | 4 2 16 | 0 3 17 | 1 3 18 | 2 3 19 | 3 3 20 | 4 3 21 | -------------------------------------------------------------------------------- /xml_to_fem/rectangle_nodes.txt: -------------------------------------------------------------------------------- 1 | 0 0 2 | 1 0 3 | 2 0 4 | 3 0 5 | 4 0 6 | 0 1 7 | 1 1 8 | 2 1 9 | 3 1 10 | 4 1 11 | 0 2 12 | 1 2 13 | 2 2 14 | 3 2 15 | 4 2 16 | 0 3 17 | 1 3 18 | 2 3 19 | 3 3 20 | 4 3 21 | -------------------------------------------------------------------------------- /c4lib/c4lib_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python c4lib_test.py > c4lib_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running c4lib_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to c4lib_test_output.txt." 12 | -------------------------------------------------------------------------------- /c8lib/c8lib_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python c8lib_test.py > c8lib_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running c8lib_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to c8lib_test_output.txt." 12 | -------------------------------------------------------------------------------- /i4lib/i4lib_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python i4lib_test.py > i4lib_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running i4lib_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to i4lib_test_output.txt." 12 | -------------------------------------------------------------------------------- /r4lib/r4lib_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python r4lib_test.py > r4lib_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running r4lib_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to r4lib_test_output.txt." 12 | -------------------------------------------------------------------------------- /r8lib/r8lib_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python r8lib_test.py > r8lib_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running r8lib_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to r8lib_test_output.txt." 12 | -------------------------------------------------------------------------------- /sobol/sobol_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python sobol_test.py > sobol_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running sobol_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to sobol_test_output.txt." 12 | -------------------------------------------------------------------------------- /timer/timer_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python timer_test.py > timer_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running timer_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to timer_test_output.txt." 12 | -------------------------------------------------------------------------------- /wtime/wtime_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python wtime_test.py > wtime_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running wtime_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to wtime_test_output.txt." 12 | -------------------------------------------------------------------------------- /stokes_2d_exact/s2de_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python s2de_test.py > s2de_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running s2de_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to s2de_test_output.txt." 12 | -------------------------------------------------------------------------------- /table_io/table_io_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python table_io_test.py > table_io_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running table_io_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Output written to table_io_test_output.txt." 12 | -------------------------------------------------------------------------------- /cauchy_principal_value/cpv_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python cpv_test.py > cpv_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running cpv_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to cpv_test_output.txt." 12 | -------------------------------------------------------------------------------- /normal/normal_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python normal_test.py > normal_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running normal_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to normal_test_output.txt." 12 | -------------------------------------------------------------------------------- /polpak/polpak_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python polpak_test.py > polpak_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running polpak_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to polpak_test_output.txt." 12 | -------------------------------------------------------------------------------- /rnglib/rnglib_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python rnglib_test.py > rnglib_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running rnglib_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to rnglib_test_output.txt." 12 | -------------------------------------------------------------------------------- /subset/subset_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python subset_test.py > subset_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running subset_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to subset_test_output.txt." 12 | -------------------------------------------------------------------------------- /xml_to_fem/xml_to_fem_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python xml_to_fem.py > xml_to_fem_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running xml_to_fem.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Output written to xml_to_fem_test_output.txt." 12 | -------------------------------------------------------------------------------- /four_fifths/four_fifths.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python four_fifths.py > four_fifths_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running four_fifths.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to four_fifths_output.txt." 12 | -------------------------------------------------------------------------------- /legendre_product_polynomial/lpp_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python lpp_test.py > lpp_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running lpp_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to lpp_test_output.txt." 12 | -------------------------------------------------------------------------------- /machine/machine_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python machine_test.py > machine_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running machine_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to machine_test_output.txt." 12 | -------------------------------------------------------------------------------- /sort_rc/sort_rc_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python sort_rc_test.py > sort_rc_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running sort_rc_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to sort_rc_test_output.txt." 12 | -------------------------------------------------------------------------------- /uniform/uniform_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python uniform_test.py > uniform_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running uniform_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to uniform_test_output.txt." 12 | -------------------------------------------------------------------------------- /monomial/monomial_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python monomial_test.py > monomial_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running monomial_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to monomial_test_output.txt." 12 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/ns2de_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python ns2de_test.py > ns2de_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running ns2de_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to ns2de_test_output.txt." 12 | -------------------------------------------------------------------------------- /navier_stokes_3d_exact/ns3de_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python ns3de_test.py > ns3de_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running ns3de_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to ns3de_test_output.txt." 12 | -------------------------------------------------------------------------------- /quadrule/quadrule_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python quadrule_test.py > quadrule_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running quadrule_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to quadrule_test_output.txt." 12 | -------------------------------------------------------------------------------- /test_mat/test_mat_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python test_mat_test.py > test_mat_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running test_mat_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to test_mat_test_output.txt." 12 | -------------------------------------------------------------------------------- /ball_grid/ball_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python ball_grid_test.py > ball_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running ball_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to ball_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /cube_grid/cube_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python cube_grid_test.py > cube_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running cube_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to cube_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /disk_grid/disk_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python disk_grid_test.py > disk_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running disk_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to disk_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /line_grid/line_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python line_grid_test.py > line_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running line_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to line_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /args/function_args.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python function_args.py > function_args_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running function_args_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to function_args_test_output.txt." 12 | -------------------------------------------------------------------------------- /fd1d_heat_explicit/t_test02.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.4 3 | 0.8 4 | 1.2 5 | 1.6 6 | 2 7 | 2.4 8 | 2.8 9 | 3.2 10 | 3.6 11 | 4 12 | 4.4 13 | 4.8 14 | 5.2 15 | 5.6 16 | 6 17 | 6.4 18 | 6.8 19 | 7.2 20 | 7.6 21 | 8 22 | 8.4 23 | 8.8 24 | 9.2 25 | 9.6 26 | 10 27 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/t_test02.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.4 3 | 0.8 4 | 1.2 5 | 1.6 6 | 2 7 | 2.4 8 | 2.8 9 | 3.2 10 | 3.6 11 | 4 12 | 4.4 13 | 4.8 14 | 5.2 15 | 5.6 16 | 6 17 | 6.4 18 | 6.8 19 | 7.2 20 | 7.6 21 | 8 22 | 8.4 23 | 8.8 24 | 9.2 25 | 9.6 26 | 10 27 | -------------------------------------------------------------------------------- /polynomial/polynomial_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python polynomial_test.py > polynomial_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running polynomial_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to polynomial_test_output.txt." 12 | -------------------------------------------------------------------------------- /wedge_grid/wedge_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python wedge_grid_test.py > wedge_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running wedge_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to wedge_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /latin_random/latin_random_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python latin_random.py > latin_random_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running latin_random.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to latin_random_test_output.txt." 12 | -------------------------------------------------------------------------------- /bellman_ford/bellman_ford_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python bellman_ford.py > bellman_ford_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running bellman_ford_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to bellman_ford_test_output.txt." 12 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python cycle_brent_test.py > cycle_brent_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running cycle_brent_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to cycle_brent_test_output.txt." 12 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python cycle_floyd_test.py > cycle_floyd_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running cycle_floyd_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to cycle_floyd_test_output.txt." 12 | -------------------------------------------------------------------------------- /hypercube_grid/hypercube_grid_points_test01.xyz: -------------------------------------------------------------------------------- 1 | 0 0 2 | 0.2 0 3 | 0.4 0 4 | 0.6 0 5 | 0 2 6 | 0.2 2 7 | 0.4 2 8 | 0.6 2 9 | 0 4 10 | 0.2 4 11 | 0.4 4 12 | 0.6 4 13 | 0 6 14 | 0.2 6 15 | 0.4 6 16 | 0.6 6 17 | 0 8 18 | 0.2 8 19 | 0.4 8 20 | 0.6 8 21 | -------------------------------------------------------------------------------- /square_grid/square_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python square_grid_test.py > square_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running square_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to square_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /test_values/test_values_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python test_values_test.py > test_values_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running test_values_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to test_values_test_output.txt." 12 | -------------------------------------------------------------------------------- /ellipse_grid/ellipse_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python ellipse_grid_test.py > ellipse_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running ellipse_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to ellipse_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /polygon_grid/polygon_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python polygon_grid_test.py > polygon_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running polygon_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to polygon_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /pyramid_grid/pyramid_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python pyramid_grid_test.py > pyramid_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running pyramid_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to pyramid_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /simplex_grid/simplex_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python simplex_grid_test.py > simplex_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running simplex_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to simplex_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /triangle_grid/triangle_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python triangle_grid_test.py > triangle_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running triangle_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to triangle_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /truncated_normal_rule/option1_w.txt: -------------------------------------------------------------------------------- 1 | 0.0004235988689526075 2 | 0.009773910300475749 3 | 0.08732148539077622 4 | 0.2921666929577973 5 | 0.381302777260617 6 | 0.1927241121920703 7 | 0.03454145376670881 8 | 0.001733345166455803 9 | 1.262409614503847e-05 10 | -------------------------------------------------------------------------------- /truncated_normal_rule/option1_x.txt: -------------------------------------------------------------------------------- 1 | 0.1816989235806438 2 | 0.6421671962828626 3 | 1.133817146328411 4 | 1.622377631581047 5 | 2.109985498103796 6 | 2.60479816623199 7 | 3.118876922773832 8 | 3.672880028794423 9 | 4.317470487988128 10 | -------------------------------------------------------------------------------- /truncated_normal_rule/option2_w.txt: -------------------------------------------------------------------------------- 1 | 2.21112928677383e-06 2 | 0.0003874551230793616 3 | 0.01015840781997616 4 | 0.07915686806315414 5 | 0.2406863292190073 6 | 0.330416577556463 7 | 0.2279692888348635 8 | 0.08933370050859707 9 | 0.02188916174557654 10 | -------------------------------------------------------------------------------- /truncated_normal_rule/option2_x.txt: -------------------------------------------------------------------------------- 1 | -0.4968475553184391 2 | 0.1201404390825635 3 | 0.6428546810934649 4 | 1.118492169419487 5 | 1.563284650573697 6 | 1.981981447186634 7 | 2.369540475470301 8 | 2.704918779370029 9 | 2.937539136672948 10 | -------------------------------------------------------------------------------- /ellipsoid_grid/ellipsoid_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python ellipsoid_grid_test.py > ellipsoid_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running ellipsoid_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to ellipsoid_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /hypercube_grid/hypercube_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python hypercube_grid_test.py > hypercube_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running hypercube_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to hypercube_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /monomial_value/monomial_value_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python monomial_value_test.py > monomial_value_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running monomial_value_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to monomial_value_test_output.txt." 12 | -------------------------------------------------------------------------------- /py/hello.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import time 4 | 5 | t = time.time() 6 | print time.ctime(t) 7 | 8 | print " " 9 | print "HELLO:" 10 | print " Python version" 11 | print " This is how to say" 12 | print " " 13 | print " Hello, world!" 14 | print " " 15 | 16 | t = time.time() 17 | print time.ctime(t) 18 | -------------------------------------------------------------------------------- /circle_arc_grid/circle_arc_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python circle_arc_grid_test.py > circle_arc_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running circle_arc_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to circle_arc_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /sphere_llq_grid/sphere_llq_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python sphere_llq_grid_test.py > sphere_llq_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running sphere_llq_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to sphere_llq_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /sphere_llt_grid/sphere_llt_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python sphere_llt_grid_test.py > sphere_llt_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running sphere_llt_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to sphere_llt_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /fem1d_bvp_linear/fem1d_bvp_linear_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python fem1d_bvp_linear_test.py > fem1d_bvp_linear_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running fem1d_bvp_linear_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to fem1d_bvp_linear_test_output.txt." 12 | -------------------------------------------------------------------------------- /tetrahedron_grid/tetrahedron_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python tetrahedron_grid_test.py > tetrahedron_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running tetrahedron_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to tetrahedron_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /truncated_normal/truncated_normal_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python truncated_normal_test.py > truncated_normal_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running truncated_normal_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to truncated_normal_test_output.txt." 12 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/fd1d_heat_implicit_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python fd1d_heat_implicit_test.py > fd1d_heat_implicit_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running fd1d_heat_implicit_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to fd1d_heat_implicit_test_output.txt." 12 | -------------------------------------------------------------------------------- /triangle_integrals/triangle_integrals_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python triangle_integrals_test.py > triangle_integrals_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running triangle_integrals_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to triangle_integrals_test_output.txt." 12 | -------------------------------------------------------------------------------- /fem1d_heat_explicit/fem1d_heat_explicit_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python fem1d_heat_explicit_test.py > fem1d_heat_explicit_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running fem1d_heat_explicit_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to fem1d_heat_explicit_test_output.txt." 12 | -------------------------------------------------------------------------------- /triangle01_integrals/triangle01_integrals_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python triangle01_integrals_test.py > triangle01_integrals_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running triangle01_integrals_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to triangle01_integrals_test_output.txt." 12 | -------------------------------------------------------------------------------- /fd1d_advection_lax_wendroff/fd1d_advection_lax_wendroff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python fd1d_advection_lax_wendroff.py > fd1d_advection_lax_wendroff_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running fd1d_advection_lax_wendroff.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Output written to fd1d_advection_lax_wendroff_output.txt." 12 | -------------------------------------------------------------------------------- /sphere_fibonacci_grid/sphere_fibonacci_grid_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python sphere_fibonacci_grid_test.py > sphere_fibonacci_grid_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running sphere_fibonacci_grid_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to sphere_fibonacci_grid_test_output.txt." 12 | -------------------------------------------------------------------------------- /truncated_normal_rule/truncated_normal_rule_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | python truncated_normal_rule_test.py > truncated_normal_rule_test_output.txt 4 | if [ $? -ne 0 ]; then 5 | echo "Errors running truncated_normal_rule_test.py" 6 | exit 7 | fi 8 | # 9 | rm *.pyc 10 | # 11 | echo "Test program output written to truncated_normal_rule_test_output.txt." 12 | -------------------------------------------------------------------------------- /hello_mpi/hello_mpi.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from mpi4py import MPI 5 | 6 | comm = MPI.COMM_WORLD 7 | 8 | id = comm.Get_rank() 9 | 10 | p = comm.Get_size() 11 | 12 | if id == 0: 13 | print "" 14 | print "HELLO_MPI:" 15 | print " There are ", p, " MPI processes running." 16 | 17 | print "Hello, world, from process ", id, "!" 18 | 19 | -------------------------------------------------------------------------------- /four_fifths/four_fifths_output.txt: -------------------------------------------------------------------------------- 1 | Sat Dec 20 21:59:42 2014 2 | 3 | FOUR_FIFTHS_TEST 4 | FOUR_FIFTHS seeks a solution of the four fifths problem: 5 | find integers a, b, c, d and e such that 6 | a^5 + b^5 + c^5 + d^5 = e^5. 7 | 8 | Result: 9 | 27^5 + 84^5 + 110^5 + 133^5 = 144^5 10 | 11 | FOUR_FIFTHS_TEST: 12 | Normal end of execution. 13 | Sat Dec 20 22:00:27 2014 14 | -------------------------------------------------------------------------------- /rkf45/f_lor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ Lorentz oscillator function """ 4 | 5 | from numpy import * 6 | 7 | def f_lor ( t, y ): 8 | """ 9 | Right hand side for the Lorenz system 10 | """ 11 | a=10. 12 | r=70. 13 | r=28 14 | b=8./3. 15 | 16 | f=zeros(3) 17 | f[0]=-a*y[0]+a*y[1] 18 | f[1]=r*y[0]-y[1]-y[0]*y[2] 19 | f[2]=-b*y[2]+y[0]*y[1] 20 | return(f) 21 | -------------------------------------------------------------------------------- /fem_to_xml/rectangle_elements.txt: -------------------------------------------------------------------------------- 1 | 5 0 1 2 | 6 5 1 3 | 6 10 5 4 | 11 10 6 5 | 15 10 11 6 | 15 11 16 7 | 6 1 2 8 | 7 6 2 9 | 7 11 6 10 | 12 11 7 11 | 16 11 12 12 | 16 12 17 13 | 7 2 3 14 | 8 7 3 15 | 8 12 7 16 | 13 12 8 17 | 17 12 13 18 | 17 13 18 19 | 8 3 4 20 | 9 8 4 21 | 9 13 8 22 | 14 13 9 23 | 18 13 14 24 | 18 14 19 25 | -------------------------------------------------------------------------------- /xml_to_fem/rectangle_elements.txt: -------------------------------------------------------------------------------- 1 | 5 0 1 2 | 6 5 1 3 | 6 10 5 4 | 11 10 6 5 | 15 10 11 6 | 15 11 16 7 | 6 1 2 8 | 7 6 2 9 | 7 11 6 10 | 12 11 7 11 | 16 11 12 12 | 16 12 17 13 | 7 2 3 14 | 8 7 3 15 | 8 12 7 16 | 13 12 8 17 | 17 12 13 18 | 17 13 18 19 | 8 3 4 20 | 9 8 4 21 | 9 13 8 22 | 14 13 9 23 | 18 13 14 24 | 18 14 19 25 | -------------------------------------------------------------------------------- /fem2d_bvp_linear/square_elements.txt: -------------------------------------------------------------------------------- 1 | 0 1 6 5 2 | 1 2 7 6 3 | 2 3 8 7 4 | 3 4 9 8 5 | 5 6 11 10 6 | 6 7 12 11 7 | 7 8 13 12 8 | 8 9 14 13 9 | 10 11 16 15 10 | 11 12 17 16 11 | 12 13 18 17 12 | 13 14 19 18 13 | 15 16 21 20 14 | 16 17 22 21 15 | 17 18 23 22 16 | 18 19 24 23 17 | -------------------------------------------------------------------------------- /circle_arc_grid/circle_arc_grid_points.xy: -------------------------------------------------------------------------------- 1 | 7 5 2 | 6.99317 5.16516 3 | 6.97272 5.32919 4 | 6.9388 5.49097 5 | 6.89163 5.6494 6 | 6.83155 5.80339 7 | 6.75895 5.95189 8 | 6.67433 6.0939 9 | 6.57828 6.22843 10 | 6.47145 6.35456 11 | 6.35456 6.47145 12 | 6.22843 6.57828 13 | 6.0939 6.67433 14 | 5.95189 6.75895 15 | 5.80339 6.83155 16 | 5.6494 6.89163 17 | 5.49097 6.9388 18 | 5.32919 6.97272 19 | 5.16516 6.99317 20 | 5 7 21 | -------------------------------------------------------------------------------- /hypercube_grid/hypercube_grid_points_test03.xyz: -------------------------------------------------------------------------------- 1 | -2 -2 -2 2 | -1 -2 -2 3 | 0 -2 -2 4 | -2 -1 -2 5 | -1 -1 -2 6 | 0 -1 -2 7 | -2 0 -2 8 | -1 0 -2 9 | 0 0 -2 10 | -2 -2 -1 11 | -1 -2 -1 12 | 0 -2 -1 13 | -2 -1 -1 14 | -1 -1 -1 15 | 0 -1 -1 16 | -2 0 -1 17 | -1 0 -1 18 | 0 0 -1 19 | -2 -2 0 20 | -1 -2 0 21 | 0 -2 0 22 | -2 -1 0 23 | -1 -1 0 24 | 0 -1 0 25 | -2 0 0 26 | -1 0 0 27 | 0 0 0 28 | -------------------------------------------------------------------------------- /args/args.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | 5 | print " " 6 | print "ARGS" 7 | print " Python version" 8 | print " Count and print the arguments." 9 | print " " 10 | print " The number of arguments was " + repr ( len ( sys.argv ) ) + "." 11 | print " " 12 | print " Arg[0] = the program name = '" + sys.argv[0] + "'" 13 | 14 | i = 1; 15 | 16 | while 1 < len ( sys.argv ): 17 | print " Arg[" + repr ( i ) + "] = '" + sys.argv[1] + "'" 18 | del sys.argv[1]; 19 | i = i + 1; 20 | 21 | -------------------------------------------------------------------------------- /spiral_data/spiral_commands.txt: -------------------------------------------------------------------------------- 1 | # spiral_commands.txt 2 | # 3 | set term png 4 | set output "spiral.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Spiral velocity flow" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "spiral_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /quad_serial/quad_serial_output.txt: -------------------------------------------------------------------------------- 1 | Fri Oct 26 22:31:39 2012 2 | 3 | QUAD_SERIAL: 4 | PYTHON version 5 | Estimate the integral of f(x) from A to B. 6 | f(x) = 50 / ( pi * ( 2500 * x * x + 1 ) ). 7 | 8 | A = 0.0 9 | B = 10.0 10 | N = 10000000 11 | Exact = 0.499363381076 12 | 13 | Estimate = 0.499371288919 14 | Error = 7.90784266969e-06 15 | Time = 9.00772213936 16 | 17 | QUAD_SERIAL: 18 | Normal end of execution. 19 | 20 | Fri Oct 26 22:31:48 2012 21 | -------------------------------------------------------------------------------- /stokes_2d_exact/stokes1_commands.txt: -------------------------------------------------------------------------------- 1 | # stokes1_commands.txt 2 | # 3 | set term png 4 | set output "stokes1.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Stokes velocity field" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "stokes1_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /stokes_2d_exact/stokes2_commands.txt: -------------------------------------------------------------------------------- 1 | # stokes2_commands.txt 2 | # 3 | set term png 4 | set output "stokes2.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Stokes velocity field" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "stokes2_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /stokes_2d_exact/stokes3_commands.txt: -------------------------------------------------------------------------------- 1 | # stokes3_commands.txt 2 | # 3 | set term png 4 | set output "stokes3.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Stokes velocity field" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "stokes3_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/lucas_commands.txt: -------------------------------------------------------------------------------- 1 | # lucas_commands.txt 2 | # 3 | set term png 4 | set output "lucas.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Navier-Stokes velocity field" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "lucas_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/spiral_commands.txt: -------------------------------------------------------------------------------- 1 | # spiral_commands.txt 2 | # 3 | set term png 4 | set output "spiral.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Navier-Stokes velocity field" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "spiral_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /navier_stokes_2d_exact/taylor_commands.txt: -------------------------------------------------------------------------------- 1 | # taylor_commands.txt 2 | # 3 | set term png 4 | set output "taylor.png" 5 | # 6 | # Add titles and labels. 7 | # 8 | set xlabel "<--- X --->" 9 | set ylabel "<--- Y --->" 10 | set title "Navier-Stokes velocity field" 11 | unset key 12 | # 13 | # Add grid lines. 14 | # 15 | set grid 16 | set size ratio -1 17 | # 18 | # Timestamp the plot. 19 | # 20 | set timestamp 21 | plot "taylor_data.txt" using 1:2:3:4 with vectors \ 22 | head filled lt 2 linecolor rgb "blue" 23 | quit 24 | -------------------------------------------------------------------------------- /filum/filum_test_output.txt: -------------------------------------------------------------------------------- 1 | Mon Oct 13 09:09:57 2014 2 | 3 | FILUM_TEST 4 | PYTHON version: 5 | Test the FILUM library. 6 | 7 | FILE_COLUMN_COUNT_TEST: 8 | Python version 9 | Count the number of columns in a typical text file line. 10 | 11 | Number of columns in "filum_prb_4by5.txt" is 5 12 | 13 | FILE_ROW_COUNT_TEST: 14 | Python version 15 | Count the number of rows in a text file. 16 | 17 | Number of rows in "filum_prb_4by5.txt" is 4 18 | 19 | FILUM_TEST: 20 | Normal end of execution. 21 | 22 | Mon Oct 13 09:09:57 2014 23 | -------------------------------------------------------------------------------- /r8lib/r8_tiny.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_tiny ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_TINY returns the smallest positive R8. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 04 June 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, real VALUE, a "tiny" value. 24 | # 25 | value = 1.0E-30 26 | 27 | return value 28 | 29 | -------------------------------------------------------------------------------- /fem1d_heat_explicit/t_test02.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.2 3 | 0.4 4 | 0.6 5 | 0.8 6 | 1 7 | 1.2 8 | 1.4 9 | 1.6 10 | 1.8 11 | 2 12 | 2.2 13 | 2.4 14 | 2.6 15 | 2.8 16 | 3 17 | 3.2 18 | 3.4 19 | 3.6 20 | 3.8 21 | 4 22 | 4.2 23 | 4.4 24 | 4.6 25 | 4.8 26 | 5 27 | 5.2 28 | 5.4 29 | 5.6 30 | 5.8 31 | 6 32 | 6.2 33 | 6.4 34 | 6.6 35 | 6.8 36 | 7 37 | 7.2 38 | 7.4 39 | 7.6 40 | 7.8 41 | 8 42 | 8.2 43 | 8.4 44 | 8.6 45 | 8.8 46 | 9 47 | 9.2 48 | 9.4 49 | 9.6 50 | 9.8 51 | 10 52 | -------------------------------------------------------------------------------- /r8lib/r8_print.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_print ( r, title ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_PRINT prints an R8. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 August 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real R, the value to be printed. 24 | # 25 | # Input, string TITLE, a title. 26 | # 27 | print '%s %g' % ( title, r ) 28 | 29 | -------------------------------------------------------------------------------- /fem1d_classes/fem1d_classes_prb_output.txt: -------------------------------------------------------------------------------- 1 | eltno= 0 2 | n= [0 1] 3 | eltno= 1 4 | n= [1 2] 5 | eltno= 2 6 | n= [2 3] 7 | eltno= 3 8 | n= [3 4] 9 | eltno= 4 10 | n= [4 5] 11 | Case 1 relative error= 1.28691867829e-15 12 | eltno= 0 13 | n= [0 1] 14 | eltno= 1 15 | n= [1 2] 16 | eltno= 2 17 | n= [2 3] 18 | eltno= 3 19 | n= [3 4] 20 | eltno= 4 21 | n= [4 5] 22 | Case 2 relative error= 1.02401444888e-15 23 | eltno= 0 24 | n= [0 1] 25 | eltno= 1 26 | n= [1 2] 27 | eltno= 2 28 | n= [2 3] 29 | eltno= 3 30 | n= [3 4] 31 | eltno= 4 32 | n= [4 5] 33 | Case 3 relative error= 8.87810358362e-16 34 | -------------------------------------------------------------------------------- /r8lib/r8_pi_sqrt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_pi_sqrt ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_PI_SQRT returns the square root of pi as an R8. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 05 June 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, real VALUE, the square root of pi. 24 | # 25 | value = 1.7724538509055160273 26 | 27 | return value 28 | 29 | -------------------------------------------------------------------------------- /fem2d_bvp_linear/square_nodes.txt: -------------------------------------------------------------------------------- 1 | 0.000000 0.000000 2 | 0.250000 0.000000 3 | 0.500000 0.000000 4 | 0.750000 0.000000 5 | 1.000000 0.000000 6 | 0.000000 0.250000 7 | 0.250000 0.250000 8 | 0.500000 0.250000 9 | 0.750000 0.250000 10 | 1.000000 0.250000 11 | 0.000000 0.500000 12 | 0.250000 0.500000 13 | 0.500000 0.500000 14 | 0.750000 0.500000 15 | 1.000000 0.500000 16 | 0.000000 0.750000 17 | 0.250000 0.750000 18 | 0.500000 0.750000 19 | 0.750000 0.750000 20 | 1.000000 0.750000 21 | 0.000000 1.000000 22 | 0.250000 1.000000 23 | 0.500000 1.000000 24 | 0.750000 1.000000 25 | 1.000000 1.000000 26 | -------------------------------------------------------------------------------- /kronrod/f.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F is a function whose integral from -1 to +1 is to be estimated. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 30 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, double X, the argument. 24 | # 25 | # Output, double F, the value. 26 | # 27 | value = 1.0 / ( x * x + 1.005 ) 28 | 29 | return value 30 | 31 | 32 | -------------------------------------------------------------------------------- /r8lib/r8_in_01.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_in_01 ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_IN_01 is TRUE if the value is in the range [0,1]. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 01 June 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real X, the value. 24 | # 25 | # Output, boolean VALUE, is TRUE if 0 <= X <= 1. 26 | # 27 | value = ( 0.0 <= x and x <= 1.0 ) 28 | 29 | return value 30 | 31 | -------------------------------------------------------------------------------- /rnglib/cgn_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cgn_get ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CGN_GET gets the current generator index. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, integer G, the current generator index. 24 | # 25 | from cgn_memory import cgn_memory 26 | 27 | i = -1 28 | g = [] 29 | g = cgn_memory ( i, g ) 30 | 31 | return g 32 | 33 | -------------------------------------------------------------------------------- /rnglib/cgn_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cgn_set ( g ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CGN_SET sets the current generator index. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the current generator index. 24 | # 1 <= G <= 32. 25 | # 26 | from cgn_memory import cgn_memory 27 | 28 | i = +1 29 | g = cgn_memory ( i, g ) 30 | 31 | return 32 | 33 | -------------------------------------------------------------------------------- /cycle_brent/f4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f4 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F4 is the iteration function for example 4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the argument of the function. 24 | # 25 | # Output, integer VALUE, the value of the function. 26 | # 27 | value = ( ( 31421 * i + 6927 ) % 65536 ); 28 | 29 | return value 30 | 31 | -------------------------------------------------------------------------------- /cycle_brent/f5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f5 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F5 is the iteration function for example 5. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the argument of the function. 24 | # 25 | # Output, integer VALUE, the value of the function. 26 | # 27 | value = ( ( 16383 * i + 1 ) % 65536 ) 28 | 29 | return value 30 | 31 | -------------------------------------------------------------------------------- /cycle_floyd/f4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f4 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F4 is the iteration function for example 4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the argument of the function. 24 | # 25 | # Output, integer VALUE, the value of the function. 26 | # 27 | value = ( ( 31421 * i + 6927 ) % 65536 ); 28 | 29 | return value 30 | 31 | -------------------------------------------------------------------------------- /cycle_floyd/f5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f5 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F5 is the iteration function for example 5. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the argument of the function. 24 | # 25 | # Output, integer VALUE, the value of the function. 26 | # 27 | value = ( ( 16383 * i + 1 ) % 65536 ) 28 | 29 | return value 30 | 31 | -------------------------------------------------------------------------------- /rnglib/initialized_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def initialized_set ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## INITIALIZED_SET sets the INITIALIZED value to true. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None. 24 | # 25 | from initialized_memory import initialized_memory 26 | 27 | i = +1 28 | initialized = True 29 | initialized = initialized_memory ( i, initialized ) 30 | 31 | -------------------------------------------------------------------------------- /r8lib/r8_is_int.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_is_int ( r ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_IS_INT determines if an R8 represents an integer value. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real R, the number to be checked. 24 | # 25 | # Output, logical VALUE, is TRUE if R is an integer value. 26 | # 27 | value = ( r == int ( r ) ) 28 | 29 | return value 30 | 31 | -------------------------------------------------------------------------------- /py/suppress_spaces_output.txt: -------------------------------------------------------------------------------- 1 | Thu May 28 08:04:54 2015 2 | 3 | SUPPRESS_SPACES 4 | Demonstrate Python's output spacing convention, 5 | and how to suppress it. 6 | 7 | Suppose we want to print a string of binary digits, 8 | each stored in a separate entry of a vector. 9 | A print statement inside a loop might do it. 10 | 11 | 1 1 0 1 0 0 1 1 1 12 | 13 | But suppose we want the digits right next to each other? 14 | We are annoyed now, that Python's print command, 15 | trying to be helpful, automatically inserts spaces. 16 | Try sys.stdout.write(str(VARIABLE)) instead. 17 | 18 | 110100111 19 | 20 | SUPPRESS_SPACES 21 | Normal end of execution. 22 | Thu May 28 08:04:54 2015 23 | -------------------------------------------------------------------------------- /r8lib/r8_sqrt_i4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sqrt_i4 ( i ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SQRT_I4 returns the square root of an I4 as an R8. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the number whose square root is desired. 24 | # 25 | # Output, real R8_SQRT_I4, the value of sqrt(I). 26 | # 27 | from math import sqrt 28 | 29 | value = sqrt ( float ( i ) ) 30 | 31 | return value 32 | 33 | -------------------------------------------------------------------------------- /r8lib/r8_degrees.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_degrees ( radians ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_DEGREES converts an angle from radian to degree measure. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real RADIANS, the angle measurement in radians. 24 | # 25 | # Output, real VALUE, the angle measurement in degrees. 26 | # 27 | pi = 3.141592653589793 28 | value = radians * 180.0 / pi 29 | 30 | return value 31 | 32 | -------------------------------------------------------------------------------- /r8lib/r8_radians.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_radians ( degrees ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_RADIANS converts an angle from degree to radian measure. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real DEGREES, the angle measurement in degrees. 24 | # 25 | # Output, real VALUE, the angle measurement in radians. 26 | # 27 | pi = 3.141592653589793 28 | value = degrees * pi / 180.0 29 | 30 | return value 31 | 32 | -------------------------------------------------------------------------------- /rnglib/antithetic_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def antithetic_set ( value ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## ANTITHETIC_SET sets the antithetic value for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, bool VALUE, is TRUE if the current generator is to be antithetic. 24 | # 25 | from antithetic_memory import antithetic_memory 26 | 27 | i = +1 28 | value = antithetic_memory ( i, value ) 29 | 30 | return 31 | 32 | -------------------------------------------------------------------------------- /rnglib/antithetic_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def antithetic_get ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## ANTITHETIC_GET queries the antithetic value for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, bool VALUE, is TRUE if generator G is antithetic. 24 | # 25 | from antithetic_memory import antithetic_memory 26 | 27 | i = -1 28 | value = [] 29 | value = antithetic_memory ( i, value ) 30 | 31 | return value 32 | 33 | -------------------------------------------------------------------------------- /r8lib/r8_sign_char.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sign_char ( r8 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SIGN_CHAR returns the sign of an R8 as a character. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real R8, the value whose sign is of interest. 24 | # 25 | # Output, character C, is '-', '0', or '+'. 26 | 27 | if ( r8 < 0.0 ): 28 | c = '-' 29 | elif ( r8 == 0.0 ): 30 | c = '0' 31 | else: 32 | c = '+' 33 | 34 | return c 35 | -------------------------------------------------------------------------------- /cycle_brent/f3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f3 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F3 is the iteration function for example 3. 8 | # 9 | # Discussion: 10 | # 11 | # This function has a cycle of length 50000 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 13 May 2013 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | # Parameters: 26 | # 27 | # Input, integer I, the argument of the function. 28 | # 29 | # Output, integer VALUE, the value of the function. 30 | # 31 | value = ( ( 123 * i + 456 ) % 1000000 ) 32 | 33 | return value 34 | 35 | -------------------------------------------------------------------------------- /cycle_floyd/f3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f3 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F3 is the iteration function for example 3. 8 | # 9 | # Discussion: 10 | # 11 | # This function has a cycle of length 50000 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 13 May 2013 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | # Parameters: 26 | # 27 | # Input, integer I, the argument of the function. 28 | # 29 | # Output, integer VALUE, the value of the function. 30 | # 31 | value = ( ( 123 * i + 456 ) % 1000000 ) 32 | 33 | return value 34 | 35 | -------------------------------------------------------------------------------- /rnglib/lg_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def lg_set ( g, lg1, lg2 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## LG_SET sets the LG values for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the index of the generator. 24 | # 1 <= G <= 32. 25 | # 26 | # Input, integer LG1, LG2, the LG values for generator G. 27 | # 28 | from lg_memory import lg_memory 29 | 30 | i = +1 31 | lg_memory ( i, g, lg1, lg2 ) 32 | 33 | return 34 | 35 | -------------------------------------------------------------------------------- /r8lib/r8_divide_i4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_divide_i4 ( i, j ): 4 | 5 | %*****************************************************************************80 6 | % 7 | %% R8_DIVIDE_I4 returns an I4 fraction as an R8. 8 | % 9 | % Discussion: 10 | % 11 | % In MATLAB, this function doesn't really serve any purpose. 12 | % 13 | % Licensing: 14 | % 15 | % This code is distributed under the GNU LGPL license. 16 | % 17 | % Modified: 18 | % 19 | % 24 July 2014 20 | % 21 | % Author: 22 | % 23 | % John Burkardt 24 | % 25 | % Parameters: 26 | % 27 | % Input, integer I, J, the numerator and denominator. 28 | % 29 | % Output, real VALUE, the value of (I/J). 30 | % 31 | value = i / j 32 | 33 | return value 34 | 35 | -------------------------------------------------------------------------------- /rnglib/ig_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def ig_set ( g, ig1, ig2 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## IG_SET sets the IG values for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the index of the generator. 24 | # 1 <= G <= 32. 25 | # 26 | # Input, integer IG1, IG2, the IG values for generator G. 27 | # 28 | from ig_memory import ig_memory 29 | 30 | i = +1 31 | [ ig1, ig2 ] = ig_memory ( i, g, ig1, ig2 ) 32 | 33 | return 34 | -------------------------------------------------------------------------------- /rnglib/initialized_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def initialized_get ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## INITIALIZED_GET gets the INITIALIZED value. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, bool INITIALIZED, is true if the package has been initialized. 24 | # 25 | from initialized_memory import initialized_memory 26 | 27 | i = -1 28 | initialized = [] 29 | initialized = initialized_memory ( i, initialized ) 30 | 31 | return initialized 32 | 33 | -------------------------------------------------------------------------------- /rnglib/cg_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cg_set ( g, cg1, cg2 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CG_SET sets the CG values for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the index of the generator. 24 | # 1 <= G <= 32. 25 | # 26 | # Input, integer CG1, CG2, the CG values for generator G. 27 | # 28 | from cg_memory import cg_memory 29 | 30 | i = +1 31 | [ cg1, cg2 ] = cg_memory ( i, g, cg1, cg2 ) 32 | 33 | return 34 | 35 | -------------------------------------------------------------------------------- /wathen/r8vec_print.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8vec_print ( n, a, title ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8VEC_PRINT prints an R8VEC. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 August 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer N, the dimension of the vector. 24 | # 25 | # Input, real A(N), the vector to be printed. 26 | # 27 | # Input, string TITLE, a title. 28 | # 29 | print '' 30 | print title 31 | print '' 32 | for i in range ( 0, n ): 33 | print '%6d %12g' % ( i, a[i] ) 34 | 35 | -------------------------------------------------------------------------------- /quad_mpi/quad_mpi_output.txt: -------------------------------------------------------------------------------- 1 | Sun Oct 28 10:32:25 2012 2 | 3 | QUAD_MPI 4 | Python/MPI version 5 | Estimate an integral of f(x) from A to B. 6 | f(x) = 50 / (pi * ( 2500 * x * x + 1 ) ) 7 | 8 | A = 0.0 9 | B = 10.0 10 | N = 10000 11 | Exact = 0.499363381076 12 | 13 | Use MPI to divide the computation among 14 | multiple processes. 15 | Sum for process 1 is 128.81731236 16 | Sum for process 3 is 120.839441838 17 | Sum for process 0 is 132.786092424 18 | 19 | Estimate = 0.507271223723 20 | Error = 0.00790784264629 21 | Time = 0.135361909866 22 | 23 | QUAD_SERIAL: 24 | Normal end of execution. 25 | 26 | Sun Oct 28 10:32:25 2012 27 | Sum for process 2 is 124.828377101 28 | -------------------------------------------------------------------------------- /r8lib/r8_aint.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def r8_aint ( x ): 4 | 5 | #****************************************************************************80 6 | # 7 | ## R8_AINT truncates an R8 argument to an integer. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 24 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt. 20 | # 21 | # Parameters: 22 | # 23 | # Input, real X, the argument. 24 | # 25 | # Output, real VALUE, the truncated version of X. 26 | # 27 | from math import abs 28 | from math import floor 29 | 30 | if ( x < 0.0 ): 31 | value = - floor ( abs ( x ) ) 32 | else: 33 | value = floor ( abs ( x ) ) 34 | 35 | return value 36 | 37 | -------------------------------------------------------------------------------- /cycle_brent/f2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f2 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F2 is the iteration function for example 2. 8 | # 9 | # Discussion: 10 | # 11 | # This function has a cycle 12 | # 13 | # 3, 67, 35, 51, 43, 11, 27, 19, 59, of length 9 14 | # 15 | # Licensing: 16 | # 17 | # This code is distributed under the GNU LGPL license. 18 | # 19 | # Modified: 20 | # 21 | # 13 May 2013 22 | # 23 | # Author: 24 | # 25 | # John Burkardt 26 | # 27 | # Parameters: 28 | # 29 | # Input, integer I, the argument of the function. 30 | # 31 | # Output, integer VALUE, the value of the function. 32 | # 33 | value = ( ( 22 * i + 1 ) % 72 ) 34 | 35 | return value 36 | 37 | -------------------------------------------------------------------------------- /cycle_floyd/f2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f2 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F2 is the iteration function for example 2. 8 | # 9 | # Discussion: 10 | # 11 | # This function has a cycle 12 | # 13 | # 3, 67, 35, 51, 43, 11, 27, 19, 59, of length 9 14 | # 15 | # Licensing: 16 | # 17 | # This code is distributed under the GNU LGPL license. 18 | # 19 | # Modified: 20 | # 21 | # 13 May 2013 22 | # 23 | # Author: 24 | # 25 | # John Burkardt 26 | # 27 | # Parameters: 28 | # 29 | # Input, integer I, the argument of the function. 30 | # 31 | # Output, integer VALUE, the value of the function. 32 | # 33 | value = ( ( 22 * i + 1 ) % 72 ) 34 | 35 | return value 36 | 37 | -------------------------------------------------------------------------------- /fd1d_advection_lax_wendroff/fd1d_advection_lax_wendroff_output.txt: -------------------------------------------------------------------------------- 1 | Wed Jan 7 22:52:02 2015 2 | 3 | FD1D_ADVECTION_LAX_WENDROFF: 4 | Python version 5 | 6 | Solve the constant-velocity advection equation in 1D, 7 | du/dt = - c du/dx 8 | over the interval: 9 | 0.0 <= x <= 1.0 10 | with periodic boundary conditions, and 11 | with a given initial condition 12 | u(0,x) = (10x-4)^2 (6-10x)^2 for 0.4 <= x <= 0.6 13 | = 0 elsewhere. 14 | 15 | We use the Lax-Wendroff method. 16 | 17 | Number of nodes NX = 101 18 | Number of time steps NT = 1000 19 | Constant velocity C = 1 20 | CFL condition: dt = (0.001) <= (0.01) = dx / c 21 | 22 | FD1D_ADVECTION_LAX_WENDROFF_TEST 23 | Normal end of execution. 24 | 25 | Wed Jan 7 22:52:47 2015 26 | -------------------------------------------------------------------------------- /rnglib/cg_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cg_get ( g ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CG_GET queries the CG values for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the index of the generator. 24 | # 1 <= G <= 32. 25 | # 26 | # Output, integer CG1, CG2, the CG values for generator G. 27 | # 28 | from cg_memory import cg_memory 29 | 30 | i = -1 31 | cg1 = [] 32 | cg2 = [] 33 | [ cg1, cg2 ] = cg_memory ( i, g, cg1, cg2 ) 34 | 35 | return cg1, cg2 36 | 37 | -------------------------------------------------------------------------------- /rnglib/ig_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def ig_get ( g ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## IG_GET queries the IG values for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the index of the generator. 24 | # 1 <= G <= 32. 25 | # 26 | # Output, integer IG1, IG2, the IG values for generator G. 27 | # 28 | from ig_memory import ig_memory 29 | 30 | i = -1 31 | ig1 = [] 32 | ig2 = [] 33 | [ ig1, ig2 ] = ig_memory ( i, g, ig1, ig2 ) 34 | 35 | return ig1, ig2 36 | 37 | -------------------------------------------------------------------------------- /rnglib/lg_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def lg_get ( g ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## LG_GET queries the LG values for a given generator. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer G, the index of the generator. 24 | # 1 <= G <= 32. 25 | # 26 | # Output, integer LG1, LG2, the LG values for generator G. 27 | # 28 | from lg_memory import lg_memory 29 | 30 | i = -1 31 | lg1 = [] 32 | lg2 = [] 33 | [ lg1, lg2 ] = lg_memory ( i, g, lg1, lg2 ) 34 | 35 | return lg1, lg2 36 | 37 | -------------------------------------------------------------------------------- /wtime/wtime_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #*****************************************************************************80 4 | # 5 | ## WTIME_TEST tests the WTIME library. 6 | # 7 | # Licensing: 8 | # 9 | # This code is distributed under the GNU LGPL license. 10 | # 11 | # Modified: 12 | # 13 | # 12 May 2013 14 | # 15 | # Author: 16 | # 17 | # John Burkardt 18 | # 19 | from wtime_test01 import wtime_test01 20 | from timestamp import timestamp 21 | 22 | timestamp ( ) 23 | print '' 24 | print 'WTIME_TEST' 25 | print ' Python version:' 26 | print ' Test the WTIME library.' 27 | 28 | wtime_test01 ( ) 29 | wtime_test02 ( ) 30 | # 31 | # Terminate. 32 | # 33 | print '' 34 | print 'WTIME_TEST:' 35 | print ' Normal end of execution.' 36 | print '' 37 | timestamp ( ) 38 | -------------------------------------------------------------------------------- /r8lib/r8_sign_match_strict.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sign_match_strict ( r1, r2 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SIGN_MATCH_STRICT is TRUE if two R8's are of the same strict sign. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real R1, R2, the values to check. 24 | # 25 | # Output, logical VALUE, is TRUE if the signs match. 26 | # 27 | value = ( r1 < 0.0 and r2 < 0.0 ) or \ 28 | ( r1 == 0.0 and r2 == 0.0 ) or \ 29 | ( 0.0 < r1 and 0.0 < r2 ) 30 | 31 | return value 32 | 33 | -------------------------------------------------------------------------------- /r8lib/r8_asin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def r8_asin ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_ASIN computes the arc sine function, with argument truncation. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 24 July 2014 16 | # 17 | # Author: 18 | # 19 | # Original FORTRAN77 version by Wayne Fullerton. 20 | # Python version by John Burkardt. 21 | # 22 | # Parameters: 23 | # 24 | # Input, real C, the argument. 25 | # 26 | # Output, real VALUE, the arc-sine of C. 27 | # 28 | from math import asin 29 | 30 | c2 = max ( c, - 1.0 ) 31 | c2 = min ( c2, +1.0 ) 32 | 33 | value = asin ( c2 ) 34 | 35 | return value 36 | -------------------------------------------------------------------------------- /r8lib/r8_sech.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def r8_sech ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SECH evaluates the hyperbolic secant, while avoiding COSH overflow. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real X, the argument of the function. 24 | # 25 | # Output, real R8_SECH, the value of the function. 26 | # 27 | from math import cosh 28 | 29 | log_huge = 80.0 30 | 31 | if ( log_huge < abs ( x ) ): 32 | value = 0.0 33 | else 34 | value = 1.0 / cosh ( x ) 35 | 36 | return value 37 | 38 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/fd1d_heat_implicit_matrix.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # 3 | def fd1d_heat_implicit_matrix ( x_num, cfl ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## FD1D_HEAT_IMPLICIT_MATRIX: set the system matrix. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 30 January 2012 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | import numpy as np 22 | 23 | a = np.zeros ( ( x_num, x_num ) ) 24 | 25 | a[0,0] = 1.0 26 | 27 | for i in range ( 1, x_num - 1 ): 28 | a[i,i-1] = - cfl 29 | a[i,i ] = 1.0 + 2.0 * cfl 30 | a[i,i+1] = - cfl 31 | 32 | a[x_num-1,x_num-1] = 1.0 33 | 34 | return a 35 | 36 | -------------------------------------------------------------------------------- /r8lib/r8_unswap3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_unswap3 ( x, y, z ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_UNSWAP3 unswaps three R8's. 8 | # 9 | # Example: 10 | # 11 | # Input: 12 | # 13 | # X = 2, Y = 3, Z = 1 14 | # 15 | # Output: 16 | # 17 | # X = 1, Y = 2, Z = 3 18 | # 19 | # Licensing: 20 | # 21 | # This code is distributed under the GNU LGPL license. 22 | # 23 | # Modified: 24 | # 25 | # 04 June 2013 26 | # 27 | # Author: 28 | # 29 | # John Burkardt 30 | # 31 | # Parameters: 32 | # 33 | # Input, real X, Y, Z, three values to be swapped. 34 | # 35 | # Output, real X, Y, Z, the swapped values. 36 | # 37 | w = z 38 | z = y 39 | y = x 40 | x = w 41 | 42 | return x, y, z 43 | 44 | -------------------------------------------------------------------------------- /wathen/nonzeros.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def nonzeros ( m, n, a ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## NONZEROS counts the nonzeros in a matrix. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 August 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer M, N, the number of rows and columns. 24 | # 25 | # Input, real A(M,N), the matrix. 26 | # 27 | # Output, integer NNZ, the number of nonzero entries. 28 | # 29 | nnz = 0; 30 | for j in range ( 0, n ): 31 | for i in range ( 0, m ): 32 | if ( a[i,j] != 0.0 ): 33 | nnz = nnz + 1 34 | 35 | return nnz 36 | -------------------------------------------------------------------------------- /timer/timer_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #*****************************************************************************80 4 | # 5 | ## TIMER_TEST tests the TIMER library. 6 | # 7 | # Licensing: 8 | # 9 | # This code is distributed under the GNU LGPL license. 10 | # 11 | # Modified: 12 | # 13 | # 13 May 2013 14 | # 15 | # Author: 16 | # 17 | # John Burkardt 18 | # 19 | from timer_test01 import timer_test01 20 | from timer_test02 import timer_test02 21 | from timestamp import timestamp 22 | 23 | timestamp ( ) 24 | print '' 25 | print 'TIMER_TEST' 26 | print ' Python version:' 27 | print ' Test the TIMER library.' 28 | 29 | timer_test01 ( ) 30 | timer_test02 ( ) 31 | # 32 | # Terminate. 33 | # 34 | print '' 35 | print 'TIMER_TEST:' 36 | print ' Normal end of execution.' 37 | 38 | print '' 39 | timestamp ( ) 40 | -------------------------------------------------------------------------------- /cycle_brent/f1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f1 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F1 is the iteration function for example 1. 8 | # 9 | # Discussion: 10 | # 11 | # This function has two cycles: 12 | # 13 | # 6, 3, 1, of length 3 14 | # 4, of length 1 15 | # 16 | # Licensing: 17 | # 18 | # This code is distributed under the GNU LGPL license. 19 | # 20 | # Modified: 21 | # 22 | # 13 May 2013 23 | # 24 | # Author: 25 | # 26 | # John Burkardt 27 | # 28 | # Parameters: 29 | # 30 | # Input, integer I, the argument of the function. 31 | # 0 <= I <= 9. 32 | # 33 | # Output, integer VALUE, the value of the function. 34 | # 35 | f_table = [ 6, 6, 0, 1, 4, 3, 3, 4, 0 ] 36 | 37 | value = f_table [i] 38 | 39 | return value 40 | 41 | -------------------------------------------------------------------------------- /cycle_floyd/f1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def f1 ( i ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## F1 is the iteration function for example 1. 8 | # 9 | # Discussion: 10 | # 11 | # This function has two cycles: 12 | # 13 | # 6, 3, 1, of length 3 14 | # 4, of length 1 15 | # 16 | # Licensing: 17 | # 18 | # This code is distributed under the GNU LGPL license. 19 | # 20 | # Modified: 21 | # 22 | # 13 May 2013 23 | # 24 | # Author: 25 | # 26 | # John Burkardt 27 | # 28 | # Parameters: 29 | # 30 | # Input, integer I, the argument of the function. 31 | # 0 <= I <= 9. 32 | # 33 | # Output, integer VALUE, the value of the function. 34 | # 35 | f_table = [ 6, 6, 0, 1, 4, 3, 3, 4, 0 ] 36 | 37 | value = f_table [i] 38 | 39 | return value 40 | 41 | -------------------------------------------------------------------------------- /r8lib/r8_sign3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sign3 ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SIGN3 returns the three-way sign of an R8. 8 | # 9 | # Discussion: 10 | # 11 | # The value is +1 if the number is positive, 0 if zero, and -1 otherwise. 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 28 September 2014 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | # Parameters: 26 | # 27 | # Input, real X, the number whose sign is desired. 28 | # 29 | # Output, real VALUE, the sign of X. 30 | # 31 | if ( x < 0.0 ): 32 | value = -1.0 33 | elif ( x == 0.0 ): 34 | value = 0.0; 35 | else: 36 | value = +1.0 37 | 38 | return value 39 | 40 | -------------------------------------------------------------------------------- /snakes_and_ladders/average_length.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def average_length(): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## AVERAGE_LENGTH estimates the average length of a one-player game. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 15 September 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from game_length import game_length 22 | 23 | games = 0 24 | total = 0 25 | 26 | while ( games < 1000 ): 27 | games = games + 1 28 | n = game_length ( ) 29 | total = total + n 30 | 31 | average = total / 1000 32 | print 'Average number of moves is ' + repr ( average ) 33 | 34 | if ( __name__ == '__main__' ): 35 | average_length ( ) 36 | 37 | -------------------------------------------------------------------------------- /polygon_grid/triangle.xy: -------------------------------------------------------------------------------- 1 | 0.5 0.288675 2 | 0.4 0.23094 3 | 0.3 0.173205 4 | 0.2 0.11547 5 | 0.1 0.057735 6 | 0 0 7 | 0.3 0.173205 8 | 0.2 0.11547 9 | 0.1 0.057735 10 | 0 0 11 | 0.2 0.11547 12 | 0.1 0.057735 13 | 0 0 14 | 0.1 0.057735 15 | 0 0 16 | 0 0 17 | 0.6 0.23094 18 | 0.7 0.173205 19 | 0.8 0.11547 20 | 0.9 0.057735 21 | 1 0 22 | 0.7 0.173205 23 | 0.8 0.11547 24 | 0.9 0.057735 25 | 1 0 26 | 0.8 0.11547 27 | 0.9 0.057735 28 | 1 0 29 | 0.9 0.057735 30 | 1 0 31 | 1 0 32 | 0.5 0.404145 33 | 0.5 0.519615 34 | 0.5 0.635085 35 | 0.5 0.750555 36 | 0.5 0.866025 37 | 0.5 0.519615 38 | 0.5 0.635085 39 | 0.5 0.750555 40 | 0.5 0.866025 41 | 0.5 0.635085 42 | 0.5 0.750555 43 | 0.5 0.866025 44 | 0.5 0.750555 45 | 0.5 0.866025 46 | 0.5 0.866025 47 | -------------------------------------------------------------------------------- /r8lib/r8_log_10.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_log_10 ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_LOG_10 returns the logarithm base 10 of |X|. 8 | # 9 | # Discussion: 10 | # 11 | # value = Log10 ( |X| ) 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 07 June 2013 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | # Parameters: 26 | # 27 | # Input, real X, the number whose base 2 logarithm is desired. 28 | # X should not be 0. 29 | # 30 | # Output, real VALUE, the logarithm base 10 of the absolute 31 | # value of X. It should be true that |X| = 10**R8_LOG_10. 32 | # 33 | from math import log 34 | 35 | value = log ( abs ( x ), 10.0 ) 36 | 37 | return value 38 | 39 | -------------------------------------------------------------------------------- /filum/filum_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #*****************************************************************************80 4 | # 5 | ## FILUM_TEST tests the FILUM library. 6 | # 7 | # Licensing: 8 | # 9 | # This code is distributed under the GNU LGPL license. 10 | # 11 | # Modified: 12 | # 13 | # 13 October 2014 14 | # 15 | # Author: 16 | # 17 | # John Burkardt 18 | # 19 | from file_column_count import file_column_count_test 20 | from file_row_count import file_row_count_test 21 | from timestamp import timestamp 22 | 23 | timestamp ( ) 24 | print '' 25 | print 'FILUM_TEST' 26 | print ' Python version:' 27 | print ' Test the FILUM library.' 28 | 29 | file_column_count_test ( ) 30 | file_row_count_test ( ) 31 | # 32 | # Terminate. 33 | # 34 | print '' 35 | print 'FILUM_TEST:' 36 | print ' Normal end of execution.' 37 | print '' 38 | timestamp ( ) 39 | -------------------------------------------------------------------------------- /r8lib/r8_sign_match.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sign_match ( r1, r2 ) 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SIGN_MATCH is TRUE if two R8's are of the same sign. 8 | # 9 | # Discussion: 10 | # 11 | # This test could be coded numerically as 12 | # 13 | # if ( 0 <= r1 * r2 ) then ... 14 | # 15 | # Licensing: 16 | # 17 | # This code is distributed under the GNU LGPL license. 18 | # 19 | # Modified: 20 | # 21 | # 25 July 2014 22 | # 23 | # Author: 24 | # 25 | # John Burkardt 26 | # 27 | # Parameters: 28 | # 29 | # Input, real R1, R2, the values to check. 30 | # 31 | # Output, logical VALUE, is TRUE if ( R1 <= 0 and R2 <= 0 ) 32 | # or ( 0 <= R1 and 0 <= R2 ). 33 | # 34 | value = ( r1 <= 0.0 and r2 <= 0.0 ) or ( 0.0 <= r1 and 0.0 <= r2 ); 35 | 36 | return value 37 | 38 | -------------------------------------------------------------------------------- /r8lib/r8_sign_opposite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sign_opposite ( r1, r2 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SIGN_OPPOSITE is TRUE if two R8's are not of the same sign. 8 | # 9 | # Discussion: 10 | # 11 | # This test could be coded numerically as 12 | # 13 | # if ( r1 * r2 <= 0.0 ) then ... 14 | # 15 | # Licensing: 16 | # 17 | # This code is distributed under the GNU LGPL license. 18 | # 19 | # Modified: 20 | # 21 | # 25 July 2014 22 | # 23 | # Author: 24 | # 25 | # John Burkardt 26 | # 27 | # Parameters: 28 | # 29 | # Input, real R1, R2, the values to check. 30 | # 31 | # Output, logical VALUE, is TRUE if ( R1 <= 0 and 0 <= R2 ) 32 | # or ( R2 <= 0 and 0 <= R1 ). 33 | # 34 | value = ( r1 <= 0.0 and 0.0 <= r2 ) or ( r2 <= 0.0 and 0.0 <= r1 ) 35 | 36 | return value 37 | 38 | -------------------------------------------------------------------------------- /r8lib/r8_insignificant.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_insignificant ( r, s ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_INSIGNIFICANT determines if an R8 is insignificant. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real R, the number to be compared against. 24 | # 25 | # Input, real S, the number to be compared. 26 | # 27 | # Output, logical R8_INSIGNIFICANT, is TRUE if S is insignificant 28 | # compared to R. 29 | # 30 | value = True 31 | r8_epsilon = 2.220446049250313E-016 32 | 33 | t = r + s 34 | tol = r8_epsilon * abs ( r ) 35 | 36 | if ( tol < abs ( r - t ) ): 37 | value = False 38 | 39 | return 40 | 41 | -------------------------------------------------------------------------------- /fd1d_heat_explicit/t_test03.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | 1.05 23 | 1.1 24 | 1.15 25 | 1.2 26 | 1.25 27 | 1.3 28 | 1.35 29 | 1.4 30 | 1.45 31 | 1.5 32 | 1.55 33 | 1.6 34 | 1.65 35 | 1.7 36 | 1.75 37 | 1.8 38 | 1.85 39 | 1.9 40 | 1.95 41 | 2 42 | 2.05 43 | 2.1 44 | 2.15 45 | 2.2 46 | 2.25 47 | 2.3 48 | 2.35 49 | 2.4 50 | 2.45 51 | 2.5 52 | 2.55 53 | 2.6 54 | 2.65 55 | 2.7 56 | 2.75 57 | 2.8 58 | 2.85 59 | 2.9 60 | 2.95 61 | 3 62 | 3.05 63 | 3.1 64 | 3.15 65 | 3.2 66 | 3.25 67 | 3.3 68 | 3.35 69 | 3.4 70 | 3.45 71 | 3.5 72 | 3.55 73 | 3.6 74 | 3.65 75 | 3.7 76 | 3.75 77 | 3.8 78 | 3.85 79 | 3.9 80 | 3.95 81 | 4 82 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/t_test03.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.05 3 | 0.1 4 | 0.15 5 | 0.2 6 | 0.25 7 | 0.3 8 | 0.35 9 | 0.4 10 | 0.45 11 | 0.5 12 | 0.55 13 | 0.6 14 | 0.65 15 | 0.7 16 | 0.75 17 | 0.8 18 | 0.85 19 | 0.9 20 | 0.95 21 | 1 22 | 1.05 23 | 1.1 24 | 1.15 25 | 1.2 26 | 1.25 27 | 1.3 28 | 1.35 29 | 1.4 30 | 1.45 31 | 1.5 32 | 1.55 33 | 1.6 34 | 1.65 35 | 1.7 36 | 1.75 37 | 1.8 38 | 1.85 39 | 1.9 40 | 1.95 41 | 2 42 | 2.05 43 | 2.1 44 | 2.15 45 | 2.2 46 | 2.25 47 | 2.3 48 | 2.35 49 | 2.4 50 | 2.45 51 | 2.5 52 | 2.55 53 | 2.6 54 | 2.65 55 | 2.7 56 | 2.75 57 | 2.8 58 | 2.85 59 | 2.9 60 | 2.95 61 | 3 62 | 3.05 63 | 3.1 64 | 3.15 65 | 3.2 66 | 3.25 67 | 3.3 68 | 3.35 69 | 3.4 70 | 3.45 71 | 3.5 72 | 3.55 73 | 3.6 74 | 3.65 75 | 3.7 76 | 3.75 77 | 3.8 78 | 3.85 79 | 3.9 80 | 3.95 81 | 4 82 | -------------------------------------------------------------------------------- /freefem++_msh_io/input.msh: -------------------------------------------------------------------------------- 1 | 15 18 10 2 | -0.309016994375 0.951056516295 1 3 | -0.809016994375 0.587785252292 1 4 | -0.321175165867 0.47552825672 0 5 | 0.309016994375 0.951056516295 1 6 | -1 1.22464679915e-16 1 7 | 0.809016994375 0.587785252292 1 8 | -0.333333334358 -1.62149427219e-09 0 9 | 0.237841829972 0.293892623813 0 10 | -0.809016994375 -0.587785252292 1 11 | -0.321175165867 -0.475528259963 0 12 | 1 0 1 13 | 0.206011327827 -0.391856835534 0 14 | -0.309016994375 -0.951056516295 1 15 | 0.809016994375 -0.587785252292 1 16 | 0.309016994375 -0.951056516295 1 17 | 1 3 4 0 18 | 7 2 5 0 19 | 9 7 5 0 20 | 8 6 4 0 21 | 12 8 7 0 22 | 12 11 8 0 23 | 3 1 2 0 24 | 7 3 2 0 25 | 7 8 3 0 26 | 4 3 8 0 27 | 6 8 11 0 28 | 12 7 10 0 29 | 11 12 14 0 30 | 10 9 13 0 31 | 12 10 13 0 32 | 7 9 10 0 33 | 12 13 15 0 34 | 14 12 15 0 35 | 11 6 1 36 | 6 4 1 37 | 4 1 1 38 | 1 2 1 39 | 2 5 1 40 | 5 9 1 41 | 9 13 1 42 | 13 15 1 43 | 15 14 1 44 | 14 11 1 45 | -------------------------------------------------------------------------------- /r8lib/r8_sign_opposite_strict.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_sign_opposite_strict ( r1, r2 ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_SIGN_OPPOSITE_STRICT is TRUE if two R8's are strictly of opposite sign. 8 | # 9 | # Discussion: 10 | # 11 | # This test could be coded numerically as 12 | # 13 | # if ( r1 * r2 < 0.0 ) then ... 14 | # 15 | # Licensing: 16 | # 17 | # This code is distributed under the GNU LGPL license. 18 | # 19 | # Modified: 20 | # 21 | # 25 July 2014 22 | # 23 | # Author: 24 | # 25 | # John Burkardt 26 | # 27 | # Parameters: 28 | # 29 | # Input, real R1, R2, the values to check. 30 | # 31 | # Output, logical R8_SIGN_OPPOSITE_STRICT, is TRUE if ( R1 < 0 and 0 < R2 ) 32 | # or ( R2 < 0 and 0 < R1 ). 33 | # 34 | value = ( r1 < 0.0 and 0.0 < r2 ) or ( r2 < 0.0 and 0.0 < r1 ); 35 | 36 | return value 37 | 38 | -------------------------------------------------------------------------------- /r8lib/r8_hypot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_hypot ( x, y ); 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_HYPOT returns the value of sqrt ( X^2 + Y^2 ). 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 01 June 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, real X, Y, the arguments. 24 | # 25 | # Output, real VALUE, the value of sqrt ( X^2 + Y^2 ). 26 | # 27 | from math import sqrt 28 | 29 | if ( abs ( x ) < abs ( y ) ): 30 | a = abs ( y ) 31 | b = abs ( x ) 32 | else: 33 | a = abs ( x ) 34 | b = abs ( y ) 35 | # 36 | # A contains the larger value. 37 | # 38 | if ( a == 0.0 ): 39 | value = 0.0 40 | else: 41 | value = a * sqrt ( 1.0 + ( b / a ) ** 2 ) 42 | 43 | return 44 | end 45 | -------------------------------------------------------------------------------- /kronrod/kronrod_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #*****************************************************************************80 4 | # 5 | ## KRONROD_TEST tests the KRONROD functions. 6 | # 7 | # Licensing: 8 | # 9 | # This code is distributed under the GNU LGPL license. 10 | # 11 | # Modified: 12 | # 13 | # 30 April 2013 14 | # 15 | # Author: 16 | # 17 | # John Burkardt 18 | # 19 | from kronrod_test01 import kronrod_test01 20 | from kronrod_test02 import kronrod_test02 21 | from kronrod_test03 import kronrod_test03 22 | from timestamp import timestamp 23 | 24 | timestamp ( ) 25 | 26 | print '' 27 | print 'KRONROD_TEST' 28 | print ' Python version.' 29 | print ' Test the KRONROD library.' 30 | 31 | kronrod_test01 ( ) 32 | kronrod_test02 ( ) 33 | kronrod_test03 ( ) 34 | # 35 | # Terminate. 36 | # 37 | print '' 38 | print 'KRONROD_TEST' 39 | print ' Normal end of execution.' 40 | print '' 41 | timestamp ( ) 42 | 43 | -------------------------------------------------------------------------------- /fem1d/fem1d_model_output.txt: -------------------------------------------------------------------------------- 1 | 2 | FEM1D_MODEL 3 | Python version 4 | Given the model two point boundary value problem: 5 | -u'' + u = x, 0 < x < 1 6 | with boundary conditions 7 | u(0) = 0, u(1) = 0, 8 | demonstrate how the finite element method can be used to 9 | define and compute a discrete approximation to the solution. 10 | 11 | Nodes: 12 | 13 | 0 0.000000 14 | 1 0.200000 15 | 2 0.400000 16 | 3 0.600000 17 | 4 0.800000 18 | 5 1.000000 19 | 20 | Node Ucomp Uexact Error 21 | 22 | 0 4.59676e-17 0 4.59676e-17 23 | 1 0.0287656 0.0286795 8.60136e-05 24 | 2 0.0506358 0.0504834 0.000152372 25 | 3 0.0584376 0.0582599 0.000177701 26 | 4 0.0444316 0.0442945 0.00013708 27 | 5 0 0 0 28 | 29 | FEM1D_MODEL: 30 | Normal end of execution. 31 | -------------------------------------------------------------------------------- /dolfin/reaction_diffusion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # reaction_diffusion.py 4 | # 5 | # Modified: 6 | # 7 | # 14 December 2011 8 | # 9 | # Reference: 10 | # 11 | # Anders Logg, Garth Wells, 12 | # DOLFIN: Automated Finite Element Computing, 13 | # ACM Transactions on Mathematical Software, 14 | # Volume 37, Number 2, Article 20, April 2010. 15 | # 16 | from dolfin import * 17 | 18 | mesh = UnitSquare ( 32, 32 ); 19 | V = FunctionSpace ( mesh, "CG", 2 ) 20 | 21 | v = TestFunction ( V ) 22 | u = TrialFunction ( V ) 23 | f = Expression ( "sin( x[0] ) * cos ( x[1] )" ) 24 | 25 | A = assemble ( dot ( grad ( v ), grad ( u ) ) * dx + v * u * dx ) 26 | b = assemble ( v * f * dx ) 27 | 28 | u_h = Function ( V ) 29 | 30 | solve ( A, u_h.vector(), b ) 31 | 32 | plot ( u_h ) 33 | file = File ( 'reaction_diffusion_solution.pvd' ) 34 | file << u_h 35 | 36 | plot ( mesh ) 37 | file = File ( 'reaction_diffusion_mesh.pvd' ) 38 | file << mesh 39 | 40 | interactive ( ) 41 | 42 | -------------------------------------------------------------------------------- /r8lib/r8vec_step.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def r8vec_step ( x0, n, x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8VEC_STEP evaluates a unit step function. 8 | # 9 | # Discussion: 10 | # 11 | # F(X) = 0 if X < X0 12 | # 1 if X0 <= X 13 | # 14 | # Licensing: 15 | # 16 | # This code is distributed under the GNU LGPL license. 17 | # 18 | # Modified: 19 | # 20 | # 30 May 2013 21 | # 22 | # Author: 23 | # 24 | # John Burkardt 25 | # 26 | # Parameters: 27 | # 28 | # Input, real X0, the location of the jump. 29 | # 30 | # Input, integer N, the number of argument values. 31 | # 32 | # Output, real X(N), the arguments. 33 | # 34 | # Output, real FX(N), the function values. 35 | # 36 | import numpy 37 | 38 | fx = numpy.zeros ( n ); 39 | 40 | for i in range ( 0, n ): 41 | if ( x < x0 ): 42 | fx[i] = 0.0 43 | else 44 | fx[i] = 1.0 45 | 46 | return fx 47 | 48 | -------------------------------------------------------------------------------- /hypercube_grid/hypercube_grid_points_test02.xyz: -------------------------------------------------------------------------------- 1 | -1 0 -0.5 0 -0.25 2 | 0 0 -0.5 0 -0.25 3 | -1 0.333333 -0.5 0 -0.25 4 | 0 0.333333 -0.5 0 -0.25 5 | -1 0 0 0 -0.25 6 | 0 0 0 0 -0.25 7 | -1 0.333333 0 0 -0.25 8 | 0 0.333333 0 0 -0.25 9 | -1 0 -0.5 0.5 -0.25 10 | 0 0 -0.5 0.5 -0.25 11 | -1 0.333333 -0.5 0.5 -0.25 12 | 0 0.333333 -0.5 0.5 -0.25 13 | -1 0 0 0.5 -0.25 14 | 0 0 0 0.5 -0.25 15 | -1 0.333333 0 0.5 -0.25 16 | 0 0.333333 0 0.5 -0.25 17 | -1 0 -0.5 0 0.25 18 | 0 0 -0.5 0 0.25 19 | -1 0.333333 -0.5 0 0.25 20 | 0 0.333333 -0.5 0 0.25 21 | -1 0 0 0 0.25 22 | 0 0 0 0 0.25 23 | -1 0.333333 0 0 0.25 24 | 0 0.333333 0 0 0.25 25 | -1 0 -0.5 0.5 0.25 26 | 0 0 -0.5 0.5 0.25 27 | -1 0.333333 -0.5 0.5 0.25 28 | 0 0.333333 -0.5 0.5 0.25 29 | -1 0 0 0.5 0.25 30 | 0 0 0 0.5 0.25 31 | -1 0.333333 0 0.5 0.25 32 | 0 0.333333 0 0.5 0.25 33 | -------------------------------------------------------------------------------- /r8lib/r8_floor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_floor ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_FLOOR rounds an R8 down to the nearest integral R8. 8 | # 9 | # Example: 10 | # 11 | # X Value 12 | # 13 | # -1.1 -2.0 14 | # -1.0 -1.0 15 | # -0.9 -1.0 16 | # -0.1 -1.0 17 | # 0.0 0.0 18 | # 0.1 0.0 19 | # 0.9 0.0 20 | # 1.0 1.0 21 | # 1.1 1.0 22 | # 2.9 2.0 23 | # 3.0 3.0 24 | # 3.14159 3.0 25 | # 26 | # Licensing: 27 | # 28 | # This code is distributed under the GNU LGPL license. 29 | # 30 | # Modified: 31 | # 32 | # 24 July 2014 33 | # 34 | # Author: 35 | # 36 | # John Burkardt 37 | # 38 | # Parameters: 39 | # 40 | # Input, real X, the number to be rounded down. 41 | # 42 | # Output, real VALUE, the rounded value of X. 43 | # 44 | from math import floor 45 | 46 | value = floor ( x ) 47 | 48 | return value 49 | 50 | -------------------------------------------------------------------------------- /r8lib/r8_pythag.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_pythag ( a, b ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_PYTHAG computes sqrt ( A^2 + B^2 ), avoiding overflow and underflow. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 July 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Reference: 22 | # 23 | # The SLATEC library 24 | # 25 | # Parameters: 26 | # 27 | # Input, real A, B, the values for which sqrt ( A**2 + B**2 ) 28 | # is desired. 29 | # 30 | # Output, real VALUE, the value of sqrt ( A**2 + B**2 ). 31 | # 32 | from math import sqrt 33 | 34 | a = abs ( a ) 35 | b = abs ( b ) 36 | 37 | if ( b < a ) 38 | value = a * sqrt ( 1.0 + ( b / a ) * ( b / a ) ) 39 | elif ( b == 0.0 ) 40 | value = 0.0 41 | elif ( a <= b ) 42 | value = b * sqrt ( 1.0 + ( a / b ) * ( a / b ) ) 43 | 44 | return value 45 | 46 | -------------------------------------------------------------------------------- /r8lib/r8_round.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_round ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_ROUND sets an R8 to the nearest integral value. 8 | # 9 | # Example: 10 | # 11 | # X R8_ROUND 12 | # 13 | # 1.3 1.0 14 | # 1.4 1.0 15 | # 1.5 1.0 or 2.0 16 | # 1.6 2.0 17 | # 0.0 0.0 18 | # -0.7 -1.0 19 | # -1.1 -1.0 20 | # -1.6 -2.0 21 | # 22 | # Licensing: 23 | # 24 | # This code is distributed under the GNU LGPL license. 25 | # 26 | # Modified: 27 | # 28 | # 25 July 2014 29 | # 30 | # Author: 31 | # 32 | # John Burkardt 33 | # 34 | # Parameters: 35 | # 36 | # Input, real X, the value. 37 | # 38 | # Output, real R8_ROUND, the rounded value. 39 | # 40 | from math import floor 41 | 42 | if ( x < 0.0 ): 43 | value = - floor ( - x + 0.5 ) 44 | else: 45 | value = floor ( + x + 0.5 ) 46 | 47 | return value 48 | 49 | -------------------------------------------------------------------------------- /prime_serial/prime_serial_output.txt: -------------------------------------------------------------------------------- 1 | Sat Oct 27 10:37:26 2012 2 | 3 | PRIME_SERIAL 4 | PYTHON version 5 | Count the primes between N_LO and N_HI. 6 | 7 | PRIME_NUMBER_SWEEP 8 | Call PRIME_NUMBER to count the primes from 1 to N. 9 | 10 | N Pi Time 11 | 12 | 1 0 0.00001 13 | 2 1 0.00000 14 | 4 2 0.00000 15 | 8 4 0.00001 16 | 16 6 0.00002 17 | 32 11 0.00005 18 | 64 18 0.00013 19 | 128 31 0.00039 20 | 256 54 0.00119 21 | 512 97 0.00448 22 | 1024 172 0.01654 23 | 2048 309 0.06546 24 | 4096 564 0.25960 25 | 8192 1028 1.00731 26 | 16384 1900 3.92110 27 | 32768 3512 15.14254 28 | 65536 6542 58.73342 29 | 131072 12251 232.86737 30 | 31 | PRIME_SERIAL 32 | Normal end of execution. 33 | 34 | Sat Oct 27 10:42:38 2012 35 | -------------------------------------------------------------------------------- /xml_to_fem/cheby9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /fem_to_xml/cheby9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /wathen/mv_st.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def mv_st ( m, n, nz_num, row, col, a, x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## MV_ST multiplies a sparse triple matrix times a vector. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 August 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer M, N, the number of rows and columns. 24 | # 25 | # Input, integer NZ_NUM, the number of nonzero values. 26 | # 27 | # Input, integer ROW(NZ_NUM), COL(NZ_NUM), the row and column indices. 28 | # 29 | # Input, real A(NZ_NUM), the nonzero values in the M by N matrix. 30 | # 31 | # Input, real X(N), the vector to be multiplied. 32 | # 33 | # Output, real B(M), the product A*X. 34 | # 35 | import numpy as np 36 | 37 | b = np.zeros ( m ) 38 | 39 | for k in range ( 0, nz_num ): 40 | b[row[k]] = b[row[k]] + a[k] * x[col[k]] 41 | 42 | return b 43 | 44 | -------------------------------------------------------------------------------- /r8lib/r8_csc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def r8_csc ( theta ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_CSC returns the cosecant of X. 8 | # 9 | # Discussion: 10 | # 11 | # R8_CSC ( THETA ) = 1.0 / SIN ( THETA ) 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 24 July 2014 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | # Parameters: 26 | # 27 | # Input, real THETA, the angle, in radians, whose cosecant is desired. 28 | # It must be the case that SIN ( THETA ) is not zero. 29 | # 30 | # Output, real VALUE, the cosecant of THETA. 31 | # 32 | from math import sin 33 | from sys import exit 34 | 35 | value = sin ( theta ) 36 | 37 | if ( value == 0.0 ) 38 | print '' 39 | print 'R8_CSC - Fatal error!' 40 | print ' Cosecant undefined for THETA = %g' % ( theta ) 41 | exit ( 'R8_CSC - Fatal error!' ) 42 | end 43 | 44 | value = 1.0 / value 45 | 46 | return value 47 | 48 | -------------------------------------------------------------------------------- /fem_to_xml/tet_mesh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /cauchy_principal_value/cpv_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cpv_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CPV_TEST tests the CPV library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 02 April 2015 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cpv import cpv_test01 22 | from cpv import cpv_test02 23 | from legendre_set import legendre_set_test01 24 | from timestamp import timestamp_test 25 | 26 | print '' 27 | print 'CPV_TEST' 28 | print ' Python version:' 29 | print ' Test the CPV library.' 30 | 31 | cpv_test01 ( ) 32 | cpv_test02 ( ) 33 | 34 | legendre_set_test01 ( ) 35 | 36 | timestamp_test ( ) 37 | # 38 | # Terminate. 39 | # 40 | print '' 41 | print 'CPV_TEST:' 42 | print ' Normal end of execution.' 43 | 44 | if ( __name__ == '__main__' ): 45 | from timestamp import timestamp 46 | timestamp ( ) 47 | cpv_test ( ) 48 | timestamp ( ) 49 | -------------------------------------------------------------------------------- /ellipsoid_grid/ellipsoid_grid_display.m: -------------------------------------------------------------------------------- 1 | function ellipsoid_grid_display ( ng, xy ) 2 | 3 | %*****************************************************************************80 4 | % 5 | %% ELLIPSOID_GRID_DISPLAY displays grid points inside an ellipsoid. 6 | % 7 | % Discussion: 8 | % 9 | % The ellipsoid is specified as 10 | % 11 | % ( ( X - C1 ) / R1 )^2 12 | % + ( ( Y - C2 ) / R2 )^2 13 | % + ( ( Z - C3 ) / R3 )^2 = 1 14 | % 15 | % The user supplies a number N. There will be N+1 grid points along 16 | % the shortest axis. 17 | % 18 | % Licensing: 19 | % 20 | % This code is distributed under the GNU LGPL license. 21 | % 22 | % Modified: 23 | % 24 | % 04 September 2010 25 | % 26 | % Author: 27 | % 28 | % John Burkardt 29 | % 30 | % Parameters: 31 | % 32 | % Input, integer NG, the number of grid points inside the ellipsoid. 33 | % 34 | % Input, real XY(3,NG), the grid points. 35 | % 36 | scatter3 ( xy(1,:), xy(2,:), xy(3,:), 'b.' ); 37 | axis equal 38 | title ( sprintf ( '%d grid points inside an ellipsoid', ng ) ) 39 | grid on 40 | 41 | return 42 | end 43 | -------------------------------------------------------------------------------- /fem1d/fem1d_output.txt: -------------------------------------------------------------------------------- 1 | 2 | Nodes: 3 | 4 | 0 0.000000 5 | 1 0.200000 6 | 2 0.400000 7 | 3 0.600000 8 | 4 0.800000 9 | 5 1.000000 10 | 11 | Matrix and RHS: 12 | 13 | 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 14 | -5.000000 10.000000 -5.000000 0.000000 0.000000 0.000000 0.164055 15 | 0.000000 -5.000000 10.000000 -5.000000 0.000000 0.000000 0.416715 16 | 0.000000 0.000000 -5.000000 10.000000 -5.000000 0.000000 0.802463 17 | 0.000000 0.000000 0.000000 -5.000000 10.000000 -5.000000 1.374323 18 | 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 19 | 20 | Node Ucomp Uexact Error 21 | 22 | 0 -1.88738e-16 0 1.88738e-16 23 | 1 0.195424 0.195424 1.06371e-09 24 | 2 0.358038 0.358038 1.73068e-09 25 | 3 0.437309 0.437309 1.88347e-09 26 | 4 0.356087 0.356087 1.37113e-09 27 | 5 0 0 0 28 | -------------------------------------------------------------------------------- /kronrod/kronrod_test02.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def kronrod_test02 ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## KRONROD_TEST02 tests the code for the even case N = 4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 30 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | import numpy 22 | from kronrod import kronrod 23 | 24 | n = 4 25 | 26 | print '' 27 | print 'KRONROD_TEST02' 28 | print ' Request KRONROD to compute the Gauss rule' 29 | print ' of order 4, and the Kronrod extension of' 30 | print ' order 4+5=9.' 31 | 32 | tol = 0.000001 33 | 34 | [ x, w1, w2 ] = kronrod ( n, tol ) 35 | 36 | print '' 37 | print ' KRONROD returns 3 vectors of length %d' % ( n + 1 ) 38 | print '' 39 | print ' I X WK WG' 40 | print '' 41 | for i in range ( 1, n + 2 ): 42 | print ' %4d %14f %14f %14f' % ( i, x[i-1], w1[i-1], w2[i-1] ) 43 | 44 | return 45 | 46 | -------------------------------------------------------------------------------- /tetrahedron_grid/tetrahedron_grid_points.xyz: -------------------------------------------------------------------------------- 1 | 3 3 3 2 | 2.6 3.2 2.4 3 | 2.2 3.4 1.8 4 | 1.8 3.6 1.2 5 | 1.4 3.8 0.6 6 | 1 4 0 7 | 2.8 2.6 2.4 8 | 2.4 2.8 1.8 9 | 2 3 1.2 10 | 1.6 3.2 0.6 11 | 1.2 3.4 0 12 | 2.6 2.2 1.8 13 | 2.2 2.4 1.2 14 | 1.8 2.6 0.6 15 | 1.4 2.8 0 16 | 2.4 1.8 1.2 17 | 2 2 0.6 18 | 1.6 2.2 0 19 | 2.2 1.4 0.6 20 | 1.8 1.6 0 21 | 2 1 0 22 | 2.4 2.4 2.4 23 | 2 2.6 1.8 24 | 1.6 2.8 1.2 25 | 1.2 3 0.6 26 | 0.8 3.2 0 27 | 2.2 2 1.8 28 | 1.8 2.2 1.2 29 | 1.4 2.4 0.6 30 | 1 2.6 0 31 | 2 1.6 1.2 32 | 1.6 1.8 0.6 33 | 1.2 2 0 34 | 1.8 1.2 0.6 35 | 1.4 1.4 0 36 | 1.6 0.8 0 37 | 1.8 1.8 1.8 38 | 1.4 2 1.2 39 | 1 2.2 0.6 40 | 0.6 2.4 0 41 | 1.6 1.4 1.2 42 | 1.2 1.6 0.6 43 | 0.8 1.8 0 44 | 1.4 1 0.6 45 | 1 1.2 0 46 | 1.2 0.6 0 47 | 1.2 1.2 1.2 48 | 0.8 1.4 0.6 49 | 0.4 1.6 0 50 | 1 0.8 0.6 51 | 0.6 1 0 52 | 0.8 0.4 0 53 | 0.6 0.6 0.6 54 | 0.2 0.8 0 55 | 0.4 0.2 0 56 | 0 0 0 57 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test02.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_brent_test02 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_BRENT_TEST02 tests CYCLE_BRENT for F2. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from f2 import f2 22 | from cycle_brent import cycle_brent 23 | 24 | print 25 | print 'CYCLE_BRENT_TEST02' 26 | print ' Test CYCLE_BRENT for F2().' 27 | print ' f2(i) = mod ( 22 * i + 1, 72 ).' 28 | 29 | x0 = 0 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_brent ( f2, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 9' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 3' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ): 45 | cycle_brent_test02 ( ) 46 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test02.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_floyd_test02 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_FLOYD_TEST02 tests CYCLE_FLOYD for F2. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from f2 import f2 22 | from cycle_floyd import cycle_floyd 23 | 24 | print 25 | print 'CYCLE_FLOYD_TEST02' 26 | print ' Test CYCLE_FLOYD for F2().' 27 | print ' f2(i) = mod ( 22 * i + 1, 72 ).' 28 | 29 | x0 = 0 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_floyd ( f2, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 9' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 3' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ): 45 | cycle_floyd_test02 ( ) 46 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test03.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_brent_test03 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_BRENT_TEST03 tests CYCLE_BRENT for F3. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cycle_brent import cycle_brent 22 | from f3 import f3 23 | 24 | print 25 | print 'CYCLE_BRENT_TEST03' 26 | print ' Test CYCLE_BRENT for F3().' 27 | print ' f3(i) = mod ( 123 * i + 456, 100000 ).' 28 | 29 | x0 = 789 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_brent ( f3, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 50000' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 0' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ) : 45 | cycle_brent_test03 ( ) 46 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test04.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_brent_test04 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_BRENT_TEST04 tests CYCLE_BRENT for F4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from f4 import f4 22 | from cycle_brent import cycle_brent 23 | 24 | print 25 | print 'CYCLE_BRENT_TEST04' 26 | print ' Test CYCLE_BRENT for F4().' 27 | print ' f4(i) = mod ( 31421 * i + 6927, 65536 ).' 28 | 29 | x0 = 1 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_brent ( f4, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 65536' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 0' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ): 45 | cycle_brent_test04 ( ) 46 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test03.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_floyd_test03 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_FLOYD_TEST03 tests CYCLE_FLOYD for F3. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cycle_floyd import cycle_floyd 22 | from f3 import f3 23 | 24 | print 25 | print 'CYCLE_FLOYD_TEST03' 26 | print ' Test CYCLE_FLOYD for F3().' 27 | print ' f3(i) = mod ( 123 * i + 456, 100000 ).' 28 | 29 | x0 = 789 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_floyd ( f3, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 50000' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 0' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ) : 45 | cycle_floyd_test03 ( ) 46 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test04.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_floyd_test04 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_FLOYD_TEST04 tests CYCLE_FLOYD for F4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from f4 import f4 22 | from cycle_floyd import cycle_floyd 23 | 24 | print 25 | print 'CYCLE_FLOYD_TEST04' 26 | print ' Test CYCLE_FLOYD for F4().' 27 | print ' f4(i) = mod ( 31421 * i + 6927, 65536 ).' 28 | 29 | x0 = 1 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_floyd ( f4, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 65536' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 0' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ): 45 | cycle_floyd_test04 ( ) 46 | -------------------------------------------------------------------------------- /machine/machine_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | def machine_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## MACHINE_TEST tests the MACHINE library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 04 April 2015 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from d1mach import d1mach_test 22 | from i1mach import i1mach_test 23 | from r1mach import r1mach_test 24 | from timestamp import timestamp 25 | 26 | timestamp ( ) 27 | print '' 28 | print 'MACHINE_TEST:' 29 | print ' Python version' 30 | print ' Test the MACHINE library.' 31 | 32 | d1mach_test ( ) 33 | i1mach_test ( ) 34 | r1mach_test ( ) 35 | # 36 | # Terminate. 37 | # 38 | print '' 39 | print 'MACHINE_TEST:' 40 | print ' Normal end of execution.' 41 | print '' 42 | timestamp ( ) 43 | 44 | return 45 | 46 | if ( __name__ == '__main__' ): 47 | from timestamp import timestamp 48 | timestamp ( ) 49 | machine_test ( ) 50 | timestamp ( ) 51 | -------------------------------------------------------------------------------- /sparse_grid/pysg_test_output.txt: -------------------------------------------------------------------------------- 1 | .. 2 | ---------------------------------------------------------------------- 3 | Ran 2 tests in 0.016s 4 | 5 | OK 6 | 7 | Coordinates of points in 2D sparse grid. 8 | 9 | 0.5 0.5 10 | 0.5 0.25 11 | 0.5 0.75 12 | 0.5 0.125 13 | 0.5 0.375 14 | 0.5 0.625 15 | 0.5 0.875 16 | 0.25 0.5 17 | 0.25 0.25 18 | 0.25 0.75 19 | 0.75 0.5 20 | 0.75 0.25 21 | 0.75 0.75 22 | 0.125 0.5 23 | 0.375 0.5 24 | 0.625 0.5 25 | 0.875 0.5 26 | 27 | Coordinates of points in 3D sparse grid. 28 | 29 | 0.5 0.5 0.5 30 | 0.5 0.5 0.25 31 | 0.5 0.5 0.75 32 | 0.5 0.5 0.125 33 | 0.5 0.5 0.375 34 | 0.5 0.5 0.625 35 | 0.5 0.5 0.875 36 | 0.5 0.25 0.5 37 | 0.5 0.25 0.25 38 | 0.5 0.25 0.75 39 | 0.5 0.75 0.5 40 | 0.5 0.75 0.25 41 | 0.5 0.75 0.75 42 | 0.5 0.125 0.5 43 | 0.5 0.375 0.5 44 | 0.5 0.625 0.5 45 | 0.5 0.875 0.5 46 | 0.25 0.5 0.5 47 | 0.25 0.5 0.25 48 | 0.25 0.5 0.75 49 | 0.25 0.25 0.5 50 | 0.25 0.75 0.5 51 | 0.75 0.5 0.5 52 | 0.75 0.5 0.25 53 | 0.75 0.5 0.75 54 | 0.75 0.25 0.5 55 | 0.75 0.75 0.5 56 | 0.125 0.5 0.5 57 | 0.375 0.5 0.5 58 | 0.625 0.5 0.5 59 | 0.875 0.5 0.5 60 | -------------------------------------------------------------------------------- /freefem++_msh_io/output.msh: -------------------------------------------------------------------------------- 1 | 15 18 10 2 | -0.30901699437500002 0.95105651629499999 1 3 | -0.80901699437499996 0.58778525229199996 1 4 | -0.32117516586700001 0.47552825671999999 0 5 | 0.30901699437500002 0.95105651629499999 1 6 | -1.0 0.0 1 7 | 0.80901699437499996 0.58778525229199996 1 8 | -0.333333334358 0.0 0 9 | 0.23784182997200001 0.29389262381300002 0 10 | -0.80901699437499996 -0.58778525229199996 1 11 | -0.32117516586700001 -0.47552825996300002 0 12 | 1.0 0.0 1 13 | 0.20601132782699999 -0.39185683553400003 0 14 | -0.30901699437500002 -0.95105651629499999 1 15 | 0.80901699437499996 -0.58778525229199996 1 16 | 0.30901699437500002 -0.95105651629499999 1 17 | 1 3 4 0 18 | 7 2 5 0 19 | 9 7 5 0 20 | 8 6 4 0 21 | 12 8 7 0 22 | 12 11 8 0 23 | 3 1 2 0 24 | 7 3 2 0 25 | 7 8 3 0 26 | 4 3 8 0 27 | 6 8 11 0 28 | 12 7 10 0 29 | 11 12 14 0 30 | 10 9 13 0 31 | 12 10 13 0 32 | 7 9 10 0 33 | 12 13 15 0 34 | 14 12 15 0 35 | 11 6 1 36 | 6 4 1 37 | 4 1 1 38 | 1 2 1 39 | 2 5 1 40 | 5 9 1 41 | 9 13 1 42 | 13 15 1 43 | 15 14 1 44 | 14 11 1 45 | -------------------------------------------------------------------------------- /r8lib/r8_to_dhms.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_to_dhms ( r ): 4 | 5 | %*****************************************************************************80 6 | % 7 | %% R8_TO_DHMS converts decimal days into days, hours, minutes, seconds. 8 | % 9 | % Licensing: 10 | % 11 | % This code is distributed under the GNU LGPL license. 12 | % 13 | % Modified: 14 | % 15 | % 04 June 2013 16 | % 17 | % Author: 18 | % 19 | % John Burkardt 20 | % 21 | % Parameters: 22 | % 23 | % Input, real R, a decimal number representing a time 24 | % period measured in days. 25 | % 26 | % Output, integer D, H, M, S, the equivalent number of days, hours, 27 | % minutes and seconds. 28 | % 29 | from r8_sign import r8_sign 30 | 31 | r_sign = r8_sign ( r ) 32 | r = abs ( r ) 33 | 34 | d = int ( r ) 35 | 36 | r = r - d 37 | r = 24.0 * r 38 | h = int ( r ) 39 | 40 | r = r - h 41 | r = 60.0 * r 42 | m = int ( r ) 43 | 44 | r = r - m 45 | r = 60.0 * r 46 | s = int ( r ) 47 | 48 | d = r_sign * d 49 | h = r_sign * h 50 | m = r_sign * m 51 | s = r_sign * s 52 | 53 | return d, h, m, s 54 | 55 | -------------------------------------------------------------------------------- /rnglib/initialized_memory.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def initialized_memory ( i, initialized ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## INITIALIZED_MEMORY stores the INITIALIZED value. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the desired action. 24 | # -1, get a value. 25 | # 0, initialize all values. 26 | # 1, set a value. 27 | # 28 | # Input/output, bool INITIALIZED. For I = -1, an output quantity, 29 | # if I = +1, an input quantity, and if I = 0 the value is ignored. 30 | # 31 | if ( i < 0 ): 32 | initialized = initialized_memory.initialized_save 33 | elif ( i == 0 ): 34 | initialized_memory.initialized_save = False 35 | initialized = False 36 | elif ( 0 < i ): 37 | initialized_memory.initialized_save = initialized 38 | 39 | return initialized 40 | 41 | initialized_memory.initialized_save = False 42 | 43 | -------------------------------------------------------------------------------- /pyramid_grid/pyramid_grid_points.xyz: -------------------------------------------------------------------------------- 1 | 0 0 1 2 | -0.25 -0.25 0.75 3 | 0.25 -0.25 0.75 4 | -0.25 0.25 0.75 5 | 0.25 0.25 0.75 6 | -0.5 -0.5 0.5 7 | 0 -0.5 0.5 8 | 0.5 -0.5 0.5 9 | -0.5 0 0.5 10 | 0 0 0.5 11 | 0.5 0 0.5 12 | -0.5 0.5 0.5 13 | 0 0.5 0.5 14 | 0.5 0.5 0.5 15 | -0.75 -0.75 0.25 16 | -0.25 -0.75 0.25 17 | 0.25 -0.75 0.25 18 | 0.75 -0.75 0.25 19 | -0.75 -0.25 0.25 20 | -0.25 -0.25 0.25 21 | 0.25 -0.25 0.25 22 | 0.75 -0.25 0.25 23 | -0.75 0.25 0.25 24 | -0.25 0.25 0.25 25 | 0.25 0.25 0.25 26 | 0.75 0.25 0.25 27 | -0.75 0.75 0.25 28 | -0.25 0.75 0.25 29 | 0.25 0.75 0.25 30 | 0.75 0.75 0.25 31 | -1 -1 0 32 | -0.5 -1 0 33 | 0 -1 0 34 | 0.5 -1 0 35 | 1 -1 0 36 | -1 -0.5 0 37 | -0.5 -0.5 0 38 | 0 -0.5 0 39 | 0.5 -0.5 0 40 | 1 -0.5 0 41 | -1 0 0 42 | -0.5 0 0 43 | 0 0 0 44 | 0.5 0 0 45 | 1 0 0 46 | -1 0.5 0 47 | -0.5 0.5 0 48 | 0 0.5 0 49 | 0.5 0.5 0 50 | 1 0.5 0 51 | -1 1 0 52 | -0.5 1 0 53 | 0 1 0 54 | 0.5 1 0 55 | 1 1 0 56 | -------------------------------------------------------------------------------- /wathen/st_to_ge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def st_to_ge ( n_st, row, col, a_st ): 4 | 5 | %*****************************************************************************80 6 | % 7 | %% ST_TO_GE converts a sparse tripet (ST) matrix to general (GE) storage. 8 | % 9 | % Licensing: 10 | % 11 | % This code is distributed under the GNU LGPL license. 12 | % 13 | % Modified: 14 | % 15 | % 01 June 2014 16 | % 17 | % Author: 18 | % 19 | % John Burkardt 20 | % 21 | % Parameters: 22 | % 23 | % Input, integer N_ST, the number of sparse triplet values. 24 | % 25 | % Input, integer ROW(N_ST), COL(N_ST), the row and column indices. 26 | % 27 | % Input, real A_ST(N_ST), the nonzero matrix values. 28 | % 29 | % Output, real A_GE(M,N), the corresponding full storage matrix. 30 | % 31 | import numpy as np 32 | % 33 | % Guess the number of rows and columns. 34 | % 35 | m = max ( row ) + 1 36 | n = max ( col ) + 1 37 | % 38 | % Set up the GE matrix. 39 | % 40 | a_ge = np.zeros ( ( m, n ) ) 41 | % 42 | % Copy the data as a vector. 43 | % 44 | for k in range ( 0, n_st ): 45 | a_ge[row[k],col[k]] = a_st[k] 46 | 47 | return a_ge 48 | 49 | -------------------------------------------------------------------------------- /sort_rc/sort_rc_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def sort_rc_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## SORT_RC_TEST tests the SORT_RC library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 11 March 2015 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from i4vec_print import i4vec_print_test 22 | from i4vec_uniform_ab import i4vec_uniform_ab_test 23 | from sort_safe_rc import sort_safe_rc_i4vec_test 24 | from timestamp import timestamp_test 25 | 26 | print '' 27 | print 'SORT_RC_TEST' 28 | print ' Python version:' 29 | print ' Test the SORT_RC library.' 30 | 31 | i4vec_print_test ( ) 32 | i4vec_uniform_ab_test ( ) 33 | sort_safe_rc_i4vec_test ( ) 34 | timestamp_test ( ) 35 | # 36 | # Terminate. 37 | # 38 | print '' 39 | print 'SORT_RC_TEST:' 40 | print ' Normal end of execution.' 41 | 42 | if ( __name__ == '__main__' ): 43 | from timestamp import timestamp 44 | timestamp ( ) 45 | sort_rc_test ( ) 46 | timestamp ( ) 47 | -------------------------------------------------------------------------------- /wathen/wathen_st_size.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def wathen_st_size ( nx, ny ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## WATHEN_ST_SIZE: Size of Wathen matrix stored in sparse triplet format. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 31 August 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt. 20 | # 21 | # Reference: 22 | # 23 | # Nicholas Higham, 24 | # Algorithm 694: A Collection of Test Matrices in MATLAB, 25 | # ACM Transactions on Mathematical Software, 26 | # Volume 17, Number 3, September 1991, pages 289-305. 27 | # 28 | # Andrew Wathen, 29 | # Realistic eigenvalue bounds for the Galerkin mass matrix, 30 | # IMA Journal of Numerical Analysis, 31 | # Volume 7, Number 4, October 1987, pages 449-457. 32 | # 33 | # Parameters: 34 | # 35 | # Input, integer NX, NY, values which determine the size of the matrix. 36 | # 37 | # Output, integer NZ_NUM, the number of items of data used to describe 38 | # the matrix. 39 | # 40 | nz_num = nx * ny * 64 41 | 42 | return nz_num 43 | 44 | -------------------------------------------------------------------------------- /r4lib/r4lib_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r4lib_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R4LIB_TEST tests the R4LIB library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 25 December 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | 22 | from r4mat_print import r4mat_print_test 23 | from r4mat_print_some import r4mat_print_some_test 24 | 25 | from r4vec_print import r4vec_print_test 26 | 27 | from timestamp import timestamp_test 28 | 29 | print '' 30 | print 'R4LIB_TEST' 31 | print ' Python version:' 32 | print ' Test the R4LIB library.' 33 | 34 | r4mat_print_test ( ) 35 | r4mat_print_some_test ( ) 36 | 37 | r4vec_print_test ( ) 38 | 39 | timestamp_test ( ) 40 | # 41 | # Terminate. 42 | # 43 | print '' 44 | print 'R4LIB_TEST:' 45 | print ' Normal end of execution.' 46 | 47 | if ( __name__ == '__main__' ): 48 | from timestamp import timestamp 49 | timestamp ( ) 50 | r4lib_test ( ) 51 | timestamp ( ) 52 | -------------------------------------------------------------------------------- /polynomial/perm_check0.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def perm_check0 ( n, p ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## PERM_CHECK0 checks a 0-based permutation. 8 | # 9 | # Discussion: 10 | # 11 | # The routine verifies that each of the integers from 0 to 12 | # to N-1 occurs among the N entries of the permutation. 13 | # 14 | # Licensing: 15 | # 16 | # This code is distributed under the GNU LGPL license. 17 | # 18 | # Modified: 19 | # 20 | # 25 October 2014 21 | # 22 | # Author: 23 | # 24 | # John Burkardt 25 | # 26 | # Parameters: 27 | # 28 | # Input, integer N, the number of entries. 29 | # 30 | # Input, integer P(N), the array to check. 31 | # 32 | from sys import exit 33 | 34 | for value in range ( 0, n ): 35 | 36 | ierror = 1 37 | 38 | for location in range ( 0, n ): 39 | if ( p[location] == value ): 40 | ierror = 0 41 | break 42 | 43 | if ( ierror != 0 ): 44 | print '' 45 | print 'PERM_CHECK0 - Fatal error!' 46 | print ' Permutation is missing the value %d.' % ( value ) 47 | exit ( 'PERM_CHECK0 - Fatal error!' ) 48 | 49 | return 50 | 51 | -------------------------------------------------------------------------------- /legendre_product_polynomial/perm_check0.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def perm_check0 ( n, p ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## PERM_CHECK0 checks a 0-based permutation. 8 | # 9 | # Discussion: 10 | # 11 | # The routine verifies that each of the integers from 0 to 12 | # to N-1 occurs among the N entries of the permutation. 13 | # 14 | # Licensing: 15 | # 16 | # This code is distributed under the GNU LGPL license. 17 | # 18 | # Modified: 19 | # 20 | # 25 October 2014 21 | # 22 | # Author: 23 | # 24 | # John Burkardt 25 | # 26 | # Parameters: 27 | # 28 | # Input, integer N, the number of entries. 29 | # 30 | # Input, integer P(N), the array to check. 31 | # 32 | from sys import exit 33 | 34 | for value in range ( 0, n ): 35 | 36 | ierror = 1 37 | 38 | for location in range ( 0, n ): 39 | if ( p[location] == value ): 40 | ierror = 0 41 | break 42 | 43 | if ( ierror != 0 ): 44 | print '' 45 | print 'PERM_CHECK0 - Fatal error!' 46 | print ' Permutation is missing the value %d.' % ( value ) 47 | exit ( 'PERM_CHECK0 - Fatal error!' ) 48 | 49 | return 50 | 51 | -------------------------------------------------------------------------------- /wathen/wathen_order.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def wathen_order ( nx, ny ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## WATHEN_ORDER returns the order of the WATHEN matrix. 8 | # 9 | # Discussion: 10 | # 11 | # N = 3 * 3 * 2 + 2 * 2 + 2 * 3 + 1 = 29 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 31 August 2014 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | # Reference: 26 | # 27 | # Nicholas Higham, 28 | # Algorithm 694: A Collection of Test Matrices in MATLAB, 29 | # ACM Transactions on Mathematical Software, 30 | # Volume 17, Number 3, September 1991, pages 289-305. 31 | # 32 | # Andrew Wathen, 33 | # Realistic eigenvalue bounds for the Galerkin mass matrix, 34 | # IMA Journal of Numerical Analysis, 35 | # Volume 7, 1987, pages 449-457. 36 | # 37 | # Parameters: 38 | # 39 | # Input, integer NX, NY, values which determine the size of A. 40 | # 41 | # Output, integer N, the order of the matrix, 42 | # as determined by NX and NY. 43 | # 44 | n = 3 * nx * ny + 2 * nx + 2 * ny + 1 45 | 46 | return n 47 | 48 | -------------------------------------------------------------------------------- /polygon_grid/ell.xy: -------------------------------------------------------------------------------- 1 | 1 1 2 | 0.8 0.8 3 | 0.6 0.6 4 | 0.4 0.4 5 | 0.2 0.2 6 | 0 0 7 | 0.6 0.6 8 | 0.4 0.4 9 | 0.2 0.2 10 | 0 0 11 | 0.4 0.4 12 | 0.2 0.2 13 | 0 0 14 | 0.2 0.2 15 | 0 0 16 | 0 0 17 | 1.2 0.8 18 | 1.4 0.6 19 | 1.6 0.4 20 | 1.8 0.2 21 | 2 0 22 | 1.4 0.6 23 | 1.6 0.4 24 | 1.8 0.2 25 | 2 0 26 | 1.6 0.4 27 | 1.8 0.2 28 | 2 0 29 | 1.8 0.2 30 | 2 0 31 | 2 0 32 | 1.2 1 33 | 1.4 1 34 | 1.6 1 35 | 1.8 1 36 | 2 1 37 | 1.4 1 38 | 1.6 1 39 | 1.8 1 40 | 2 1 41 | 1.6 1 42 | 1.8 1 43 | 2 1 44 | 1.8 1 45 | 2 1 46 | 2 1 47 | 1 1 48 | 1 1 49 | 1 1 50 | 1 1 51 | 1 1 52 | 1 1 53 | 1 1 54 | 1 1 55 | 1 1 56 | 1 1 57 | 1 1 58 | 1 1 59 | 1 1 60 | 1 1 61 | 1 1 62 | 1 1.2 63 | 1 1.4 64 | 1 1.6 65 | 1 1.8 66 | 1 2 67 | 1 1.4 68 | 1 1.6 69 | 1 1.8 70 | 1 2 71 | 1 1.6 72 | 1 1.8 73 | 1 2 74 | 1 1.8 75 | 1 2 76 | 1 2 77 | 0.8 1.2 78 | 0.6 1.4 79 | 0.4 1.6 80 | 0.2 1.8 81 | 0 2 82 | 0.6 1.4 83 | 0.4 1.6 84 | 0.2 1.8 85 | 0 2 86 | 0.4 1.6 87 | 0.2 1.8 88 | 0 2 89 | 0.2 1.8 90 | 0 2 91 | 0 2 92 | -------------------------------------------------------------------------------- /rnglib/rnglib_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def rnglib_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## MAIN is the main program for RNGLIB_TEST. 8 | # 9 | # Discussion: 10 | # 11 | # RNGLIB_TEST calls sample problems for the RNGLIB library. 12 | # 13 | # Licensing: 14 | # 15 | # This code is distributed under the GNU LGPL license. 16 | # 17 | # Modified: 18 | # 19 | # 27 May 2013 20 | # 21 | # Author: 22 | # 23 | # John Burkardt 24 | # 25 | from timestamp import timestamp 26 | from rnglib_test01 import rnglib_test01 27 | from rnglib_test02 import rnglib_test02 28 | from rnglib_test03 import rnglib_test03 29 | from rnglib_test04 import rnglib_test04 30 | 31 | timestamp ( ) 32 | 33 | print '' 34 | print 'RNGLIB_TEST' 35 | print ' PYTHON version' 36 | print ' Test the RNGLIB library.' 37 | # 38 | # Call tests. 39 | # 40 | rnglib_test01 ( ) 41 | rnglib_test02 ( ) 42 | rnglib_test03 ( ) 43 | rnglib_test04 ( ) 44 | # 45 | # Terminate. 46 | # 47 | print '' 48 | print 'RNGLIB_TEST' 49 | print ' Normal end of execution.' 50 | print '' 51 | timestamp ( ) 52 | 53 | if ( __name__ == '__main__' ): 54 | rnglib_test ( ) 55 | -------------------------------------------------------------------------------- /fd1d_heat_implicit/fd1d_heat_implicit_test.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # 3 | def fd1d_heat_implicit_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## FD1D_HEAT_IMPLICIT_TEST tests the FD1D_HEAT_IMPLICIT library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 17 November 2014 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from fd1d_heat_implicit_test01 import fd1d_heat_implicit_test01 22 | from fd1d_heat_implicit_test02 import fd1d_heat_implicit_test02 23 | from fd1d_heat_implicit_test03 import fd1d_heat_implicit_test03 24 | 25 | print '' 26 | print 'FD1D_HEAT_IMPLICIT_TEST:' 27 | print ' Python version.' 28 | print ' Test the FD1D_HEAT_IMPLICIT library.' 29 | 30 | fd1d_heat_implicit_test01 ( ) 31 | fd1d_heat_implicit_test02 ( ) 32 | fd1d_heat_implicit_test03 ( ) 33 | # 34 | # Terminate. 35 | # 36 | print '' 37 | print 'FD1D_HEAT_IMPLICIT_TEST:' 38 | print ' Normal end of execution.' 39 | 40 | return 41 | 42 | if ( __name__ == '__main__' ): 43 | from timestamp import timestamp 44 | timestamp ( ) 45 | fd1d_heat_implicit_test ( ) 46 | timestamp ( ) 47 | -------------------------------------------------------------------------------- /r8lib/r8_fraction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_fraction ( i, j ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_FRACTION uses real arithmetic on an integer ratio. 8 | # 9 | # Discussion: 10 | # 11 | # Given integer variables I and J, both FORTRAN and C will evaluate 12 | # an expression such as "I/J" using what is called "integer division", 13 | # with the result being an integer. It is often convenient to express 14 | # the parts of a fraction as integers but expect the result to be computed 15 | # using real arithmetic. This function carries out that operation. 16 | # 17 | # Example: 18 | # 19 | # I J I/J R8_FRACTION 20 | # 21 | # 1 2 0 0.5 22 | # 7 4 1 1.75 23 | # 8 4 2 2.00 24 | # 9 4 2 2.25 25 | # 26 | # Licensing: 27 | # 28 | # This code is distributed under the GNU LGPL license. 29 | # 30 | # Modified: 31 | # 32 | # 24 July 2014 33 | # 34 | # Author: 35 | # 36 | # John Burkardt 37 | # 38 | # Parameters: 39 | # 40 | # Input, integer I, J, the arguments. 41 | # 42 | # Output, real R8_FRACTION, the value of the ratio. 43 | # 44 | value = i / j 45 | 46 | return value 47 | 48 | -------------------------------------------------------------------------------- /r8lib/r8_round_i4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def r8_round_i4 ( x ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## R8_ROUND_I4 rounds an R8 to the nearest integral value, returning an I4. 8 | # 9 | # Discussion: 10 | # 11 | # In MATLAB, it is essentially true that there is little difference between 12 | # this function and R8_ROUND, because we store our integers in what amounts 13 | # to a real variable. 14 | # 15 | # Example: 16 | # 17 | # X R8_ROUND_I4 18 | # 19 | # 1.3 1 20 | # 1.4 1 21 | # 1.5 1 or 2 22 | # 1.6 2 23 | # 0.0 0 24 | # -0.7 -1 25 | # -1.1 -1 26 | # -1.6 -2 27 | # 28 | # Licensing: 29 | # 30 | # This code is distributed under the GNU LGPL license. 31 | # 32 | # Modified: 33 | # 34 | # 25 July 2014 35 | # 36 | # Author: 37 | # 38 | # John Burkardt 39 | # 40 | # Parameters: 41 | # 42 | # Input, real X, the value. 43 | # 44 | # Output, integer R8_ROUND_I4, the rounded value. 45 | # 46 | from math import floor 47 | 48 | if ( x < 0.0 ): 49 | value = - floor ( - x + 0.5 ) 50 | else: 51 | value = floor ( + x + 0.5 ) 52 | 53 | return value 54 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_brent_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_BRENT_TEST tests the CYCLE_BRENT library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cycle_brent_test01 import cycle_brent_test01 22 | from cycle_brent_test02 import cycle_brent_test02 23 | from cycle_brent_test03 import cycle_brent_test03 24 | from cycle_brent_test04 import cycle_brent_test04 25 | from cycle_brent_test05 import cycle_brent_test05 26 | 27 | print 'CYCLE_BRENT_TEST' 28 | print ' Python version' 29 | print ' Test the CYCLE_BRENT library.' 30 | 31 | cycle_brent_test01 ( ) 32 | cycle_brent_test02 ( ) 33 | cycle_brent_test03 ( ) 34 | cycle_brent_test04 ( ) 35 | cycle_brent_test05 ( ) 36 | # 37 | # Terminate. 38 | # 39 | print 40 | print 'CYCLE_BRENT_TEST' 41 | print ' Normal end of execution.' 42 | 43 | return 44 | 45 | if ( __name__ == '__main__' ): 46 | from timestamp import timestamp 47 | timestamp ( ) 48 | cycle_brent_test ( ) 49 | timestamp ( ) 50 | -------------------------------------------------------------------------------- /rnglib/cgn_memory.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cgn_memory ( i, g ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CGN_MEMORY stores the current generator index. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 27 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Input, integer I, the desired action. 24 | # -1, get the value. 25 | # 0, initialize the value. 26 | # 1, set the value. 27 | # 28 | # Input/output, integer G. For I = -1 or 0, an output quantity. 29 | # For I = +1, an input quantity. 30 | # 31 | from sys import exit 32 | 33 | g_max = 32 34 | 35 | if ( i < 0 ): 36 | 37 | g = cgn_memory.g_save 38 | 39 | elif ( i == 0 ): 40 | 41 | cgn_memory.g_save = 1 42 | g = cgn_memory.g_save 43 | 44 | elif ( 0 < i ): 45 | 46 | if ( g < 1 or g_max < g ): 47 | print '' 48 | print 'CGN_MEMORY - Fatal error!' 49 | print ' Input generator index G is out of bounds.' 50 | exit ( 'CGN_MEMORY - Fatal error!' ) 51 | 52 | cgn_memory.g_save = g 53 | 54 | 55 | return g 56 | 57 | cgn_memory.g_save = 1 58 | 59 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test05.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/env python 2 | 3 | def cycle_brent_test05 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_BRENT_TEST05 tests CYCLE_BRENT for F5. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from f5 import f5 22 | from cycle_brent import cycle_brent 23 | 24 | print 25 | print 'CYCLE_BRENT_TEST05' 26 | print ' Test CYCLE_BRENT for F5().' 27 | print ' f5(i) = mod ( 16383 * i + 1, 65536 ).' 28 | 29 | x0 = 1 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_brent ( f5, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 8' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 0' 41 | 42 | i = 0 43 | x0 = 1 44 | print 45 | print ' %d %d' % ( i, x0 ) 46 | for i in range ( 1, 11 ): 47 | x0 = f5 ( x0 ) 48 | print ' %d %d' % ( i, x0 ) 49 | 50 | return 51 | 52 | if ( __name__ == '__main__' ) : 53 | cycle_brent_test05 ( ) 54 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test05.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/env python 2 | 3 | def cycle_floyd_test05 ( ) : 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_FLOYD_TEST05 tests CYCLE_FLOYD for F5. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from f5 import f5 22 | from cycle_floyd import cycle_floyd 23 | 24 | print 25 | print 'CYCLE_FLOYD_TEST05' 26 | print ' Test CYCLE_FLOYD for F5().' 27 | print ' f5(i) = mod ( 16383 * i + 1, 65536 ).' 28 | 29 | x0 = 1 30 | print 31 | print ' Starting argument X0 = %d' % ( x0 ) 32 | 33 | [ lam, mu ] = cycle_floyd ( f5, x0 ) 34 | 35 | print 36 | print ' Reported cycle length is %d' % ( lam ) 37 | print ' Expected value is 8' 38 | print 39 | print ' Reported distance to first cycle element is %d' % ( mu ) 40 | print ' Expected value is 0' 41 | 42 | i = 0 43 | x0 = 1 44 | print 45 | print ' %d %d' % ( i, x0 ) 46 | for i in range ( 1, 11 ): 47 | x0 = f5 ( x0 ) 48 | print ' %d %d' % ( i, x0 ) 49 | 50 | return 51 | 52 | if ( __name__ == '__main__' ) : 53 | cycle_floyd_test05 ( ) 54 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | def cycle_floyd_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_FLOYD_TEST tests the CYCLE_FLOYD library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cycle_floyd_test01 import cycle_floyd_test01 22 | from cycle_floyd_test02 import cycle_floyd_test02 23 | from cycle_floyd_test03 import cycle_floyd_test03 24 | from cycle_floyd_test04 import cycle_floyd_test04 25 | from cycle_floyd_test05 import cycle_floyd_test05 26 | 27 | print '' 28 | print 'CYCLE_FLOYD_TEST' 29 | print ' MATLAB version' 30 | print ' Test the CYCLE_FLOYD library.' 31 | 32 | cycle_floyd_test01 ( ) 33 | cycle_floyd_test02 ( ) 34 | cycle_floyd_test03 ( ) 35 | cycle_floyd_test04 ( ) 36 | cycle_floyd_test05 ( ) 37 | # 38 | # Terminate. 39 | # 40 | print '' 41 | print 'CYCLE_FLOYD_TEST' 42 | print ' Normal end of execution.' 43 | 44 | return 45 | 46 | if ( __name__ == '__main__' ): 47 | from timestamp import timestamp 48 | timestamp ( ) 49 | cycle_floyd_test ( ) 50 | timestamp ( ) 51 | 52 | -------------------------------------------------------------------------------- /cycle_brent/cycle_brent_test01.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_brent_test01 ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_BRENT_TEST01 tests CYCLE_BRENT for a tiny example. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cycle_brent import cycle_brent 22 | from f1 import f1 23 | 24 | print 25 | print 'CYCLE_BRENT_TEST01' 26 | print ' Test CYCLE_BRENT on F1().' 27 | print ' f1(0) = 6.' 28 | print ' f1(1) = 6.' 29 | print ' f1(2) = 0.' 30 | print ' f1(3) = 1.' 31 | print ' f1(4) = 4.' 32 | print ' f1(5) = 3.' 33 | print ' f1(6) = 3.' 34 | print ' f1(7) = 4.' 35 | print ' f1(8) = 0.' 36 | 37 | x0 = 2; 38 | print 39 | print ' Starting argument X0 = %d' % ( x0 ) 40 | 41 | [ lam, mu ] = cycle_brent ( f1, x0 ) 42 | 43 | print 44 | print ' Reported cycle length is %d' % ( lam ) 45 | print ' Expected value is 3' 46 | print 47 | print ' Reported distance to first cycle element is %d' % ( mu ) 48 | print ' Expected value is 2' 49 | 50 | return 51 | 52 | if ( __name__ == '__main__' ): 53 | cycle_brent_test01 ( ) 54 | -------------------------------------------------------------------------------- /cycle_floyd/cycle_floyd_test01.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def cycle_floyd_test01 ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## CYCLE_FLOYD_TEST01 tests CYCLE_FLOYD for a tiny example. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 13 May 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from cycle_floyd import cycle_floyd 22 | from f1 import f1 23 | 24 | print 25 | print 'CYCLE_FLOYD_TEST01' 26 | print ' Test CYCLE_FLOYD on F1().' 27 | print ' f1(0) = 6.' 28 | print ' f1(1) = 6.' 29 | print ' f1(2) = 0.' 30 | print ' f1(3) = 1.' 31 | print ' f1(4) = 4.' 32 | print ' f1(5) = 3.' 33 | print ' f1(6) = 3.' 34 | print ' f1(7) = 4.' 35 | print ' f1(8) = 0.' 36 | 37 | x0 = 2; 38 | print 39 | print ' Starting argument X0 = %d' % ( x0 ) 40 | 41 | [ lam, mu ] = cycle_floyd ( f1, x0 ) 42 | 43 | print 44 | print ' Reported cycle length is %d' % ( lam ) 45 | print ' Expected value is 3' 46 | print 47 | print ' Reported distance to first cycle element is %d' % ( mu ) 48 | print ' Expected value is 2' 49 | 50 | return 51 | 52 | if ( __name__ == '__main__' ): 53 | cycle_floyd_test01 ( ) 54 | -------------------------------------------------------------------------------- /fem1d_classes/fem1d_classes_test_output.txt: -------------------------------------------------------------------------------- 1 | 2 | Test01 3 | Solve -u''=rhs on [0,1] using 10 elements. 4 | 5 | I X U(exact) U(comp) 6 | 7 | 0 0.0000 0 3.14796e-15 8 | 1 0.0500 0.0499354 0.0499357 9 | 2 0.1000 0.0994654 0.0994652 10 | 3 0.1500 0.148134 0.148134 11 | 4 0.2000 0.195424 0.195424 12 | 5 0.2500 0.240755 0.240755 13 | 6 0.3000 0.28347 0.28347 14 | 7 0.3500 0.322838 0.322838 15 | 8 0.4000 0.358038 0.358037 16 | 9 0.4500 0.388157 0.388158 17 | 10 0.5000 0.41218 0.41218 18 | 11 0.5500 0.42898 0.428981 19 | 12 0.6000 0.437309 0.437308 20 | 13 0.6500 0.435786 0.435786 21 | 14 0.7000 0.422888 0.422887 22 | 15 0.7500 0.396938 0.396938 23 | 16 0.8000 0.356087 0.356086 24 | 17 0.8500 0.298305 0.298306 25 | 18 0.9000 0.221364 0.221364 26 | 19 0.9500 0.122821 0.122823 27 | 20 1.0000 0 0 28 | 29 | Relative error = 2.28172709982e-06 30 | -------------------------------------------------------------------------------- /uniform/i4_huge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def i4_huge ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## I4_HUGE returns a "huge" I4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 04 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, integer VALUE, a huge integer. 24 | # 25 | value = 2147483647 26 | 27 | return value; 28 | 29 | def i4_huge_test ( ) : 30 | 31 | #*****************************************************************************80 32 | # 33 | ## I4_HUGE_TEST tests I4_HUGE. 34 | # 35 | # Licensing: 36 | # 37 | # This code is distributed under the GNU LGPL license. 38 | # 39 | # Modified: 40 | # 41 | # 09 May 2013 42 | # 43 | # Author: 44 | # 45 | # John Burkardt 46 | # 47 | print '' 48 | print 'I4_HUGE_TEST' 49 | print ' I4_HUGE returns a huge integer.' 50 | print '' 51 | i = i4_huge ( ) 52 | print ' I4_HUGE() = %d' % ( i ) 53 | 54 | print '' 55 | print 'I4_HUGE_TEST' 56 | print ' Normal end of execution.' 57 | 58 | return 59 | 60 | if ( __name__ == '__main__' ): 61 | from timestamp import timestamp 62 | timestamp ( ) 63 | i4_huge_test ( ) 64 | timestamp ( ) 65 | 66 | -------------------------------------------------------------------------------- /line_grid/line_grid_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def line_grid_test ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## LINE_GRID_TEST tests the LINE_GRID library. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 24 April 2015 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | from line_grid import line_grid_test01 22 | from line_grid import line_grid_test02 23 | from line_grid import line_grid_test03 24 | from r8vec_print import r8vec_print_test 25 | from timestamp import timestamp_test 26 | 27 | print '' 28 | print 'LINE_GRID_TEST' 29 | print ' Python version:' 30 | print ' Test the LINE_GRID library.' 31 | # 32 | # Utilities: 33 | # 34 | r8vec_print_test ( ) 35 | timestamp_test ( ) 36 | # 37 | # Library. 38 | # 39 | line_grid_test01 ( ) 40 | line_grid_test02 ( ) 41 | line_grid_test03 ( ) 42 | # 43 | # Terminate. 44 | # 45 | print '' 46 | print 'LINE_GRID_TEST:' 47 | print ' Normal end of execution.' 48 | 49 | if ( __name__ == '__main__' ): 50 | from timestamp import timestamp 51 | timestamp ( ) 52 | line_grid_test ( ) 53 | timestamp ( ) 54 | -------------------------------------------------------------------------------- /fd1d_heat_explicit/fd1d_heat_explicit_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #*****************************************************************************80 4 | 5 | def fd1d_heat_explicit_test ( ): 6 | 7 | #*****************************************************************************80 8 | # 9 | ## FD1D_HEAT_EXPLICIT_TEST tests the FD1D_HEAT_EXPLICIT library. 10 | # 11 | # Licensing: 12 | # 13 | # This code is distributed under the GNU LGPL license. 14 | # 15 | # Modified: 16 | # 17 | # 06 November 2014 18 | # 19 | # Author: 20 | # 21 | # John Burkardt 22 | # 23 | from fd1d_heat_explicit_test01 import fd1d_heat_explicit_test01 24 | from fd1d_heat_explicit_test02 import fd1d_heat_explicit_test02 25 | from fd1d_heat_explicit_test03 import fd1d_heat_explicit_test03 26 | 27 | print '' 28 | print 'FD1D_HEAT_EXPLICIT_TEST:' 29 | print ' Python version.' 30 | print ' Test the FD1D_HEAT_EXPLICIT library.' 31 | 32 | fd1d_heat_explicit_test01 ( ) 33 | fd1d_heat_explicit_test02 ( ) 34 | fd1d_heat_explicit_test03 ( ) 35 | # 36 | # Terminate. 37 | # 38 | print '' 39 | print 'FD1D_HEAT_EXPLICIT_TEST:' 40 | print ' Normal end of execution.' 41 | 42 | return 43 | 44 | if ( __name__ == '__main__' ): 45 | from timestamp import timestamp 46 | timestamp ( ) 47 | fd1d_heat_explicit_test ( ) 48 | timestamp ( ) 49 | 50 | -------------------------------------------------------------------------------- /fem1d_heat_explicit/fem1d_heat_explicit_test_output.txt: -------------------------------------------------------------------------------- 1 | Mon Nov 17 11:29:32 2014 2 | 3 | FEM1D_HEAT_EXPLICIT_TEST 4 | Python version. 5 | Test the FEM1D_HEAT_EXPLICIT library. 6 | 7 | FEM1D_HEAT_EXPLICIT_TEST01: 8 | The time dependent 1D heat equation is 9 | 10 | Ut - k * Uxx = f(x,t) 11 | 12 | for space interval A <= X <= B with boundary conditions 13 | 14 | U(A,t) = UA(t) 15 | U(B,t) = UB(t) 16 | 17 | and time interval T0 <= T <= T1 with initial condition 18 | 19 | U(X,T0) = U0(X). 20 | 21 | To compute an approximate solution: 22 | the interval [A,B] is replace by a discretized mesh Xi 23 | a set of finite element functions PSI(X) are determined, 24 | the solution U is written as a weighted sum of the basis functions, 25 | the weak form of the differential equation is written, 26 | a time grid Tj is imposed, and time derivatives replaced by 27 | an explicit forward Euler first difference, 28 | 29 | The continuous PDE has now been transformed into a set of algebraic 30 | equations for the coefficients C(Xi,Tj). 31 | 32 | Number of X nodes = 21 33 | X interval = [ 0.000000, 1.000000 ] 34 | X step size = 0.050000 35 | Number of T steps = 401 36 | T interval = [ 0.000000, 80.000000 ] 37 | T step size = 0.200000 38 | Number of elements = 20 39 | Number of quadrature points = 3 40 | -------------------------------------------------------------------------------- /i4lib/i4_huge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def i4_huge ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## I4_HUGE returns a "huge" I4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 04 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, integer VALUE, a huge integer. 24 | # 25 | value = 2147483647 26 | 27 | return value; 28 | 29 | def i4_huge_test ( ) : 30 | 31 | #*****************************************************************************80 32 | # 33 | ## I4_HUGE_TEST tests I4_HUGE. 34 | # 35 | # Licensing: 36 | # 37 | # This code is distributed under the GNU LGPL license. 38 | # 39 | # Modified: 40 | # 41 | # 09 May 2013 42 | # 43 | # Author: 44 | # 45 | # John Burkardt 46 | # 47 | print '' 48 | print 'I4_HUGE_TEST' 49 | print ' I4_HUGE returns a huge integer.' 50 | print '' 51 | i = i4_huge ( ) 52 | print ' I4_HUGE() = %d' % ( i ) 53 | # 54 | # Terminate. 55 | # 56 | print '' 57 | print 'I4_HUGE_TEST' 58 | print ' Normal end of execution.' 59 | 60 | return 61 | 62 | if ( __name__ == '__main__' ): 63 | from timestamp import timestamp 64 | timestamp ( ) 65 | i4_huge_test ( ) 66 | timestamp ( ) 67 | 68 | -------------------------------------------------------------------------------- /normal/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /r8lib/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /subset/i4_huge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def i4_huge ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## I4_HUGE returns a "huge" I4. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 04 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # Output, integer VALUE, a huge integer. 24 | # 25 | value = 2147483647 26 | 27 | return value; 28 | 29 | def i4_huge_test ( ) : 30 | 31 | #*****************************************************************************80 32 | # 33 | ## I4_HUGE_TEST tests I4_HUGE. 34 | # 35 | # Licensing: 36 | # 37 | # This code is distributed under the GNU LGPL license. 38 | # 39 | # Modified: 40 | # 41 | # 09 May 2013 42 | # 43 | # Author: 44 | # 45 | # John Burkardt 46 | # 47 | print '' 48 | print 'I4_HUGE_TEST' 49 | print ' I4_HUGE returns a huge integer.' 50 | print '' 51 | i = i4_huge ( ) 52 | print ' I4_HUGE() = %d' % ( i ) 53 | # 54 | # Terminate. 55 | # 56 | print '' 57 | print 'I4_HUGE_TEST' 58 | print ' Normal end of execution.' 59 | 60 | return 61 | 62 | if ( __name__ == '__main__' ): 63 | from timestamp import timestamp 64 | timestamp ( ) 65 | i4_huge_test ( ) 66 | timestamp ( ) 67 | 68 | -------------------------------------------------------------------------------- /ball_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /bvec/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | 67 | if ( __name__ == '__main__' ): 68 | timestamp_test ( ) 69 | 70 | -------------------------------------------------------------------------------- /c4lib/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | 67 | if ( __name__ == '__main__' ): 68 | timestamp_test ( ) 69 | 70 | -------------------------------------------------------------------------------- /c8lib/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | 67 | if ( __name__ == '__main__' ): 68 | timestamp_test ( ) 69 | 70 | -------------------------------------------------------------------------------- /cube_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /disk_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /ellipse_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /filum/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | 67 | if ( __name__ == '__main__' ): 68 | timestamp_test ( ) 69 | 70 | -------------------------------------------------------------------------------- /i4lib/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | 67 | if ( __name__ == '__main__' ): 68 | timestamp_test ( ) 69 | 70 | -------------------------------------------------------------------------------- /line_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /polpak/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | 67 | if ( __name__ == '__main__' ): 68 | timestamp_test ( ) 69 | 70 | -------------------------------------------------------------------------------- /polygon_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /pyramid_grid/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | -------------------------------------------------------------------------------- /quadrule/timestamp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def timestamp ( ): 4 | 5 | #*****************************************************************************80 6 | # 7 | ## TIMESTAMP prints the date as a timestamp. 8 | # 9 | # Licensing: 10 | # 11 | # This code is distributed under the GNU LGPL license. 12 | # 13 | # Modified: 14 | # 15 | # 06 April 2013 16 | # 17 | # Author: 18 | # 19 | # John Burkardt 20 | # 21 | # Parameters: 22 | # 23 | # None 24 | # 25 | import time 26 | 27 | t = time.time ( ) 28 | print time.ctime ( t ) 29 | 30 | return None 31 | 32 | def timestamp_test ( ): 33 | 34 | #*****************************************************************************80 35 | # 36 | ## TIMESTAMP_TEST tests TIMESTAMP. 37 | # 38 | # Licensing: 39 | # 40 | # This code is distributed under the GNU LGPL license. 41 | # 42 | # Modified: 43 | # 44 | # 03 December 2014 45 | # 46 | # Author: 47 | # 48 | # John Burkardt 49 | # 50 | # Parameters: 51 | # 52 | # None 53 | # 54 | print '' 55 | print 'TIMESTAMP_TEST:' 56 | print ' Python version:' 57 | print ' TIMESTAMP prints a timestamp of the current date and time.' 58 | print '' 59 | 60 | timestamp ( ) 61 | 62 | print '' 63 | print 'TIMESTAMP_TEST:' 64 | print ' Normal end of execution.' 65 | 66 | if ( __name__ == '__main__' ): 67 | timestamp_test ( ) 68 | 69 | --------------------------------------------------------------------------------