36 #ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_FIELDIO_H
37 #define NEKTAR_LIB_UTILITIES_BASIC_UTILS_FIELDIO_H
47 namespace LibUtilities
56 boost::assign::list_of(NullNekDoubleVector);
62 const std::vector<unsigned int> &elementIDs,
63 const std::vector<LibUtilities::BasisType> &basis,
65 const std::vector<unsigned int> &numModes,
66 const std::vector<std::string> &fields,
68 const std::vector<NekDouble> &HomoLengths
69 = NullNekDoubleVector,
70 bool homoStrips =
false,
71 const std::vector<unsigned int> &HomoSIDs
72 = NullUnsignedIntVector,
73 const std::vector<unsigned int> &HomoZIDs
74 = NullUnsignedIntVector,
75 const std::vector<unsigned int> &HomoYIDs
76 = NullUnsignedIntVector,
77 const std::vector<LibUtilities::PointsType> &points
78 = NullPointsTypeVector,
79 bool pointsDef =
false,
80 const std::vector<unsigned int> &numPoints
81 = NullUnsignedIntVector,
82 bool numPointsDef =
false)
95 std::vector<LibUtilities::BasisType>
m_basis;
122 const std::string &outFile,
123 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
124 std::vector<std::vector<NekDouble> > &fielddata,
125 const FieldMetaDataMap &fieldinfomap = NullFieldMetaDataMap);
129 const std::string &infilename,
130 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
131 std::vector<std::vector<NekDouble> > &fielddata
132 = NullVectorNekDoubleVector,
133 FieldMetaDataMap &fieldinfomap = NullFieldMetaDataMap,
142 bool sharedFilesystem =
false);
146 const std::string &outFile,
147 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
148 std::vector<std::vector<NekDouble> > &fielddata,
149 const FieldMetaDataMap &fieldinfomap
150 = NullFieldMetaDataMap);
154 const std::string &infilename,
155 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
156 std::vector<std::vector<NekDouble> > &fielddata
157 = NullVectorNekDoubleVector,
158 FieldMetaDataMap &fieldinfomap
159 = NullFieldMetaDataMap,
164 std::string filename,
165 FieldMetaDataMap &fieldmetadatamap);
169 TiXmlDocument &doc, FieldMetaDataMap &fieldmetadatamap);
174 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
180 const std::vector<FieldDefinitionsSharedPtr> &fielddefs,
181 std::vector<std::vector<NekDouble> > &fielddata);
184 const std::string &outfile,
185 const std::vector<std::string> fileNames,
186 std::vector<std::vector<unsigned int> > &elementList,
187 const FieldMetaDataMap &fieldinfomap = NullFieldMetaDataMap);
197 TiXmlElement *root,
const FieldMetaDataMap &fieldmetadatamap);
200 const std::vector<unsigned int> &elmtids, std::string &idString);
205 const std::string outname,
206 const std::vector<FieldDefinitionsSharedPtr> &fielddefs,
207 const FieldMetaDataMap &fieldmetadatamap);
210 const std::string &inFile,
211 std::vector<std::string> &fileNames,
212 std::vector<std::vector<unsigned int> > &elementList,
213 FieldMetaDataMap &fieldmetadatamap);
216 const FieldDefinitionsSharedPtr &fielddefs);
std::vector< unsigned int > m_numPoints
void ImportFieldDefs(TiXmlDocument &doc, std::vector< FieldDefinitionsSharedPtr > &fielddefs, bool expChild)
Imports the definition of the fields.
std::vector< unsigned int > m_homogeneousYIDs
void ImportFieldData(TiXmlDocument &doc, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata)
Imports the data fileds.
std::vector< NekDouble > m_homogeneousLengths
FieldIO(LibUtilities::CommSharedPtr pComm, bool sharedFilesystem=false)
Constructor.
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata=NullVectorNekDoubleVector, FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap, const Array< OneD, int > ElementiDs=NullInt1DArray)
Imports an FLD file.
boost::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
FieldDefinitions(ShapeType shapeType, const std::vector< unsigned int > &elementIDs, const std::vector< LibUtilities::BasisType > &basis, bool uniOrder, const std::vector< unsigned int > &numModes, const std::vector< std::string > &fields, int NumHomoDir=0, const std::vector< NekDouble > &HomoLengths=NullNekDoubleVector, bool homoStrips=false, const std::vector< unsigned int > &HomoSIDs=NullUnsignedIntVector, const std::vector< unsigned int > &HomoZIDs=NullUnsignedIntVector, const std::vector< unsigned int > &HomoYIDs=NullUnsignedIntVector, const std::vector< LibUtilities::PointsType > &points=NullPointsTypeVector, bool pointsDef=false, const std::vector< unsigned int > &numPoints=NullUnsignedIntVector, bool numPointsDef=false)
void ImportMultiFldFileIDs(const std::string &inFile, std::vector< std::string > &fileNames, std::vector< std::vector< unsigned int > > &elementList, FieldMetaDataMap &fieldmetadatamap)
std::string SetUpOutput(const std::string outname)
std::vector< unsigned int > m_homogeneousZIDs
bool m_uniOrder
Define order of the element group.
std::map< std::string, std::string > FieldMetaDataMap
int CheckFieldDefinition(const FieldDefinitionsSharedPtr &fielddefs)
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.
std::vector< unsigned int > m_homogeneousSIDs
void GenerateSeqString(const std::vector< unsigned int > &elmtids, std::string &idString)
std::vector< LibUtilities::BasisType > m_basis
static std::vector< NekDouble > NullNekDoubleVector
bool m_sharedFilesystem
True if same filesystem accessible by all processes.
std::vector< unsigned int > m_numModes
Define number of modes per direction.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void AddInfoTag(TiXmlElement *root, const FieldMetaDataMap &fieldmetadatamap)
add information about provenance and fieldmetadata
#define LIB_UTILITIES_EXPORT
bool m_sharedFilesystem
True if filesystem is shared.
static std::vector< std::vector< NekDouble > > NullVectorNekDoubleVector
static std::vector< unsigned int > NullUnsignedIntVector
boost::shared_ptr< FieldIO > FieldIOSharedPtr
std::vector< unsigned int > m_elementIDs
std::vector< std::string > m_fields
LibUtilities::CommSharedPtr m_comm
Communicator to use when writing parallel format.
void SetUpFieldMetaData(const std::string outname, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, const FieldMetaDataMap &fieldmetadatamap)
static std::vector< LibUtilities::PointsType > NullPointsTypeVector
void WriteMultiFldFileIDs(const std::string &outfile, const std::vector< std::string > fileNames, std::vector< std::vector< unsigned int > > &elementList, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap)
std::vector< LibUtilities::PointsType > m_points
Define the type of points per direction.
Class for operating on FLD files.
void ImportFieldMetaData(std::string filename, FieldMetaDataMap &fieldmetadatamap)
Imports the definition of the meta data.
virtual std::string GetFileEnding() const
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap)
Write data in FLD format.
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap)
Write a field file in serial only.
static Array< OneD, int > NullInt1DArray
static FieldMetaDataMap NullFieldMetaDataMap