File invert_parderiv.hxx#


template<class DerivedType>
using RegisterInvertPar = InvertParFactory::RegisterInFactory<DerivedType>#
using RegisterUnavailableInvertPar = InvertParFactory::RegisterUnavailableInFactory#


constexpr auto PARDERIVCYCLIC = "cyclic"#
class InvertParFactory : public Factory<InvertPar, InvertParFactory, 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 = "InvertPar"#
static constexpr auto section_name = "parderiv"#
static constexpr auto option_name = "type"#
static constexpr auto default_type = PARDERIVCYCLIC#
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


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

Field3D result = inv->solve(rhs);

Public Functions

inline InvertPar(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 InvertPar object call the create() static function.

virtual ~InvertPar() = default#
virtual 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

inline 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

inline virtual const 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 Grad2_par2 coefficient B

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

Set the D2DYDZ coefficient C

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

Set the D2DZ2 coefficient D

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

Set the DDY coefficient E

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

Public Static Functions

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

Create an instance of InvertPar

Protected Attributes

CELL_LOC location#
Mesh *localmesh#

Mesh object for this solver.