3#if defined(__GPUCOMPILE__) || !defined(TETRAHEDRAL_TREE_H)
5#if !defined(__GPUCOMPILE__) && !defined(TETRAHEDRAL_TREE_H)
6#define TETRAHEDRAL_TREE_H
12#if defined(__GPUCOMPILE__)
13#include "GPUInterface.hh"
15class TetrahedralTreeGPU;
42class GARFIELD_CLASS_NAME(TetrahedralTree) {
53 const Vec3& halfDimension);
61 void InsertMeshNode(
Vec3 point,
const int index);
64 void InsertMeshElement(
const double bb[6],
const int index);
67 double CreateGPUTransferObject(TetrahedralTreeGPU*& tree_gpu);
71 static std::vector<int> emptyBlock;
93 std::vector<std::pair<Vec3, int> > nodes;
97 int* elements{
nullptr};
100 std::vector<int> elements;
103 static const size_t BlockCapacity = 10;
105#ifndef __GPUCOMPILE__
107 bool DoesBoxOverlap(
const double bb[6])
const;
116 const int*& tet_list_elems,
117 int& num_elems)
const;
119 const std::vector<int>& GetElementsInBlock(
const Vec3& point)
const;
126 GetBlockFromPoint(
const Vec3& point)
const;
130 GetBlockFromPointHelper(
const Vec3& point)
const;
133 friend class TetrahedralTree;