Commit 4de49c15 authored by Ed Laughton's avatar Ed Laughton

Address review comments

parent 23245e1a
Pipeline #1939 passed with stages
in 182 minutes and 19 seconds
...@@ -282,7 +282,7 @@ Filter \inltt{Electrogram} computes virtual unipolar electrograms at a ...@@ -282,7 +282,7 @@ Filter \inltt{Electrogram} computes virtual unipolar electrograms at a
\subsection{Error}\label{filters:Error} \subsection{Error}\label{filters:Error}
This filter produces a CSV file containing the time-evolution of the $L_2$ and This filter produces a file containing the time-evolution of the $L_2$ and
$L_{inf}$ errors. By default this file is called \inltt{session.err} where $L_{inf}$ errors. By default this file is called \inltt{session.err} where
\inltt{session} is the session name. \inltt{session} is the session name.
......
...@@ -64,10 +64,10 @@ FilterError::FilterError(const LibUtilities::SessionReaderSharedPtr &pSession, ...@@ -64,10 +64,10 @@ FilterError::FilterError(const LibUtilities::SessionReaderSharedPtr &pSession,
outName += ".err"; outName += ".err";
// Lock equation system pointer // Lock equation system pointer
m_equationShPtr = pEquation.lock(); auto equationSys = m_equ.lock();
ASSERTL0(m_equationShPtr, "Weak pointer expired"); ASSERTL0(equationSys, "Weak pointer expired");
m_numVariables = m_equationShPtr->GetNvariables(); m_numVariables = equationSys->GetNvariables();
m_comm = pSession->GetComm(); m_comm = pSession->GetComm();
if (m_comm->GetRank() == 0) if (m_comm->GetRank() == 0)
...@@ -79,9 +79,9 @@ FilterError::FilterError(const LibUtilities::SessionReaderSharedPtr &pSession, ...@@ -79,9 +79,9 @@ FilterError::FilterError(const LibUtilities::SessionReaderSharedPtr &pSession,
m_outFile << "Time"; m_outFile << "Time";
for (size_t i = 0; i < m_numVariables; ++i) for (size_t i = 0; i < m_numVariables; ++i)
{ {
std::string varName = m_equationShPtr->GetVariable(i); std::string varName = equationSys->GetVariable(i);
m_outFile << "," + varName + " L2" m_outFile << " " + varName + "_L2"
<< "," + varName + " Linf"; << " " + varName + "_Linf";
} }
m_outFile << std::endl; m_outFile << std::endl;
...@@ -125,19 +125,23 @@ void FilterError::v_Update( ...@@ -125,19 +125,23 @@ void FilterError::v_Update(
m_outFile << time; m_outFile << time;
} }
// Lock equation system pointer
auto equationSys = m_equ.lock();
ASSERTL0(equationSys, "Weak pointer expired");
for (size_t i = 0; i < m_numVariables; ++i) for (size_t i = 0; i < m_numVariables; ++i)
{ {
Array<OneD, NekDouble> exactsoln(m_equationShPtr->GetTotPoints(), 0.0); Array<OneD, NekDouble> exactsoln(equationSys->GetTotPoints(), 0.0);
// Evaluate "ExactSolution" function, or zero array // Evaluate "ExactSolution" function, or zero array
m_equationShPtr->EvaluateExactSolution(i, exactsoln, time); equationSys->EvaluateExactSolution(i, exactsoln, time);
NekDouble vL2Error = m_equationShPtr->L2Error(i, exactsoln); NekDouble vL2Error = equationSys->L2Error(i, exactsoln);
NekDouble vLinfError = m_equationShPtr->LinfError(i, exactsoln); NekDouble vLinfError = equationSys->LinfError(i, exactsoln);
if (m_comm->GetRank() == 0) if (m_comm->GetRank() == 0)
{ {
m_outFile << "," << vL2Error << "," << vLinfError; m_outFile << " " << vL2Error << " " << vLinfError;
} }
} }
......
...@@ -84,7 +84,6 @@ private: ...@@ -84,7 +84,6 @@ private:
size_t m_numVariables; size_t m_numVariables;
std::ofstream m_outFile; std::ofstream m_outFile;
LibUtilities::CommSharedPtr m_comm; LibUtilities::CommSharedPtr m_comm;
std::shared_ptr<EquationSystem> m_equationShPtr;
}; };
} // namespace SolverUtils } // namespace SolverUtils
} // namespace Nektar } // namespace Nektar
......
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