OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
interpolate< vector, grid, kernel > Class Template Reference

Main class for interpolation Particle to mest p2m and Mesh to particle m2p. More...

Detailed Description

template<typename vector, typename grid, typename kernel>
class interpolate< vector, grid, kernel >

Main class for interpolation Particle to mest p2m and Mesh to particle m2p.

This function is the main class to interpolate from particle to mesh and mesh to particle

Template Parameters
vectortype of vector for interpolation
gridtype of grid for interpolation
interpolationkernel

Definition at line 503 of file interpolation.hpp.

#include <interpolation.hpp>

Data Structures

struct  Box_vol
 

Public Member Functions

 interpolate (vector &vd, grid &gd)
 construct an interpolation object between a grid and a vector
 
template<unsigned int prp_v, unsigned int prp_g>
void p2m (vector &vd, grid &gd)
 Interpolate particles to mesh.
 
template<unsigned int prp_g, unsigned int prp_v>
void m2p (grid &gd, vector &vd)
 Interpolate mesh to particle.
 
template<unsigned int prp_v, unsigned int prp_g>
void p2m (vector &vd, grid &gd, const vect_dist_key_dx &p)
 Interpolate particles to mesh.
 
template<unsigned int prp_g, unsigned int prp_v>
void m2p (grid &gd, vector &vd, const vect_dist_key_dx &p)
 Interpolate mesh to particle.
 
int getSub (Point< vector::dims, typename vector::stype > &p)
 Return the sub-domain of the particles.
 

Private Types

typedef vector::stype arr_type
 Type of the calculations.
 

Private Member Functions

void calculate_the_offsets (openfpm::vector< agg_arr< openfpm::math::pow(kernel::np, vector::dims)> > &offsets, size_t(&sz)[vector::dims])
 It calculate the interpolation stencil offsets.
 

Private Attributes

CellList< vector::dims, typename vector::stype, Mem_fast<>, shift< vector::dims, typename vector::stype > > geo_cell
 Cell list used to convert particles position to sub-domain.
 
vector & vd
 particles
 
gridgd
 grid
 
openfpm::vector< agg_arr< openfpm::math::pow(kernel::np, vector::dims)> > offsets
 the offset for each sub-sub-domain
 
size_t sz [vector::dims]
 kernel size
 
vector::stype dx [vector::dims]
 grid spacing
 
Box< vector::dims, typename vector::stype > domain
 Simulation domain.
 

Member Typedef Documentation

◆ arr_type

template<typename vector , typename grid , typename kernel >
typedef vector::stype interpolate< vector, grid, kernel >::arr_type
private

Type of the calculations.

Definition at line 541 of file interpolation.hpp.

Constructor & Destructor Documentation

◆ interpolate()

template<typename vector , typename grid , typename kernel >
interpolate< vector, grid, kernel >::interpolate ( vector &  vd,
grid gd 
)
inline

construct an interpolation object between a grid and a vector

When possible and easy to do we suggest to retain the object

Parameters
vdinterpolation vector
gdinterpolation grid

Definition at line 600 of file interpolation.hpp.

Member Function Documentation

◆ calculate_the_offsets()

template<typename vector , typename grid , typename kernel >
void interpolate< vector, grid, kernel >::calculate_the_offsets ( openfpm::vector< agg_arr< openfpm::math::pow(kernel::np, vector::dims)> > &  offsets,
size_t(&)  sz[vector::dims] 
)
inlineprivate

It calculate the interpolation stencil offsets.

Parameters
offsetsarray where to store the linearized offset of the kernel stencil for each local-grid (sub-domain)
szkernel stencil points in each direction

Definition at line 562 of file interpolation.hpp.

◆ getSub()

template<typename vector , typename grid , typename kernel >
int interpolate< vector, grid, kernel >::getSub ( Point< vector::dims, typename vector::stype > &  p)
inline

Return the sub-domain of the particles.

Parameters
pPoint to check

Definition at line 831 of file interpolation.hpp.

◆ m2p() [1/2]

template<typename vector , typename grid , typename kernel >
template<unsigned int prp_g, unsigned int prp_v>
void interpolate< vector, grid, kernel >::m2p ( grid gd,
vector &  vd 
)
inline

Interpolate mesh to particle.

Most of the time the particle set and the mesh are the same as the one used in the constructor. They also can be different as soon as they have the same decomposition

Parameters
gdgrid or mesh
vdparticle set

Definition at line 708 of file interpolation.hpp.

◆ m2p() [2/2]

template<typename vector , typename grid , typename kernel >
template<unsigned int prp_g, unsigned int prp_v>
void interpolate< vector, grid, kernel >::m2p ( grid gd,
vector &  vd,
const vect_dist_key_dx p 
)
inline

Interpolate mesh to particle.

Most of the time the particle set and the mesh are the same as the one used in the constructor. They also can be different as soon as they have the same decomposition

Parameters
gdgrid or mesh
vdparticle set
pparticle

Definition at line 797 of file interpolation.hpp.

◆ p2m() [1/2]

template<typename vector , typename grid , typename kernel >
template<unsigned int prp_v, unsigned int prp_g>
void interpolate< vector, grid, kernel >::p2m ( vector &  vd,
grid gd 
)
inline

Interpolate particles to mesh.

Most of the time the particle set and the mesh are the same as the one used in the constructor. They also can be different as soon as they have the same decomposition

Parameters
gdgrid or mesh
vdparticle set

Definition at line 662 of file interpolation.hpp.

◆ p2m() [2/2]

template<typename vector , typename grid , typename kernel >
template<unsigned int prp_v, unsigned int prp_g>
void interpolate< vector, grid, kernel >::p2m ( vector &  vd,
grid gd,
const vect_dist_key_dx p 
)
inline

Interpolate particles to mesh.

Most of the time the particle set and the mesh are the same as the one used in the constructor. They also can be different as soon as they have the same decomposition

Parameters
gdgrid or mesh
vdparticle set
pparticle

Definition at line 758 of file interpolation.hpp.

Field Documentation

◆ domain

template<typename vector , typename grid , typename kernel >
Box<vector::dims,typename vector::stype> interpolate< vector, grid, kernel >::domain
private

Simulation domain.

Definition at line 553 of file interpolation.hpp.

◆ dx

template<typename vector , typename grid , typename kernel >
vector::stype interpolate< vector, grid, kernel >::dx[vector::dims]
private

grid spacing

Definition at line 550 of file interpolation.hpp.

◆ gd

template<typename vector , typename grid , typename kernel >
grid& interpolate< vector, grid, kernel >::gd
private

grid

Definition at line 538 of file interpolation.hpp.

◆ geo_cell

template<typename vector , typename grid , typename kernel >
CellList<vector::dims,typename vector::stype,Mem_fast<>,shift<vector::dims,typename vector::stype> > interpolate< vector, grid, kernel >::geo_cell
private

Cell list used to convert particles position to sub-domain.

Definition at line 506 of file interpolation.hpp.

◆ offsets

template<typename vector , typename grid , typename kernel >
openfpm::vector<agg_arr<openfpm::math::pow(kernel::np,vector::dims)> > interpolate< vector, grid, kernel >::offsets
private

the offset for each sub-sub-domain

Definition at line 544 of file interpolation.hpp.

◆ sz

template<typename vector , typename grid , typename kernel >
size_t interpolate< vector, grid, kernel >::sz[vector::dims]
private

kernel size

Definition at line 547 of file interpolation.hpp.

◆ vd

template<typename vector , typename grid , typename kernel >
vector& interpolate< vector, grid, kernel >::vd
private

particles

Definition at line 535 of file interpolation.hpp.


The documentation for this class was generated from the following file: