File invert_parderiv.hxx


class InvertPar
#include <invert_parderiv.hxx>

Base class for parallel inversion solvers.

Inverts a matrix of the form

A + B * Grad2_par2 + C*D2DYDZ + D*D2DZ2 + E*DDY


InvertPar *inv = InvertPar::Create(); inv->setCoefA(1.0); inv->setCoefB(-0.1);

Field3D result = inv->solve(rhs);

Subclassed by InvertParCR

Public Functions

InvertPar(Options *opt, Mesh *mesh_in = nullptr)

Constructor. Note that this is a base class, with pure virtual members, so can’t be created directly. To create an InvertPar object call the create() static function.

virtual ~InvertPar()
const Field2D solve(const Field2D &f)

Solve the system of equations Warning: Default implementation very inefficient. This converts the Field2D to a Field3D then calls solve() on the 3D variable

virtual const Field3D solve(const Field3D &f) = 0

Solve the system of equations

This method must be implemented

virtual const Field3D solve(const Field2D &f, const Field2D &start)

Solve, given an initial guess for the solution This can help if using an iterative scheme

virtual const Field3D solve(const Field3D &f, const Field3D &start)
virtual void setCoefA(const Field2D &f) = 0

Set the constant coefficient A

virtual void setCoefA(const Field3D &f)
virtual void setCoefA(BoutReal f)
virtual void setCoefB(const Field2D &f) = 0

Set the Grad2_par2 coefficient B

virtual void setCoefB(const Field3D &f)
virtual void setCoefB(BoutReal f)
virtual void setCoefC(const Field2D &f) = 0

Set the D2DYDZ coefficient C

virtual void setCoefC(const Field3D &f)
virtual void setCoefC(BoutReal f)
virtual void setCoefD(const Field2D &f) = 0

Set the D2DZ2 coefficient D

virtual void setCoefD(const Field3D &f)
virtual void setCoefD(BoutReal f)
virtual void setCoefE(const Field2D &f) = 0

Set the DDY coefficient E

virtual void setCoefE(const Field3D &f)
virtual void setCoefE(BoutReal f)

Public Static Functions

InvertPar *Create(Mesh *mesh_in = nullptr)

Create an instance of InvertPar

Note: For consistency this should be renamed “create” and take an Options* argument

Protected Attributes

Mesh *localmesh

Mesh object for this solver.