22 #include <LbmLib/include/reportHandler/DensityDomainReporter.hpp>
23 #include <UtilLib/include/Exception.hpp>
24 #include <LbmLib/include/nodes/PhysicalNode.hpp>
25 #include <LbmLib/include/solver/CDESolver/CDEAbstractSolver.hpp>
26 #include <LbmLib/include/solver/FluidSolver/FluidSolver.hpp>
33 namespace reportHandler {
35 std::stringstream filename;
36 filename <<
filename_ <<
"_" << time <<
".txt";
37 std::ofstream oStream(filename.str().c_str());
38 if (!oStream.is_open()) {
42 std::map<unsigned int, double> sums;
43 for (
const auto i : physicalNodes_) {
44 for (
const auto pt : i) {
45 auto it = sums.find(pt->getDomainIdentifier());
46 if (it != sums.end()) {
47 if (solverName_.empty()) {
48 it->second += pt->getFluidSolver().getRho();
50 it->second += pt->getCDESolverSlow(solverName_).getC();
53 if (solverName_.empty()) {
54 sums[pt->getDomainIdentifier()] =
55 pt->getFluidSolver().getRho();
57 sums[pt->getDomainIdentifier()] = pt->getCDESolverSlow(
63 for (
const auto& i : sums) {
64 oStream << std::setprecision(12) << i.first <<
"\t" << i.second <<
"\n";
virtual void operator()(unsigned int time) const
operator() Writes the report
const std::string filename_
filename_ Stores the filename of this functor