Hex  1.0
Hydrogen-electron collision solver
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
input.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2  * *
3  * / / / / __ \ \ / / *
4  * / /__ / / / _ \ \ \/ / *
5  * / ___ / | |/_/ / /\ \ *
6  * / / / / \_\ / / \ \ *
7  * *
8  * Jakub Benda (c) 2014 *
9  * Charles University in Prague *
10  * *
11 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12 
13 #ifndef HEX_INPUT
14 #define HEX_INPUT
15 
16 #include <cstdio>
17 #include <fstream>
18 #include <vector>
19 #include <string>
20 
21 #include "arrays.h"
22 
35 {
36  public:
37 
51  typedef enum {
53  StgNone = 0x00,
55  StgRadial = 0x01,
57  StgSolve = 0x02,
59  StgExtract = 0x04
60  } HexEcsStg;
61 
62  // constructor
63  CommandLine (int argc, char* argv[])
64  : zipcount(0), zipmax(-1), parallel(false), preconditioner(0),
65  droptol(1e-15), itinerary(StgNone), outofcore(false), itertol(1e-10),
66  parallel_dot(false), parallel_block(true)
67  {
68  // get command line options
69  parse(argc, argv);
70 
71  // run the whole sequence if nothing specified
72  if (itinerary == StgNone)
74  }
75 
77  void parse (int argc, char* argv[]);
78 
79  //
80  // public attributes
81  //
82 
84  std::ifstream inputfile;
85 
87  std::string zipfile;
88 
90  int zipcount;
91 
93  double zipmax;
94 
96  bool parallel;
97 
100 
102  double droptol;
103 
106 
108  bool outofcore;
109 
111  double itertol;
112 
115 
118 };
119 
148 {
149  public:
150 
151  // constructor
152  InputFile (std::ifstream & inputfile)
153  {
154  // read inputfile
155  read(inputfile);
156 
157  // compute angular momentum limit
158  maxell = levels + L;
159 
160  // projectile momenta
161  ki.resize(Ei.size());
162  for (size_t i = 0; i < Ei.size(); i++)
163  ki[i] = sqrt(Ei[i]);
164  }
165 
166  // read data from file
167  void read (std::ifstream & inputfile);
168 
169  //
170  // public attributes
171  //
172 
173  int order, ni, L, Spin, Pi, levels, maxell;
174  double ecstheta, B;
176  std::vector<std::tuple<int,int,int>> instates, outstates;
177 };
178 
179 #endif
bool parallel
Whether to use MPI.
Definition: input.h:96
int Pi
Definition: input.h:173
bool outofcore
Whether to keep precomputed data only on disk and spare RAM.
Definition: input.h:108
CommandLine(int argc, char *argv[])
Definition: input.h:63
Extract the T-matrices.
Definition: input.h:59
double itertol
Tolerance for terminating iterative solution.
Definition: input.h:111
int itinerary
Which parts of the computation to run.
Definition: input.h:105
virtual size_t resize(size_t n)
Resize array.
Definition: arrays.h:685
rArray Ei
Definition: input.h:175
double B
Definition: input.h:174
bool parallel_dot
Whether to use OpenMP parallelization in SymDiaMatrix::dot.
Definition: input.h:114
double zipmax
Radial cutoff for solution zipping useful if one is interested only in the near-origin behaviour...
Definition: input.h:93
Command line parameters.
Definition: input.h:34
const double e
Definition: special.h:44
bool parallel_block
Whether to use OpenMP parallelization to run preconditioner for several blocks simultaneously.
Definition: input.h:117
int maxell
Definition: input.h:173
int preconditioner
Preconditioner to use. See Preconditioners::AvailableTypes for available types.
Definition: input.h:99
int ni
Definition: input.h:173
double droptol
Drop tolerance for the ILU preconditioner.
Definition: input.h:102
Solve the equations.
Definition: input.h:57
std::string zipfile
A B-spline expansion of a solution to &quot;zip&quot;. See Bspline::zip .
Definition: input.h:87
double ecstheta
Definition: input.h:174
int zipcount
How many equidistant samples on each axis to use.
Definition: input.h:90
Compute only the radial integrals necessary for the construction of the equations.
Definition: input.h:55
int Spin
Definition: input.h:173
InputFile(std::ifstream &inputfile)
Definition: input.h:152
Input parameters.
Definition: input.h:147
void parse(int argc, char *argv[])
Read options from command line.
Definition: input.cpp:65
rArray cknots
Definition: input.h:175
int order
Definition: input.h:173
HexEcsStg
Stages of the computations.
Definition: input.h:51
int levels
Definition: input.h:173
int L
Definition: input.h:173
std::vector< std::tuple< int, int, int > > outstates
Definition: input.h:176
void read(std::ifstream &inputfile)
Definition: input.cpp:305
Do not start any intensive computations.
Definition: input.h:53
NumberArray< T > sqrt(NumberArray< T > const &A)
Return per-element square root.
Definition: arrays.h:1711
std::vector< std::tuple< int, int, int > > instates
Definition: input.h:176
rArray ki
Definition: input.h:175
std::ifstream inputfile
Alternative name for the input file. Default is &quot;hex.inp&quot;.
Definition: input.h:84
size_t size() const
Item count.
Definition: arrays.h:673
rArray rknots
Definition: input.h:175