70 inline double MuaMusToKappa (
const double mua,
const double mus)
71 {
return 1.0 / (3.0*(mua+mus)); }
73 inline double MuaKappaToMus (
const double mua,
const double kappa)
74 {
return 1.0/(3.0*kappa) - mua; }
77 const double c0 = 0.3;
78 const double default_n = 1.4;
79 const double default_mua = 0.025;
80 const double default_mus = 2.0;
81 const double default_kappa = MuaMusToKappa (default_mua, default_mus);
82 const double default_a = -1.0;
85 inline double lspeed (
double n) {
return c0/n; }
86 void SetReflectionFunction (ReflectionType rt,
double A = 1.0);
91 FELIB
double A_Keijzer (
double n);
92 FELIB
double A_Contini (
double n);
93 FELIB
double A_Const (
double );
100 { mua = default_mua, kappa = default_kappa, n = default_n, a = default_a; }
102 Parameter (
const double _mua,
const double _kappa,
const double _n,
103 const double _a = default_a)
104 { mua = _mua, kappa = _kappa, n = _n, a = _a; }
107 { mua = prm.mua, kappa = prm.kappa, n = prm.n, a = prm.a; }
110 friend double MuaMusToKappa (
const double mua,
const double mus);
111 friend double MuaKappaToMus (
const double mua,
const double kappa);
115 int operator== (
const Parameter &prm)
const;
116 int operator!= (
const Parameter &prm)
const;
119 double Mua()
const {
return mua; }
120 double Kappa()
const {
return kappa; }
121 double N()
const {
return n; }
122 double C()
const {
return lspeed(n); }
123 double CMua()
const {
return C()*Mua(); }
124 double CKappa()
const {
return C()*Kappa(); }
125 double Mus()
const {
return MuaKappaToMus (mua, kappa); }
126 double CMus()
const {
return C()*Mus(); }
128 double bndA (
double n2 = 1.0)
const;
129 double C2A()
const {
return C()/(2.0*A()); }
130 double Param (ParameterType prmtp)
const;
132 static double C2A (ReflectionType rt,
double n);
135 void SetMua (
const double _mua) { mua = _mua; }
136 void SetKappa (
const double _kappa) { kappa = _kappa; }
137 void SetN (
const double _n) { n = _n; }
138 void SetC (
const double _c) { n = c0/_c; }
139 void SetMus (
const double _mus) { kappa = MuaMusToKappa (mua, _mus); }
140 void SetCMua (
const double _cmua) { mua = _cmua/C(); }
141 void SetCKappa (
const double _ckappa) { kappa = _ckappa/C(); }
142 void SetA (
const double _a) { a = _a; }
143 void SetMuaKappa (
const double _mua,
const double _kappa)
144 { mua = _mua, kappa = _kappa; }
145 void SetMuaMus (
const double _mua,
const double _mus)
146 { mua = _mua, kappa = MuaMusToKappa (_mua, _mus); }
147 void SetParam (ParameterType prmtp,
const double val);
150 friend std::istream& operator>> (std::istream& is,
Parameter& prm);
151 friend std::ostream& operator<< (std::ostream& os,
Parameter& prm);
152 void get (std::istream &is, ParameterType p1 = PRM_MUA,
153 ParameterType p2 = PRM_KAPPA, ParameterType p3 = PRM_N);
154 void put (std::ostream &os, ParameterType p1 = PRM_MUA,
155 ParameterType p2 = PRM_KAPPA, ParameterType p3 = PRM_N);
175 void New (
const int _size);
181 int Len()
const {
return size; }
186 void Swap (
const int rec1,
const int rec2);
189 void Append (
int number);
193 void Remove (
const int rec);
197 PlistType pltype()
const {
return plist_type;}
198 void SetListType(PlistType p) { plist_type = p;}
200 RVector Mua()
const {
return Param (PRM_MUA); }
201 RVector Kappa()
const {
return Param (PRM_KAPPA); }
202 RVector N()
const {
return Param (PRM_N); }
203 RVector C()
const {
return Param (PRM_C); }
204 RVector CMua()
const {
return Param (PRM_CMUA); }
205 RVector CKappa()
const {
return Param (PRM_CKAPPA); }
206 RVector Mus()
const {
return Param (PRM_MUS); }
207 RVector CMus()
const {
return Param (PRM_CMUS); }
208 RVector A()
const {
return Param (PRM_A); }
209 RVector C2A()
const {
return Param (PRM_C2A); }
210 RVector Param (ParameterType prmtp)
const;
214 void Mua (
RVector &prmvec)
const { Param (PRM_MUA, prmvec); }
215 void Kappa (
RVector &prmvec)
const { Param (PRM_KAPPA, prmvec); }
216 void N (
RVector &prmvec)
const { Param (PRM_N, prmvec); }
217 void C (
RVector &prmvec)
const { Param (PRM_C, prmvec); }
218 void CMua (
RVector &prmvec)
const { Param (PRM_CMUA, prmvec); }
219 void CKappa (
RVector &prmvec)
const { Param (PRM_CKAPPA, prmvec); }
220 void Mus (
RVector &prmvec)
const { Param (PRM_MUS, prmvec); }
221 void CMus (
RVector &prmvec)
const { Param (PRM_CMUS, prmvec); }
222 void A (
RVector &prmvec)
const { Param (PRM_A, prmvec); }
223 void C2A (
RVector &prmvec)
const { Param (PRM_C2A, prmvec); }
224 void Param (ParameterType prmtp,
RVector &prmvec)
const;
227 void SetMua (
const RVector& prmvec) { SetParam (PRM_MUA, prmvec); }
228 void SetKappa (
const RVector& prmvec) { SetParam (PRM_KAPPA, prmvec); }
229 void SetN (
const RVector& prmvec) { SetParam (PRM_N, prmvec); }
230 void SetC (
const RVector& prmvec) { SetParam (PRM_C, prmvec); }
231 void SetCMua (
const RVector& prmvec) { SetParam (PRM_CMUA, prmvec); }
232 void SetCKappa (
const RVector& prmvec) { SetParam (PRM_CKAPPA, prmvec); }
233 void SetMus (
const RVector& prmvec) { SetParam (PRM_MUS, prmvec); }
234 void SetA (
const RVector& prmvec) { SetParam (PRM_A, prmvec); }
235 void SetParam (ParameterType prmtp,
const RVector& prmvec);
238 void SetMua (
double prm) { SetParam (PRM_MUA, prm); }
239 void SetKappa (
double prm) { SetParam (PRM_KAPPA, prm); }
240 void SetN (
double prm) { SetParam (PRM_N, prm); }
241 void SetC (
double prm) { SetParam (PRM_C, prm); }
242 void SetCMua (
double prm) { SetParam (PRM_CMUA, prm); }
243 void SetCKappa (
double prm) { SetParam (PRM_CKAPPA, prm); }
244 void SetMus (
double prm) { SetParam (PRM_MUS, prm); }
245 void SetA (
double prm) { SetParam (PRM_A, prm); }
246 void SetParam (ParameterType prmtp,
double prm);
249 Parameter& operator[] (
const int rec)
const;
251 Parameter& operator[] (
const int rec)
const {
return list[rec]; }
255 void SetOutputParameterTypes (
const ParameterType p1,
256 const ParameterType p2,
const ParameterType p3);
258 friend std::istream& operator>> (std::istream& is,
ParameterList& plist);
259 friend std::ostream& operator<< (std::ostream& os,
265 ParameterType output_prmtp_p1, output_prmtp_p2, output_prmtp_p3;
266 PlistType plist_type;