Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 std;
8 using namespace Nektar;
9 
10 int main(int argc, char *argv[])
11 {
12  if(argc != 2)
13  {
14  fprintf(stderr,"Usage: ExtractMultiFileInfo file.fld \n" );
15  exit(1);
16  }
17 
18  //default meshgraph
20 
21  //----------------------------------------------
22  // Import fieldfile.
23  string fieldfile(argv[argc-1]);
24  vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
25  vector<vector<NekDouble> > fielddata;
26  LibUtilities::Import(fieldfile,fielddef,fielddata);
27 
28  //----------------------------------------------
29 
30  cout << "<MultipleFldFiles FileName=\"" << fieldfile << "\" >";
31 
32  cout << fielddef[0]->m_elementIDs[0];
33 
34  for(int f = 0; f < fielddef.size(); ++f)
35  {
36  for(int i = 1; i < fielddef[f]->m_elementIDs.size(); ++i)
37  {
38  cout << "," <<fielddef[f]->m_elementIDs[i];
39  }
40  }
41  cout << "<\\MultipleFldFiles>" << endl;
42  return 0;
43 }
44 
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > &ElementIDs)
This function allows for data to be imported from an FLD file when a session and/or communicator is n...
Definition: FieldIO.cpp:279
STL namespace.
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:186
int main(int argc, char *argv[])