|
| Average ()=default |
| No allocation.
|
|
template<class Topology , size_t Md> |
| Average (const Topology &g, std::array< unsigned, Md > axes) |
| Average along given axes.
|
|
template<class Topology , typename = std::enable_if_t<Topology::ndim() == 2>> |
| Average (const Topology &g, enum coo2d axes) |
| Average along given axes.
|
|
template<class Topology , typename = std::enable_if_t<Topology::ndim() == 3>> |
| Average (const Topology &g, enum coo3d axes) |
| Average along given axes.
|
|
template<class Topology , typename = std::enable_if_t<Topology::ndim() == 3>> |
| Average (const Topology &g, std::array< enum coo3d, 2 > axes) |
| Average along given axes.
|
|
void | operator() (const ContainerType &src, ContainerType &res, bool extend=true) |
| Compute the average as configured in the constructor.
|
|
template<class IMatrix, class ContainerType>
struct dg::Average< IMatrix, ContainerType >
Topological average computations in a Cartesian topology.
\begin{align}
\langle f \rangle_x := \frac{1}{L_x}\int_0^{L_x}dx f \quad
\langle f \rangle_y := \frac{1}{L_y}\int_0^{L_y}dy f \quad
\langle f \rangle_z := \frac{1}{L_z}\int_0^{L_z}dz f \\
\langle f \rangle_{xy} := \frac{1}{L_xL_y}\int_0^{L_x}\int_0^{L_y}dxdy f \quad
\langle f \rangle_{xz} := \frac{1}{L_xL_z}\int_0^{L_x}\int_0^{L_z}dxdz f \quad
\langle f \rangle_{yz} := \frac{1}{L_yL_z}\int_0^{L_y}\int_0^{L_z}dydz f \quad
\end{align}
Given a Cartesian topology it is possible to define a partial reduction of a given vector. In two dimensions for example we can define a reduction over all points that are neighbors in the x (or y) direction. We are then left with Ny (Nx) points. In three dimensions we can define the reduction along the x, y, z directions but also over all points in the xy (xz or yz) planes. We are left with two- (respectively three-)dimensional vectors.
- See also
- Average is essentially a
dg::create::projection(std::array<unsigned,Md>,const aRealTopology<real_type,Nd>&)
scaled with the inverse area
- Note
- The integrals include the dG weights but not the volume element (does not know about geometry)
pol( vector, average_y, false);
INFO("Distance to solution is: "<<res<<"\t(Should be 0)");
CHECK_THAT( res, WithinAbs( 0.0, 1e-13));