MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / outputVars

Method outputVars

src/solver/solver.cxx:682–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682void Solver::outputVars(Options& output_options, bool save_repeat) {
683 Timer time("io");
684 output_options["tt"].force(simtime, "Solver");
685 output_options["hist_hi"].force(iteration, "Solver");
686
687 output_options["run_id"]
688 .doc("UUID for this simulation")
689 .assignRepeat(run_id, "t", save_repeat and save_repeat_run_id, "Solver");
690 output_options["run_restart_from"]
691 .doc("run_id of the simulation this one was restarted from."
692 "'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' means the run is not a restart, "
693 "or the previous run did not have a run_id.")
694 .assignRepeat(run_restart_from, "t", save_repeat and save_repeat_run_id, "Solver");
695
696 // Add 2D and 3D evolving fields to output file
697 for (const auto& f : f2d) {
698 // Add to dump file (appending)
699 output_options[f.name].assignRepeat(*(f.var), "t", save_repeat, "Solver");
700 output_options[f.name].attributes["description"] = f.description;
701 }
702 for (const auto& f : f3d) {
703 // Add to dump file (appending)
704 output_options[f.name].assignRepeat(*(f.var), "t", save_repeat, "Solver");
705 output_options[f.name].attributes["description"] = f.description;
706 if (mms) {
707 // Add an error variable
708 output_options["E_" + f.name].assignRepeat(*(f.MMS_err), "t", save_repeat,
709 "Solver");
710 output_options["E_" + f.name].attributes["description"] = f.description;
711 }
712 }
713
714 if (save_repeat) {
715 // Do not save if save_repeat=false so we avoid adding diagnostic variables to restart
716 // files, otherwise they might cause errors if the solver type is changed before
717 // restarting
718
719 // Add solver diagnostics to output file
720 for (const auto& d : diagnostic_int) {
721 output_options[d.name].assignRepeat(*(d.var), "t", true, "Solver");
722 output_options[d.name].attributes["description"] = d.description;
723 }
724 for (const auto& d : diagnostic_BoutReal) {
725 output_options[d.name].assignRepeat(*(d.var), "t", true, "Solver");
726 output_options[d.name].attributes["description"] = d.description;
727 }
728 }
729}
730
731void Solver::readEvolvingVariablesFromOptions(Options& options) {
732 run_id = options["run_id"].withDefault(default_run_id);

Callers 2

writeDefaultOutputFileFunction · 0.45
call_monitorsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected