|
SPI
SLEPc PETSc Interface is used for rapid development and intuitive matrix operations similar to MatLab or NumPy style of operations
|
Go to the documentation of this file.
11 SPIMat
map_D(SPIMat D, SPIVec y, PetscInt d, PetscInt order=4);
12 SPIMat
set_D(SPIVec &y, PetscInt d, PetscInt order=4, PetscBool uniform=PETSC_FALSE);
15 SPIMat
set_D_Chebyshev(SPIVec &x, PetscInt d=1, PetscBool need_map=PETSC_FALSE);
22 std::tuple<SPIMat,SPIMat>
set_D_UltraS(SPIVec &x, PetscInt d=1);
23 std::tuple<SPIMat,SPIMat>
set_T_That(PetscInt n);
SPIMat FTinv
inverse Fourier Transform from wavenumber space to physical space for time
SPIMat S0invS1inv
inverse of S0^-1 * S1^-1
@ FDperiodic
finite difference grid on periodic grid
SPIVec get_D_Coeffs(SPIVec &s, PetscInt d)
get the coefficients of the given stencil.
SPIMat Ihalf
positive wavenumbers from FT
SPIMat FT
Fourier Transform operator.
SPIMat FT
Fourier Transform operator from physical space to wavenumber space for time.
SPIMat Ihalfn
negative wavenumbers from FT
SPIMat Dyy
2nd derivative operator with respect to y
PetscScalar integrate(const SPIVec &a, SPIgrid1D &grid)
integrate a vector of chebyshev Coefficients on a physical grid
PetscBool flag_set_operators
flag if set_operators has been executed
PetscBool flag_set_grid
flag if set_grid has been executed
Class to contain various grid parameters.
SPIMat T
Chebyshev operator taking it from Chebyshev coefficients to physical space.
~SPIgrid2D()
destructor of saved SPIVec and SPIMat
SPIgrid1D()
constructor with at no arguments
SPIMat Dy
1st derivative operator with respect to y
@ Chebyshev
Chebyshev collocated grid.
@ FD
finite difference grid
PetscBool flag_set_derivatives
flag if set_derivatives has been executed
@ Fourier
Fourier transform collocated grid.
SPIMat O
zero matrix same size as derivative operators of size ny*nt x ny*nt
SPIMat set_D_periodic(SPIVec &y, PetscInt d, PetscInt order=4)
set the derivative operator for the proper periodic grid assuming uniform discretization.
SPIVec y
grid for wall-normal dimension
void print()
saves grid to internal grid
SPIMat set_D(SPIVec &y, PetscInt d, PetscInt order=4, PetscBool uniform=PETSC_FALSE)
set the derivative operator for the proper y grid if uniform=false. Uses map_D function
void set_derivatives(PetscInt order=4)
sets derivatives Dy and Dyy using saved grid
std::tuple< SPIMat, SPIMat, SPIMat, SPIMat > dft_dftinv_Ihalf_Ihalfn(PetscInt nt)
@ UltraS
UltraSpherical grid and derivatives.
SPIVec set_Cheby_mapped_y(PetscScalar a, PetscScalar b, PetscInt ny)
create a stretched Chebyshev grid from [a,b] using default Chebfun like mapping
gridtype ttype
type of grid for time dimension
void set_derivatives(PetscInt order=4)
sets derivatives Dy and Dyy using saved grid
std::tuple< SPIMat, SPIMat > set_D_UltraS(SPIVec &x, PetscInt d=1)
set a UltraSpherical operator acting with respect to the collocated grid (keeps everything in UltraSp...
SPIMat That
Chebyshev operator taking it from physical space to Chebyshev coefficients.
void set_grid(SPIVec &y)
saves grid to internal grid
SPIMat I
identity matrix same size as derivative operators of size ny*nt x ny*nt
SPIMat Ihalfn
negative wavenumbers from FT
SPIMat Dyy
2nd derivative operator with respect to y of size ny*nt x ny*nt
SPIMat Dt
1st derivative operator with respect to t of size ny*nt x ny*nt
SPIMat map_D_Chebyshev(SPIVec &x, PetscInt d=1)
map a Chebyshev collocated operator acting with respect to the stretched collocated grid
~SPIgrid1D()
destructor of saved SPIVec and SPIMat
std::vector< SPIVec > orthogonalize(std::vector< SPIVec > &x, SPIgrid1D &grid)
SPIMat FT4
Fourier Transform operator from physical space to wavenumber space for time. For 4 variable state vec...
SPIMat S0invS1inv
[in] inverse of S0^-1 * S1^-1
SPIVec set_Fourier_t(PetscScalar T, PetscInt ny)
create a Fourier grid from [0,T]
SPIVec SPIVec1Dto2D(SPIgrid2D &grid2D, SPIVec &u)
expand a 1D vector to a 2D vector copying data along time dimension
SPIMat Ihalf
positive wavenumbers from FT
void set_operators()
sets zero and identity operators for grid
SPIMat FTinv4
inverse Fourier Transform from wavenumber space to physical space for time. For 4 variable state vect...
PetscInt factorial(PetscInt n)
compute the factorial of n. This is needed for get_D_Coeffs function
SPIgrid2D(SPIVec &y, SPIVec &t, std::string name="SPIgrid2D", gridtype y_gridtype=FD, gridtype t_gridtype=Fourier)
constructor with no arguments (set default values)
SPIMat O
zero matrix same size as derivative operators
SPIMat Ihalfn4
negative wavenumbers from FT. For 4 variable state vector
SPIVec set_Cheby_stretched_y(PetscScalar y_max, PetscInt ny, PetscScalar yi=10.)
create a stretched Chebyshev grid from [0,y_max] with yi being the midpoint location for the number o...
SPIMat Dy
1st derivative operator with respect to y of size ny*nt x ny*nt
SPIMat map_D(SPIMat D, SPIVec y, PetscInt d, PetscInt order=4)
map the derivative operator to the proper y grid
SPIMat P
row permutation matrix for UltraSpherical operators to shift rows from bottom to top to reduce LU fac...
SPIVec set_FD_stretched_y(PetscScalar y_max, PetscInt ny, PetscScalar delta=2.0001)
set stretched grid from [0,y_max] using tanh stretching for use with finite difference operators
SPIMat avgt
average in time operator
SPIVec set_Cheby_y(PetscInt ny)
create a Chebyshev grid from [-1,1]
SPIMat That
transform from physical to chebyshev
gridtype ytype
type of grid
std::string name
name of grid
SPIMat Ihalf4
positive wavenumbers from FT. For 4 variable state vector
SPIMat S1S0That
UltraSpherical helper matrix S1*S0*That for baseflow.
PetscBool flag_set_operators
flag if set_operators has been executed
void print()
saves grid to internal grid
gridtype
enumeration of grid types
SPIMat S0
UltraSpherical helper matrix S_0 takes chebyshev coefficients and outputs C^(1) coefficients.
PetscBool flag_set_derivatives
flag if set_derivatives has been executed
SPIVec t
grid for time dimension
SPIVec proj(SPIVec &u, SPIVec &v, SPIgrid1D &grid)
void set_grid(SPIVec &y, SPIVec &t)
saves grid to internal grid
SPIMat FTinv
inverse Fourier Transform
void set_operators()
sets zero and identity operators for grid
gridtype ytype
type of grid for wall-normal dimension
SPIMat set_D_Fourier(SPIVec t, PetscInt d=1)
create a Fourier derivative operator acting on grid t
PetscBool flag_set_grid
flag if set_grid has been executed
std::string name
name of grid
SPIMat S1
UltraSpherical helper matrices S_1 takes C^(1) coefficients and outputs C^(2) coefficients.
SPIMat S1S0That
UltraSpherical helper matrix S1*S0*That for baseflow.
SPIMat T
transform from chebyshev to physical
SPIMat I
identity matrix same size as derivative operators
SPIMat interp1D_Mat(SPIgrid1D &grid1, SPIgrid1D &grid2)
SPIMat set_D_Chebyshev(SPIVec &x, PetscInt d=1, PetscBool need_map=PETSC_FALSE)
set a Chebyshev collocated operator acting with respect to the collocated grid
std::tuple< SPIMat, SPIMat > set_T_That(PetscInt n)
set a T and That operators acting with respect to the Chebyshev collocated grid, That: physical -> Ch...