54 integer,
parameter :: &
55 OUTPUT_COORDINATES = 1, &
71 procedure classical_particle_constructor
82 class(classical_particle_t),
pointer :: sys
83 type(namespace_t),
intent(in) :: namespace
84 type(mpi_grp_t),
intent(in) :: grp
102 class(classical_particle_t),
intent(inout) :: this
103 type(namespace_t),
intent(in) :: namespace
104 type(mpi_grp_t),
intent(in) :: grp
108 this%namespace = namespace
109 this%space =
space_t(namespace)
110 call this%init_parallelization(grp)
112 if (this%space%is_periodic())
then
130 this%supported_interactions_as_partner = [this%supported_interactions_as_partner,
gravity,
lennard_jones]
166 select type (interaction)
168 call interaction%init(this%space%dim, 1, this%mass, this%pos)
172 write(
message(1),
'(a,es9.2)')
'Using default value for Lennard-Jones parameter.'
176 call interaction%init(this%space%dim, 1, this%pos, this%lj_epsilon(1), this%lj_sigma(1))
188 integer :: n_rows, idir
191 real(real64) :: random_pos(1:this%space%dim), width_pos(1:this%space%dim)
192 real(real64) :: random_vel(1:this%space%dim), width_vel(1:this%space%dim)
193 integer(int64) :: seed
194 logical :: in_ensemble
207 if (
parse_block(this%namespace,
'ParticleInitialPosition', blk) == 0)
then
211 do idir = 1, this%space%dim
225 if (
parse_block(this%namespace,
'ParticleInitialVelocity', blk) == 0)
then
228 do idir = 1, this%space%dim
235 if (in_ensemble)
then
237 seed = this%namespace%get_hash32()
247 if (
parse_block(this%namespace,
'ParticlePositionDistributionWidth', blk) == 0)
then
250 do idir = 1, this%space%dim
263 if (
parse_block(this%namespace,
'ParticleVelocityDistributionWidth', blk) == 0)
then
266 do idir = 1, this%space%dim
271 call messages_print_var_value(
'ParticleVelocityDistributionWidth', width_vel(1:this%space%dim), namespace=this%namespace)
274 call quickrnd(seed, this%space%dim, random_pos)
275 call quickrnd(seed, this%space%dim, random_vel)
278 this%pos(:,1) = this%pos(:,1) + (random_pos - 0.5_real64) * width_pos
279 this%vel(:,1) = this%vel(:,1) + (random_vel - 0.5_real64) * width_vel
289 character(len=*),
intent(in) :: label
309 select type (interaction)
311 interaction%partner_np = 1
312 safe_allocate(interaction%partner_mass(1))
313 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
314 interaction%partner_pos =
m_zero
317 interaction%partner_np = 1
318 safe_allocate(interaction%partner_pos(1:partner%space%dim, 1))
323 interaction%lj_sigma =
m_half * (partner%lj_sigma(1) + interaction%lj_sigma)
324 interaction%lj_epsilon =
sqrt(partner%lj_epsilon(1) * interaction%lj_epsilon)
341 select type (interaction)
343 interaction%partner_mass(1) = partner%mass(1)
344 interaction%partner_pos(:,1) = partner%pos(:,1)
347 interaction%partner_pos(:,1) = partner%pos(:,1)
350 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 classical_particle_init_interaction_as_partner(partner, interaction)
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...
class(classical_particle_t) function, pointer classical_particle_constructor(namespace, grp)
The factory routine (or constructor) allocates a pointer of the corresponding type and then calls the...
subroutine classical_particle_finalize(this)
integer, parameter output_energy
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.