File generator_context.hxx#

namespace bout

Information about the version of BOUT++

The build system will update this file on every commit, which may result in files that include it getting rebuilt. Therefore it should be included in as few places as possible

Information about the version of BOUT++

The build system will update this file at configure-time

Explicit inversion of a 3x3 matrix a

If the matrix is singular (ill conditioned), the determinant is return. Otherwise, an empty std::optional is return

namespace generator#
class Context#

Public Functions

template<IND_TYPE N>
inline Context(const SpecificInd<N> &i, CELL_LOC loc, Mesh *msh, BoutReal t)#

Set using an index. Can be Ind2D, Ind3D or IndPerp.

inline Context(const Ind2D &i, CELL_LOC loc, Mesh *msh, BoutReal t)#
Context(int ix, int iy, int iz, CELL_LOC loc, Mesh *msh, BoutReal t)#

Specify a cell index, together with the cell location, mesh and time

Context(BoutReal x, BoutReal y, BoutReal z, Mesh *msh, BoutReal t)#

Specify the values directly.

Context() = default#

If constructed without parameters, contains no values (null). Requesting x,y,z or t throws an exception

Context(const BoundaryRegion *bndry, int iz, CELL_LOC loc, BoutReal t, Mesh *msh)#

The location on the boundary.

inline Context(const BoundaryRegion *bndry, CELL_LOC loc, BoutReal t, Mesh *msh)#
inline BoutReal x() const#
inline BoutReal y() const#
inline BoutReal z() const#
inline BoutReal t() const#
inline Context &set(const std::string &name, BoutReal value)#

Set the value of a parameter with given name.

template<typename ...Args>
inline Context &set(const std::string &name, BoutReal value, Args... args)#

Set multiple values, by passing alternating strings and values

eg. set(“x”, 1, “y”, 2)

inline BoutReal get(const std::string &name) const#

Retrieve a value previously set.

inline Mesh *getMesh() const#

Get the mesh for this context (position) If the mesh is null this will throw a BoutException (if CHECK >= 1)

Private Members

Mesh *localmesh = {nullptr}#

The mesh on which the position is defined.

std::map<std::string, BoutReal> parameters = {}#

Contains user-set values which can be set and retrieved.