Nektar++
Loading...
Searching...
No Matches
Classes | Namespaces
PhysInterp1DScaledOp.hpp File Reference

Whole-field interface of the PhysInterp1DScaled element operator, which re-evaluates a physical-space field on a rescaled quadrature grid of the same elements. More...

#include <MultiRegions/ElmtOps/ElmtOp.hpp>
#include <MultiRegions/ElmtOps/PhysInterp1DScaled/PhysInterp1DScaledBlockOp.hpp>

Go to the source code of this file.

Classes

class  Nektar::MultiRegions::PhysInterp1DScaledOp< TData >
 Whole-field interface of the scaled physical-space interpolation: re-evaluates a physical-space field on the rescaled quadrature grid of every element. More...
 

Namespaces

namespace  Nektar
 
namespace  Nektar::MultiRegions
 

Detailed Description

Whole-field interface of the PhysInterp1DScaled element operator, which re-evaluates a physical-space field on a rescaled quadrature grid of the same elements.

What the operator computes

Each element of a block holds its values on a tensor-product grid of quadrature points, \(nm_d\) points in reference direction \(d\). The operator interpolates those values onto a grid of \(nq_d\) points of the same points distribution, so input and output are both in FieldState::Phys and only the number of points changes. In one direction that is

\[ u(\xi^{new}_i) = \sum_{p} h_p(\xi^{new}_i)\, u(\xi_p), \]

where \(h_p\) is the Lagrange interpolant through the element's own quadrature points, \(h_p(\xi_r) = \delta_{pr}\); in two and three directions it is the tensor product of one such sum per direction,

\[ u(\xi^{new}_{i}, \eta^{new}_{j}) = \sum_{p,q} h_p(\xi^{new}_{i})\, h_q(\eta^{new}_{j})\, u(\xi_p, \eta_q). \]

The element's geometry never enters – no Jacobians or metric terms – and neither do the expansion's modes: the operator maps point values to point values. It is the block-operator counterpart of ExpList::PhysInterp1DScaled, the over-integration step the solvers use to dealias nonlinear terms; PhysGalerkinProject1DScaledOp maps the finer grid back. AdvectionDealiasOp performs the same interpolation as a stage of its own kernels, fetching the same warehouse data, rather than applying this operator.

The scale factor

The output point counts come from the single scale factor \(\sigma\) set through SetScaleFactor(), applied per direction to the number of quadrature points (it is not a geometric scaling):

\[ nq_0 = \lfloor \sigma\, nm_0 \rfloor, \qquad nq_d = \begin{cases} \lfloor \sigma\, nm_0 \rfloor - 1, & nm_0 - nm_d = 1 \\ \lfloor \sigma\, nm_d \rfloor, & \text{otherwise} \end{cases} \quad (d = 1, 2). \]

The special case keeps a one-point offset between direction 0 and a direction one point shorter – the standard point relation of the collapsed shapes – intact in the output. It is the rule of MultiRegions::ExpList::Get1DScaledTotPoints, which writes the offset case as \(\lfloor \sigma\, nm_0 - 1 \rfloor\), the same number for \(\sigma\, nm_0 \ge 1\); so the operator's output sizes match those of a field the caller sized with it. Because the point counts differ between input and output, the two fields do not share block attributes: the output field must be built with per-element data counts computed from the same \(\sigma\) by this rule.

Note
These are the counts the operator interpolates onto, but not the ones the sum-factorised implementations' size switch is driven by: that switch recomputes per-direction output counts as \(\lfloor \sigma\, nm_d \rfloor\) from the scale factor and the input counts, without the offset case, and reads the counts derived here only for its runtime-sized fall-back (see LibUtilities/BasicUtils/Switch/BlockOpSwitchPhysInterp1D.h.in).

Interpolation matrices

The per-direction matrices are the interpolation operators from the direction's own points distribution to \(nq_d\) points of that same distribution, taken from the data warehouse under LibUtilities::BasisDataKey with LibUtilities::eInterp and \(nq_d\) as the target count, and laid out exactly like a 1D basis table: I[p * nq_d + i] is \(h_p(\xi^{new}_i)\). That is why the sum-factorised implementations can drive the backward transform's tensor-product kernels unchanged, with the input points of a direction playing the role of its modes. The StdMat implementations instead fetch the assembled dense matrix over all directions (StdRegions::StdMatKey with StdRegions::ePhysInterpStdMat or its transpose, the output counts being part of the key). Either way the target point counts enter the warehouse key, so one cached entry is built per basis and target point count and shared between blocks and operators.

The collapsed shapes need no special treatment: the physical points of a triangle, tetrahedron, prism or pyramid form a tensor-product grid in the collapsed coordinates, so the tensor-product kernels of the segment, quadrilateral and hexahedron serve every shape of the matching dimension.

The family follows the standard element-operator layout (see ElmtOp.hpp):

Definition in file PhysInterp1DScaledOp.hpp.