Skip to content

Grid Interpolation

Sam Reeve edited this page Sep 12, 2024 · 2 revisions

Overview

Cabana::Grid provides methods for interpolating data back and forth between particles and grids: particle-to-grid (p2g) and grid-to-particle (g2p). Interpolation

Implementation

Cabana_Grid_Interpolation.hpp

Examples

Usage

    auto scalar_p2g =
        Cabana::Grid::createScalarValueP2G( scalar_particle_field, -0.5 );
    Cabana::Grid::p2g( scalar_p2g, particle_positions, num_particles,
                       Cabana::Grid::Spline<1>(), *scalar_halo, *scalar_grid_field );

    auto scalar_value_g2p =
        Cabana::Grid::createScalarValueG2P( scalar_particle_field, -0.5 );
    Cabana::Grid::g2p( *scalar_grid_field, *scalar_halo, particle_positions,
                       num_particles, Cabana::Grid::Spline<1>(), scalar_value_g2p );

This is part of the Programming Guide series

Clone this wiki locally