53 integer,
parameter :: &
54 OUTPUT_COORDINATES = 1, &
70 procedure classical_particle_constructor
81 class(classical_particle_t),
pointer :: sys
82 type(namespace_t),
intent(in) :: namespace
100 class(classical_particle_t),
intent(inout) :: this
101 type(namespace_t),
intent(in) :: namespace
105 this%namespace = namespace
107 this%space =
space_t(namespace)
108 if (this%space%is_periodic())
then
126 this%supported_interactions_as_partner = [this%supported_interactions_as_partner,
gravity,
lennard_jones]
162 select type (interaction)
164 call interaction%init(this%space%dim, 1, this%mass, this%pos)
168 write(
message(1),
'(a,es9.2)')
'Using default value for Lennard-Jones parameter.'
172 call interaction%init(this%space%dim, 1, this%pos, this%lj_epsilon(1), this%lj_sigma(1))
184 integer :: n_rows, idir
187 real(real64) :: random_pos(1:this%space%dim), width_pos(1:this%space%dim)
188 real(real64) :: random_vel(1:this%space%dim), width_vel(1:this%space%dim)
189 integer(int64) :: seed
190 logical :: in_ensemble
203 if (
parse_block(this%namespace,
'ParticleInitialPosition', blk) == 0)
then
207 do idir = 1, this%space%dim
221 if (
parse_block(this%namespace,
'ParticleInitialVelocity', blk) == 0)
then
224 do idir = 1, this%space%dim
231 if (in_ensemble)
then
233 seed = this%namespace%get_hash32()
243 if (
parse_block(this%namespace,
'ParticlePositionDistributionWidth', blk) == 0)
then
246 do idir = 1, this%space%dim
259 if (
parse_block(this%namespace,
'ParticleVelocityDistributionWidth', blk) == 0)
then
262 do idir = 1, this%space%dim
267 call messages_print_var_value(
'ParticleVelocityDistributionWidth', width_vel(1:this%space%dim), namespace=this%namespace)
270 call quickrnd(seed, this%space%dim, random_pos)
271 call quickrnd(seed, this%space%dim, random_vel)
274 this%pos(:,1) = this%pos(:,1) + (random_pos - 0.5_real64) * width_pos
275 this%vel(:,1) = this%vel(:,1) + (random_vel - 0.5_real64) * width_vel
285 character(len=*),
intent(in) :: label
305 select type (interaction)
307 interaction%partner_np = 1
308 safe_allocate(interaction%partner_mass(1))
309 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
310 interaction%partner_pos =
m_zero
313 interaction%partner_np = 1
314 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
319 interaction%lj_sigma =
m_half * (partner%lj_sigma(1) + interaction%lj_sigma)
320 interaction%lj_epsilon =
sqrt(partner%lj_epsilon(1) * interaction%lj_epsilon)
337 select type (interaction)
339 interaction%partner_mass(1) = partner%mass(1)
340 interaction%partner_pos(:,1) = partner%pos(:,1)
343 interaction%partner_pos(:,1) = partner%pos(:,1)
346 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_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_initialize(this)
subroutine classical_particle_update_quantity(this, label)
subroutine classical_particle_init_interaction(this, interaction)
subroutine classical_particle_copy_quantities_to_interaction(partner, interaction)
subroutine, public classical_particles_update_quantity(this, label)
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_init_interaction(this, interaction)
This module provides a random number generator for a normalized gaussian distribution.
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...
subroutine, public shiftseed(iseed, n)
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.