1 #ifndef KRIPKE_GRID_DATA_H__
2 #define KRIPKE_GRID_DATA_H__
3 
4 #include <Kripke/Directions.h>
5 #include <Kripke/Kernel.h>
6 #include <Kripke/Subdomain.h>
7 #include <Kripke/Timing.h>
8 #include <mpi.h>
9 #include <vector>
10 
11 // Foreward Decl
12 struct Input_Variables;
13 struct Grid_Data;
14 struct SubTVec;
15 
16 
17 /**
18  * Contains all grid parameters and variables.
19  */
20 struct Grid_Data {
21 public:
22   explicit Grid_Data(Input_Variables *input_vars);
23   ~Grid_Data();
24 
25   void randomizeData(void);
26   void copy(Grid_Data const &b);
27   bool compare(Grid_Data const &b, double tol, bool verbose);
28   double particleEdit(void);
29 #ifdef KRIPKE_USE_SILO
30   void writeSilo(std::string const &fname);
31 #endif
32 
33   Timing timing;
34 
35   int niter;
36 
37   double source_value;
38 
39   std::vector<double> sigma_tot;            // Cross section data
40 
41   int num_group_sets;                       // Number of group-sets
42   int num_groups_per_set;                   // How many groups in each set
43   int num_direction_sets;                   // Number of direction-sets
44   int num_directions_per_set;               // Number of directions per dir set
45   int num_zone_sets;                        // Number of zone sets
46   int legendre_order;                       // Legendra expansion order ( >= 0 )
47   int total_num_moments;                    // Number of spherical harmonic moments
48 
49   std::vector<int> moment_to_coeff;         // Map from harmonic moments to legendre coefficients
50 
51   std::vector<Directions> directions;       // Quadrature point data, for all directions
52   Kernel *kernel;                           // Layout-specific math kernels
53 
54   std::vector<Subdomain> subdomains;        // Group/Angle/Zone set data
55   std::vector<int> zs_to_sdomid;            // map of zonesets to subdomains with ds=gs=0
56 
57   // Variables:
58   std::vector<SubTVec *> sigs;              // scattering lookup table for each material
59 
60   // Per directionset ell and ell_plus matrices (Subdomain point into these arrays)
61   std::vector<SubTVec *> ell;               // L matrix in nm_offset coordinates
62   std::vector<SubTVec *> ell_plus;          // L+ matrix in nm_offset coordinates
63 
64   // Per zoneset phi and phi_out (Subdomains point into these arrays)
65   std::vector<SubTVec *> phi;               // Moments of psi
66   std::vector<SubTVec *> phi_out;           // Scattering source
67 };
68 
69 #endif
70