Skip to content
Snippets Groups Projects

Fix OEP full - spin polarized case

Merged Nicolas Tancogne-Dejean requested to merge fix_oep_polarized into hotfix-12.2
2 files
+ 57
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -23,6 +23,7 @@ module charged_particle_oct_m
use classical_particle_oct_m
use clock_oct_m
use coulomb_force_oct_m
use current_to_mxll_field_oct_m
use debug_oct_m
use global_oct_m
use interaction_oct_m
@@ -110,6 +111,9 @@ contains
call this%supported_interactions%add(LORENTZ_FORCE)
call this%supported_interactions%add(COULOMB_FORCE)
call this%supported_interactions_as_partner%add(COULOMB_FORCE)
call this%supported_interactions_as_partner%add(CURRENT_TO_MXLL_FIELD)
this%quantities(CURRENT)%required = .true.
POP_SUB(charged_particle_init)
end subroutine charged_particle_init
@@ -180,6 +184,10 @@ contains
! The charged particle has a charge, but it is not necessary to update it, as it does not change with time.
! We still need to set its clock, so we set it to be in sync with the particle position.
call this%quantities(iq)%clock%set_time(this%quantities(POSITION)%clock)
case(CURRENT)
! The charged particle has a velocity, and the current is directly giving the current.
! We still need to set its clock, so we set it to be in sync with the particle position.
call this%quantities(iq)%clock%set_time(this%quantities(VELOCITY)%clock)
case default
! Other quantities should be handled by the parent class
call this%classical_particle_t%update_quantity(iq)
@@ -202,7 +210,11 @@ contains
call partner%quantities(iq)%clock%set_time(partner%quantities(POSITION)%clock)
call multisystem_debug_write_marker(partner%namespace, &
event_clock_update_t("quantity", QUANTITY_LABEL(iq), partner%quantities(iq)%clock, "set"))
case (CURRENT)
! We still need to set its clock, so we set it to be in sync with the particle velocity.
call partner%quantities(iq)%clock%set_time(partner%quantities(VELOCITY)%clock)
call multisystem_debug_write_marker(partner%namespace, &
event_clock_update_t("quantity", QUANTITY_LABEL(iq), partner%quantities(iq)%clock, "set"))
case default
! Other quantities should be handled by the parent class
call partner%classical_particle_t%update_exposed_quantity(iq)
@@ -223,7 +235,12 @@ contains
interaction%partner_np = 1
SAFE_ALLOCATE(interaction%partner_charge(1))
SAFE_ALLOCATE(interaction%partner_pos(1:partner%space%dim, 1))
type is (current_to_mxll_field_t)
interaction%partner_np = 1
interaction%grid_based_partner = .false.
SAFE_ALLOCATE(interaction%partner_charge(1))
SAFE_ALLOCATE(interaction%partner_pos(1:partner%space%dim, 1))
SAFE_ALLOCATE(interaction%partner_vel(1:partner%space%dim, 1))
class default
! Other interactions should be handled by the parent class
call partner%classical_particle_t%init_interaction_as_partner(interaction)
@@ -244,6 +261,11 @@ contains
interaction%partner_charge(1) = partner%charge(1)
interaction%partner_pos(:,1) = partner%pos(:, 1)
type is (current_to_mxll_field_t)
interaction%partner_charge(1) = partner%charge(1)
interaction%partner_pos(:,1) = partner%pos(:, 1)
interaction%partner_vel(:,1) = partner%vel(:, 1)
class default
call partner%classical_particle_t%copy_quantities_to_interaction(interaction)
end select
Loading