9 : q(fq), emin(femin), emax(femax) {
10 mfunname(
"EnergyMesh::EnergyMesh(double femin, double femax, long fq)");
13 const 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;
24 mfunname(
"std::vector< double > fec");
32 emin = fec[0] - (fec[1] - fec[0]) / 2.0;
33 emax = fec[q - 1] + (fec[q - 1] - fec[q - 2]) / 2.0;
37 for (
long n = 0; n < q; n++) {
40 for (
long n = 1; n < q; n++) {
41 e[n] = 0.5 * (fec[n - 1] + fec[n]);
46 if (ener < emin)
return -1;
47 if (ener > emax)
return q;
52 const long n3 = n1 + ((n2 - n1) >> 1);
63 if (ener < ec[0])
return -1;
64 if (ener > ec[q - 1])
return q;
69 const long n3 = n1 + ((n2 - n1) >> 1);
80 Ifile <<
"EnergyMesh: \n";
82 Ifile <<
"emin=" << f.emin <<
" emax=" << f.emax
83 <<
" number of intervals=" << f.q <<
'\n'
84 <<
" maximal number of intervals=" << EnergyMesh::pqener <<
'\n';
85 Ifile <<
" bin left side center right side width\n";
86 for (
int n = 0; n < f.q; n++) {
87 Ifile << std::setw(5) << n << std::setw(15) << f.e[n] << std::setw(15)
88 << f.ec[n] << std::setw(15) << f.e[n + 1] << std::setw(15)
89 << (f.e[n + 1] - f.e[n]) <<
'\n';
97 Ifile <<
"EnergyMesh (l=" << l <<
"): \n";
99 Ifile <<
"emin=" << emin <<
" emax=" << emax <<
" quantity of intervals=" << q
100 <<
'\n' <<
" maximal possible quantity of intervals=" << pqener <<
'\n';
102 Ifile <<
" number left side center right side widht\n";
103 for (
int n = 0; n < q; n++) {
104 Ifile << std::setw(5) << n << std::setw(15) << e[n] << std::setw(15)
105 << ec[n] << std::setw(15) << e[n + 1] << std::setw(15)
106 << (e[n + 1] - e[n]) <<
'\n';
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
#define check_econd11(a, signb, stream)
void print(std::ostream &file, int l) const
EnergyMesh()=default
Default constructor.
long get_interval_number_between_centers(const double ener) const
long get_interval_number(const double ener) const
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
DoubleAc pow(const DoubleAc &f, double p)