MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / plotFileOutput

Method plotFileOutput

Source/driver/Castro_io.cpp:942–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940
941
942void
943Castro::plotFileOutput(const std::string& dir,
944 ostream& os,
945 VisMF::How how,
946 const int is_small)
947{
948#ifdef AMREX_PARTICLES
949 ParticlePlotFile(dir);
950#endif
951
952 //
953 // The list of indices of State to write to plotfile.
954 // first component of pair is state_type,
955 // second component of pair is component # within the state_type
956 //
957 std::vector<std::pair<int,int> > plot_var_map;
958 for (int typ = 0; typ < desc_lst.size(); typ++) {
959 for (int comp = 0; comp < desc_lst[typ].nComp(); comp++) {
960 if (((parent->isStatePlotVar(desc_lst[typ].name(comp)) && is_small == 0) ||
961 (parent->isStateSmallPlotVar(desc_lst[typ].name(comp)) && is_small == 1)) &&
962 desc_lst[typ].getType() == IndexType::TheCellType()) {
963 plot_var_map.emplace_back(typ, comp);
964 }
965 }
966 }
967
968 int num_derive = 0;
969 std::list<std::string> derive_names;
970 const std::list<DeriveRec>& dlist = derive_lst.dlist();
971
972 for (const auto & dd : dlist) {
973
974 if ((parent->isDerivePlotVar(dd.name()) && is_small == 0) ||
975 (parent->isDeriveSmallPlotVar(dd.name()) && is_small == 1))
976 {
977#ifdef AMREX_PARTICLES
978 if (dd.name() == "particle_count" ||
979 dd.name() == "total_particle_count")
980 {
981 if (Castro::theTracerPC())
982 {
983 derive_names.push_back(dd.name());
984 num_derive = num_derive + dd.numDerive();
985 }
986 } else
987#endif
988 {
989 derive_names.push_back(dd.name());
990 num_derive = num_derive + dd.numDerive();
991 }
992 }
993 }
994
995 int n_data_items = static_cast<int>(plot_var_map.size()) + num_derive;
996
997#ifdef RADIATION
998 if (Radiation::nplotvar > 0) n_data_items += Radiation::nplotvar;
999#endif

Callers

nothing calls this directly

Calls 5

theTracerPCFunction · 0.85
sizeMethod · 0.80
write_groupsMethod · 0.80
closeMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected