Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtractMultiFldFileInfo.cpp
Go to the documentation of this file.
1 #include <cstdio>
2 #include <cstdlib>
3 
4 #include <LibUtilities/BasicUtils/ErrorUtil.hpp> // for ASSERTL0
5 #include <SpatialDomains/MeshGraph.h> // for FieldDefinitions, etc
6 
7 using namespace Nektar;
8 
9 int main(int argc, char *argv[])
10 {
11  if(argc != 2)
12  {
13  fprintf(stderr,"Usage: ExtractMultiFileInfo file.fld \n" );
14  exit(1);
15  }
16 
17  //default meshgraph
19 
20  //----------------------------------------------
21  // Import fieldfile.
22  string fieldfile(argv[argc-1]);
23  vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
24  vector<vector<NekDouble> > fielddata;
25  LibUtilities::Import(fieldfile,fielddef,fielddata);
26 
27  //----------------------------------------------
28 
29  cout << "<MultipleFldFiles FileName=\"" << fieldfile << "\" >";
30 
31  cout << fielddef[0]->m_elementIDs[0];
32 
33  for(int f = 0; f < fielddef.size(); ++f)
34  {
35  for(int i = 1; i < fielddef[f]->m_elementIDs.size(); ++i)
36  {
37  cout << "," <<fielddef[f]->m_elementIDs[i];
38  }
39  }
40  cout << "<\\MultipleFldFiles>" << endl;
41  return 0;
42 }
43