diff options
Diffstat (limited to 'src/Hermite/2d.maple')
-rw-r--r-- | src/Hermite/2d.maple | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/src/Hermite/2d.maple b/src/Hermite/2d.maple new file mode 100644 index 0000000..9b402ab --- /dev/null +++ b/src/Hermite/2d.maple @@ -0,0 +1,114 @@ +# 2d.maple -- compute Hermite interpolation coefficients in 2-D +# $Header$ + +################################################################################ + +# +# 2d, cube, polynomial order=3, derivatives via 3-point order=2 formula +# ==> overall order=2, 4-point molecule +# + +# interpolating polynomial +interp_2d_cube_order2 + := Hermite_polynomial_interpolant(fn_2d_order3, + coeffs_set_2d_order3, + [x,y], + { + {x} = deriv_2d_dx_3point, + {y} = deriv_2d_dy_3point, + {x,y} = deriv_2d_dxy_3point + }, + {op(posn_list_2d_size2)}, + {op(posn_list_2d_size2)}); + +# I +coeffs_as_lc_of_data(%, posn_list_2d_size4); +print_coeffs__lc_of_data(%, "coeffs_I->coeff_", "fp", + "2d.coeffs/2d.cube.order2/coeffs-I.compute.c"); + +# d/dx +simplify( diff(interp_2d_cube_order2,x) ); +coeffs_as_lc_of_data(%, posn_list_2d_size4); +print_coeffs__lc_of_data(%, "coeffs_dx->coeff_", "fp", + "2d.coeffs/2d.cube.order2/coeffs-dx.compute.c"); + +# d/dy +simplify( diff(interp_2d_cube_order2,y) ); +coeffs_as_lc_of_data(%, posn_list_2d_size4); +print_coeffs__lc_of_data(%, "coeffs_dy->coeff_", "fp", + "2d.coeffs/2d.cube.order2/coeffs-dy.compute.c"); + +# d^2/dx^2 +simplify( diff(interp_2d_cube_order2,x,x) ); +coeffs_as_lc_of_data(%, posn_list_2d_size4); +print_coeffs__lc_of_data(%, "coeffs_dxx->coeff_", "fp", + "2d.coeffs/2d.cube.order2/coeffs-dxx.compute.c"); + +# d^2/dxdy +simplify( diff(interp_2d_cube_order2,x,y) ); +coeffs_as_lc_of_data(%, posn_list_2d_size4); +print_coeffs__lc_of_data(%, "coeffs_dxy->coeff_", "fp", + "2d.coeffs/2d.cube.order2/coeffs-dxy.compute.c"); + +# d^2/dy^2 +simplify( diff(interp_2d_cube_order2,y,y) ); +coeffs_as_lc_of_data(%, posn_list_2d_size4); +print_coeffs__lc_of_data(%, "coeffs_dyy->coeff_", "fp", + "2d.coeffs/2d.cube.order2/coeffs-dyy.compute.c"); + +################################################################################ + +# +# 2d, cube, polynomial order=3, derivatives via 5-point order=4 formula +# ==> overall order=3, 6-point molecule +# + +# interpolating polynomial +interp_2d_cube_order3 + := Hermite_polynomial_interpolant(fn_2d_order3, + coeffs_set_2d_order3, + [x,y], + { + {x} = deriv_2d_dx_5point, + {y} = deriv_2d_dy_5point, + {x,y} = deriv_2d_dxy_5point + }, + {op(posn_list_2d_size2)}, + {op(posn_list_2d_size2)}); + +# I +coeffs_as_lc_of_data(%, posn_list_2d_size6); +print_coeffs__lc_of_data(%, "coeffs_I->coeff_", "fp", + "2d.coeffs/2d.cube.order3/coeffs-I.compute.c"); + +# d/dx +simplify( diff(interp_2d_cube_order3,x) ); +coeffs_as_lc_of_data(%, posn_list_2d_size6); +print_coeffs__lc_of_data(%, "coeffs_dx->coeff_", "fp", + "2d.coeffs/2d.cube.order3/coeffs-dx.compute.c"); + +# d/dy +simplify( diff(interp_2d_cube_order3,y) ); +coeffs_as_lc_of_data(%, posn_list_2d_size6); +print_coeffs__lc_of_data(%, "coeffs_dy->coeff_", "fp", + "2d.coeffs/2d.cube.order3/coeffs-dy.compute.c"); + +# d^2/dx^2 +simplify( diff(interp_2d_cube_order3,x,x) ); +coeffs_as_lc_of_data(%, posn_list_2d_size6); +print_coeffs__lc_of_data(%, "coeffs_dxx->coeff_", "fp", + "2d.coeffs/2d.cube.order3/coeffs-dxx.compute.c"); + +# d^2/dxdy +simplify( diff(interp_2d_cube_order3,x,y) ); +coeffs_as_lc_of_data(%, posn_list_2d_size6); +print_coeffs__lc_of_data(%, "coeffs_dxy->coeff_", "fp", + "2d.coeffs/2d.cube.order3/coeffs-dxy.compute.c"); + +# d^2/dy^2 +simplify( diff(interp_2d_cube_order3,y,y) ); +coeffs_as_lc_of_data(%, posn_list_2d_size6); +print_coeffs__lc_of_data(%, "coeffs_dyy->coeff_", "fp", + "2d.coeffs/2d.cube.order3/coeffs-dyy.compute.c"); + +################################################################################ |