5 #include "sll_memory.h"
6 #include "sll_working_precision.h"
31 sll_t_distribution_function_2d
36 #define NEW_TYPE_FOR_DF( new_df_type, extended_type) \
37 type,
extends(extended_type) :: new_df_type; \
38 sll_real64 :: pmass; \
39 sll_real64 :: pcharge; \
40 sll_real64 :: average; \
53 #undef NEW_TYPE_FOR_DF
65 class(sll_t_distribution_function_2d) :: this
68 sll_int32,
intent(in) :: data_position
69 character(len=*),
intent(in) :: name
72 sll_real64 :: eta1, eta2
73 sll_real64 :: delta1, delta2
78 this%data_position = data_position
79 this%pcharge = 1.0_f64
81 associate(mesh => transf%mesh)
84 sll_allocate(this%data(mesh%num_cells1 + 1, mesh%num_cells2 + 1), ierr)
85 do i2 = 1, mesh%num_cells2 + 1
86 do i1 = 1, mesh%num_cells1 + 1
87 this%data(i1, i2) = data_func(transf%x1_at_node(i1, i2), &
88 transf%x2_at_node(i1, i2))
92 sll_allocate(this%data(mesh%num_cells1 + 1, mesh%num_cells2 + 1), ierr)
93 delta1 = 1.0_f64/mesh%num_cells1
94 delta2 = 1.0_f64/mesh%num_cells2
96 do i2 = 1, mesh%num_cells2
98 do i1 = 1, mesh%num_cells1
99 this%data(i1, i2) = data_func(transf%x1(eta1, eta2), &
100 transf%x2(eta1, eta2))*transf%jacobian(eta1, eta2)
121 class(sll_c_coordinate_transformation_2d_base),
pointer :: transf
122 class(sll_c_interpolator_1d),
pointer :: eta1_interpolator
123 class(sll_c_interpolator_1d),
pointer :: eta2_interpolator
124 class(sll_c_scalar_field_2d_initializer_base),
pointer,
optional :: initializer
125 type(sll_t_distribution_function_2d),
intent(inout) :: this
126 sll_real64,
intent(in) :: mass
127 sll_real64,
intent(in) :: charge
128 character(len=*),
intent(in) :: field_name
129 sll_int32,
intent(in) :: data_position
132 this%pcharge = charge
134 call sll_s_scalar_field_2d_init( &
Cartesian mesh basic types.
Implements the distribution function types.
subroutine sll_new_distribution_function_2d(this, transf, data_position, name, data_func)
subroutine, public sll_s_distribution_function_2d_init(this, mass, charge, field_name, transf, data_position, eta1_interpolator, eta2_interpolator, initializer)
Module for 1D interpolation and reconstruction.
Scalar field on mesh with coordinate transformation.
subroutine, public sll_s_scalar_field_2d_init(this, field_name, transf, data_position, eta1_interpolator, eta2_interpolator, initializer)
integer, parameter, public sll_p_node_centered_field
integer, parameter, public sll_p_cell_centered_field
Abstract class for 1D interpolation and reconstruction.