File parallel_boundary_region.hxx#

Defines

ITER()#

Functions

BOUT_ENUM_CLASS(SheathLimitMode, limit_free, exponential_free, linear_free)#

Boundary region for parallel direction. This contains a vector of points that are inside the boundary.

class BoundaryRegionPar : public BoundaryRegionBase#

Public Functions

inline BoundaryRegionPar(const std::string &name, int dir, Mesh *passmesh)#
inline BoundaryRegionPar(const std::string &name, BndryLoc loc, int dir, Mesh *passmesh)#
inline void add_point(Ind3D ind, BoutReal x, BoutReal y, BoutReal z, BoutReal length, char valid, signed char offset)#

Add a point to the boundary.

inline void add_point(int ix, int iy, int iz, BoutReal x, BoutReal y, BoutReal z, BoutReal length, char valid, signed char offset)#
inline virtual void first() final#

Move the region iterator to the start.

inline virtual void next() final#

Get the next element in the loop over every element from inside out (in X or Y first)

inline virtual bool isDone() final#

Returns true if outside domain. Can use this with nested nextX, nextY.

inline bool contains(const BoundaryRegionPar &bndry) const#
inline bool contains(const int ix, const int iy, const int iz) const#
inline void setValid(char val)#
inline BoundaryRegionParIter begin()#
inline BoundaryRegionParIter end()#

Public Members

const int dir#

Private Members

bout::parallel_boundary_region::IndicesVec bndry_points#

Vector of points in the boundary.

bout::parallel_boundary_region::IndicesIter bndry_position#

Current position in the boundary points.

bool is_sorted = {true}#

Private Static Functions

static inline Ind3D xyz2ind(int x, int y, int z, Mesh *mesh)#
namespace bout

Provides access to the Hypre library, handling initialisation and finalisation.

Usage

#include <bout/hyprelib.hxx>

class MyClass { public:

private: HypreLib lib; };

This will then automatically initialise Hypre the first time an object is created, and finalise it when the last object is destroyed.

Copyright 2012 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu

Contact: Ben Dudson, bd512@york.ac.uk

This file is part of BOUT++.

BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.

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

SNB model

namespace parallel_boundary_region#

Typedefs

using IndicesVec = std::vector<Indices>#
using IndicesIter = IndicesVec::iterator#
using IndicesIterConst = IndicesVec::const_iterator#

Functions

inline BoutReal limitFreeScale(BoutReal fm, BoutReal fc, SheathLimitMode mode)#

Limited free gradient of log of a quantity This ensures that the guard cell values remain positive while also ensuring that the quantity never increases

fm fc | fp ^ boundary

exp( 2*log(fc) - log(fm) )

inline BoutReal limitFreeScale(BoutReal fm, BoutReal fc)#
struct RealPoint#

Public Members

BoutReal s_x#
BoutReal s_y#
BoutReal s_z#
struct Indices#

Public Functions

inline Indices(Ind3D index, RealPoint &&intersection, BoutReal length, signed char valid, signed char offset, unsigned char abs_offset)#

Public Members

Ind3D index#
RealPoint intersection#
BoutReal length#
signed char valid#
signed char offset#
unsigned char abs_offset#
template<class IndicesVec, class IndicesIter>
class BoundaryRegionParIterBase#

Public Functions

inline BoundaryRegionParIterBase(IndicesVec &bndry_points, IndicesIter bndry_position, int dir, Mesh *localmesh)#
inline Ind3D ind() const#
inline BoutReal s_x() const#
inline BoutReal s_y() const#
inline BoutReal s_z() const#
inline BoutReal length() const#
inline signed char valid() const#
inline signed char offset() const#
inline unsigned char abs_offset() const#
inline void setValid(signed char valid)#
inline BoutReal extrapolate_sheath_o1(const Field3D &f) const#
inline BoutReal extrapolate_sheath_o2(const Field3D &f) const#
inline BoutReal extrapolate_sheath_o1(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal extrapolate_sheath_o2(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal interpolate_sheath_o2(const Field3D &f) const#
inline BoutReal interpolate_sheath_o2(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal extrapolate_next_o1(const Field3D &f) const#
inline BoutReal extrapolate_next_o2(const Field3D &f) const#
inline BoutReal extrapolate_next_o1(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal extrapolate_next_o2(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal extrapolate_grad_o1(const Field3D &f) const#
inline BoutReal extrapolate_grad_o2(const Field3D &f) const#
inline BoundaryRegionParIterBase &operator*()#
inline BoundaryRegionParIterBase &operator++()#
inline bool operator!=(const BoundaryRegionParIterBase &rhs)#
inline void dirichlet_o1(Field3D &f, BoutReal value) const#
inline void dirichlet_o2(Field3D &f, BoutReal value) const#
inline void dirichlet_o3(Field3D &f, BoutReal value) const#
inline void limit_at_least(Field3D &f, BoutReal value) const#
inline bool is_lower() const#
inline void neumann_o1(Field3D &f, BoutReal value) const#
inline void neumann_o2(Field3D &f, BoutReal value) const#
inline void neumann_o3(Field3D &f, BoutReal value) const#
inline void limitFree(Field3D &f) const#
inline BoutReal extrapolate_sheath_free(const Field3D &f, SheathLimitMode mode) const#
inline void set_free(Field3D &f, SheathLimitMode mode) const#
inline void setAll(Field3D &f, const BoutReal val) const#
template<bool check = true>
inline BoutReal &getAt(Field3D &f, int off) const#
template<bool check = true>
inline const BoutReal &getAt(const Field3D &f, int off) const#
inline const BoutReal &ynext(const Field3D &f) const#
inline BoutReal &ynext(Field3D &f) const#
inline const BoutReal &ythis(const Field3D &f) const#
inline BoutReal &ythis(Field3D &f) const#
inline const BoutReal &yprev(const Field3D &f) const#
inline BoutReal &yprev(Field3D &f) const#
template<bool check = true>
inline BoutReal getAt(const std::function<BoutReal(int yoffset, Ind3D ind)> &f, int off) const#
inline BoutReal ynext(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal ythis(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline BoutReal yprev(const std::function<BoutReal(int yoffset, Ind3D ind)> &f) const#
inline void setYPrevIfValid(Field3D &f, BoutReal val) const#

Public Members

const int dir#
Mesh *localmesh#

Private Members

const IndicesVec &bndry_points#
IndicesIter bndry_position#

Private Static Attributes

static constexpr BoutReal small_value = 1e-2#