Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
4de49c15
Commit
4de49c15
authored
May 10, 2020
by
Ed Laughton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review comments
parent
23245e1a
Pipeline
#1939
passed with stages
in 182 minutes and 19 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
docs/user-guide/xml/xml-filters.tex
docs/user-guide/xml/xml-filters.tex
+1
-1
library/SolverUtils/Filters/FilterError.cpp
library/SolverUtils/Filters/FilterError.cpp
+15
-11
library/SolverUtils/Filters/FilterError.h
library/SolverUtils/Filters/FilterError.h
+0
-1
No files found.
docs/user-guide/xml/xml-filters.tex
View file @
4de49c15
...
@@ -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.
...
...
library/SolverUtils/Filters/FilterError.cpp
View file @
4de49c15
...
@@ -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_
equationS
hPtr
=
pEquation
.
lock
();
auto
equationS
ys
=
m_equ
.
lock
();
ASSERTL0
(
m_
equationS
hPtr
,
"Weak pointer expired"
);
ASSERTL0
(
equationS
ys
,
"Weak pointer expired"
);
m_numVariables
=
m_
equationS
hPtr
->
GetNvariables
();
m_numVariables
=
equationS
ys
->
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_
equationS
hPtr
->
GetVariable
(
i
);
std
::
string
varName
=
equationS
ys
->
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_
equationS
hPtr
->
GetTotPoints
(),
0.0
);
Array
<
OneD
,
NekDouble
>
exactsoln
(
equationS
ys
->
GetTotPoints
(),
0.0
);
// Evaluate "ExactSolution" function, or zero array
// Evaluate "ExactSolution" function, or zero array
m_
equationS
hPtr
->
EvaluateExactSolution
(
i
,
exactsoln
,
time
);
equationS
ys
->
EvaluateExactSolution
(
i
,
exactsoln
,
time
);
NekDouble
vL2Error
=
m_
equationS
hPtr
->
L2Error
(
i
,
exactsoln
);
NekDouble
vL2Error
=
equationS
ys
->
L2Error
(
i
,
exactsoln
);
NekDouble
vLinfError
=
m_
equationS
hPtr
->
LinfError
(
i
,
exactsoln
);
NekDouble
vLinfError
=
equationS
ys
->
LinfError
(
i
,
exactsoln
);
if
(
m_comm
->
GetRank
()
==
0
)
if
(
m_comm
->
GetRank
()
==
0
)
{
{
m_outFile
<<
"
,
"
<<
vL2Error
<<
"
,
"
<<
vLinfError
;
m_outFile
<<
"
"
<<
vL2Error
<<
"
"
<<
vLinfError
;
}
}
}
}
...
...
library/SolverUtils/Filters/FilterError.h
View file @
4de49c15
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment