2 #include <athena/athena.hpp>
3 #include <athena/hydro/hydro.hpp>
4 #include <athena/mesh/mesh.hpp>
5 #include <athena/outputs/outputs.hpp>
18 void OutputType::loadUserOutputData(MeshBlock *pmb) {
20 auto phyd = pmb->phydro;
21 auto prad = pmb->pimpl->prad;
25 if (output_params.variable.compare(
"prim") == 0 ||
26 output_params.variable.compare(
"vapor") == 0) {
28 pod->type =
"VECTORS";
30 pod->data.InitWithShallowSlice(phyd->w, 4, 1, NVAPOR);
31 AppendOutputDataNode(pod);
35 if (output_params.variable.compare(
"cons") == 0) {
37 pod->type =
"VECTORS";
39 pod->data.InitWithShallowSlice(phyd->u, 4, 1, NVAPOR);
40 AppendOutputDataNode(pod);
46 if (output_params.variable.compare(
"rad") == 0 ||
47 output_params.variable.compare(
"radtau") == 0) {
48 for (
int b = 0;
b < prad->GetNumBands(); ++
b) {
49 auto pband = prad->GetBand(
b);
52 pod->type =
"SCALARS";
53 pod->name = pband->GetName() +
"tau";
54 pod->data.InitWithShallowSlice(pband->btau, 4, 0, 1);
55 AppendOutputDataNode(pod);
60 if (output_params.variable.compare(
"rad") == 0 ||
61 output_params.variable.compare(
"radflux") == 0) {
64 pod->type =
"SCALARS";
66 pod->data.InitWithShallowSlice(prad->flxup, 4, 0, 1);
67 AppendOutputDataNode(pod);
71 pod->type =
"SCALARS";
73 pod->data.InitWithShallowSlice(prad->flxdn, 4, 0, 1);
74 AppendOutputDataNode(pod);
78 if (output_params.variable.compare(
"rad") == 0 ||
79 output_params.variable.compare(
"radtoa") == 0) {
80 if (prad->radiance.GetDim3() > 0) {
82 pod->type =
"SCALARS";
83 pod->name =
"radiance";
84 pod->data.InitWithShallowSlice(prad->radiance, 4, 0, 1);
85 AppendOutputDataNode(pod);
100 for (
auto &fits_out : pmb->pimpl->GetFITSOutputGroups()) {
101 if (fits_out.lock()->ShouldFITSOutput(output_params.variable))
102 fits_out.lock()->LoadFITSOutputData(
this, &num_vars_);
106 for (
auto &mesh_out : pmb->pimpl->GetMeshOutputGroups()) {
107 if (mesh_out.lock()->ShouldMeshOutput(output_params.variable))
108 mesh_out.lock()->LoadMeshOutputData(
this, &num_vars_);