5 #include "sll_errors.h"
6 #include "sll_memory.h"
7 #include "sll_working_precision.h"
67 sll_real64,
dimension(:, :),
pointer :: f
73 sll_real64,
dimension(:),
pointer :: dof_positions1
75 sll_real64,
dimension(:),
pointer :: dof_positions2
77 sll_int32 :: advection_form
79 sll_real64,
dimension(:, :),
pointer :: a1
81 sll_real64,
dimension(:, :),
pointer :: a2
88 sll_real64,
dimension(:),
pointer :: input1
89 sll_real64,
dimension(:),
pointer :: output1
90 sll_real64,
dimension(:),
pointer :: origin1
91 sll_real64,
dimension(:),
pointer :: origin_middle1
92 sll_real64,
dimension(:),
pointer :: feet1
93 sll_real64,
dimension(:),
pointer :: feet_middle1
94 sll_real64,
dimension(:),
pointer :: feet_inside1
95 sll_real64,
dimension(:),
pointer :: input2
96 sll_real64,
dimension(:),
pointer :: output2
97 sll_real64,
dimension(:),
pointer :: origin2
98 sll_real64,
dimension(:),
pointer :: origin_middle2
99 sll_real64,
dimension(:),
pointer :: feet2
100 sll_real64,
dimension(:),
pointer :: feet_middle2
101 sll_real64,
dimension(:),
pointer :: feet_inside2
105 sll_real64,
dimension(:),
pointer :: primitive1
106 sll_real64,
dimension(:),
pointer :: primitive2
107 sll_real64,
dimension(:),
pointer :: xi1
108 sll_real64,
dimension(:),
pointer :: xi2
109 sll_real64,
dimension(:),
pointer :: a1jac
110 sll_real64,
dimension(:),
pointer :: a2jac
113 procedure, pass(this) :: operatort =>
adv1
114 procedure, pass(this) :: operatorv =>
adv2
124 process_outside_point1, &
127 process_outside_point2, &
139 sll_real64,
dimension(:, :),
pointer,
intent(in) :: f
140 sll_real64,
dimension(:, :),
pointer,
intent(in) :: a1
141 sll_real64,
dimension(:, :),
pointer,
intent(in) :: a2
149 sll_int32,
intent(in) :: advection_form
150 sll_int32,
intent(in) :: split_case
151 sll_real64,
dimension(:),
intent(in),
optional :: split_step
152 sll_int32,
intent(in),
optional :: nb_split_step
153 logical,
intent(in),
optional :: split_begin_t
154 sll_real64,
intent(in),
optional :: dt
156 logical,
intent(in),
optional :: csl_2012
160 sll_allocate(this, ierr)
168 process_outside_point1, &
171 process_outside_point2, &
192 process_outside_point1, &
195 process_outside_point2, &
206 sll_real64,
dimension(:, :),
pointer,
intent(in) :: f
207 sll_real64,
dimension(:, :),
pointer,
intent(in) :: a1
208 sll_real64,
dimension(:, :),
pointer,
intent(in) :: a2
216 sll_int32,
intent(in) :: advection_form
217 sll_int32,
intent(in) :: split_case
218 sll_real64,
dimension(:),
intent(in),
optional :: split_step
219 sll_int32,
intent(in),
optional :: nb_split_step
220 logical,
intent(in),
optional :: split_begin_T
221 sll_real64,
intent(in),
optional :: dt
223 logical,
intent(in),
optional :: csl_2012
228 sll_real64 :: eta1_min
229 sll_real64 :: eta1_max
230 sll_real64 :: eta2_min
231 sll_real64 :: eta2_max
236 this%interp1 => interp1
237 this%interp2 => interp2
238 this%charac1 => charac1
239 this%process_outside_point1 => process_outside_point1
240 this%process_outside_point2 => process_outside_point2
241 this%charac2 => charac2
242 this%mesh_2d => mesh_2d
244 this%advection_form = advection_form
246 if (
present(transformation))
then
247 this%transformation => transformation
249 if (
present(csl_2012))
then
250 this%csl_2012 = csl_2012
252 this%csl_2012 = .false.
255 n1 = mesh_2d%num_cells1 + 1
256 n2 = mesh_2d%num_cells2 + 1
258 eta1_min = mesh_2d%eta1_min
259 eta1_max = mesh_2d%eta1_max
260 eta2_min = mesh_2d%eta2_min
261 eta2_max = mesh_2d%eta2_max
263 select case (this%advection_form)
268 this%num_dof1 = n1 - 1
269 this%num_dof2 = n2 - 1
271 sll_error(
"initialize_split_advection_2d",
"bad value of advection_form")
272 print *,
'advection_form', advection_form
276 if ((
size(f, 1) /= this%num_dof1) .or. (
size(f, 2) /= this%num_dof2))
then
277 sll_error(
"initialize_split_advection_2d",
"bad size of f")
278 print *,
'size of f=',
size(f)
281 if ((
size(a1, 1) /= n1) .or. (
size(a1, 2) /= this%num_dof2))
then
282 sll_error(
"initialize_split_advection_2d",
"bad size of a1")
283 print *,
'size of a1=',
size(a1)
286 if ((
size(a2, 1) /= this%num_dof1) .or. (
size(a2, 2) /= n2))
then
287 sll_error(
"initialize_split_advection_2d",
"bad size of a2")
288 print *,
'size of a2=',
size(a2)
292 sll_allocate(this%input1(n1), ierr)
293 sll_allocate(this%output1(n1), ierr)
294 sll_allocate(this%origin1(n1), ierr)
295 sll_allocate(this%origin_middle1(n1 - 1), ierr)
296 sll_allocate(this%feet_middle1(n1 - 1), ierr)
297 sll_allocate(this%feet1(n1), ierr)
298 sll_allocate(this%feet_inside1(n1), ierr)
300 sll_allocate(this%input2(n2), ierr)
301 sll_allocate(this%output2(n2), ierr)
302 sll_allocate(this%origin2(n2), ierr)
303 sll_allocate(this%origin_middle2(n2 - 1), ierr)
304 sll_allocate(this%feet_middle2(n2 - 1), ierr)
305 sll_allocate(this%feet2(n2), ierr)
306 sll_allocate(this%feet_inside2(n2), ierr)
308 sll_allocate(this%primitive1(n1), ierr)
309 sll_allocate(this%primitive2(n2), ierr)
310 sll_allocate(this%xi1(n1), ierr)
311 sll_allocate(this%xi2(n2), ierr)
312 sll_allocate(this%A1jac(n1), ierr)
313 sll_allocate(this%A2jac(n2), ierr)
316 this%origin1(i) = real(i - 1, f64)/real(n1 - 1, f64)
318 eta1_min + this%origin1(i)*(eta1_max - eta1_min)
321 this%origin2(i) = real(i - 1, f64)/real(n2 - 1, f64)
323 eta2_min + this%origin2(i)*(eta2_max - eta2_min)
327 this%origin_middle1(i) = 0.5_f64*(this%origin1(i) + this%origin1(i + 1))
330 this%origin_middle2(i) = 0.5_f64*(this%origin2(i) + this%origin2(i + 1))
350 sll_real64,
intent(in) :: dt
356 sll_int32 :: num_dof1
357 sll_int32 :: num_dof2
358 sll_real64 :: eta1_min
359 sll_real64 :: eta1_max
364 sll_real64 :: delta_eta1
369 n1 = this%mesh_2d%num_cells1 + 1
370 n2 = this%mesh_2d%num_cells2 + 1
371 num_dof1 = this%num_dof1
372 num_dof2 = this%num_dof2
373 eta1_min = this%mesh_2d%eta1_min
374 eta1_max = this%mesh_2d%eta1_max
375 delta_eta1 = (eta1_max - eta1_min)/real(n1 - 1, f64)
376 if (this%csl_2012)
then
548 this%input1(1:num_dof1) = this%f(1:num_dof1, j)
601 call this%charac1%compute_characteristics( &
604 this%origin1(1:n1), &
609 this%feet_inside1(i) = this%process_outside_point1( &
615 call this%interp1%interpolate_array( &
618 -this%feet_inside1(1:n1), &
623 this%output1(1:n1), &
624 this%origin1(1:n1), &
639 this%f(1:num_dof1, j) = this%output1(1:num_dof1)
665 sll_real64,
intent(in) :: dt
671 sll_int32 :: num_dof1
672 sll_int32 :: num_dof2
673 sll_real64 :: eta2_min
674 sll_real64 :: eta2_max
680 n1 = this%mesh_2d%num_cells1 + 1
681 n2 = this%mesh_2d%num_cells2 + 1
682 num_dof1 = this%num_dof1
683 num_dof2 = this%num_dof2
684 eta2_min = this%mesh_2d%eta2_min
685 eta2_max = this%mesh_2d%eta2_max
689 this%input2(1:num_dof2) = this%f(i, 1:num_dof2)
739 call this%charac2%compute_characteristics( &
742 this%origin2(1:n2), &
748 this%feet_inside2(j) = this%process_outside_point2( &
753 call this%interp2%interpolate_array( &
756 -this%feet_inside2(1:n2), &
761 this%output2(1:n2), &
762 this%origin2(1:n2), &
777 this%f(i, 1:num_dof2) = this%output2(1:num_dof2)
787 sll_real64,
dimension(:),
intent(inout) :: f
788 sll_real64,
dimension(:),
intent(in) :: node_positions
789 sll_int32,
intent(in):: n
790 sll_real64,
intent(out)::m
792 sll_real64::tmp, tmp2
797 m = m + f(i)*(node_positions(i + 1) - node_positions(i))
800 m = m/(node_positions(n + 1) - node_positions(1))
803 f(1) = (f(1) - m)*(node_positions(2) - node_positions(1))
807 f(i) = (f(i) - m)*(node_positions(i + 1) - node_positions(i))
809 f(i) = f(i - 1) + tmp
812 f(n + 1) = f(n) + tmp
821 node_positions_back, &
824 sll_real64,
dimension(:),
intent(inout) :: f
825 sll_real64,
dimension(:),
intent(in) :: node_positions
826 sll_real64,
dimension(:),
intent(in) :: node_positions_back
827 sll_int32,
intent(in):: n
828 sll_real64,
intent(in)::m
834 f(i) = f(i + 1) - f(i) + m*(node_positions_back(i + 1) - node_positions_back(i))
836 f(n) = tmp - f(n) + m*(node_positions_back(n + 1) - node_positions_back(n))
840 f(i) = f(i)/(node_positions(i + 1) - node_positions(i))
Describe different boundary conditions.
Cartesian mesh basic types.
Abstract class for characteristic derived type.
Module for 1D interpolation and reconstruction.
Base class of operator splitting library. It is only used with particle-in-cell method.
subroutine, public sll_s_operator_splitting_init(split, split_case, split_step, nb_split_step, split_begin_T, dt)
Initialises data for operator splitting.
Implements split operators for constant coefficient advection.
integer(kind=i32), parameter, public sll_p_advective
subroutine initialize_split_advection_2d(this, f, a1, a2, interp1, charac1, process_outside_point1, interp2, charac2, process_outside_point2, mesh_2d, advection_form, split_case, split_step, nb_split_step, split_begin_T, dt, transformation, csl_2012)
Initialise advection_2d object.
class(sll_t_split_advection_2d) function, pointer, public sll_f_new_split_advection_2d(f, a1, a2, interp1, charac1, process_outside_point1, interp2, charac2, process_outside_point2, mesh_2d, advection_form, split_case, split_step, nb_split_step, split_begin_T, dt, transformation, csl_2012)
subroutine primitive_to_function_adv(f, node_positions, node_positions_back, N, M)
subroutine adv1(this, dt)
Advection operator in first direction.
subroutine adv2(this, dt)
Advection operator in second direction.
subroutine function_to_primitive_adv(f, node_positions, N, M)
integer(kind=i32), parameter, public sll_p_conservative
Abstract class for 1D interpolation and reconstruction.
operator splitting object
Simple operator splitting type for 2D advection Extends operator splitting.