File naulin_laplace.hxx#
-
class LaplaceNaulin : public Laplacian#
- #include <naulin_laplace.hxx>
Solves the 2D Laplacian equation.
Public Functions
-
LaplaceNaulin(Options *opt = NULL, const CELL_LOC loc = CELL_CENTRE, Mesh *mesh_in = nullptr, Solver *solver = nullptr)#
-
~LaplaceNaulin() = default#
-
inline virtual void setCoefA(const Field2D &val) override#
Set coefficients for inversion. Re-builds matrices if necessary.
-
inline virtual bool uses3DCoefs() const override#
Does this solver use Field3D coefficients (true) or only their DC component (false)
-
virtual Field3D solve(const Field3D &b, 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 void setGlobalFlags(int f) override#
-
inline virtual void setInnerBoundaryFlags(int f) override#
-
inline virtual void setOuterBoundaryFlags(int f) override#
-
inline void resetMeanIterations()#
-
void setCoefA(const Field2D &val) = 0
Set coefficients for inversion. Re-builds matrices if necessary.
-
inline void setCoefA(const Field3D &val)
-
void setCoefC(const Field2D &val) = 0
-
inline void setCoefC(const Field3D &val)
-
inline void setCoefC1(const Field2D &val)
-
inline void setCoefC1(const Field3D &val)
-
inline void setCoefC2(const Field2D &val)
-
inline void setCoefC2(const Field3D &val)
-
void setCoefD(const Field2D &val) = 0
-
inline void setCoefD(const Field3D &val)
-
void setCoefEx(const Field2D &val) = 0
-
void setCoefEz(const Field2D &val) = 0
-
Field3D solve(const Field3D &b, const Field3D &x0)
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
Private Functions
-
LaplaceNaulin(const LaplaceNaulin&)#
-
LaplaceNaulin &operator=(const LaplaceNaulin&)#
Private Members
-
std::unique_ptr<Laplacian> delp2solver = {nullptr}#
Laplacian solver used to solve the equation with constant-in-z coefficients.
-
int maxits#
Maximum number of iterations.
-
BoutReal initial_underrelax_factor = {1.}#
Initial choice for under-relaxation factor, should be greater than 0 and less than or equal to 1. Value of 1 means no underrelaxation
-
BoutReal underrelax_threshold = {1.5}#
Factor by which the error may increase since the previous iteration before triggering a sub-cycle with decreasing underrelax_factor to try and prevent divergence.
-
BoutReal underrelax_decrease_factor = {0.9}#
Factor by which to decrease underrelax_factor at each stage of the sub-loop triggered if underrelax_threshold is crossed.
-
int underrelax_decrease_maxits = {10}#
Maximum number of iterations in the decreasing-underrelax_factor subcycle before trying to continue the main iteration loop.
-
BoutReal underrelax_recovery = {1.1}#
If underrelax_factor has been decreased, increase it again by this factor at the end of a successful iteration to try and speed up subsequent convergence.
-
BoutReal naulinsolver_mean_underrelax_counts = {0.}#
Mean number of times the underrelaxation factor is reduced.
-
int ncalls#
Counter for the number of times the solver has been called.
-
LaplaceNaulin(Options *opt = NULL, const CELL_LOC loc = CELL_CENTRE, Mesh *mesh_in = nullptr, Solver *solver = nullptr)#