39template<
class IMatrix,
class ContainerType>
56 template<
class Topology,
size_t Md>
57 Average(
const Topology& g, std::array<unsigned, Md> axes)
62 auto remains = dg::create::detail::complement( g, axes);
65 for(
unsigned u=1; u<remains.size(); u++)
70 for(
unsigned u=0; u<Md; u++)
71 m_area_inv /= g.l(axes[u]);
75 template<
class Topology,
typename = std::enable_if_t<Topology::ndim() == 2>>
82 template<
class Topology,
typename = std::enable_if_t<Topology::ndim() == 3>>
89 template<
class Topology,
typename = std::enable_if_t<Topology::ndim() == 3>>
90 Average(
const Topology& g, std::array<enum coo3d,2> axes)
91 :
Average( g, {coo2axis(axes[0]), coo2axis(axes[1])})
113 void operator() (
const ContainerType& src, ContainerType& res,
bool extend
140 IMatrix m_average, m_prolongation;
DG_DEVICE T one(T x, Ts ...xs)
Definition functions.h:24
auto kronecker(Functor &&f, const ContainerType &x0, const ContainerTypes &... xs)
Memory allocating version of dg::blas1::kronecker
Definition blas1.h:857
ContainerType construct(const from_ContainerType &from, Params &&... ps)
Generic way to construct an object of ContainerType given a from_ContainerType object and optional ad...
Definition blas1.h:792
void scal(ContainerType &x, value_type alpha)
Definition blas1.h:263
void symv(MatrixType &&M, const ContainerType1 &x, ContainerType2 &y)
Definition blas2.h:325
coo3d
3d coordinates
Definition enums.h:179
direction
Direction of a discrete derivative.
Definition enums.h:97
coo2d
2d coordinates
Definition enums.h:173
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition tensor_traits.h:45
auto evaluate(Functor &&f, const Topology &g)
Evaluate a function on grid coordinates
Definition evaluation.h:74
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
Useful MPI typedefs and overloads of interpolation and projection.
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
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Prolongation matrix creation functions.
Topological average computations in a Cartesian topology.
Definition average.h:41
Average()=default
No allocation.
dg::get_value_type< ContainerType > value_type
Definition average.h:43
Average(const Topology &g, std::array< enum coo3d, 2 > axes)
Average along given axes.
Definition average.h:90
void operator()(const ContainerType &src, ContainerType &res, bool extend=true)
Compute the average as configured in the constructor.
Definition average.h:113
Average(const Topology &g, enum coo3d axes)
Average along given axes.
Definition average.h:83
ContainerType container_type
Definition average.h:42
Average(const Topology &g, enum coo2d axes)
Average along given axes.
Definition average.h:76
Average(const Topology &g, std::array< unsigned, Md > axes)
Average along given axes.
Definition average.h:57
Definition subroutines.h:100