# Structure of C++ code ```c++ const int DIMN = 4; struct Coordinate : public array {}; ``` ### GeometryNode ```c++ struct GeometryNode { bool initialized; int num_node; int id_node; Coordinate size_node; Coordinate coor_node; }; ``` ### Geometry ```c++ struct Geometry { bool initialized; GeometryNode geon; int eo; // 0:full; 1:odd; 2:even Coordinate node_site; Coordinate expansion_left; Coordinate expansion_right; Coordinate node_site_expanded; }; ``` ### vector and box ```c++ template struct vector { bool is_copy; // do not free memory if is_copy=true bool is_acc; // if place data on cudaMallocManaged memory (default false) Vector v; }; template struct vector_acc : vector { // default is_acc = true }; ``` ```c++ template struct box { bool is_copy; // do not free memory if is_copy=true bool is_acc; // if place data on cudaMallocManaged memory (default false) Handle v; }; template struct box_acc : box { // default is_acc = true }; ``` ```c++ template struct API Vector { M* p; Long n; }; ``` ```c++ template struct API Handle { M* p; }; ``` ### Field ```c++ template struct Field { bool initialized; int multiplicity; box_acc geo; vector_acc field; }; ``` ### FieldM ```c++ template struct FieldM : Field {}; ``` ### SelectedPoints ```c++ enum struct PointsDistType { Global, Local, Random, // shuffle based on coordinate }; ``` ```c++ struct API PointsSelection { bool initialized; PointsDistType points_dist_type; // default PointsDistType::Global (all node has the same data) Coordinate total_site; vector_acc xgs; }; ``` ```c++ template struct SelectedPoints { bool initialized; PointsDistType points_dist_type; // default PointsDistType::Global (all node has the same data) int multiplicity; long n_points; vector_acc points; // points.size() == n_points * multiplicity if initialized = true }; ``` ### SelectedField ```c++ template struct SelectedField { bool initialized; long n_elems; int multiplicity; box_acc geo; vector_acc field; }; ```