Skip to content
Snippets Groups Projects
Commit 42b8b21b authored by Jacques Xing's avatar Jacques Xing Committed by Chris Cantwell
Browse files

Fix AdaptiveSFD for MPI

parent 62345b9b
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ v5.7.0 ...@@ -7,6 +7,7 @@ v5.7.0
- Fix memory-leak with LowEnergyBlock preconditioner for time-updated matrices (!1627) - Fix memory-leak with LowEnergyBlock preconditioner for time-updated matrices (!1627)
- Fix Fourier expansion integration weights are related test (!1803) - Fix Fourier expansion integration weights are related test (!1803)
- Separate MeshGraph input/output functions into a new class (!1778) - Separate MeshGraph input/output functions into a new class (!1778)
- Fix AdaptiveSFD for MPI (!1821)
**IncNavierStokesSolver** **IncNavierStokesSolver**
- Fix initial and boundary conditions in the moving reference frame (!1692) - Fix initial and boundary conditions in the moving reference frame (!1692)
......
...@@ -150,30 +150,39 @@ void Driver::v_InitObject(ostream &out) ...@@ -150,30 +150,39 @@ void Driver::v_InitObject(ostream &out)
break; break;
case eAdaptiveSFD: case eAdaptiveSFD:
{ {
// Coupling SFD method and Arnoldi algorithm // use-opt-file
// For having 2 equation systems defined into 2 different bool useOptFile =
// session files (with the mesh into a file named 'session'.gz) m_session->DefinesCmdLineArgument("use-opt-file");
string LinNSCondFile; std::string optfilename =
vector<string> LinNSFilename; useOptFile ? m_session->GetFilenames()[0] : "";
// assume that the conditions file is the last char *argv[] = {const_cast<char *>("IncNavierStokesSolver"),
// filename on intiialisation and so copy all other const_cast<char *>("--use-opt-file"),
// files to new session. This will include the mesh const_cast<char *>(optfilename.c_str()),
// file and possibly the optimsaiton file nullptr};
for (int i = 0; i < m_session->GetFilenames().size() - 1; ++i)
size_t argc = useOptFile ? 3 : 1;
std::vector<std::string> LinNSFilename;
if (m_comm->GetSize() == 1)
{ {
LinNSFilename.push_back(m_session->GetFilenames()[i]); // Use .xml.gz file for serial case
LinNSFilename.push_back(m_session->GetSessionName() +
".xml.gz");
} }
else
{
// Use previous partition for parallel case
LinNSFilename.push_back(m_session->GetSessionName() +
"_xml");
}
LinNSFilename.push_back(m_session->GetSessionName() +
"_LinNS.xml");
LinNSCondFile = m_session->GetSessionName();
LinNSCondFile += "_LinNS.xml";
LinNSFilename.push_back(LinNSCondFile);
char *argv[] = {const_cast<char *>("IncNavierStokesSolver"),
nullptr};
session_LinNS = LibUtilities::SessionReader::CreateInstance( session_LinNS = LibUtilities::SessionReader::CreateInstance(
1, argv, LinNSFilename, m_comm); argc, argv, LinNSFilename, m_comm);
// Set graph for LinNs solver.
SpatialDomains::MeshGraphSharedPtr graph_linns = SpatialDomains::MeshGraphSharedPtr graph_linns =
SpatialDomains::MeshGraphIO::Read(session_LinNS); SpatialDomains::MeshGraphIO::Read(session_LinNS);
......
...@@ -262,6 +262,7 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES ) ...@@ -262,6 +262,7 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES )
ADD_NEKTAR_TEST(FlapAirfoil_3DH1D_par LENGTHY) ADD_NEKTAR_TEST(FlapAirfoil_3DH1D_par LENGTHY)
ADD_NEKTAR_TEST(PlungingAirfoil_3DH1D_parBCs LENGTHY) ADD_NEKTAR_TEST(PlungingAirfoil_3DH1D_parBCs LENGTHY)
ADD_NEKTAR_TEST(ChanFlow_m8_BodyForce_par LENGTHY) ADD_NEKTAR_TEST(ChanFlow_m8_BodyForce_par LENGTHY)
ADD_NEKTAR_TEST(Cyl_AdaptiveSFD_par)
IF(NOT WIN32) IF(NOT WIN32)
ADD_NEKTAR_TEST(KovaFlow_expFromFile_par) ADD_NEKTAR_TEST(KovaFlow_expFromFile_par)
......
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
</REGION> </REGION>
</BOUNDARYCONDITIONS> </BOUNDARYCONDITIONS>
<FUNCTION NAME="InitialConditions"> <FUNCTION NAME="InitialConditions">
<F VAR="u,v,p" FILE="Cyl_AdaptiveSFD_Eig.rst"/> <F VAR="u,v" FILE="Cyl_AdaptiveSFD_Eig.rst"/>
<E VAR="p" VALUE="0.0"/>
</FUNCTION> </FUNCTION>
<FUNCTION NAME="BaseFlow"> <FUNCTION NAME="BaseFlow">
<E VAR="u" VALUE="1.0"/> <E VAR="u" VALUE="1.0"/>
......
<?xml version="1.0" encoding="utf-8"?>
<test>
<description>2D cylinder flow, mixed elements, P=5</description>
<executable>IncNavierStokesSolver</executable>
<parameters>Cyl_AdaptiveSFD.xml.gz Cyl_AdaptiveSFD.xml</parameters>
<processes> 2 </processes>
<files>
<file description="Session File">Cyl_AdaptiveSFD.xml.gz</file>
<file description="Session File">Cyl_AdaptiveSFD.xml</file>
<file description="Session File">Cyl_AdaptiveSFD_LinNS.xml</file>
<file description="Session File">Cyl_AdaptiveSFD.rst</file>
<file description="Session File">Cyl_AdaptiveSFD_Eig.rst</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-8">0.241485</value>
<value variable="v" tolerance="1e-8">0.254726</value>
<value variable="p" tolerance="1e-4">0.0726467</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-8">0.0829632</value>
<value variable="v" tolerance="1e-8">0.0752455</value>
<value variable="p" tolerance="1e-8">0.0251153</value>
</metric>
</metrics>
</test>
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