Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
Derived types and interfaces | Functions/Subroutines | Variables
sll_m_particle_sampling Module Reference

Description

Particle initializer class with various functions to initialize a particle.

Author
Katharina Kormann, Benedikt Perse

...

Derived types and interfaces

type  sll_t_particle_sampling
 Data type for particle sampling. More...
 

Functions/Subroutines

subroutine free_particle_sampling (self)
 Descructor. More...
 
subroutine init_particle_sampling (self, sampling_type, dims, n_particles_local, rank, delta_perturb, delta_eps)
 Initializer. More...
 
subroutine reset_seed_jump (self, jump)
 
subroutine sample_cv_particle_sampling (self, particle_group, params, xmin, Lx, control_variate, time, map, lindf)
 Sample with control variate (we assume that the particle weights are given in the following order: (full f weight, value of initial distribution at time 0, delta f weights) More...
 
subroutine sample_particle_sampling (self, particle_group, params, xmin, Lx, map)
 Sample from distribution defined by params. More...
 
subroutine sample_particle_sampling_all (self, particle_group, params, xmin, Lx)
 Helper function for pure sampling. More...
 
subroutine sample_particle_sampling_sym_1d2v (self, particle_group, params, xmin, Lx)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine sample_particle_sampling_sym2_1d2v (self, particle_group, params, xmin, Lx)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine sample_particle_sampling_unix (self, particle_group, params, xmin, Lx)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine sample_particle_sampling_unix_1d2v (self, particle_group, params, xmin, Lx)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine sample_particle_sampling_sym_3d3v (self, particle_group, params, xmin, Lx)
 Helper function for antithetic sampling in 3d3v. More...
 
subroutine sample_particle_sampling_sym_uni_3d3v (self, particle_group, params, xmin, Lx)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine sample_particle_sampling_all_trafo (self, particle_group, params, xmin, Lx, map)
 Helper function for pure sampling. More...
 
subroutine delta_function_perturbation (self, particle_group, xmin, Lx)
 
subroutine sample_particle_sampling_sym_1d2v_trafo (self, particle_group, params, Lx, map)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine sample_particle_sampling_sym_3d3v_trafo (self, particle_group, params, xmin, Lx, map)
 Helper function for antithetic sampling in 1d2v. More...
 
subroutine, public sll_s_particle_sampling_randomized_weights (particle_group, alpha, seed)
 

Variables

integer(kind=i32), parameter sll_p_random_numbers = 0
 draw random numbers More...
 
integer(kind=i32), parameter sll_p_sobol_numbers = 1
 draw sobol numbers More...
 
integer(kind=i32), parameter sll_p_standard = 0
 each particle is drawn separately More...
 
integer(kind=i32), parameter sll_p_symmetric_all = 1
 2^(dim_x+dim_v) points constructed from each drawn particle, all possible combinations of reflections along each direction More...
 
integer(kind=i32), parameter sll_p_symmetric_negative = 2
 one additional point for each drawd point, the one reflected along all directions More...
 
integer(kind=i32), parameter sll_p_uniformx_negative = 3
 

Function/Subroutine Documentation

◆ delta_function_perturbation()

subroutine sll_m_particle_sampling::delta_function_perturbation ( type(sll_t_particle_sampling), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private
Parameters
[in,out]selfparticle sampling object
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 1387 of file sll_m_particle_sampling.F90.

Here is the caller graph for this function:

◆ free_particle_sampling()

subroutine sll_m_particle_sampling::free_particle_sampling ( class( sll_t_particle_sampling ), intent(inout)  self)
private

Descructor.

Parameters
[in,out]selfparticle sampling object

Definition at line 87 of file sll_m_particle_sampling.F90.

◆ init_particle_sampling()

subroutine sll_m_particle_sampling::init_particle_sampling ( class( sll_t_particle_sampling ), intent(out)  self,
character(len=*), intent(in)  sampling_type,
integer(kind=i32), dimension(:), intent(in)  dims,
integer(kind=i32), intent(inout)  n_particles_local,
integer(kind=i32), intent(in), optional  rank,
logical, intent(in), optional  delta_perturb,
real(kind=f64), dimension(6), intent(in), optional  delta_eps 
)
private

Initializer.

Parameters
[out]selfparticle sampling object
[in]dimsdims(1) number of spatial dimensions, dims(2) number of velocity dimensions
[in,out]n_particles_localnumber of particles on processor
[in]rankoptional argument to set random seed dependent on processor rank
[in]delta_perturbdelta perturbation of the velocity distribution
[in]delta_epsvalues for delta perturbation

Definition at line 95 of file sll_m_particle_sampling.F90.

◆ reset_seed_jump()

subroutine sll_m_particle_sampling::reset_seed_jump ( class( sll_t_particle_sampling ), intent(inout)  self,
integer(kind=i32), intent(in)  jump 
)
private
Parameters
[in,out]selfparticle sampling object

Definition at line 242 of file sll_m_particle_sampling.F90.

◆ sample_cv_particle_sampling()

subroutine sll_m_particle_sampling::sample_cv_particle_sampling ( class( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx,
class(sll_t_control_variate), intent(in)  control_variate,
real(kind=f64), intent(in), optional  time,
type(sll_t_mapping_3d), optional  map,
logical, optional  lindf 
)
private

Sample with control variate (we assume that the particle weights are given in the following order: (full f weight, value of initial distribution at time 0, delta f weights)

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsparameters for initial distribution
[in]xminlower bound of the domain
[in]lxlength of the domain.
[in]control_variatePIC control variate
[in]timeinitial time (default: 0)
mapcoordinate transformation

Definition at line 258 of file sll_m_particle_sampling.F90.

◆ sample_particle_sampling()

subroutine sll_m_particle_sampling::sample_particle_sampling ( class( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx,
type(sll_t_mapping_3d), optional  map 
)
private

Sample from distribution defined by params.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsparameters for initial distribution
[in]xminlower bound of the domain
[in]lxlength of the domain.
mapcoordinate transformation

Definition at line 443 of file sll_m_particle_sampling.F90.

Here is the call graph for this function:

◆ sample_particle_sampling_all()

subroutine sll_m_particle_sampling::sample_particle_sampling_all ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for pure sampling.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 503 of file sll_m_particle_sampling.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_particle_sampling_all_trafo()

subroutine sll_m_particle_sampling::sample_particle_sampling_all_trafo ( type(sll_t_particle_sampling), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class(sll_c_distribution_params), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx,
type(sll_t_mapping_3d), intent(inout)  map 
)
private

Helper function for pure sampling.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxdomain length
[in,out]mapcoordinate transformation

Definition at line 1253 of file sll_m_particle_sampling.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_particle_sampling_sym2_1d2v()

subroutine sll_m_particle_sampling::sample_particle_sampling_sym2_1d2v ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 713 of file sll_m_particle_sampling.F90.

Here is the caller graph for this function:

◆ sample_particle_sampling_sym_1d2v()

subroutine sll_m_particle_sampling::sample_particle_sampling_sym_1d2v ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(in), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 615 of file sll_m_particle_sampling.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_particle_sampling_sym_1d2v_trafo()

subroutine sll_m_particle_sampling::sample_particle_sampling_sym_1d2v_trafo ( type(sll_t_particle_sampling), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class(sll_c_distribution_params), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  Lx,
type(sll_t_mapping_3d), intent(inout)  map 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]lxdomain length
[in,out]mapcoordinate transformation

Definition at line 1418 of file sll_m_particle_sampling.F90.

Here is the caller graph for this function:

◆ sample_particle_sampling_sym_3d3v()

subroutine sll_m_particle_sampling::sample_particle_sampling_sym_3d3v ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(in), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for antithetic sampling in 3d3v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 1052 of file sll_m_particle_sampling.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_particle_sampling_sym_3d3v_trafo()

subroutine sll_m_particle_sampling::sample_particle_sampling_sym_3d3v_trafo ( type(sll_t_particle_sampling), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class(sll_c_distribution_params), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx,
type(sll_t_mapping_3d), intent(inout)  map 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxdomain length
[in,out]mapcoordinate transformation

Definition at line 1515 of file sll_m_particle_sampling.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_particle_sampling_sym_uni_3d3v()

subroutine sll_m_particle_sampling::sample_particle_sampling_sym_uni_3d3v ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 1158 of file sll_m_particle_sampling.F90.

Here is the caller graph for this function:

◆ sample_particle_sampling_unix()

subroutine sll_m_particle_sampling::sample_particle_sampling_unix ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 803 of file sll_m_particle_sampling.F90.

◆ sample_particle_sampling_unix_1d2v()

subroutine sll_m_particle_sampling::sample_particle_sampling_unix_1d2v ( type( sll_t_particle_sampling ), intent(inout)  self,
class(sll_c_particle_group_base), intent(inout), target  particle_group,
class( sll_c_distribution_params ), intent(inout), target  params,
real(kind=f64), dimension(:), intent(in)  xmin,
real(kind=f64), dimension(:), intent(in)  Lx 
)
private

Helper function for antithetic sampling in 1d2v.

Parameters
[in,out]selfparticle sampling object
[in,out]particle_groupparticle group
[in,out]paramsdistribution parameter
[in]xminlower bound of the domain
[in]lxlength of the domain.

Definition at line 938 of file sll_m_particle_sampling.F90.

Here is the caller graph for this function:

◆ sll_s_particle_sampling_randomized_weights()

subroutine, public sll_m_particle_sampling::sll_s_particle_sampling_randomized_weights ( class(sll_c_particle_group_base), intent(inout), target  particle_group,
real(kind=f64), intent(in)  alpha,
integer(kind=i32), dimension(:), intent(in), optional  seed 
)

Definition at line 1648 of file sll_m_particle_sampling.F90.

Variable Documentation

◆ sll_p_random_numbers

integer(kind=i32), parameter sll_p_random_numbers = 0
private

draw random numbers

Definition at line 50 of file sll_m_particle_sampling.F90.

◆ sll_p_sobol_numbers

integer(kind=i32), parameter sll_p_sobol_numbers = 1
private

draw sobol numbers

Definition at line 51 of file sll_m_particle_sampling.F90.

◆ sll_p_standard

integer(kind=i32), parameter sll_p_standard = 0
private

each particle is drawn separately

Definition at line 53 of file sll_m_particle_sampling.F90.

◆ sll_p_symmetric_all

integer(kind=i32), parameter sll_p_symmetric_all = 1
private

2^(dim_x+dim_v) points constructed from each drawn particle, all possible combinations of reflections along each direction

Definition at line 54 of file sll_m_particle_sampling.F90.

◆ sll_p_symmetric_negative

integer(kind=i32), parameter sll_p_symmetric_negative = 2
private

one additional point for each drawd point, the one reflected along all directions

Definition at line 55 of file sll_m_particle_sampling.F90.

◆ sll_p_uniformx_negative

integer(kind=i32), parameter sll_p_uniformx_negative = 3
private

Definition at line 56 of file sll_m_particle_sampling.F90.

    Report Typos and Errors