Skip to content

Struct mgrid::Axis

ClassList > mgrid > Axis

One grid axis: point count, spacing, and periodicity, with the index arithmetic every stencil / sweep / transfer needs. A bounded axis uses one-sided stencils at its ends and never wraps; a periodic axis has no ends (index arithmetic is mod n ).

  • #include <types.hpp>

Public Attributes

Type Name
double h = 0.0
grid spacing
int n = 0
number of grid points on this axis
bool periodic = false
true if this axis wraps periodically

Public Functions

Type Name
bool edge_hi (int i) const
True if index i needs the high-end one-sided stencil.
bool edge_lo (int i) const
True if index i needs the low-end one-sided stencil.
int hi () const
One-past-the-last sweep index.
int lo () const
First index of a relaxation / operator sweep (half-open with hi() ).
int shift (int i, int d) const
Index i offset byd , wrapped into [0, n) iff periodic.

Public Attributes Documentation

variable h

grid spacing

double mgrid::Axis::h;


variable n

number of grid points on this axis

int mgrid::Axis::n;


variable periodic

true if this axis wraps periodically

bool mgrid::Axis::periodic;


Public Functions Documentation

function edge_hi

True if index i needs the high-end one-sided stencil.

inline bool mgrid::Axis::edge_hi (
    int i
) const


function edge_lo

True if index i needs the low-end one-sided stencil.

inline bool mgrid::Axis::edge_lo (
    int i
) const


function hi

One-past-the-last sweep index.

inline int mgrid::Axis::hi () const


function lo

First index of a relaxation / operator sweep (half-open with hi() ).

inline int mgrid::Axis::lo () const


function shift

Index i offset byd , wrapped into [0, n) iff periodic.

inline int mgrid::Axis::shift (
    int i,
    int d
) const



The documentation for this class was generated from the following file include/multigrid/types.hpp