Block-Structured AMR Software Framework
AMReX_Bittree.H
Go to the documentation of this file.
1 #ifndef BL_BITTREE_H_
2 #define BL_BITTREE_H_
3 
4 #include <AMReX_IntVect.H>
5 #include <AMReX_BoxArray.H>
7 #include <Bittree_BittreeAmr.h>
8 
9 namespace amrex {
10 
11 /*
12 Include in Make.local:
13 BITTREE_PATH = /path/to/bittree/installation
14 INCLUDE_LOCATIONS += $(BITTREE_PATH)/include
15 LIBRARY_LOCATIONS += $(BITTREE_PATH)/lib
16 LIBRARIES += -lbittree
17 
18 Include in inputs:
19 amr.use_bittree = true
20 */
21 class btUnit {
22  // Functions used in AmrMesh
23  public:
24  static int btRefine (bittree::BittreeAmr* mesh,
25  std::vector<int>& btTags,
26  int max_crse, int lbase,
28  MPI_Comm comm);
29  static void btCalculateGrids (bittree::BittreeAmr* mesh,
30  int lbase,
31  int& new_finest,
32  Vector<BoxArray>& new_grids,
34  static void btCalculateLevel (bittree::BittreeAmr* mesh,
35  int lev,
36  BoxArray& ba,
37  IntVect const& max_grid_size);
38  // Utils
39  static int getBitid (bittree::BittreeAmr* mesh, bool updated,
40  int lev, int idx_on_lev);
41  static int getIndex (bittree::BittreeAmr* mesh, bool updated,
42  int lev, int bitid);
43 
44  // Functions to implement strict octree logic
45  private:
46  static void btCheckRefine (bittree::BittreeAmr* mesh,
47  std::vector<int>& btTags,
48  int max_crse, int lbase,
50  MPI_Comm comm);
51 
52  static void btCheckDerefine (bittree::BittreeAmr* mesh,
53  std::vector<int>& btTags,
54  int max_crse, int lbase,
56  MPI_Comm comm);
57 
58  // Utility Functions
59  static bool checkNeighborsRefine (bittree::BittreeAmr* mesh,
60  bittree::MortonTree::Block b);
61  static std::vector<int> neighIntCoords (bittree::BittreeAmr* mesh,
62  unsigned lev, unsigned const* lcoord,
63  int const* gCell);
64 
65  public:
66  // Represents whether domain has periodic BC in each direction
67  // true = Periodic, false = Non-Periodic
68  static bool bcPeriodic[AMREX_SPACEDIM];
69 };
70 
71 
72 }
73 #endif
int MPI_Comm
Definition: AMReX_ccse-mpi.H:47
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:549
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
Definition: AMReX_Bittree.H:21
static void btCheckDerefine(bittree::BittreeAmr *mesh, std::vector< int > &btTags, int max_crse, int lbase, Vector< BoxArray > &grids, Vector< DistributionMapping > &dmap, MPI_Comm comm)
Definition: AMReX_Bittree.cpp:225
static int btRefine(bittree::BittreeAmr *mesh, std::vector< int > &btTags, int max_crse, int lbase, Vector< BoxArray > &grids, Vector< DistributionMapping > &dmap, MPI_Comm comm)
Definition: AMReX_Bittree.cpp:33
static bool checkNeighborsRefine(bittree::BittreeAmr *mesh, bittree::MortonTree::Block b)
Definition: AMReX_Bittree.cpp:289
static int getIndex(bittree::BittreeAmr *mesh, bool updated, int lev, int bitid)
Definition: AMReX_Bittree.cpp:143
static std::vector< int > neighIntCoords(bittree::BittreeAmr *mesh, unsigned lev, unsigned const *lcoord, int const *gCell)
Definition: AMReX_Bittree.cpp:348
static int getBitid(bittree::BittreeAmr *mesh, bool updated, int lev, int idx_on_lev)
Definition: AMReX_Bittree.cpp:137
static bool bcPeriodic[AMREX_SPACEDIM]
Definition: AMReX_Bittree.H:68
static void btCalculateGrids(bittree::BittreeAmr *mesh, int lbase, int &new_finest, Vector< BoxArray > &new_grids, Vector< IntVect > const &max_grid_size)
Definition: AMReX_Bittree.cpp:82
static void btCalculateLevel(bittree::BittreeAmr *mesh, int lev, BoxArray &ba, IntVect const &max_grid_size)
Definition: AMReX_Bittree.cpp:102
static void btCheckRefine(bittree::BittreeAmr *mesh, std::vector< int > &btTags, int max_crse, int lbase, Vector< BoxArray > &grids, Vector< DistributionMapping > &dmap, MPI_Comm comm)
Definition: AMReX_Bittree.cpp:159
AMREX_EXPORT int max_grid_size
Definition: AMReX_EB2.cpp:23
Definition: AMReX_Amr.cpp:49