Perform WENO reconstruction of q.
| Parameters: |
|
|---|
Supported reconstruction points points are:
This function wraps several complied WENO kernels which were generated by PyWENO. If you need WENO reconstructions at points not supported by this wrapper, please checkout PyWENO.
Build a symbolic polynomial that interpolates the points (x_i, y_i).
The returned polynomial is a function of the SymPy variable x.
Build a symbolic polynomial that approximates the primitive function f such that f(x_i) = sum_j y_j * (x_{j+1} - x_{j}).
The returned polynomial is a function of the SymPy variable ‘x’.
Compute the reconstruction coefficients for a 2k-1 order WENO scheme corresponding to the reconstruction points in xi.
The reconstruction points in xi should in \([-1, 1]\). This interval is then mapped to the cell \([x_{i-1/2}, x_{i+1/2}]\).
The returned coefficients are stored as SymPy variables in a dictionary indexed according to c[l,r,j]. That is
for each \(l\) from 0 to len(xi).
Compute the optimal weights for a 2k-1 order WENO scheme corresponding to the reconstruction points in xi.
The coefficients are stored as SymPy variables in a dictionary indexed according to w[l,r]. That is
for each \(l\) from 0 to len(xi).
Compute the Jiang-Shu smoothness coefficients for a 2k-1 order WENO scheme.
The coefficients are stored as SymPy variables in a dictionary indexed according to beta[r,m,n]. That is
XXX
XXX
XXX
PyWENO code generation tool kit (kernels).
Generate kernels for WENO reconstructions.
Each method generates a ‘kernel’ for a specific WENO operation: computing smoothness indicators, non-linear weights, and reconstructions. These code snippets can, in-turn, be used to create seperate functions or larger kernels.
The local_names dictionary is used to define naming conventions:
For each of the above, the occurance of X is replaced by the left-shift r. For example, for k=3 and omega='omegaX', the weights are stored in omega0, omega1, and omega2, each of which are assumed to be in scope. In some routines the accumulator variable acc is also assumed to be in scope.
| Parameters: | lang – 'c', 'opencl', or 'fortran' |
|---|
Fully un-rolled reconstruction kernel for uniform grids.
The reconstruction kernel computes the WENO reconstruction based on the weights omega (which have already been computed) and the reconstruction coefficients coeffs.
Set the optimal (linear) weights.
Set the reconstruction coefficients.
Set the smoothness indicator coefficients.
Fully un-rolled smoothness indicator kernel for uniform grids.
The smoothness indicator kernel computes the smoothness indicators sigma determined by the coefficients in beta. That is:
Fully un-rolled weights kernel for uniform grids.
The weights kernel computes the weights \(\omega^r\) determined by the smoothness coefficients \(\sigma^r\) (which have already been computed). The weights \(\omega^r\) are computed from the optimal weights \(\varpi^r\) according to:
The weights are subsequently renormalised (if requested) according to:
| Parameters: |
|
|---|
If normalise is False the weights are not re-normalised. Instead, the re-normalisation occurs during the reconstruction step. This saves a few divisions if the weights are computed during the reconstruction.
PyWENO function generation class (callable functions).
Generate callable functions for WENO reconstructions.
Each method generates a function for a specific WENO operation (or combinations thereof): computing smoothness indicators, non-linear weights, and reconstructions.
| Parameters: | lang – 'c', 'opencl', or 'fortran' |
|---|
Generate WENO function/subroutine called function.
| Parameters: |
|
|---|---|
| Returns: | function source code as a string |
Set reconstruction coeffs, optimal weights, and smoothness coeffs to symbols appropriate for non-uniform reconstructions.
Set the optimal (linear) weights.
Set the reconstruction coefficients.
Set the smoothness indicator coefficients.
PyWENO non-uniform reconstruction routines.
Compute the Jiang-Shu smoothness coefficients for a 2k-1 order WENO scheme on the non-uniform grid x.
The coefficients are stored in a NumPy array indexed according to beta[i,r,m,n]. That is
Compute the optimal weights for a 2k-1 order WENO scheme corresponding to the reconstruction points in xi on the non-uniform grid x.
The coefficients are stored in a NumPy array that is indexed according to w[i,l,r]. That is
for each \(l\) from 0 to len(xi).
Numerically compute the reconstruction coefficients for a 2k-1 order WENO scheme corresponding to the reconstruction points in xi on the non-uniform grid x.
The reconstruction points in xi should be in \([-1, 1]\). This interval is then mapped to the cell \([x_{i-1/2}, x_{i+1/2}]\).
| Parameters: |
|
|---|
The returned coefficients are stored in a NumPy array that is indexed according to c[i,l,r,j]. That is
for each \(l\) from 0 to len(xi).
PyWENO version information.
To obtain the version of PyWENO:
>>> import pyweno.version
>>> pyweno.version.version()
>>> pyweno.version.git_version()