Discontinuous Galerkin Library
#include "dg/algorithm.h"
Loading...
Searching...
No Matches
Averaging, prolongation and partial reductions

\( I \) and \( P = I^\dagger\) More...

Collaboration diagram for Averaging, prolongation and partial reductions:

Classes

struct  dg::Average< IMatrix, ContainerType >
 Topological average computations in a Cartesian topology. More...
 

Functions

template<class real_type , size_t Nd, size_t Md>
dg::SparseMatrix< int, real_type, thrust::host_vector > dg::create::prolongation (const aRealTopology< real_type, Nd > &g_new, std::array< unsigned, Md > axes)
 Prolongation matrix along given axes / Transpose of reduction.
 
template<class real_type , size_t Nd, size_t Md>
dg::SparseMatrix< int, real_type, thrust::host_vector > dg::create::reduction (std::array< unsigned, Md > axes, const aRealTopology< real_type, Nd > &g_old)
 Reduction matrix along given axes.
 
template<class real_type , size_t Nd, size_t Md>
dg::SparseMatrix< int, real_type, thrust::host_vector > dg::create::projection (std::array< unsigned, Md > axes, const aRealTopology< real_type, Nd > &g_old)
 Projection matrix along given axes.
 

Detailed Description

\( I \) and \( P = I^\dagger\)

Function Documentation

◆ projection()

template<class real_type , size_t Nd, size_t Md>
dg::SparseMatrix< int, real_type, thrust::host_vector > dg::create::projection ( std::array< unsigned, Md > axes,
const aRealTopology< real_type, Nd > & g_old )

Projection matrix along given axes.

For example if you have 2d vectors in the x-y plane that you want to reduce along the y-direction:

dg::Grid2d g2d( ...);
auto project = dg::create::projection ( std::array{1u}, g2d);
dg::MIHMatrix_t< typename MPITopology::value_type > projection(const MPITopology &g_new, const MPITopology &g_old, std::string method="dg")
Create a projection between two grids.
Definition mpi_projection.h:272
Template Parameters
NdFull grid number of dimenensions
MdNumber of dimensions to reduce Md<Nd
Parameters
axesAxis numbers in g_old along which to reduce axes[i]<g_old.ndim()
g_oldGrid of the old, un-reduced vectors
Returns
matrix that acts on vectors on the un-reduced grid g_old and produces vectors on g_old w/o axes
See also
prolongation Average
Projection is the adjoint of a prolongation

◆ prolongation()

template<class real_type , size_t Nd, size_t Md>
dg::SparseMatrix< int, real_type, thrust::host_vector > dg::create::prolongation ( const aRealTopology< real_type, Nd > & g_new,
std::array< unsigned, Md > axes )

Prolongation matrix along given axes / Transpose of reduction.

For example if you have 2d vectors in the x-y plane that you want to prolong along the z-direction:

dg::Grid3d g3d( ...);
// Create prolongation along the 2 axis of g3d to g3d
auto prolong = dg::create::prolongation ( g3d, std::array{2u});
// Means you have vectors in the 0 and 1 axis
dg::MIHMatrix_t< typename MPITopology::value_type > prolongation(const MPITopology &g_new, std::array< unsigned, Md > axes)
Prolongation matrix along given axes / Transpose of reduction.
Definition mpi_prolongation.h:18
Template Parameters
NdProlongated grid number of dimenensions
MdNumber of dimensions to prolongate Md<Nd
Parameters
g_newthe grid of the new, prolongated vectors
axesAxis numbers in g_new along which to prolong. Does not need to be sorted but axes[i] < Nd
Returns
matrix that acts on vectors on the reduced grid g_new w/o axes and produces vectors on g_new
See also
Prolongation is the transpose of a reduction and adjoint of projection

◆ reduction()

template<class real_type , size_t Nd, size_t Md>
dg::SparseMatrix< int, real_type, thrust::host_vector > dg::create::reduction ( std::array< unsigned, Md > axes,
const aRealTopology< real_type, Nd > & g_old )

Reduction matrix along given axes.

For example if you have 2d vectors in the x-y plane that you want to reduce along the y-direction:

dg::Grid2d g2d( ...);
auto reduce = dg::create::reduction ( std::array{1u}, g2d);
dg::MIHMatrix_t< typename MPITopology::value_type > reduction(std::array< unsigned, Md > axes, const MPITopology &g_old)
Reduction matrix along given axes.
Definition mpi_prolongation.h:31
Template Parameters
NdFull grid number of dimenensions
MdNumber of dimensions to reduce Md<Nd
Parameters
axesAxis numbers in g_old along which to reduce
g_oldGrid of the old, un-reduced vectors
Returns
matrix that acts on vectors on the un-reduced grid g_old and produces vectors on g_old w/o axes
Note
Weights multiply through in 1/W R W
See also
projection Average
Reduction is the transpose of a prolongation