MPI-AMRVAC  2.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
mod_particles.t
Go to the documentation of this file.
1 !> Module containing all the particle routines
8 
9  implicit none
10 
11 contains
12 
13  !> Initialize particle data and parameters
14  subroutine particles_init()
16 
17  call particle_base_init()
18  call init_particles_com()
19 
20  select case(physics_type_particles)
21  case('advect')
22  call advect_init()
23  case('Lorentz')
24  call lorentz_init()
25  case('GCA')
26  call gca_init()
27  case('sample')
28  call sample_init()
29  case default
30  if (mype == 0) then
31  print *, "Unknown physics_type_particles", &
33  print *, "Options are: advect, Lorentz, GCA, sample"
34  call mpistop("Unknown physics_type_particles")
35  end if
36  end select
37 
38  end subroutine particles_init
39 
40  !> Create initial particles
41  subroutine particles_create()
43  use mod_timing
44 
45  ! Allocate grid variables
46  tpartc_grid_0=mpi_wtime()
47  call init_gridvars()
48  tpartc_grid = tpartc_grid + (mpi_wtime()-tpartc_grid_0)
49 
50  select case(physics_type_particles)
51  case('advect')
53  case('Lorentz')
54  ! The Vay mover can use the same routine
56  case('GCA')
58  case('sample')
60  case default
61  if (mype == 0) then
62  print *, "Unknown physics_type_particles", &
64  print *, "Options are: advect, Lorentz, GCA, sample"
65  call mpistop("Unknown physics_type_particles")
66  end if
67  end select
68 
69  ! Remove grid variables again
70  call finish_gridvars()
71 
72  end subroutine particles_create
73 
74 end module mod_particles
character(len=name_len) physics_type_particles
String describing the particle physics type.
This module contains definitions of global parameters and variables and some generic functions/subrou...
subroutine, public advect_create_particles()
subroutine init_gridvars()
Initialize grid variables for particles.
subroutine, public sample_init()
subroutine finish_gridvars()
Deallocate grid variables for particles.
subroutine, public lorentz_create_particles()
subroutine particles_init()
Initialize particle data and parameters.
Definition: mod_particles.t:15
subroutine, public gca_init()
subroutine particle_base_init()
Give initial values to parameters.
integer mype
The rank of the current MPI task.
Scattered sampling based on fixed-particle interpolation By Fabio Bacchini (2020) ...
subroutine particles_create()
Create initial particles.
Definition: mod_particles.t:42
subroutine, public lorentz_init()
Module containing all the particle routines.
Definition: mod_particles.t:2
subroutine mpistop(message)
Exit MPI-AMRVAC with an error message.
Definition: comm_lib.t:198
subroutine, public sample_create_particles()
Particle mover with Newtonian/relativistic Boris scheme for Lorentz dynamics By Jannis Teunissen...
Module with shared functionality for all the particle movers.
subroutine, public advect_init()
double precision tpartc_grid_0
Definition: mod_timing.t:13
subroutine init_particles_com()
Initialise communicators for particles.
Particle mover with Newtonian/relativistic Guiding Center Approximation (GCA) By Jannis Teunissen...
subroutine, public gca_create_particles()
Tracer for advected particles moving with fluid flows By Jannis Teunissen, Bart Ripperda, Oliver Porth, and Fabio Bacchini (2017-2020)
double precision tpartc_grid
Definition: mod_timing.t:12