Particle-Mesh coupling

GEMPIC.ParticleMeshCoupling1DType
ParticleMeshCoupling1D( mesh, no_particles, spline_degree, 
                      smoothing_type )

Kernel smoother with splines of arbitrary degree placed on a uniform mesh. Spline with index i starts at point i

  • delta_x : Value of grid spacing along both directions.
  • n_grid : Array containing number ofpoints along each direction
  • no_particles : Number of particles of underlying PIC method
  • spline_degree : Degree of smoothing kernel spline
  • n_span : Number of intervals where spline non zero (spline_degree + 1)
  • scaling : Scaling factor depending on whether :galerkin or :collocation
  • n_quad_points : Number of quadrature points
  • spline_val: scratch data for spline evaluation
  • spline_val_more : more scratch data for spline evaluation
  • quad_x, quad_w : quadrature weights and points
Note

Only 1D version is implemented for now

GEMPIC.add_charge!Method
add_charge!( rho, p, position, marker_charge)

Add charge of one particle

  • p : kernel smoother object
  • position : Position of the particle
  • marker_charge : Particle weights time charge
  • rho_dofs : Coefficient vector of the charge distribution
GEMPIC.add_charge_pp!Method
add_charge_pp!(rho_dofs, p, position, marker_charge)

Add charge of one particle

  • p : kernel smoother object
  • position : Position of the particle
  • marker_charge : Particle weights time charge
  • rho_dofs : Coefficient vector of the charge distribution
GEMPIC.add_current_update_v!Method
add_current_update_v!( j_dofs, p, 
                       position_old, position_new, 
                       marker_charge, qoverm, 
                       bfield_dofs, vi)

Add current for one particle and update v (according to $H_{p1}$ part in Hamiltonian splitting)

  • Read out particle position and velocity
  • Compute index_old, the index of the last DoF on the grid the

particle contributes to, and r_old, its position (normalized to cell size one).

GEMPIC.add_current_update_v!Method
add_current_update_v!( j_dofs, p, 
                       position_old, position_new, 
                       marker_charge, qoverm, vi)

Add current for one particle and update v (according to $H_{p1}$ part in Hamiltonian splitting)

This is the 1d1v case, there is no magnetic field.

  • Read out particle position and velocity
  • Compute index_old, the index of the last DoF on the grid the

particle contributes to, and r_old, its position (normalized to cell size one).

GEMPIC.add_current_update_v_pp!Method
add_current_update_v_pp!( j_dofs, p, position_old, position_new, 
                          marker_charge, qoverm, bfield_dofs, vi)

Add current for one particle and update v (according to H_p1 part in Hamiltonian splitting)

GEMPIC.evaluateMethod
evaluate(p, position, field_dofs)

Evaluate field at position

  • p : Kernel smoother object
  • position : Position of the particle
  • field_dofs : Coefficient vector for the field DoFs
  • field_value : Value(s) of the electric fields at given position
GEMPIC.evaluate_ppMethod
evaluate_pp(p, position, field_dofs_pp)

Evaluate field at position using horner scheme

  • p : Kernel smoother object
  • position : Position of the particle
  • field_dofs_pp : Degrees of freedom in kernel representation.
  • field_value : Value(s) of the electric fields at given position
GEMPIC.update_jv!Method
update_jv!(j_dofs, p, 
           lower, upper, index, marker_charge, 
           qoverm, sign, vi, bfield_dofs)

Helper function for add_current_update_v.

GEMPIC.update_jv!Method
update_jv!(j_dofs, p, 
           lower, upper, index, marker_charge, 
           qoverm, sign, vi)

Helper function for add_current_update_v without the magnetic field (1d1v case)

GEMPIC.update_jv_pp!Method
update_jv_pp!( j_dofs, p, lower, upper, index, marker_charge, 
               qoverm, vi, bfield_dofs)

Helper function for add_current_update_v.

GEMPIC.ParticleMeshCoupling2DType
ParticleMeshCoupling2D( pg, grid, degree, smoothing_type)
  • n_grid(2) : no. of spline coefficients
  • domain(2,2) : lower and upper bounds of the domain
  • no_particles : no. of particles
  • degree : Degree of smoothing kernel spline
  • smoothing_type : Define if Galerkin or collocation smoothing for right scaling in accumulation routines
GEMPIC.add_charge!Method
add_charge!(ρ_dofs, pm, xp, yp, wp)

Add charge of single particle

  • position : Particle position
  • wp : Particle weight times charge
  • ρ_dofs : spline coefficient of accumulated density
GEMPIC.add_charge_pp!Method
add_charge_pp!(ρ_dofs, pm, xp, yp, wp)

Add charge of single particle

  • Information about the 2d mesh
    • delta_x(2) : Value of grid spacing along both directions.
    • domain(2,2) : Definition of the domain: domain(1,1) = x1min, domain(2,1) = x2min, domain(1,2) = x1max, domain(2,2) = x2max
  • Information about the particles
    • no_particles : Number of particles of underlying PIC method (processor local)
    • n_span : Number of intervals where spline non zero (degree + 1)
    • scaling
  • position : Particle position
  • wp : Particle weight times charge
  • ρ_dofs : spline coefficient of accumulated density
GEMPIC.compute_shape_factorMethod
compute_shape_factor(pm, xp, yp)

Helper function computing shape factor

  • pm : kernel smoother object
  • xp, xp : poisition of the particle
GEMPIC.evaluateMethod
evaluate(pm, xp, yp, field_dofs)
  • position(pm.dim) : Position where to evaluate
  • fielddofs(pm.ndofs) : Degrees of freedom in kernel representation.
  • field_value : Value of the field

Evaluate field with given dofs at position

GEMPIC.evaluate_multipleMethod
evaluate_multiple(pm, position, field_dofs)

Evaluate multiple fields at position  position

  • position(pm%dim) : Position where to evaluate
  • components(:) : Components of the field that shall be evaluated
  • field_dofs(:,:) : Degrees of freedom in kernel representation.
  • field_value(:) : Value of the field
GEMPIC.evaluate_ppMethod
evaluate_pp(pm, xp, yp, pp)

Evaluate field at position using horner scheme

  • pm : kernel smoother object
  • position : Position where to evaluate
  • fielddofspp(:,:) : Degrees of freedom in kernel representation.
  • field_value : Value of the field
GEMPIC.index_1dto2d_column_majorMethod
index_1dto2d_column_major(pm, index1d_1, index_1d_2)

Self function computes the index of a 1D array that stores 2D data in column major ordering. It also takes periodic boundary conditions into account.

  • index1d_1 !< indice along x (start counting with zero).
  • index1d_2 !< indice along y (start counting with zero).
  • index2d !< Corresponding index in 1d array representing 2d data (start counting with one).