Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
stencil.h
1 //
2 // Created by milinda on 3/31/17.
9 //
10 
11 #ifndef SFCSORTBENCH_STENCIL_H
12 #define SFCSORTBENCH_STENCIL_H
13 
14 #include <iostream>
15 #include <array>
16 #include "assert.h"
17 
23 enum StencilDirection{STENCIL_DIR_X,STENCIL_DIR_Y,STENCIL_DIR_Z,STENCIL_DIR_XY,STENCIL_DIR_YZ,STENCIL_DIR_XZ,STENCIL_DIR_XYZ};
24 
25 template <typename T,unsigned int length, unsigned int offset>
26 struct Stencil
27 {
28 
29 private:
31  std::array<T,length> m_uiS;
33  StencilDirection m_uiDirection;
35  unsigned int m_uiOffset=offset;
36 
37 
38 public:
40  Stencil(){};
41 
47  Stencil(T* coeff, int n, StencilDirection pDir)
48  {
49  assert(n==length);
50  for(unsigned int k=0;k<length;k++)
51  m_uiS[k]=coeff[k];
52 
53  m_uiDirection=pDir;
54  }
55 
56  const T& operator[](unsigned int i) const
57  {
58  assert(i<length);
59  return m_uiS[i];
60  }
61 
63  inline StencilDirection getStencilDirection() const {return m_uiDirection;}
65  inline unsigned int getOffset() const {return m_uiOffset;}
67  inline unsigned int getStencilLength() const {return m_uiS.size();}
68 
69 
70 };
71 
72 
73 #endif //SFCSORTBENCH_STENCIL_H
StencilDirection getStencilDirection() const
Definition: stencil.h:63
Stencil(T *coeff, int n, StencilDirection pDir)
: creates a stencil with given coefficients.
Definition: stencil.h:47
Stencil()
: default constructor
Definition: stencil.h:40
unsigned int getOffset() const
Definition: stencil.h:65
unsigned int getStencilLength() const
Definition: stencil.h:67
Definition: stencil.h:26