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...
|
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) |
|
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.
§ 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] | iv | Variable to store density |
[in] | n_particles | The number of particles |
[in] | coords | The particle coordinates |
[in] | weights | Weights for the particles |
[in] | order | Order of interpolation |
[in,out] | id_guess | Guess for box id containing particle, set to 0 where no guess is available |
[in] | density | Divide by cell area/volume (default: true) |
[in] | fill_gc | Fill 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 |
|
) |
| |
§ 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] | iv | Variable 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 |
|
) |
| |