#include <EnergyMesh.h>
Definition at line 44 of file EnergyMesh.h.
◆ EnergyMesh() [1/3]
Heed::EnergyMesh::EnergyMesh |
( |
void |
| ) |
|
|
inline |
Definition at line 46 of file EnergyMesh.h.
46: q(0), emin(0.0), emax(0.0) {}
◆ EnergyMesh() [2/3]
Heed::EnergyMesh::EnergyMesh |
( |
double |
femin, |
|
|
double |
femax, |
|
|
long |
fq |
|
) |
| |
Definition at line 8 of file EnergyMesh.cpp.
9 : q(fq), emin(femin), emax(femax) {
10 mfunname(
"EnergyMesh::EnergyMesh(double femin, double femax, long fq)");
12
13 double rk =
pow(emax / emin, (1.0 /
double(q)));
14 double er = emin;
15 e[0] = er;
16 for (long n = 1; n < q + 1; n++) {
17 e[n] = er * rk;
18 ec[n - 1] = (e[n - 1] + e[n]) * 0.5;
19 er = e[n];
20 }
21
22
23
24}
DoubleAc pow(const DoubleAc &f, double p)
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
◆ EnergyMesh() [3/3]
Heed::EnergyMesh::EnergyMesh |
( |
DynLinArr< double > |
fec | ) |
|
Definition at line 26 of file EnergyMesh.cpp.
30 if (q > 0) {
31 emin = fec[0] - (fec[1] - fec[0]) / 2.0;
32 emax = fec[q - 1] + (fec[q - 1] - fec[q - 2]) / 2.0;
33 e[0] = emin;
34 e[q] = emax;
35
36 for (long n = 0; n < q; n++) {
37 ec[n] = fec[n];
38 }
39 for (long n = 1; n < q; n++) {
40 e[n] = 0.5 * (fec[n - 1] + fec[n]);
41 }
42 } else {
43 emin = 0.0;
44 emax = 0.0;
45 }
46
47
48}
#define check_econd11(a, signb, stream)
◆ ~EnergyMesh()
virtual Heed::EnergyMesh::~EnergyMesh |
( |
| ) |
|
|
inlinevirtual |
◆ get_ae()
const double * Heed::EnergyMesh::get_ae |
( |
void |
| ) |
const |
|
inline |
◆ get_aec()
const double * Heed::EnergyMesh::get_aec |
( |
void |
| ) |
const |
|
inline |
◆ get_e()
double Heed::EnergyMesh::get_e |
( |
long |
n | ) |
const |
|
inline |
◆ get_ec()
double Heed::EnergyMesh::get_ec |
( |
long |
n | ) |
const |
|
inline |
◆ get_emax()
double Heed::EnergyMesh::get_emax |
( |
| ) |
const |
|
inline |
◆ get_emin()
double Heed::EnergyMesh::get_emin |
( |
| ) |
const |
|
inline |
◆ get_interval_number()
long Heed::EnergyMesh::get_interval_number |
( |
double |
ener | ) |
|
Definition at line 75 of file EnergyMesh.cpp.
75 {
76 if (ener < emin) return -1;
77 if (ener > emax) return q;
78
79 long n1 = 0;
80 long n2 = q;
81 long n3 = n1;
82 while (n2 - n1 > 1) {
83 n3 = n1 + (n2 - n1) / 2;
84 if (ener < e[n3]) {
85 n2 = n3;
86 } else {
87 n1 = n3;
88 }
89 }
90 return n1;
91}
◆ get_interval_number_between_centers()
long Heed::EnergyMesh::get_interval_number_between_centers |
( |
double |
ener | ) |
|
◆ get_q()
long Heed::EnergyMesh::get_q |
( |
| ) |
const |
|
inline |
◆ macro_copy_total()
◆ print()
void Heed::EnergyMesh::print |
( |
std::ostream & |
file, |
|
|
int |
l |
|
) |
| const |
|
virtual |
Definition at line 129 of file EnergyMesh.cpp.
129 {
130 if (l <= 0) return;
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';
135 if (l > 1) {
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';
141 }
142 }
144}
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
EnergyMesh & |
f |
|
) |
| |
|
friend |
Definition at line 111 of file EnergyMesh.cpp.
111 {
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';
122 }
123
124
126 return file;
127}
The documentation for this class was generated from the following files: