Commit 9fe2410e authored by Melanie Lipp's avatar Melanie Lipp Committed by Timo Koch
Browse files

[test][freeflow] Fix header of error csv file.

Previously it was (incorrectly) assumed that pressure is index 0 in primary variables,
u is index 1 and v is index 2.
parent 14e27272
Pipeline #8734 passed with stages
......@@ -201,9 +201,8 @@ public:
// write header
logFile << "time";
using ErrorNames = std::vector<std::string>;
for (const std::string& e : { "L2Abs", "L2Rel", "LinfAbs", "LinfRel" })
printError_(logFile, ErrorNames({ e + "(p)", e + "(u)", e + "(v)", e + "(w)" }), "{:s}");
printError_(logFile, errorNames_(e), "{:s}");
logFile << "\n";
}
......@@ -230,6 +229,16 @@ private:
logFile << Fmt::format(", " + format, error[Indices::velocity(dirIdx)]);
}
std::vector<std::string> errorNames_(const std::string& e) const
{
if constexpr (dim == 1)
return { e + "(u)", e + "(p)" };
else if constexpr (dim == 2)
return { e + "(u)", e + "(v)", e + "(p)" };
else
return { e + "(u)", e + "(v)", e + "(w)", e + "(p)" };
}
std::string name_;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment