An open source method of characteristics neutron transport code.
RunTime.h
Go to the documentation of this file.
1 
13 #ifndef RUNTIME_H_
14 #define RUNTIME_H_
15 
16 #ifdef __cplusplus
17 #ifdef SWIG
18 #include "Python.h"
19 #endif
20 #include <iostream>
21 #include <string.h>
22 #include <vector>
23 #endif
24 
25 #ifdef MPIx
26 #include <mpi.h>
27 #endif
28 
29 #ifdef SWIG
30 #define printf PySys_WriteStdout
31 #endif
32 
33 /* A Vector3D is simply a 3-dimensional std::vector of doubles */
34 typedef std::vector<std::vector<std::vector<double> > > DoubleVector3D;
35 
40  RuntimeParameters() : _debug_flag(false), _NDx(1), _NDy(1), _NDz(1),
41  _NMx(1), _NMy(1), _NMz(1), _NCx(0), _NCy(0), _NCz(0),
42  _num_threads(1), _azim_spacing(0.05), _num_azim(64), _polar_spacing(0.75),
43  _num_polar(10), _tolerance(1.0E-4), _max_iters(1000), _knearest(1),
44  _CMFD_flux_update_on(true), _CMFD_centroid_update_on(false),
45  _use_axial_interpolation(0), _log_filename(NULL), _linear_solver(true),
46  _MOC_src_residual_type(1), _SOR_factor(1.0), _CMFD_relaxation_factor(1.0),
47  _segmentation_type(3), _verbose_report(true), _time_report(true),
48  _log_level((char*)"NORMAL"), _quadraturetype(2), _test_run(false) {}
49 
50  /* To debug or not when running, dead while loop */
51  bool _debug_flag;
52  char* _log_level;
53 
54  /* Domain decomposition structure */
55  int _NDx, _NDy, _NDz;
56 
57  /* Modules structure, used to define sub-domains */
58  int _NMx, _NMy, _NMz;
59 
60  /* Number of OpenMP threads */
61  int _num_threads;
62 
63  /* Log file name */
64  char* _log_filename;
65 
66  /* Geometry file name */
67  std::string _geo_filename;
68 
69  /* Space and angle quadrature parameters */
70  double _azim_spacing;
71  int _num_azim;
72  double _polar_spacing;
73  int _num_polar;
74 
75  /* Segmentation zones for 2D extruded segmentation*/
76  std::vector<double> _seg_zones;
77 
78  /* Segmentation type of track generation*/
79  int _segmentation_type;
80 
81  /* Polar quadrature type */
82  int _quadraturetype;
83 
84  /* CMFD group structure */
85  std::vector<std::vector<int> > _CMFD_group_structure;
86 
87  /* CMFD lattice structure, used for uniform CMFD */
88  int _NCx, _NCy, _NCz;
89 
91  std::vector<double> _cell_widths_x;
92  std::vector<double> _cell_widths_y;
93  std::vector<double> _cell_widths_z;
94 
95  /* CMFD flux update on or not */
96  bool _CMFD_flux_update_on;
97 
98  /* The order of k-nearest update */
99  int _knearest;
100 
101  /* K-nearest update or conventional update */
102  bool _CMFD_centroid_update_on;
103 
104  /* Whether to use axial interpolation for CMFD update */
105  int _use_axial_interpolation;
106 
107  /* CMFD linear solver SOR factor */
108  double _SOR_factor;
109 
110  /* CMFD relaxation factor */
111  double _CMFD_relaxation_factor;
112 
113  /* Linear source solver if true*/
114  bool _linear_solver;
115 
116  /* The maximum number of MOC source iterations */
117  int _max_iters;
118 
119  /* Type of MOC source residual for convergence check */
120  int _MOC_src_residual_type;
121 
122  /* MOC source convergence tolerance */
123  double _tolerance;
124 
125  /* uniform lattice output */
126  std::vector<std::vector<int> > _output_mesh_lattices;
127 
128  /* widths and offsets of multiple output meshes with non-uniform lattice */
129  DoubleVector3D _non_uniform_mesh_lattices;
130 
131  /* output reaction types for both uniform and non-uniform */
132  std::vector<int> _output_types;
133  bool _verbose_report;
134  bool _time_report;
135 
136  /* whether to run the code for test */
137  bool _test_run;
138 
139  /* Setter, can be used from command line */
140  int setRuntimeParameters(int argc, char *argv[]);
141 };
142 
143 #endif /* RUNTIME_H_ */
std::vector< double > _cell_widths_x
Definition: RunTime.h:91
int setRuntimeParameters(int argc, char *argv[])
Process the run time options.
Definition: RunTime.cpp:11
Structure for run time options.
Definition: RunTime.h:39