File petsc3damg.hxx#

class LaplacePetsc3dAmg : public Laplacian#

Public Functions

LaplacePetsc3dAmg(Options *opt = nullptr, const CELL_LOC loc = CELL_CENTRE, Mesh *mesh_in = nullptr, Solver *solver = nullptr)#
~LaplacePetsc3dAmg() override#
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 void setCoefA(const Field3D &val) override#
inline virtual void setCoefC(const Field3D &val) override#
inline virtual void setCoefC1(const Field3D &val) override#
inline virtual void setCoefC2(const Field3D &val) override#
inline virtual void setCoefD(const Field3D &val) override#
inline virtual void setCoefEx(const Field3D &val) override#
inline virtual void setCoefEz(const Field3D &val) override#
PetscMatrix<Field3D> &getMatrix3D()#
inline IndexerPtr<Field3D> getIndexer()#
virtual Field2D solve(const Field2D &b) override#
inline virtual Field3D solve(const Field3D &b) override#
virtual Field3D solve(const Field3D &b_in, const Field3D &x0) override#

Performs the laplacian inversion y-slice by y-slice

Parameters:
  • b[in] All the y-slices of b_slice, which is the right hand side of the equation A*x_slice = b_slice

  • x0[in] All the y-slices of the variable eventually used to set BC

Returns:

x All the y-slices of x_slice in the equation A*x_slice = b_slice

inline virtual FieldPerp solve(const FieldPerp &b) override#

Private Functions

void updateMatrix3D()#

Private Members

Field3D A#
Field3D C1#
Field3D C2#
Field3D D#
Field3D Ex#
Field3D Ez#
bool issetD = false#
bool issetC = false#
bool issetE = false#
bool updateRequired = true#
Options *opts#
int lower_boundary_flags#
int upper_boundary_flags#
std::string ksptype#

KSP solver type.

std::string pctype#

Preconditioner type.

BoutReal richardson_damping_factor#
BoutReal chebyshev_max#
BoutReal chebyshev_min#
int gmres_max_steps#
BoutReal rtol#
BoutReal atol#
BoutReal dtol#
int maxits#
bool direct#
RangeIterator lowerY#
RangeIterator upperY#
IndexerPtr<Field3D> indexer#
PetscMatrix<Field3D> operator3D#
KSP ksp = nullptr#
bool kspInitialised = false#
PetscLib lib#

Private Static Functions

static OperatorStencil<Ind3D> getStencil(Mesh *localmesh, const RangeIterator &lowerYBound, const RangeIterator &upperYBound)#

Private Static Attributes

static constexpr int implemented_flags = INVERT_START_NEW#
static constexpr int implemented_boundary_flags = INVERT_AC_GRAD + INVERT_SET + INVERT_RHS#