File laplacexz-petsc.hxx

class LaplaceXZpetsc : public LaplaceXZ

Public Functions

LaplaceXZpetsc(Mesh *m = nullptr, Options *options = nullptr, const CELL_LOC loc = CELL_CENTRE)




void setCoefs(const Field3D &A, const Field3D &B)
void setCoefs(const Field2D &A, const Field2D &B)
Field3D solve(const Field3D &b, const Field3D &x0)

Solve Laplacian in X-Z

Private Members

PetscLib lib

Requires PETSc library.

std::vector<YSlice> slice
Vec xs
Vec bs

Solution and RHS vectors.

int reuse_limit

How many times can the preconditioner be reused?

int reuse_count

How many times has it been reused?

bool coefs_set

Have coefficients been set?

int inner_boundary_flags

Flags to set inner boundary condition.

int outer_boundary_flags

Flags to set outer boundary condition.

Private Static Attributes

const int implemented_boundary_flags = INVERT_AC_GRAD + INVERT_SET + INVERT_RHS
struct YSlice

Data for a single Y slice

Public Members

int yindex
Mat MatA

Y index.

Matrix to be inverted

Mat MatP

Matrix for preconditioner.

KSP ksp

Krylov Subspace solver context.