10
10
void Ions::calc_efield (Grid grid) {
11
11
12
12
// efield = - grad(potential)
13
- efield_vcgc = calc_gradient_vector (potential_scgc, grid);
14
-
15
- for (int64_t iComp = 0 ; iComp < 3 ; iComp++)
16
- efield_vcgc[iComp] = -efield_vcgc[iComp];
13
+ efield_vcgc = calc_gradient_vector (-1.0 * potential_scgc, grid);
17
14
18
15
// Remove component along b-field (should be zero, anyways!)
19
16
arma_cube edotb = dot_product (efield_vcgc, grid.bfield_unit_vcgc );
@@ -28,12 +25,16 @@ void Ions::calc_efield(Grid grid) {
28
25
// --------------------------------------------------------------------------
29
26
30
27
void Ions::calc_exb_drift (Grid grid) {
28
+ std::string function = " Ions::calc_exb" ;
29
+ static int iFunction = -1 ;
30
+ report.enter (function, iFunction);
31
31
arma_cube bmag2 =
32
32
(grid.bfield_mag_scgc ) % (grid.bfield_mag_scgc );
33
33
exb_vcgc = cross_product (efield_vcgc, grid.bfield_vcgc );
34
34
35
35
for (int64_t iComp = 0 ; iComp < 3 ; iComp++)
36
36
exb_vcgc[iComp] = exb_vcgc[iComp] / bmag2;
37
+ report.exit (function);
37
38
}
38
39
39
40
// --------------------------------------------------------------------------
@@ -42,6 +43,10 @@ void Ions::calc_exb_drift(Grid grid) {
42
43
43
44
std::vector<arma_cube> Ions::calc_ion_electron_pressure_gradient (int64_t iIon,
44
45
Grid grid) {
46
+
47
+ std::string function = " Ions::elec_ion_pressure_gradient" ;
48
+ static int iFunction = -1 ;
49
+ report.enter (function, iFunction);
45
50
std::vector<arma_cube> pressure_gradient_vcgc;
46
51
arma_cube total_pressure_scgc;
47
52
@@ -57,6 +62,7 @@ std::vector<arma_cube> Ions::calc_ion_electron_pressure_gradient(int64_t iIon,
57
62
cKB;
58
63
59
64
pressure_gradient_vcgc = calc_gradient_vector (total_pressure_scgc, grid);
65
+ report.exit (function);
60
66
61
67
return pressure_gradient_vcgc;
62
68
}
0 commit comments