7 #include "../coordinates/coordinates.hpp"
8 #include "../reconstruct/interpolation.hpp"
9 #include "../thermodynamics/thermodynamics.hpp"
22 eddy_.DeleteAthenaArray();
23 mean_.DeleteAthenaArray();
24 data.DeleteAthenaArray();
32 int is = pmb->is, js = pmb->js, ks = pmb->ks;
33 int ie = pmb->ie, je = pmb->je, ke = pmb->ke;
35 Real *data_sum =
new Real[(NHYDRO + 1) *
ncells1_];
36 std::fill(data_sum, data_sum + (NHYDRO + 1) *
ncells1_, 0.);
39 for (
int k = ks; k <= ke; ++k)
40 for (
int j = js;
j <= je; ++
j) {
41 pcoord->CellVolume(k,
j, is, ie,
vol_);
42 for (
int i = is; i <= ie; ++i) {
43 for (
int n = 0; n < IPR; ++n)
53 MPI_Allreduce(MPI_IN_PLACE, data_sum, (NHYDRO + 1) *
ncells1_,
54 MPI_ATHENA_REAL, MPI_SUM, MPI_COMM_WORLD);
58 for (
int k = ks; k <= ke; ++k)
59 for (
int j = js;
j <= je; ++
j)
60 for (
int i = is; i <= ie; ++i) {
61 Real vol = data_sum[NHYDRO *
ncells1_ + i];
62 for (
int n = 0; n < IPR; ++n) {
74 for (
int n = 0; n < NHYDRO; ++n)
75 for (
int k = ks; k <= ke; ++k)
76 for (
int j = js;
j <= je; ++
j) {
77 pcoord->CellVolume(k,
j, is, ie,
vol_);
78 for (
int i = is; i <= ie; ++i) {
80 data(n + NHYDRO, i) +=
92 int is = pmb->is, js = pmb->js, ks = pmb->ks;
93 int ie = pmb->ie, je = pmb->je, ke = pmb->ke;
95 Real *total_vol =
new Real[
ncells1_];
96 std::fill(total_vol, total_vol +
ncells1_, 0.);
99 for (
int k = ks; k <= ke; ++k)
100 for (
int j = js;
j <= je; ++
j) {
101 pmb->pcoord->CellVolume(k,
j, is, ie,
vol_);
102 for (
int i = is; i <= ie; ++i) total_vol[i] +=
vol_(i);
109 MPI_Allreduce(MPI_IN_PLACE,
data.data(),
data.GetSize(), MPI_ATHENA_REAL,
110 MPI_SUM, MPI_COMM_WORLD);
111 MPI_Allreduce(MPI_IN_PLACE, total_vol,
ncells1_, MPI_ATHENA_REAL, MPI_SUM,
114 for (
int n = 0; n < 2 * NHYDRO; ++n)
115 for (
int i = is; i <= ie; ++i)
data(n, i) /=
ncycle * total_vol[i];
AthenaArray< Real > mean_
mean and eddy component
AthenaArray< Real > eddy_
void Finalize(AthenaArray< Real > const &w)
void Progress(AthenaArray< Real > const &w)
Real GetTemp(MeshBlock const *pmb, int k, int j, int i) const
Calculate temperature from primitive variable.