Discontinuous Galerkin Library
#include "dg/algorithm.h"
interpolationX.h
Go to the documentation of this file.
1#pragma once
2//#include <iomanip>
3
4#include "interpolation.h"
5#include "gridX.h"
6
12namespace dg{
13
14namespace create{
17
26template<class real_type>
27cusp::coo_matrix<int, real_type, cusp::host_memory> interpolation( const thrust::host_vector<real_type>& x, const RealGridX1d<real_type>& g)
28{
29 return interpolation( x, g.grid());
30}
31
43template<class real_type>
44cusp::coo_matrix<int, real_type, cusp::host_memory> interpolation( const thrust::host_vector<real_type>& x, const thrust::host_vector<real_type>& y, const aRealTopologyX2d<real_type>& g , dg::bc globalbcz = dg::NEU)
45{
46 return interpolation( x,y, g.grid(), globalbcz);
47}
48
49
50
64template<class real_type>
65cusp::coo_matrix<int, real_type, cusp::host_memory> interpolation( const thrust::host_vector<real_type>& x, const thrust::host_vector<real_type>& y, const thrust::host_vector<real_type>& z, const aRealTopologyX3d<real_type>& g, dg::bc globalbcz= dg::NEU)
66{
67 return interpolation( x,y,z, g.grid(), globalbcz);
68}
69
82template<class real_type>
83cusp::coo_matrix<int, real_type, cusp::host_memory> interpolation( const RealGridX1d<real_type>& g_new, const RealGridX1d<real_type>& g_old)
84{
85 return interpolation( g_new.grid(), g_old.grid());
86}
99template<class real_type>
100cusp::coo_matrix<int, real_type, cusp::host_memory> interpolation( const aRealTopologyX2d<real_type>& g_new, const aRealTopologyX2d<real_type>& g_old)
101{
102 return interpolation( g_new.grid(), g_old.grid());
103}
104
117template<class real_type>
118cusp::coo_matrix<int, real_type, cusp::host_memory> interpolation( const aRealTopologyX3d<real_type>& g_new, const aRealTopologyX3d<real_type>& g_old)
119{
120 return interpolation( g_new.grid(), g_old.grid());
121}
123
132template<class real_type>
133thrust::host_vector<real_type> forward_transform( const thrust::host_vector<real_type>& in, const aRealTopologyX2d<real_type>& g)
134{
135 return forward_transform( in, g.grid());
136}
137}//namespace create
138
159template<class real_type>
160real_type interpolate(
161 dg::space sp,
162 const thrust::host_vector<real_type>& v,
163 real_type x, real_type y,
165 dg::bc bcx = dg::NEU, dg::bc bcy = dg::NEU )
166{
167 return interpolate( sp, v, x, y, g.grid(), bcx, bcy);
168}
169
170} //namespace dg
base X-point topology classes
bc
Switch between boundary conditions.
Definition: enums.h:15
space
Space of DG coefficients.
Definition: enums.h:164
@ z
z direction
@ NEU
Neumann on both boundaries.
Definition: enums.h:20
@ y
y direction
@ x
x direction
cusp::coo_matrix< int, real_type, cusp::host_memory > interpolation(const thrust::host_vector< real_type > &x, const RealGrid1d< real_type > &g, dg::bc bcx=dg::NEU, std::string method="dg")
Create interpolation matrix.
Definition: interpolation.h:254
real_type interpolate(dg::space sp, const thrust::host_vector< real_type > &v, real_type x, const RealGrid1d< real_type > &g, dg::bc bcx=dg::NEU)
Interpolate a vector on a single point on a 1d Grid.
Definition: interpolation.h:884
1D, 2D and 3D interpolation matrix creation functions
thrust::host_vector< real_type > forward_transform(const thrust::host_vector< real_type > &in, const aRealTopologyX2d< real_type > &g)
Transform a vector from XSPACE to LSPACE.
Definition: interpolationX.h:133
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
1D grid for X-point topology
Definition: gridX.h:68
RealGrid1d< real_type > grid() const
Definition: gridX.h:185
A 2D grid class with X-point topology.
Definition: gridX.h:257
RealGrid2d< real_type > grid() const
Return a copy without topology.
Definition: gridX.h:382
A 3D grid class with X-point topology.
Definition: gridX.h:541
RealGrid3d< real_type > grid() const
Return a copy without topology.
Definition: gridX.h:705