Skip to content
Snippets Groups Projects
Commit 8b938919 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[convergence-study] let run() return all computed data

parent 9a925837
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,8 @@ void ConvergenceStudy::print_eoc(std::ostream& out,
}
} // ... print_eoc(...)
void ConvergenceStudy::run(const std::vector<std::string>& only_these, std::ostream& out)
std::map<std::string, std::map<std::string, std::map<size_t, double>>>
ConvergenceStudy::run(const std::vector<std::string>& only_these, std::ostream& out)
{
auto& self = *this;
// check what we want to compute and print
......@@ -340,6 +341,13 @@ void ConvergenceStudy::run(const std::vector<std::string>& only_these, std::ostr
out << delim;
out << std::endl;
}
// convert data
std::map<std::string, std::map<std::string, std::map<size_t, double>>> return_data;
for (const auto& level : data)
for (const auto& category : level.second)
for (const auto& type : category.second)
return_data[category.first][type.first][level.first] = type.second;
return return_data;
} // ... run(...)
......
......@@ -138,7 +138,16 @@ protected:
const std::string& target_id) const;
public:
void run(const std::vector<std::string>& only_these = {}, std::ostream& out = std::cout);
/**
* \brief Runs the study and displays a table with all targets, norms, estimates and quantities given by the study
* (if only_these is empty) or only those which are contained in only_these (else).
*
* \return data with data[foo][bar][level] where 0 <= level <= num_refinements(), "foo" is one of
* {"target", "norm", "estimate", "quantity"} and bar is one of targets(), norms(), estimates() or
* quantities() (intersected with only_these), respectively.
**/
std::map<std::string, std::map<std::string, std::map<size_t, double>>>
run(const std::vector<std::string>& only_these = {}, std::ostream& out = std::cout);
}; // class ConvergenceStudy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment