File multigrid_laplace.hxx

Defines

MAXGM
class MultigridAlg

Subclassed by Multigrid1DP, Multigrid2DPf1D, MultigridSerial

Public Functions

MultigridAlg(int level, int lx, int lz, int gx, int gz, MPI_Comm comm, int check)
~MultigridAlg()
void setMultigridC(int plag)
void getSolution(BoutReal *x, BoutReal *b, int flag)

Public Members

int mglevel
int mgplag
int cftype
int mgsm
int pcheck
int xNP
int zNP
int rProcI
BoutReal rtol
BoutReal atol
BoutReal dtol
BoutReal omega
Array<int> gnx
Array<int> gnz
Array<int> lnx
Array<int> lnz
BoutReal **matmg

Protected Functions

void communications(BoutReal *x, int level)
void setMatrixC(int level)
void cycleMG(int level, BoutReal *sol, BoutReal *rhs)
void smoothings(int level, BoutReal *x, BoutReal *b)
void projection(int level, BoutReal *r, BoutReal *pr)
void prolongation(int level, BoutReal *x, BoutReal *ix)
void pGMRES(BoutReal *sol, BoutReal *rhs, int level, int iplag)
void solveMG(BoutReal *sol, BoutReal *rhs, int level)
void multiAVec(int level, BoutReal *x, BoutReal *b)
void residualVec(int level, BoutReal *x, BoutReal *b, BoutReal *r)
BoutReal vectorProd(int level, BoutReal *x, BoutReal *y)
void lowestSolver(BoutReal *x, BoutReal *b, int plag)

Protected Attributes

int numP
int xProcI
int zProcI
int xProcP
int xProcM
int zProcP
int zProcM
MPI_Comm commMG
class MultigridSerial : public MultigridAlg

Public Functions

MultigridSerial(int level, int gx, int gz, MPI_Comm comm, int check)
~MultigridSerial()
void convertMatrixF(BoutReal *)
class Multigrid2DPf1D : public MultigridAlg

Public Functions

Multigrid2DPf1D(int level, int lx, int lz, int gx, int gz, int dl, int px, int pz, MPI_Comm comm, int check)
~Multigrid2DPf1D()
void setMultigridC(int plag)
void setPcheck(int check)
void setValueS()

Public Members

int kflag

Private Functions

void convertMatrixFS(int level)
void lowestSolver(BoutReal *x, BoutReal *b, int plag)

Private Members

std::unique_ptr<MultigridSerial> sMG
class Multigrid1DP : public MultigridAlg

Public Functions

Multigrid1DP(int level, int lx, int lz, int gx, int dl, int merge, MPI_Comm comm, int check)
~Multigrid1DP()
void setMultigridC(int plag)
void setPcheck(int check)
void setValueS()

Public Members

int kflag

Private Functions

void convertMatrixF2D(int level)
void convertMatrixFS(int level)
void lowestSolver(BoutReal *x, BoutReal *b, int plag)

Private Members

MPI_Comm comm2D
std::unique_ptr<MultigridSerial> sMG
std::unique_ptr<Multigrid2DPf1D> rMG
class LaplaceMultigrid : public Laplacian

Public Functions

LaplaceMultigrid(Options *opt = nullptr, const CELL_LOC loc = CELL_CENTRE, Mesh *mesh_in = nullptr)
~LaplaceMultigrid()
void setCoefA(const Field2D &val)

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

void setCoefC(const Field2D &val)
void setCoefC1(const Field2D &val)
void setCoefC2(const Field2D &val)
void setCoefD(const Field2D &val)
void setCoefEx(const Field2D &val)
void setCoefEz(const Field2D &val)
void setCoefA(const Field3D &val)
void setCoefC(const Field3D &val)
void setCoefC1(const Field3D &val)
void setCoefC2(const Field3D &val)
void setCoefD(const Field3D &val)
bool uses3DCoefs() const

Does this solver use Field3D coefficients (true) or only their DC component (false)

FieldPerp solve(const FieldPerp &b)
FieldPerp solve(const FieldPerp &b_in, const FieldPerp &x0)

Private Functions

void generateMatrixF(int level)

Private Members

Field3D A
Field3D C1
Field3D C2
Field3D D
int Nx_local
int Nx_global
int Nz_local
int Nz_global
int yindex
Array<BoutReal> x
Array<BoutReal> b
std::unique_ptr<Multigrid1DP> kMG
int mglevel
int mgplag
int cftype
int mgsm
int pcheck
int mgcount
int mgmpi
Options *opts
BoutReal rtol
BoutReal atol
BoutReal dtol
BoutReal omega
MPI_Comm commX
int comms_tagbase