Afivo  0.3
Functions/Subroutines
m_a2_particles Module Reference

This module contains routines related to , which can interpolate 'to' the grid and 'from' the grid (useful for e.g. particle simulations). The interpolation for meshes is called prolongation, see m_aX_prolong. More...

Functions/Subroutines

subroutine, public a2_particles_to_grid (tree, iv, coords, weights, n_particles, order, id_guess, density, fill_gc)
 Map a list of particles to a density. The order can be zero (map particle to the containing cell) or one (use bi/tri-linear interpolation). Note that ghost cells are automatically filled by this routine. More...
 
subroutine particles_to_grid_0 (tree, iv, coords, weights, ids, threads, n_particles, density)
 
subroutine particles_to_grid_1 (tree, iv, coords, weights, ids, threads, n_particles, density)
 Add weights to the cell centers using linear interpolation. More...
 
subroutine tree_add_from_ghostcells (tree, iv)
 

Detailed Description

This module contains routines related to , which can interpolate 'to' the grid and 'from' the grid (useful for e.g. particle simulations). The interpolation for meshes is called prolongation, see m_aX_prolong.

Function/Subroutine Documentation

§ a2_particles_to_grid()

subroutine, public m_a2_particles::a2_particles_to_grid ( type(a2_t), intent(inout)  tree,
integer, intent(in)  iv,
real(dp), dimension(2, n_particles), intent(in)  coords,
real(dp), dimension(n_particles), intent(in)  weights,
integer, intent(in)  n_particles,
integer, intent(in)  order,
integer, dimension(n_particles), intent(inout), optional  id_guess,
logical, intent(in), optional  density,
logical, intent(in), optional  fill_gc 
)

Map a list of particles to a density. The order can be zero (map particle to the containing cell) or one (use bi/tri-linear interpolation). Note that ghost cells are automatically filled by this routine.

Parameters
[in]ivVariable to store density
[in]n_particlesThe number of particles
[in]coordsThe particle coordinates
[in]weightsWeights for the particles
[in]orderOrder of interpolation
[in,out]id_guessGuess for box id containing particle, set to 0 where no guess is available
[in]densityDivide by cell area/volume (default: true)
[in]fill_gcFill ghost cells afterwards (default: true)

Definition at line 20 of file m_a2_particles.f90.

§ particles_to_grid_0()

subroutine m_a2_particles::particles_to_grid_0 ( type(a2_t), intent(inout)  tree,
integer, intent(in)  iv,
real(dp), dimension(2, n_particles), intent(in)  coords,
real(dp), dimension(n_particles), intent(in)  weights,
integer, dimension(n_particles), intent(in)  ids,
integer, dimension(n_particles), intent(in)  threads,
integer, intent(in)  n_particles,
logical, intent(in)  density 
)
Parameters
[in]ivVariable to store particle density

Definition at line 144 of file m_a2_particles.f90.

§ particles_to_grid_1()

subroutine m_a2_particles::particles_to_grid_1 ( type(a2_t), intent(inout)  tree,
integer, intent(in)  iv,
real(dp), dimension(2, n_particles), intent(in)  coords,
real(dp), dimension(n_particles), intent(in)  weights,
integer, dimension(n_particles), intent(in)  ids,
integer, dimension(n_particles), intent(in)  threads,
integer, intent(in)  n_particles,
logical, intent(in)  density 
)

Add weights to the cell centers using linear interpolation.

Todo:
Support cylindrical coordinates
Parameters
[in]ivVariable to store particle density

Definition at line 185 of file m_a2_particles.f90.

§ tree_add_from_ghostcells()

subroutine m_a2_particles::tree_add_from_ghostcells ( type(a2_t), intent(inout)  tree,
integer, intent(in)  iv 
)
Parameters
[in]ivIndex of variable

Definition at line 230 of file m_a2_particles.f90.