Skip to content

6. Splittings ​

A splitting scheme advances a system y′=f1(y)+f2(y) by composing flows, each moving one partition of the components by a fraction of the step. Hamiltonian systems split into positions and momenta, and the compositions of SELAH's catalogue (Strang, Yoshida, Blanes–Moan) are symmetric and symplectic.

The stepper drives a splitting like a Runge–Kutta scheme, one flow per stage. You declare the partitions as component ranges, and stage_partition(k) tells you which partition flow k advances, so you compute only that half of the residual.

fortran
allocate(y(1:2, 0:2, 0:2, 0:2, 1:1))                          ! one cell, two components: q (1) and p (2)
y = 0._R_P ; y(2,1,1,1,1) = 1._R_P
bx = box_interior(LAYOUT_V_FIRST, 2_I4P, 1_I4P, 1_I4P, 1_I4P, 1_I4P, 1_I4P)
! partition 1 = components 1..1 (q), partition 2 = components 2..2 (p): column p holds (v1, v2)
call st%initialize(name, FORM_SPLITTING, lb=lbound(y), ub=ubound(y), partitions=reshape([1, 1, 2, 2], [2, 2]))
fortran
call st%begin_step(bx, y)
do k=1, st%stages()
   call st%begin_stage(k, bx, dt, y)
   r => st%rhs_register()
   select case(st%stage_partition(k))                      ! the flow of stage k advances one partition:
   case(1) ; r(1,1,1,1,1) = y(2,1,1,1,1)                   !   q' = p  (its residual depends on p only)
   case(2) ; r(2,1,1,1,1) = -y(1,1,1,1,1)                  !   p' = -q (on q only)
   endselect
   call st%end_stage(k, bx, dt, y)                         ! the partition's components += c_k dt r
enddo
call st%finish_step(bx, dt, y)
  • partitions(:,p) holds (v1, v2), the components of partition p: here q alone and p alone.
  • end_stage advances the partition's components by ckΔtR: a forward-Euler sub-flow.

Running it ​

text
$ splittings
strang          errors  3.23E-04  8.07E-05  2.02E-05  orders 2.00 2.00
yoshida-4       errors  8.50E-07  5.31E-08  3.32E-09  orders 4.00 4.00
blanes-moan-s10 errors  8.09E-10  1.26E-11  1.96E-13  orders 6.01 6.01

When a splitting reaches its order

The sub-flow yp+=ckΔtRp is the exact flow of partition p only when Rp does not depend on partition p itself: q˙=p moves q with p frozen, and p˙=−q moves p with q frozen. This holds for separable Hamiltonians, kinetic and potential. For other splittings the forward-Euler sub-flow is first order and caps the composition at first order.

What you learned

Partitions, flows, stage_partition, and when the declared order holds. Reference: Schemes: splittings, A4.

Next: 7. Masks.

GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice