Nektar++
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 
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
Definition: FieldIO.cpp:106
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:183
int main(int argc, char *argv[])