File pcr.hxx#

Perpendicular Laplacian inversion. Parallel code using FFT and tridiagonal solver.

class LaplacePCR : public Laplacian#

Public Functions

LaplacePCR(Options *opt = nullptr, const CELL_LOC loc = CELL_CENTRE, Mesh *mesh_in = nullptr, Solver *solver = nullptr)#
~LaplacePCR() = default#
inline virtual void setCoefA(const Field2D &val) override#

Set coefficients for inversion. Re-builds matrices if necessary.

inline virtual void setCoefC(const Field2D &val) override#
inline virtual void setCoefC1(const Field2D &val) override#
inline virtual void setCoefC2(const Field2D &val) override#
inline virtual void setCoefD(const Field2D &val) override#
inline virtual void setCoefEx(const Field2D &val) override#
inline virtual void setCoefEz(const Field2D &val) override#
inline virtual FieldPerp solve(const FieldPerp &b) override#
virtual FieldPerp solve(const FieldPerp &rhs, const FieldPerp &x0) override#
inline virtual Field3D solve(const Field3D &b) override#
virtual Field3D solve(const Field3D &rhs, const Field3D &x0) override#
void cr_solver(double *a_mpi, double *b_mpi, double *c_mpi, double *r_mpi, double *x_mpi)#
void cr_pcr_solver(Matrix<dcomplex> &a_mpi, Matrix<dcomplex> &b_mpi, Matrix<dcomplex> &c_mpi, Matrix<dcomplex> &r_mpi, Matrix<dcomplex> &x_mpi)#
void Thomas_pcr_solver(double *a_mpi, double *b_mpi, double *c_mpi, double *r_mpi, double *x_mpi)#
void verify_solution(double *a_ver, double *b_ver, double *c_ver, double *r_ver, double *x_sol)#
void setCoefA(const Field2D &val) = 0

Set coefficients for inversion. Re-builds matrices if necessary.

inline void setCoefA(const Field3D &val)#
inline void setCoefA(BoutReal r)#
void setCoefC(const Field2D &val) = 0
inline void setCoefC(const Field3D &val)#
inline void setCoefC(BoutReal r)#
inline void setCoefC1(const Field2D &val)
inline void setCoefC1(const Field3D &val)#
inline void setCoefC1(BoutReal r)#
inline void setCoefC2(const Field2D &val)
inline void setCoefC2(const Field3D &val)#
inline void setCoefC2(BoutReal r)#
void setCoefD(const Field2D &val) = 0
inline void setCoefD(const Field3D &val)#
inline void setCoefD(BoutReal r)#
void setCoefEx(const Field2D &val) = 0
inline void setCoefEx(const Field3D &val)#
inline void setCoefEx(BoutReal r)#
void setCoefEz(const Field2D &val) = 0
inline void setCoefEz(const Field3D &val)#
inline void setCoefEz(BoutReal r)#
FieldPerp solve(const FieldPerp &b) = 0
Field3D solve(const Field3D &b)
Field2D solve(const Field2D &b)#
inline FieldPerp solve(const FieldPerp &b, const FieldPerp &x0)
Field3D solve(const Field3D &b, const Field3D &x0)
Field2D solve(const Field2D &b, const Field2D &x0)#

Private Functions

void cr_forward_multiple_row(Matrix<dcomplex> &a, Matrix<dcomplex> &b, Matrix<dcomplex> &c, Matrix<dcomplex> &r) const#
void cr_backward_multiple_row(Matrix<dcomplex> &a, Matrix<dcomplex> &b, Matrix<dcomplex> &c, Matrix<dcomplex> &r, Matrix<dcomplex> &x) const#
void apply_boundary_conditions(const Matrix<dcomplex> &a, const Matrix<dcomplex> &b, const Matrix<dcomplex> &c, const Matrix<dcomplex> &r, Matrix<dcomplex> &x)#
void eliminate_boundary_rows(Matrix<dcomplex> &a, Matrix<dcomplex> &b, Matrix<dcomplex> &c, Matrix<dcomplex> &r)#
void cr_forward_single_row()#
void cr_backward_single_row()#
void pcr_forward_single_row(Matrix<dcomplex> &a, Matrix<dcomplex> &b, Matrix<dcomplex> &c, Matrix<dcomplex> &r, Matrix<dcomplex> &x) const#
void verify_solution(const Matrix<dcomplex> &a_ver, const Matrix<dcomplex> &b_ver, const Matrix<dcomplex> &c_ver, const Matrix<dcomplex> &r_ver, const Matrix<dcomplex> &x_sol) const#

Private Members

Field2D Acoef#
Field2D C1coef#
Field2D C2coef#
Field2D Dcoef#
Matrix<dcomplex> bcmplx#
Matrix<dcomplex> xcmplx#
int n_mpi#

Number of rows per MPI process and should be 2^n.

int nprocs#

Number of MPI process and should be also 2^m.

int myrank#

MPI process ID.

int xproc#

MPI process x ID.

int inbndry#

Number of inner boundary cells.

int outbndry#

Number of outer boundary cells.

Matrix<dcomplex> a#

Local private pointer for coefficient maxtix a.

Matrix<dcomplex> aa#
Matrix<dcomplex> b#

Local private pointer for coefficient maxtix b.

Matrix<dcomplex> bb#
Matrix<dcomplex> c#

Local private pointer for coefficient maxtix c.

Matrix<dcomplex> cc#
Matrix<dcomplex> r#

Local private pointer for RHS vector r.

Matrix<dcomplex> x#

Local private pointer for solution vector x.

int nmode#

Number of unfiltered Fourier modes.

int nsys = {}#

Number of systems to solve = number of unfiltered Fourier modes times number of y points

int ncx#

Number of local x, y points.

int ny#
Tensor<dcomplex> avec#

Lower-, on- and upper-diagonal terms of the operator matrix.

Tensor<dcomplex> bvec#
Tensor<dcomplex> cvec#
int ncalls = {0}#

Counter for the number of times the solver has been called.

int xs#

First and last interior points xstart, xend.

int xe#
bool dst = {false}#