Commit e13d71ae authored by Chris Cantwell's avatar Chris Cantwell Committed by Spencer Sherwin
Browse files

Fix logic for reading time fn in body forcing.

parent f8aaa379
...@@ -70,7 +70,7 @@ namespace SolverUtils ...@@ -70,7 +70,7 @@ namespace SolverUtils
{ {
funcNameElmt = pForce->FirstChildElement("FIELDFORCE"); funcNameElmt = pForce->FirstChildElement("FIELDFORCE");
ASSERTL0(funcNameElmt, "Requires BODYFORCE of FIELDFORCE tag " ASSERTL0(funcNameElmt, "Requires BODYFORCE or FIELDFORCE tag "
"specifying function name which prescribes body force."); "specifying function name which prescribes body force.");
} }
...@@ -78,25 +78,27 @@ namespace SolverUtils ...@@ -78,25 +78,27 @@ namespace SolverUtils
ASSERTL0(m_session->DefinesFunction(funcName), ASSERTL0(m_session->DefinesFunction(funcName),
"Function '" + funcName + "' not defined."); "Function '" + funcName + "' not defined.");
// Time function is optional
funcNameElmt = pForce->FirstChildElement("BODYFORCETIMEFCN"); funcNameElmt = pForce->FirstChildElement("BODYFORCETIMEFCN");
if(!funcNameElmt) if(!funcNameElmt)
{ {
funcNameElmt = pForce->FirstChildElement("FIELDFORCETIMEFCN"); funcNameElmt = pForce->FirstChildElement("FIELDFORCETIMEFCN");
}
if(funcNameElmt) // Load time function if specified
{ if(funcNameElmt)
std::string funcNameTime = funcNameElmt->GetText(); {
std::string funcNameTime = funcNameElmt->GetText();
ASSERTL0(!funcNameTime.empty(), ASSERTL0(!funcNameTime.empty(),
"Expression must be given in BODYFORCETIMEFCN or " "Expression must be given in BODYFORCETIMEFCN or "
"FIELDFORCETIMEFCN."); "FIELDFORCETIMEFCN.");
m_session->SubstituteExpressions(funcNameTime); m_session->SubstituteExpressions(funcNameTime);
m_timeFcnEqn = MemoryManager<LibUtilities::Equation> m_timeFcnEqn = MemoryManager<LibUtilities::Equation>
::AllocateSharedPtr(m_session,funcNameTime); ::AllocateSharedPtr(m_session,funcNameTime);
m_hasTimeFcnScaling = true; m_hasTimeFcnScaling = true;
}
} }
m_Forcing = Array<OneD, Array<OneD, NekDouble> > (m_NumVariable); m_Forcing = Array<OneD, Array<OneD, NekDouble> > (m_NumVariable);
...@@ -126,7 +128,7 @@ namespace SolverUtils ...@@ -126,7 +128,7 @@ namespace SolverUtils
for (int i = 0; i < m_NumVariable; ++i) for (int i = 0; i < m_NumVariable; ++i)
{ {
pFields[0]->HomogeneousFwdTrans(m_Forcing[i],m_Forcing[i]); pFields[0]->HomogeneousFwdTrans(m_Forcing[i],m_Forcing[i]);
} }
} }
} }
......
Supports Markdown
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