Failure of instantiation of SessionReader
******************* This email originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list https://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address. ******************* Hello, I am trying to implement a post-processing application based on nektar++ library and got stuck in the reading of XML session file into SeesionReader. My main.cpp code is: // main.cpp #include <LibUtilities/BasicUtils/SessionReader.h> #include <iostream> using namespace Nektar; int main(int argc, char* argv[]) { LibUtilities::SessionReaderSharedPtr session = LibUtilities::SessionReader::CreateInstance(argc, argv); std::cout << "Session Name: " << session->GetSessionName() << std::endl; std::cout << "Parameter TimeStep: " << session->GetParameter("TimeStep") << std::endl; return 0; } The main.cpp code can be compiled successfully, but when I run the executive with a session file (eg., ./main ChanFlow_3DH1D_FFT.xml),the method GetParameter produce an error saying the parameter "TimeStep" cannot be found, which actually exists in the session XML file. Could you give me some suggestions about what went wrong here? The required files (main.cpp, CMakeLists.txt, ChanFlow_3DH1D_FFT.xml) are attached in attachments. Thanks, Yong Wang
Dear Yong Wang, I believe that you need to read the mesh graph before you can access the parameters in the session file. If you add the following include statement to your example: #include <SpatialDomains/MeshGraph.h> and then after creating the session instance, read the mesh graph, for example: SpatialDomains::MeshGraphSharedPtr graph = SpatialDomains::MeshGraph::Read(session); you should now be able to build and run your example successfully with the TimeStep value being read and printed. Kind regards, Jeremy
On 15 Jul 2020, at 02:11, Yong Wang <yongwang.ttu@gmail.com> wrote:
This email from yongwang.ttu@gmail.com originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list <https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address.
Hello,
I am trying to implement a post-processing application based on nektar++ library and got stuck in the reading of XML session file into SeesionReader. My main.cpp code is:
// main.cpp #include <LibUtilities/BasicUtils/SessionReader.h> #include <iostream>
using namespace Nektar;
int main(int argc, char* argv[]) { LibUtilities::SessionReaderSharedPtr session = LibUtilities::SessionReader::CreateInstance(argc, argv);
std::cout << "Session Name: " << session->GetSessionName() << std::endl; std::cout << "Parameter TimeStep: " << session->GetParameter("TimeStep") << std::endl;
return 0; } The main.cpp code can be compiled successfully, but when I run the executive with a session file (eg., ./main ChanFlow_3DH1D_FFT.xml),the method GetParameter produce an error saying the parameter "TimeStep" cannot be found, which actually exists in the session XML file. Could you give me some suggestions about what went wrong here? The required files (main.cpp, CMakeLists.txt, ChanFlow_3DH1D_FFT.xml) are attached in attachments. Thanks, Yong Wang <CMakeLists.txt><ChanFlow_3DH1D_FFT.xml><main.cpp>_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
participants (2)
- 
                
                Jeremy Cohen
- 
                
                Yong Wang