Aether  0.0
Ionosphere-Thermosphere model
grid.h
1 // Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
2 // Full license can be found in License.md
3 
4 #ifndef INCLUDE_GRID_H_
5 #define INCLUDE_GRID_H_
6 
7 // ----------------------------------------------------------------------------
8 // Grid class
9 // ----------------------------------------------------------------------------
10 
11 class Grid {
12 
13 public:
14 
15  int get_IsGeoGrid();
16  bool get_HasBField();
17  void set_IsGeoGrid(int value);
18 
19  int64_t get_nPointsInGrid();
20 
21  int64_t get_nX();
22  int64_t get_nY();
23  int64_t get_nZ();
24 
25  int64_t get_nLons();
26  int64_t get_nLats();
27  int64_t get_nAlts();
28 
29  int64_t get_nGCs();
30 
31  // Armidillo Cube Versions:
32  arma_cube geoLon_scgc, geoX_scgc;
33  arma_cube geoLat_scgc, geoY_scgc;
34  arma_cube geoAlt_scgc, geoZ_scgc;
35  arma_cube geoLocalTime_scgc;
36 
37  // These define the magnetic grid:
38  // Armidillo Cube Versions:
39  arma_cube magLon_scgc, magX_scgc;
40  arma_cube magLat_scgc, magY_scgc;
41  arma_cube magAlt_scgc, magZ_scgc;
42  arma_cube magLocalTime_scgc;
43 
44  // These are the locations of the magnetic poles:
45  // ll -> lat, lon, radius independent
46  arma_vec mag_pole_north_ll;
47  arma_vec mag_pole_south_ll;
48 
49  // pole gse -> needs to be for each altitude, so we can compute
50  // magnetic local time. We want to use some GSE conversion function,
51  // so this type has to a vector of arma_cubes:
52  std::vector<arma_cube> mag_pole_north_gse;
53  std::vector<arma_cube> mag_pole_south_gse;
54 
55  std::vector<arma_cube> GSE_XYZ_vcgc;
56 
57  std::string altitude_name = "Altitude";
58  std::string altitude_unit = "meters";
59 
60  std::string longitude_name = "Longitude";
61  std::string longitude_unit = "radians";
62 
63  std::string latitude_name = "Latitude";
64  std::string latitude_unit = "radians";
65 
66  // These are derived variables from the grid:
67 
68  // Switch to armadillo variables (precision_t cubes):
69  arma_cube radius_scgc;
70  arma_cube radius2_scgc;
71  arma_cube radius2i_scgc;
72  arma_cube gravity_scgc;
73 
74  arma_cube sza_scgc;
75  arma_cube cos_sza_scgc;
76 
77  arma_cube dalt_center_scgc;
78  arma_cube dalt_lower_scgc;
79  arma_cube dalt_ratio_scgc;
80  arma_cube dalt_ratio_sq_scgc;
81 
82  arma_cube dlon_center_scgc;
83  arma_cube dlon_center_dist_scgc;
84 
85  arma_cube dlat_center_scgc;
86  arma_cube dlat_center_dist_scgc;
87 
88  std::vector<arma_cube> bfield_vcgc;
89  arma_cube bfield_mag_scgc;
90  std::vector<arma_cube> bfield_unit_vcgc;
91 
92  Grid(int nX_in, int nY_in, int nZ_in, int nGCs_in);
93 
94  void calc_sza(Planets planet, Times time, Report &report);
95  void calc_gse(Planets planet, Times time, Report &report);
96  void calc_mlt(Report &report);
97  void fill_grid(Planets planet, Report &report);
98  void fill_grid_radius(Planets planet, Report &report);
99  void init_geo_grid(Planets planet, Inputs input, Report &report);
100  void fill_grid_bfield(Planets planet, Inputs input, Report &report);
101 
102  private:
103 
104  int IsGeoGrid;
105  bool HasBField;
106 
107  int64_t nX, nLons;
108  int64_t nY, nLats;
109  int64_t nZ, nAlts;
110 
111  int nGCs; // number of ghostcells
112 
113 };
114 
115 #endif // INCLUDE_GRID_H_
Planets
Definition: planets.h:16
Inputs
Definition: inputs.h:10
Report
Definition: report.h:28
Times
Definition: times.h:21
Grid
Definition: arm_vars.h:11