58 real(real64) :: charge(1)
70 procedure charged_particle_constructor
81 class(charged_particle_t),
pointer :: sys
82 type(namespace_t),
intent(in) :: namespace
83 type(mpi_grp_t),
intent(in) :: grp
100 class(charged_particle_t),
intent(inout) :: this
101 type(namespace_t),
intent(in) :: namespace
102 type(mpi_grp_t),
intent(in) :: grp
120 call this%quantities%add(
quantity_t(
"charge", updated_on_demand = .false., always_available = .
true.))
121 call this%quantities%add(
quantity_t(
"current", parents=[
character(8) ::
"charge",
"velocity"]))
129 class(charged_particle_t),
target,
intent(inout) :: this
130 class(interaction_t),
intent(inout) :: interaction
134 select type (interaction)
136 call interaction%init(this%space%dim, 1, this%charge, this%pos)
138 call interaction%init(this%space%dim, 1, this%charge, this%pos, this%vel, this%namespace)
140 call this%classical_particle_t%init_interaction(interaction)
148 class(charged_particle_t),
intent(inout) :: this
152 call this%classical_particle_t%initialize()
160 real(real64),
intent(in) :: tol
164 converged = this%classical_particle_t%is_tolerance_reached(tol)
172 character(len=*),
intent(in) :: label
183 call this%classical_particle_t%update_quantity(label)
196 select type (interaction)
198 interaction%partner_np = 1
199 safe_allocate(interaction%partner_charge(1))
200 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
202 interaction%partner_np = 1
203 interaction%grid_based_partner = .false.
204 safe_allocate(interaction%partner_charge(1))
205 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
206 safe_allocate(interaction%partner_vel(1:partner%space%dim, 1))
209 call partner%classical_particle_t%init_interaction_as_partner(interaction)
222 select type (interaction)
224 interaction%partner_charge(1) = partner%charge(1)
225 interaction%partner_pos(:,1) = partner%pos(:, 1)
228 interaction%partner_charge(1) = partner%charge(1)
229 interaction%partner_pos(:,1) = partner%pos(:, 1)
230 interaction%partner_vel(:,1) = partner%vel(:, 1)
231 call interaction%do_mapping()
234 call partner%classical_particle_t%copy_quantities_to_interaction(interaction)
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
This module implements the basic elements defining algorithms.
subroutine charged_particle_init_interaction_as_partner(partner, interaction)
subroutine, public charged_particle_init(this, namespace, grp)
The init routine is a module level procedure This has the advantage that different classes can have d...
subroutine charged_particle_update_quantity(this, label)
class(charged_particle_t) function, pointer charged_particle_constructor(namespace, grp)
The factory routine (or constructor) allocates a pointer of the corresponding type and then calls the...
subroutine charged_particle_initialize(this)
subroutine charged_particle_copy_quantities_to_interaction(partner, interaction)
subroutine charged_particle_init_interaction(this, interaction)
logical function charged_particle_is_tolerance_reached(this, tol)
subroutine, public classical_particle_init(this, namespace, grp)
The init routine is a module level procedure This has the advantage that different classes can have d...
real(real64), parameter, public m_one
integer, parameter, public lorentz_force
integer, parameter, public current_to_mxll_field
integer, parameter, public coulomb_force
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
This module implements the multisystem debug functionality.
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
This module implements the abstract system type.
class for a charged classical particle
class for a neutral classical particle
Coulomb interaction between two systems of particles.
Class to transfer a current to a Maxwell field.
surrogate interaction class to avoid circular dependencies between modules.
Lorenz force between a systems of particles and an electromagnetic field.
Systems (system_t) can expose quantities that can be used to calculate interactions with other system...