9 : q(fq), emin(femin), emax(femax) {
10 mfunname(
"EnergyMesh::EnergyMesh(double femin, double femax, long fq)");
13 double rk =
pow(emax / emin, (1.0 /
double(q)));
16 for (
long n = 1; n < q + 1; n++) {
18 ec[n - 1] = (e[n - 1] + e[n]) * 0.5;
31 emin = fec[0] - (fec[1] - fec[0]) / 2.0;
32 emax = fec[q - 1] + (fec[q - 1] - fec[q - 2]) / 2.0;
36 for (
long n = 0; n < q; n++) {
39 for (
long n = 1; n < q; n++) {
40 e[n] = 0.5 * (fec[n - 1] + fec[n]);
76 if (ener < emin)
return -1;
77 if (ener > emax)
return q;
83 n3 = n1 + (n2 - n1) / 2;
94 if (ener < ec[0])
return -1;
95 if (ener > ec[q - 1])
return q;
100 while (n2 - n1 > 1) {
101 n3 = n1 + (n2 - n1) / 2;
112 Ifile <<
"EnergyMesh: \n";
114 Ifile <<
"emin=" << f.emin <<
" emax=" << f.emax
115 <<
" quantity of intervals=" << f.q <<
'\n'
116 <<
" maximal possible quantity of intervals=" <<
pqener <<
'\n';
117 Ifile <<
" number left side center right side widht\n";
118 for (
int n = 0; n < f.q; n++) {
119 Ifile << std::setw(5) << n << std::setw(15) << f.e[n] << std::setw(15)
120 << f.ec[n] << std::setw(15) << f.e[n + 1] << std::setw(15)
121 << (f.e[n + 1] - f.e[n]) <<
'\n';
131 Ifile <<
"EnergyMesh (l=" << l <<
"): \n";
133 Ifile <<
"emin=" << emin <<
" emax=" << emax <<
" quantity of intervals=" << q
134 <<
'\n' <<
" maximal possible quantity of intervals=" <<
pqener <<
'\n';
136 Ifile <<
" number left side center right side widht\n";
137 for (
int n = 0; n < q; n++) {
138 Ifile << std::setw(5) << n << std::setw(15) << e[n] << std::setw(15)
139 << ec[n] << std::setw(15) << e[n + 1] << std::setw(15)
140 << (e[n + 1] - e[n]) <<
'\n';
148 "DynLinArr< double > make_log_mesh_ec(double emin, double emax, long q)");
150 double rk =
pow(emax / emin, (1.0 /
double(q)));
155 for (
long n = 0; n < q; n++) {
158 ec[n] = (e1 + e2) * 0.5;
DoubleAc pow(const DoubleAc &f, double p)
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
#define check_econd11(a, signb, stream)
virtual void print(std::ostream &file, int l) const
long get_interval_number_between_centers(double ener)
long get_interval_number(double ener)
DynLinArr< double > make_log_mesh_ec(double emin, double emax, long q)
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)