Commit 7685fc06 authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Updated OutputTecplot to use a L2 error and also modified .tst files

parent a9d09192
......@@ -59,7 +59,7 @@ namespace Nektar
void OutputTecplot::Process(po::variables_map &vm)
{
m_doFloor = (vm.count("error") == 1)? true: false;
m_doError = (vm.count("error") == 1)? true: false;
if(!m_f->m_exp.size()) // do nothing if no expansion defined
{
......@@ -164,16 +164,19 @@ namespace Nektar
m_f->m_exp[0]->GetCoords(coords[0],coords[1],coords[2]);
if (m_doFloor)
if (m_doError)
{
// restrict coores to six significant figure
for(int i = 0; i < totpoints; ++i)
NekDouble l2err;
std::string coordval[] = {"x","y","z"};
int rank = m_f->m_session->GetComm()->GetRank();
for(int i = 0; i < coordim; ++i)
{
for(int j = 0; j < 3; ++j)
l2err = m_f->m_exp[0]->L2(coords[i]);
if(rank == 0)
{
coords[j][i] *= 100000;
coords[j][i] = floor(coords[j][i]);
coords[j][i] /= 100000;
cout << "L 2 error (variable "
<< coordval[i] << ") : " << l2err << endl;
}
}
}
......@@ -268,21 +271,16 @@ namespace Nektar
m_f->m_exp[field]->UpdatePhys());
}
if (m_doFloor)
if (m_doError)
{
for(int i = 0; i < totpoints; ++i)
NekDouble l2err = m_f->m_exp[0]->L2(m_f->m_exp[field]->UpdatePhys());
if(m_f->m_session->GetComm()->GetRank() == 0)
{
NekDouble val = m_f->m_exp[field]->GetPhys()[i];
val *= 100000;
val = floor(val);
val /= 100000;
outfile << val << " ";
if((!(i % 1000))&&i)
{
outfile << std::endl;
}
cout << "L 2 error (variable "
<< m_f->m_fielddef[0]->m_fields[field] << ") : "
<< l2err << endl;
}
}
else
{
......
......@@ -59,7 +59,7 @@ namespace Nektar
virtual void Process(po::variables_map &vm);
private:
bool m_doFloor;
bool m_doError;
void WriteTecplotHeader(std::ofstream &outfile,
std::string var);
......
......@@ -8,11 +8,13 @@
<file description="Session File">bfs_tg.fld</file>
</files>
<metrics>
<metric type="file" id="1">
<file filename="bfs_tg.dat">
<sha1>2a8aca916f8db040c2a8c2ced64cc3298ddfac04</sha1>
</file>
</metric>
<metric type="L2" id="1">
<value variable="x" tolerance="1e-6">289.252</value>
<value variable="y" tolerance="1e-6">6.0553</value>
<value variable="u" tolerance="1e-6">4.6773</value>
<value variable="v" tolerance="1e-6">0.172187</value>
<value variable="p" tolerance="1e-6">0.359627</value>
</metric>
</metrics>
</test>
......@@ -8,11 +8,13 @@
<file description="Session File">bfs_tg.fld</file>
</files>
<metrics>
<metric type="file" id="1">
<file filename="bfs_tg.dat">
<sha1>7d8fb6d1df918e7218f8d5705742e67a69fd51bc</sha1>
</file>
</metric>
<metric type="L2" id="1">
<value variable="x" tolerance="1e-6">1.35354</value>
<value variable="y" tolerance="1e-6">1.09498</value>
<value variable="u" tolerance="1e-6">1.15931</value>
<value variable="v" tolerance="1e-6">0.0195245</value>
<value variable="p" tolerance="1e-6">0.119152</value>
</metric>
</metrics>
</test>
......@@ -8,11 +8,15 @@
<file description="Session File">chan3D.fld</file>
</files>
<metrics>
<metric type="file" id="1">
<file filename="chan3D.dat">
<sha1>5775c16cc4c8f1a2e059170c6fbbbcb4739c8659</sha1>
</file>
</metric>
<metric type="L2" id="1">
<value variable="x" tolerance="1e-6">1.69239</value>
<value variable="y" tolerance="1e-6">1.69239</value>
<value variable="z" tolerance="1e-6">1.69239</value>
<value variable="u" tolerance="1e-6">2.0864</value>
<value variable="v" tolerance="1e-6">0</value>
<value variable="w" tolerance="1e-6">0</value>
<value variable="p" tolerance="1e-6">6.59218</value>
</metric>
</metrics>
</test>
......@@ -8,11 +8,15 @@
<file description="Session File">chan3D.fld</file>
</files>
<metrics>
<metric type="file" id="1">
<file filename="chan3D.dat">
<sha1>bafe913a59cdd16b5bc298d3379b14bbd6a8d387</sha1>
</file>
</metric>
<metric type="L2" id="1">
<value variable="x" tolerance="1e-6">1.63299</value>
<value variable="y" tolerance="1e-6">1.63299</value>
<value variable="z" tolerance="1e-6">1.63299</value>
<value variable="u" tolerance="1e-6">2.06559</value>
<value variable="v" tolerance="1e-6">0</value>
<value variable="w" tolerance="1e-6">0</value>
<value variable="p" tolerance="1e-6">6.53197</value>
</metric>
</metrics>
</test>
......@@ -9,16 +9,15 @@
<file description="Session File">chan3D.fld</file>
</files>
<metrics>
<metric type="file" id="1">
<file filename="chan3D_P0.dat">
<sha1>9bfd6d3bc24137f77f32a3148ee69eafdcf811ab</sha1>
</file>
</metric>
<metric type="file" id="2">
<file filename="chan3D_P1.dat">
<sha1>7eb90cc0db9d011be2552d72a6c3c9e665a9d720</sha1>
</file>
</metric>
<metric type="L2" id="1">
<value variable="x" tolerance="1e-6">1.69239</value>
<value variable="y" tolerance="1e-6">1.69239</value>
<value variable="z" tolerance="1e-6">1.69239</value>
<value variable="u" tolerance="1e-6">2.0864</value>
<value variable="v" tolerance="1e-6">0</value>
<value variable="w" tolerance="1e-6">0</value>
<value variable="p" tolerance="1e-6">6.59218</value>
</metric>
</metrics>
</test>
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