IM-SRG++  0
ReadWrite.hh
1 
2 #ifndef ReadWrite_h
3 #define ReadWrite_h 1
4 #define BOOST_IOSTREAMS_NO_LIB 1
5 
6 #include <map>
7 #include <string>
8 #include "Operator.hh"
9 
10 using namespace std;
11 
12 
13 class ReadWrite
14 {
15  public:
16  ~ReadWrite();
17  ReadWrite();
18  void ReadSettingsFile( string filename);
19  void ReadTBME_Oslo( string filename, Operator& Hbare);
20  void ReadTBME_OakRidge( string filename, Operator& Hbare);
21  void ReadBareTBME_Jason( string filename, Operator& Hbare);
22  void ReadBareTBME_Navratil( string filename, Operator& Hbare);
23  void ReadBareTBME_Navratil_from_stream( istream& infile, Operator& Hbare);
24  void ReadBareTBME_Darmstadt( string filename, Operator& Hbare, int E1max, int E2max, int lmax);
25  template<class T> void ReadBareTBME_Darmstadt_from_stream( T & infile, Operator& Hbare, int E1max, int E2max, int lmax);
26  void Read_Darmstadt_3body( string filename, Operator& Hbare, int E1max, int E2max, int E3max);
27  template<class T>void Read_Darmstadt_3body_from_stream( T & infile, Operator& Hbare, int E1max, int E2max, int E3max);
28  void GetHDF5Basis( ModelSpace* modelspace, string filename, vector<array<int,5>>& Basis );
29  void Read3bodyHDF5( string filename, Operator& op);
30  void Read3bodyHDF5_new( string filename, Operator& op);
31  void ReadOperator_Nathan( string filename1b, string filename2b, Operator& op);
32  void ReadTensorOperator_Nathan( string filename1b, string filename2b, Operator& op);
33  void Write_me2j( string filename, Operator& op, int emax, int e2max, int lmax);
34  void Write_me3j( string filename, Operator& op, int E1max, int E2max, int E3max);
35  void WriteTBME_Navratil( string filename, Operator& Hbare);
36  void WriteNuShellX_sps( Operator& op, string filename);
37  void WriteNuShellX_int( Operator& op, string filename);
38  void WriteNuShellX_op( Operator& op, string filename);
39  void ReadNuShellX_int( Operator& op, string filename);
40  void WriteNuShellX_intfile( Operator& op, string filename, string mode);
41  void WriteAntoine_int( Operator& op, string filename);
42  void WriteAntoine_input( Operator& op, string filename, int A, int Z);
43  void WriteOperator(Operator& op, string filename);
44  void WriteOperatorHuman(Operator& op, string filename);
45  void ReadOperator(Operator& op, string filename);
46  void CompareOperators(Operator& op1, Operator& op2, string filename);
47  void ReadOneBody_Takayuki(string filename, Operator& Hbare);
48  void ReadTwoBody_Takayuki(string filename, Operator& Hbare);
49  void WriteOneBody_Takayuki(string filename, Operator& Hbare);
50  void WriteTwoBody_Takayuki(string filename, Operator& Hbare);
51  void WriteTensorOneBody(string filename, Operator& H, string opname);
52  void WriteTensorTwoBody(string filename, Operator& H, string opname);
53  void WriteOneBody_Oslo(string filename, Operator& Hbare);
54  void WriteTwoBody_Oslo(string filename, Operator& Hbare);
55  void ReadTwoBodyEngel(string filename, Operator& Op);
56  void ReadTwoBodyEngel_from_stream(istream& infile, Operator& Op);
57  void ReadRelCMOpFromJavier( string statefile, string MEfile, Operator& Op);
58  void SetLECs(double c1, double c3, double c4, double cD, double cE);
59  array<double,5> GetLECs(){return LECs;};
60  void SetLECs_preset(string);
61  void SetCoMCorr(bool b){doCoM_corr = b;cout <<"Setting com_corr to "<< b << endl;};
62  void SetScratchDir( string d){scratch_dir = d;};
63  string GetScratchDir(){return scratch_dir;};
64  int GetAref(){return Aref;};
65  int GetZref(){return Zref;};
66  void SetAref(int a){Aref = a;};
67  void SetZref(int z){Zref = z;};
68 
69  // Fields
70 
71  std::map<string,string> InputParameters;
72 
73  bool InGoodState(){return goodstate;};
74  bool doCoM_corr;
75  bool goodstate;
76  array<double,5> LECs;
77  string scratch_dir;
78  string File2N;
79  string File3N;
80  int Aref;
81  int Zref;
82 
83 
84 };
85 
86 
87 
91 {
92  public:
93  VectorStream(vector<float>& v) : vec(v), i(0) {};
94 // VectorStream(vector<double>& v) : vec(v), i(0) {};
95  VectorStream& operator>>(float& x) { x = vec[i++]; return (VectorStream&)(*this);}
96 // VectorStream& operator>>(double& x) { x = vec[i++]; return (VectorStream&)(*this);}
97  bool good(){ return i<vec.size(); };
98  void getline(char[], int) {}; // Don't do nuthin'.
99  private:
100  vector<float>& vec;
101 // vector<double>& vec;
102  long long unsigned int i;
103 };
104 
105 #endif
106 
Definition: Operator.hh:21
Definition: ReadWrite.cc:3012
Definition: ReadWrite.hh:13
Definition: ModelSpace.hh:157
Definition: ReadWrite.hh:90