Commit 8dbd6f16 authored by Pavel Burovskiy's avatar Pavel Burovskiy
Browse files

Fix to few bugs + tidying up error messages in Equation class

git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3789 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 0a4aea3c
......@@ -74,14 +74,14 @@ namespace Nektar
catch (const std::runtime_error& e)
{
m_expr_id = -1;
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Equation() fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e.what());
return;
}
catch (const std::string& e)
{
m_expr_id = -1;
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Equation() fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e);
return;
}
......@@ -103,12 +103,12 @@ namespace Nektar
}
catch (const std::runtime_error& e)
{
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Evaluate fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e.what());
}
catch (const std::string& e)
{
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Evaluate fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e);
}
return 0;
......@@ -125,12 +125,12 @@ namespace Nektar
}
catch (const std::runtime_error& e)
{
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Evaluate fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e.what());
}
catch (const std::string& e)
{
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Evaluate fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e);
}
return 0;
......@@ -174,13 +174,13 @@ namespace Nektar
}
catch (const std::runtime_error& e)
{
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Evaluate fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e.what());
return;
}
catch (const std::string& e)
{
std::string msg(std::string("Equation::Constructor fails on expression [") + m_expr + std::string("]\n"));
std::string msg(std::string("Equation::Evaluate fails on expression [") + m_expr + std::string("]\n"));
ASSERTL0(false, msg + std::string("ERROR: ") + e);
return;
}
......
......@@ -179,7 +179,8 @@ namespace Nektar
if( f )
{
(*m_values)[key] = f(key);
ValueType v = f(key);
(*m_values)[key] = v;
return (*m_values)[key];
}
else
......
......@@ -594,19 +594,24 @@ namespace Nektar
while(work_left > 0)
{
const int this_chunk_size = (std::min)(work_left, 1024);
for (int i = 0; i < this_chunk_size; m_variable[i+this_chunk_size*0] = x[offset + i++]) ;
for (int i = 0; i < this_chunk_size; m_variable[i+this_chunk_size*1] = y[offset + i++]) ;
for (int i = 0; i < this_chunk_size; m_variable[i+this_chunk_size*2] = z[offset + i++]) ;
for (int i = 0; i < this_chunk_size; m_variable[i+this_chunk_size*3] = t[offset + i++]) ;
for (int i = 0; i < this_chunk_size; i++)
{
m_variable[i+this_chunk_size*0] = x[offset + i];
m_variable[i+this_chunk_size*1] = y[offset + i];
m_variable[i+this_chunk_size*2] = z[offset + i];
m_variable[i+this_chunk_size*3] = t[offset + i];
}
for (int i = 0; i < stack.size(); i++)
{
(*stack[i]).run_many(this_chunk_size);
}
for (int i = 0; i < this_chunk_size; result[offset + i] = m_state[i++]) ;
for (int i = 0; i < this_chunk_size; i++)
{
result[offset + i] = m_state[i];
}
work_left -= this_chunk_size;
offset += this_chunk_size;
}
m_timer.Stop();
m_total_eval_time += m_timer.TimePerTest(1);
}
......
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