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.
testUtils.h
Go to the documentation of this file.
1 
11 #ifndef _TESTUTILS_H_
12 #define _TESTUTILS_H_
13 
14 #include <mpi.h>
15 #include <vector>
16 #include "TreeNode.h"
17 #include "treenode2vtk.h"
18 #include <climits>
19 #include <math.h>
20 #include <block.h>
21 #include <functional>
22 
23 
24 #ifdef DIM_2
25 #define NUM_CHILDREN 4
26  #define ROTATION_OFFSET 8
27 #else
28 #define NUM_CHILDREN 8
29 #define ROTATION_OFFSET 16
30 #endif
31 
32 
33 namespace seq {
34 
40  namespace test {
41 
47  template<typename T>
48  bool isSorted(const std::vector<T >& nodes);
49 
50  template<typename T>
51  bool isSorted_all_pairs(const std::vector<T > & nodes);
52 
53 
54  template<typename T>
55  bool isSorted(T * nodes, unsigned int sz);
56 
58  template<typename T>
59  bool isNAN(const T * in, const unsigned int sz);
60 
62  template<typename T>
63  bool isBlockNAN(const T * in, const unsigned int* sz);
64 
66  template<typename T>
67  bool isBlockNAN(const T * in, const unsigned int* sz,unsigned int flag);
68 
69 
75  template<typename T>
76  bool isUniqueAndSorted(const std::vector<T >& nodes);
77 
78 
79  template <typename T>
80  bool containsAncestor(const std::vector<T > & nodes);
81 
82 
83  template <typename T>
84  bool isComplete (const std::vector<T>& nodes);
85 
89  template <typename T>
90  bool checkE2EMapping( const std::vector<unsigned int >& E2EMap, const std::vector<T>& allNodes, unsigned int localBegin, unsigned int localEnd ,unsigned int k_s,unsigned numDirections);
91 
92 
98  template <typename T>
99  bool checkE2NMapping( const std::vector<unsigned int >& E2EMap , const std::vector<unsigned int >& E2NMap, const std::vector<T>& allNodes,unsigned int numDirections,unsigned int elementOrder);
100 
101 
102  }//end namespace
103 }//end namespace
104 
105 namespace par {
106 
112  namespace test {
113 
114  template<typename T>
115  bool isSorted(const std::vector<T>& nodes, MPI_Comm comm);
116 
117  template<typename T>
118  bool isUniqueAndSorted(const std::vector<T >& nodes,MPI_Comm comm) ;
119 
120 
121  template <typename T>
122  bool containsAncestor(const std::vector<T > &nodes, MPI_Comm comm);
123 
124  //@author: Milinda Fernando. Assess the completeness of the octree based on the volumes of the octants.
125  template <typename T>
126  bool isComplete (const std::vector<T>& nodes, MPI_Comm comm);
127 
128 
129  }//end namespace
130 }//end namespace
131 
132 namespace ot {
133 
134  //class TreeNode;
135 
136  namespace test {
144  template<typename T>
145  bool isLinear(const std::vector<T >& nodes) ;
146 
147  template<typename T>
148  bool isBalanced(unsigned int dim, unsigned int maxDepth, char* failFileName,
149  const std::vector<T>& nodes, bool incCorn, unsigned int maxLevDiff) ;
150 
151  template<typename T>
152  bool isBalancedInternal(unsigned int dim, unsigned int maxDepth,
153  char*failFileName, const std::vector<T> & nodes,
154  TreeNode holder, bool incCorn, unsigned int maxLevDiff) ;
155 
156 
169  template<typename T,typename B>
170  bool isBlockListValid(const std::vector<T>& pNodes, std::vector<T> & blockList,unsigned int d_min, unsigned int d_max,unsigned int nBegin,unsigned int nEnd);
171 
172 
173 
174 
175 
176 
177 
178 
179  }//end namespace
180 }//end namespace
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 #include "testUtils.tcc"
192 
193 #endif
194 
bool isBlockListValid(const std::vector< T > &pNodes, std::vector< T > &blockList, unsigned int d_min, unsigned int d_max, unsigned int nBegin, unsigned int nEnd)
for a given sorted 2:1 balanced octree and a block list this procedure checks that for each block...
Simple class to manage async data transfer in the ODA class.
Definition: asyncExchangeContex.h:16
bool isNAN(const T *in, const unsigned int sz)
checks whether the numeric array constains nan values.
A collection of functions for debugging.
bool checkE2EMapping(const std::vector< unsigned int > &E2EMap, const std::vector< T > &allNodes, unsigned int localBegin, unsigned int localEnd, unsigned int k_s, unsigned numDirections)
Collection of Generic Sequential Functions.
Collection of Generic Parallel Functions: Sorting, Partitioning, Searching,...
Definition: zoltan_hilbert.h:72
bool isBlockNAN(const T *in, const unsigned int *sz)
checks whether the numeric array constains nan values. for block local region
bool checkE2NMapping(const std::vector< unsigned int > &E2EMap, const std::vector< unsigned int > &E2NMap, const std::vector< T > &allNodes, unsigned int numDirections, unsigned int elementOrder)
: Check whether the E2N mapping is correct based on the DG indexing. This assumes that StensilSz is 1...