| 132 | } |
| 133 | |
| 134 | void |
| 135 | AmrLevel::writePlotFile (const std::string& dir, |
| 136 | std::ostream& os, |
| 137 | VisMF::How how) |
| 138 | { |
| 139 | BL_PROFILE("AmrLevel::writePlotFile()"); |
| 140 | int i, n; |
| 141 | // |
| 142 | // The list of indices of State to write to plotfile. |
| 143 | // first component of pair is state_type, |
| 144 | // second component of pair is component # within the state_type |
| 145 | // |
| 146 | std::vector<std::pair<int,int> > plot_var_map; |
| 147 | for (int typ = 0; typ < std::ssize(desc_lst); typ++) |
| 148 | { |
| 149 | for (int comp = 0; comp < desc_lst[typ].nComp();comp++) |
| 150 | { |
| 151 | if (amrex::Amr::isStatePlotVar(desc_lst[typ].name(comp)) && |
| 152 | desc_lst[typ].getType() == IndexType::TheCellType()) |
| 153 | { |
| 154 | plot_var_map.emplace_back(typ,comp); |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | int num_derive = 0; |
| 160 | std::vector<std::string> derive_names; |
| 161 | const std::list<DeriveRec>& dlist = derive_lst.dlist(); |
| 162 | for (auto const& d : dlist) |
| 163 | { |
| 164 | if (amrex::Amr::isDerivePlotVar(d.name())) |
| 165 | { |
| 166 | derive_names.push_back(d.name()); |
| 167 | num_derive += d.numDerive(); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | int n_data_items = static_cast<int>(plot_var_map.size()) + num_derive; |
| 172 | |
| 173 | #ifdef AMREX_USE_EB |
| 174 | if (EB2::TopIndexSpaceIfPresent()) { |
| 175 | n_data_items += 1; |
| 176 | } |
| 177 | #endif |
| 178 | |
| 179 | // get the time from the first State_Type |
| 180 | // if the State_Type is ::Interval, this will get t^{n+1/2} instead of t^n |
| 181 | Real cur_time = state[0].curTime(); |
| 182 | |
| 183 | int f_lev = std::min(parent->plotMaxLevel(), parent->finestLevel()); |
| 184 | |
| 185 | if (level == 0 && ParallelDescriptor::IOProcessor()) |
| 186 | { |
| 187 | // |
| 188 | // The first thing we write out is the plotfile type. |
| 189 | // |
| 190 | os << thePlotFileType() << '\n'; |
| 191 |
nothing calls this directly
no test coverage detected