Commit f79bf1e3 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Fixed overwritten array bug in reading diffusion tensor in cardiac solver.

Fixed error with session reader initialisation in VtkToFld.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@4006 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 325fd9d1
...@@ -265,7 +265,6 @@ namespace Nektar ...@@ -265,7 +265,6 @@ namespace Nektar
{ {
vVarCoeffMap[x->first] = x->second + cnt; vVarCoeffMap[x->first] = x->second + cnt;
} }
cnt += vExp->GetTotPoints();
} }
LocalRegions::MatrixKey matkey( m_linSysKey.GetMatrixType(), LocalRegions::MatrixKey matkey( m_linSysKey.GetMatrixType(),
...@@ -307,7 +306,7 @@ namespace Nektar ...@@ -307,7 +306,7 @@ namespace Nektar
const DNekMatSharedPtr& GlobalLinSys::v_GetGmat(void) const const DNekMatSharedPtr& GlobalLinSys::v_GetGmat(void) const
{ {
NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" ); NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
return NullDNekMatSharedPtr; return NullDNekMatSharedPtr;
} }
} //end of namespace } //end of namespace
......
...@@ -101,14 +101,16 @@ namespace Nektar ...@@ -101,14 +101,16 @@ namespace Nektar
"AnisotropicConductivityY", "AnisotropicConductivityY",
"AnisotropicConductivityZ" "AnisotropicConductivityZ"
}; };
int nq = m_fields[0]->GetNpoints();
Array<OneD, NekDouble> vTemp; Array<OneD, NekDouble> vTemp;
if (m_session->DefinesFunction("IsotropicConductivity")) if (m_session->DefinesFunction("IsotropicConductivity"))
{ {
EvaluateFunction(varName, vTemp, "IsotropicConductivity"); EvaluateFunction(varName, vTemp, "IsotropicConductivity");
for (int i = 0; i < m_spacedim; ++i) for (int i = 0; i < m_spacedim; ++i)
{ {
m_vardiff[varCoeffEnum[i]] = vTemp; m_vardiff[varCoeffEnum[i]] = Array<OneD, NekDouble>(nq);
Vmath::Vcopy(nq, vTemp, 1, m_vardiff[varCoeffEnum[i]], 1);
} }
} }
else if (m_session->DefinesFunction(varCoeffs[0])) else if (m_session->DefinesFunction(varCoeffs[0]))
...@@ -118,7 +120,8 @@ namespace Nektar ...@@ -118,7 +120,8 @@ namespace Nektar
ASSERTL0(m_session->DefinesFunction(varCoeffs[i], varName), ASSERTL0(m_session->DefinesFunction(varCoeffs[i], varName),
"Function '" + varCoeffs[i] + "' not correctly defined."); "Function '" + varCoeffs[i] + "' not correctly defined.");
EvaluateFunction(varName, vTemp, varCoeffs[i]); EvaluateFunction(varName, vTemp, varCoeffs[i]);
m_vardiff[varCoeffEnum[i]] = vTemp; m_vardiff[varCoeffEnum[i]] = Array<OneD, NekDouble>(nq);
Vmath::Vcopy(nq, vTemp, 1, m_vardiff[varCoeffEnum[i]], 1);
} }
} }
...@@ -131,7 +134,6 @@ namespace Nektar ...@@ -131,7 +134,6 @@ namespace Nektar
if (m_session->DefinesParameter("d_min")) if (m_session->DefinesParameter("d_min"))
{ {
// Normalise and invert // Normalise and invert
int nq = m_fields[0]->GetNpoints();
NekDouble f_min = m_session->GetParameter("d_min"); NekDouble f_min = m_session->GetParameter("d_min");
NekDouble f_max = m_session->GetParameter("d_max"); NekDouble f_max = m_session->GetParameter("d_max");
NekDouble f_range = f_max - f_min; NekDouble f_range = f_max - f_min;
......
...@@ -56,7 +56,7 @@ int main(int argc, char* argv[]) ...@@ -56,7 +56,7 @@ int main(int argc, char* argv[])
vFilenames.push_back(std::string(argv[1])); vFilenames.push_back(std::string(argv[1]));
LibUtilities::SessionReaderSharedPtr vSession LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv, vFilenames); = LibUtilities::SessionReader::CreateInstance(2, argv, vFilenames);
try try
{ {
......
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