51 integer,
parameter :: &
52 OUTPUT_COORDINATES = 1, &
68 procedure classical_particle_constructor
79 class(classical_particle_t),
pointer :: sys
80 type(namespace_t),
intent(in) :: namespace
98 class(classical_particle_t),
intent(inout) :: this
99 type(namespace_t),
intent(in) :: namespace
103 this%namespace = namespace
105 this%space =
space_t(namespace)
106 if (this%space%is_periodic())
then
124 this%supported_interactions_as_partner = [this%supported_interactions_as_partner,
gravity,
lennard_jones]
160 select type (interaction)
162 call interaction%init(this%space%dim, 1, this%mass, this%pos)
166 write(
message(1),
'(a,es9.2)')
'Using default value for Lennard-Jones parameter.'
170 call interaction%init(this%space%dim, 1, this%pos, this%lj_epsilon(1), this%lj_sigma(1))
182 integer :: n_rows, idir
194 if (
parse_block(this%namespace,
'ParticleInitialPosition', blk) == 0)
then
198 do idir = 1, this%space%dim
212 if (
parse_block(this%namespace,
'ParticleInitialVelocity', blk) == 0)
then
215 do idir = 1, this%space%dim
228 integer,
intent(in) :: iq
233 assert(this%quantities(iq)%updated_on_demand)
251 select type (interaction)
253 interaction%partner_np = 1
254 safe_allocate(interaction%partner_mass(1))
255 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
256 interaction%partner_pos =
m_zero
259 interaction%partner_np = 1
260 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
265 interaction%lj_sigma =
m_half * (partner%lj_sigma(1) + interaction%lj_sigma)
266 interaction%lj_epsilon =
sqrt(partner%lj_epsilon(1) * interaction%lj_epsilon)
283 select type (interaction)
285 interaction%partner_mass(1) = partner%mass(1)
286 interaction%partner_pos(:,1) = partner%pos(:,1)
289 interaction%partner_pos(:,1) = partner%pos(:,1)
292 message(1) =
"Unsupported 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, public classical_particle_init(this, namespace)
The init routine is a module level procedure This has the advantage that different classes can have d...
subroutine classical_particle_init_interaction_as_partner(partner, interaction)
subroutine classical_particle_initial_conditions(this)
subroutine classical_particle_finalize(this)
integer, parameter output_energy
class(classical_particle_t) function, pointer classical_particle_constructor(namespace)
The factory routine (or constructor) allocates a pointer of the corresponding type and then calls the...
subroutine classical_particle_update_quantity(this, iq)
subroutine classical_particle_init_interaction(this, interaction)
subroutine classical_particle_copy_quantities_to_interaction(partner, interaction)
subroutine, public classical_particles_init_interaction_as_partner(partner, interaction)
subroutine, public classical_particles_end(this)
subroutine, public classical_particles_init(this, np)
The init routine is a module level procedure This has the advantage that different classes can have d...
subroutine, public classical_particles_update_quantity(this, iq)
subroutine, public classical_particles_init_interaction(this, interaction)
real(real64), parameter, public m_zero
real(real64), parameter, public m_half
real(real64), parameter, public m_one
integer, parameter, public lennard_jones
integer, parameter, public gravity
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
subroutine, public messages_not_implemented(feature, namespace)
character(len=512), private msg
subroutine, public messages_warning(no_lines, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
logical function, public parse_is_defined(namespace, name)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
This module implements the basic propagator framework.
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.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
class for a neutral classical particle
Gravity interaction between two systems of particles. This should be used for testing purposes only....
abstract interaction class
surrogate interaction class to avoid circular dependencies between modules.
Lennard-Jones interaction between two systems of particles.