Skip to content
Snippets Groups Projects
Commit 47db656c authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Updated PrePacing utility for use with tests.

Added an initial test for Courtemanche.
parent e0942e63
No related branches found
No related tags found
No related merge requests found
......@@ -312,6 +312,11 @@ namespace Nektar
return outarray;
}
Array<OneD, NekDouble> CellModel::GetCellSolution(unsigned int idx)
{
return m_cellSol[idx];
}
void CellModel::LoadCellModel()
{
const bool root = (m_session->GetComm()->GetRank() == 0);
......
......@@ -103,6 +103,8 @@ namespace Nektar
Array<OneD, NekDouble> GetCellSolutionCoeffs(unsigned int idx);
Array<OneD, NekDouble> GetCellSolution(unsigned int idx);
protected:
/// Session
LibUtilities::SessionReaderSharedPtr m_session;
......
<?xml version="1.0" encoding="utf-8"?>
<test>
<description>Courtemanche Cell model</description>
<executable>PrePacing</executable>
<parameters>Courtemanche.xml</parameters>
<files>
<file description="Session File">Courtemanche.xml</file>
</files>
<metrics>
<!--<metric type="Regex" id="1">
<regex>^(\d*\.?\d*)\s*([+-]?\d*\.?\d*)</regex>
<matches>
<match>
<field>0.5</field>
<field>-81.0043</field>
</match>
<match>
<field>1</field>
<field>-81.0085</field>
</match>
<match>
<field>10</field>
<field>-2.33809</field>
</match>
</matches>
</metric>-->
<metric type="Regex" id="2">
<regex>^#\s([\w]*)\s*([+-]?\d*\.?\d*)</regex>
<matches>
<match>
<field>u</field>
<field>-2.29798</field>
</match>
<match>
<field>m</field>
<field>0.99334</field>
</match>
</matches>
</metric>
</metrics>
</test>
<NEKTAR>
<CONDITIONS>
<PARAMETERS>
<P> TimeStep = 0.02 </P>
<P> FinTime = 10 </P>
<P> NumSteps = FinTime/TimeStep </P>
<P> SubSteps = 1 </P>
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="CellModel" VALUE="CourtemancheRamirezNattel98" />
</SOLVERINFO>
<FUNCTION NAME="InitialConditions">
<E VAR="u" VALUE="-81.0" />
</FUNCTION>
</CONDITIONS>
<STIMULI>
<STIMULUS ID="0" TYPE="StimulusPoint">
<p_strength> 20.0 </p_strength>
<PROTOCOL TYPE = "ProtocolS1S2">
<START> 2.0 </START>
<DURATION> 2.0 </DURATION>
<S1CYCLELENGTH> 700.0 </S1CYCLELENGTH>
<NUM_S1> 50 </NUM_S1>
<S2CYCLELENGTH>0.0 </S2CYCLELENGTH>
</PROTOCOL>
</STIMULUS>
</STIMULI>
</NEKTAR>
......@@ -71,6 +71,12 @@ int main(int argc, char *argv[])
// Output current solution to stdout
cout << vTime << " " << vSol[0][0] << endl;
}
for (unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
{
cout << "# " << vCell->GetCellVarName(i) << " "
<< vCell->GetCellSolution(i)[0] << endl;
}
}
catch (...)
{
......
......@@ -110,7 +110,7 @@ namespace Nektar
// Process output file line by line searching for regex matches
std::string line;
while (getline(pStdout, line))
while (getline(pStdout, line) && m_matches.size() > 0)
{
// Test to see if we have a match on this line.
if (boost::regex_match(line.c_str(), matches, m_regex))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment