File invert_pardiv.hxx#


template<class DerivedType>
using RegisterInvertParDiv = InvertParDivFactory::RegisterInFactory<DerivedType>#
using RegisterUnavailableInvertParDiv = InvertParDivFactory::RegisterUnavailableInFactory#


constexpr auto PARDIVCYCLIC = "cyclic"#
class InvertParDivFactory : public Factory<InvertParDiv, InvertParDivFactory, Options*, CELL_LOC, Mesh*>#

Public Functions

inline ReturnType create(Options *options = nullptr, CELL_LOC location = CELL_CENTRE, Mesh *mesh = nullptr) const#
inline ReturnType create(const std::string &type, Options *options) const#

Public Static Functions

static void ensureRegistered()#

Public Static Attributes

static constexpr auto type_name = "InvertParDiv"#
static constexpr auto section_name = "pardiv"#
static constexpr auto option_name = "type"#
static constexpr auto default_type = PARDIVCYCLIC#
class InvertParDiv#
#include <invert_pardiv.hxx>

Base class for parallel inversion solvers.

Inverts a matrix of the form

A + Div_par( B * Grad_par )


auto inv = InvertParDiv::create(); inv->setCoefA(1.0); inv->setCoefB(-0.1);

Field3D result = inv->solve(rhs);

Public Functions

inline InvertParDiv(Options *opt, CELL_LOC location_in, 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 InvertParDiv object call the create() static function.

virtual ~InvertParDiv() = default#
virtual 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 Field3D solve(const Field3D &f) = 0#

Solve the system of equations

This method must be implemented

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

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

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

Set the constant coefficient A

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

Set the Div_par(Grad_par()) coefficient B

inline virtual void setCoefB(const Field3D &f)#
inline virtual void setCoefB(BoutReal f)#

Public Static Functions

static inline std::unique_ptr<InvertParDiv> create(Options *opt_in = nullptr, CELL_LOC location_in = CELL_CENTRE, Mesh *mesh_in = nullptr)#

Create an instance of InvertParDiv

Protected Attributes

CELL_LOC location#
Mesh *localmesh#

Mesh object for this solver.