Directions.h File Reference

Detailed Description

Defines all stencil directions and their properties, and a general DxQy stencil class.

Author
Martin Bauer marti.nosp@m.n.ba.nosp@m.uer@f.nosp@m.au.d.nosp@m.e
#include "core/cell/Cell.h"
#include "core/DataTypes.h"
#include "core/debug/Debug.h"
#include "core/math/Vector3.h"
#include <string>
#include <cmath>

Namespaces

 walberla
 \file TimestepTracker.h \ingroup lbm \author Frederik Hennig frede.nosp@m.rik..nosp@m.henni.nosp@m.g@fa.nosp@m.u.de
 
 walberla::stencil
 

Enumerations

enum  walberla::stencil::Direction {
  walberla::stencil::C = 0, walberla::stencil::N = 1, walberla::stencil::S = 2, walberla::stencil::W = 3,
  walberla::stencil::E = 4, walberla::stencil::T = 5, walberla::stencil::B = 6, walberla::stencil::NW = 7,
  walberla::stencil::NE = 8, walberla::stencil::SW = 9, walberla::stencil::SE = 10, walberla::stencil::TN = 11,
  walberla::stencil::TS = 12, walberla::stencil::TW = 13, walberla::stencil::TE = 14, walberla::stencil::BN = 15,
  walberla::stencil::BS = 16, walberla::stencil::BW = 17, walberla::stencil::BE = 18, walberla::stencil::TNE = 19,
  walberla::stencil::TNW = 20, walberla::stencil::TSE = 21, walberla::stencil::TSW = 22, walberla::stencil::BNE = 23,
  walberla::stencil::BNW = 24, walberla::stencil::BSE = 25, walberla::stencil::BSW = 26, walberla::stencil::INVALID_DIR = 27
}
 
enum  walberla::stencil::BinaryDirection {
  walberla::stencil::Bin_C = 1<<0, walberla::stencil::Bin_N = 1<<1, walberla::stencil::Bin_S = 1<<2, walberla::stencil::Bin_W = 1<<3,
  walberla::stencil::Bin_E = 1<<4, walberla::stencil::Bin_T = 1<<5, walberla::stencil::Bin_B = 1<<6, walberla::stencil::Bin_NW = 1<<7,
  walberla::stencil::Bin_NE = 1<<8, walberla::stencil::Bin_SW = 1<<9, walberla::stencil::Bin_SE = 1<<10, walberla::stencil::Bin_TN = 1<<11,
  walberla::stencil::Bin_TS = 1<<12, walberla::stencil::Bin_TW = 1<<13, walberla::stencil::Bin_TE = 1<<14, walberla::stencil::Bin_BN = 1<<15,
  walberla::stencil::Bin_BS = 1<<16, walberla::stencil::Bin_BW = 1<<17, walberla::stencil::Bin_BE = 1<<18, walberla::stencil::Bin_TNE = 1<<19,
  walberla::stencil::Bin_TNW = 1<<20, walberla::stencil::Bin_TSE = 1<<21, walberla::stencil::Bin_TSW = 1<<22, walberla::stencil::Bin_BNE = 1<<23,
  walberla::stencil::Bin_BNW = 1<<24, walberla::stencil::Bin_BSE = 1<<25, walberla::stencil::Bin_BSW = 1<<26
}
 

Functions

Direction walberla::stencil::vectorToDirection (cell_idx_t x, cell_idx_t y, cell_idx_t z)
 Maps a (x,y,z) direction vector to its direction. More...
 
Direction walberla::stencil::vectorToDirection (Vector3< cell_idx_t > vec)
 
bool walberla::stencil::isFaceDirection (Direction dir)
 
bool walberla::stencil::isEdgeDirection (Direction dir)
 
bool walberla::stencil::isCornerDirection (Direction dir)
 
Direction walberla::stencil::directionFromAxis (int axis, bool minOrMax)
 Maps (direction,axis) pair to direction. More...
 
Direction walberla::stencil::directionFromAxis (uint_t axis, bool minOrMax)
 Maps (direction,axis) pair to direction. More...
 
Cell walberla::stencil::operator+ (const Cell &cell, const Direction d)
 Computes neighbor from cell in direction d. More...
 
Cell walberla::stencil::operator- (const Cell &cell, const Direction d)
 Computes neighbor from cell in direction inverseDir[d]. More...
 
Cell & walberla::stencil::operator+= (Cell &cell, const Direction d)
 Shifts cell to its neighbor in direction d. More...
 
Cell & walberla::stencil::operator-= (Cell &cell, const Direction d)
 Shifts cell to its neighbor in direction inverseDir[d]. More...
 

Variables

const uint_t walberla::stencil::NR_OF_DIRECTIONS = 27
 
const int walberla::stencil::cx [NR_OF_DIRECTIONS]
 The x component for each direction. More...
 
const int walberla::stencil::cy [NR_OF_DIRECTIONS]
 The y component for each direction. More...
 
const int walberla::stencil::cz [NR_OF_DIRECTIONS]
 The z component for each direction. More...
 
const int walberla::stencil::c [3][NR_OF_DIRECTIONS]
 The x,y,z component for each direction. More...
 
const real_t walberla::stencil::cNorm [3][NR_OF_DIRECTIONS]
 The x,y,z component for each normalized direction. More...
 
const std::string walberla::stencil::dirToString [NR_OF_DIRECTIONS]
 String representation for each direction. More...
 
const BinaryDirection walberla::stencil::dirToBinary [27]
 Binary encoded direction for each direction. More...
 
const Direction walberla::stencil::inverseDir [NR_OF_DIRECTIONS]
 Inverse directions. More...
 
const real_t walberla::stencil::dirLength [NR_OF_DIRECTIONS]
 Length for each direction. More...
 
const real_t walberla::stencil::gaussianWeights [NR_OF_DIRECTIONS]
 
const uint_t walberla::stencil::gaussianMultipliers [NR_OF_DIRECTIONS]
 
const Direction walberla::stencil::mirrorX [NR_OF_DIRECTIONS]
 The mirrored directions (flip W-E) More...
 
const Direction walberla::stencil::mirrorY [NR_OF_DIRECTIONS]
 The mirrored directions (flip N-S) More...
 
const Direction walberla::stencil::mirrorZ [NR_OF_DIRECTIONS]
 The mirrored directions (flip T-B) More...
 
const Direction walberla::stencil::map2Dto3D [3][NR_OF_DIRECTIONS]
 Maps from 2D directions (C, N, S, W, E, NW, NE, SW, SE) to 3D directions, by slicing through x,y or z coordinate. More...