Nektar++
|
Class for operating on FLD files. More...
#include <FieldIO.h>
Public Member Functions | |
FieldIO (LibUtilities::CommSharedPtr pComm) | |
Constructor. | |
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 | 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. | |
void | ImportFieldMetaData (std::string filename, FieldMetaDataMap &fieldmetadatamap) |
Imports the definition of the meta data. | |
void | ImportFieldMetaData (TiXmlDocument &doc, FieldMetaDataMap &fieldmetadatamap) |
Imports the definition of the meta data. | |
void | ImportFieldDefs (TiXmlDocument &doc, std::vector< FieldDefinitionsSharedPtr > &fielddefs, bool expChild) |
Imports the definition of the fields. | |
void | ImportFieldData (TiXmlDocument &doc, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata) |
Imports the data fileds. | |
void | WriteMultiFldFileIDs (const std::string &outfile, const std::vector< std::string > fileNames, std::vector< std::vector< unsigned int > > &elementList, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap) |
Private Member Functions | |
void | AddInfoTag (TiXmlElement *root, const FieldMetaDataMap &fieldmetadatamap) |
add information about provenance and fieldmetadata | |
void | GenerateSeqString (const std::vector< unsigned int > &elmtids, std::string &idString) |
std::string | SetUpOutput (const std::string outname, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, const FieldMetaDataMap &fieldmetadatamap) |
void | ImportMultiFldFileIDs (const std::string &inFile, std::vector< std::string > &fileNames, std::vector< std::vector< unsigned int > > &elementList, FieldMetaDataMap &fieldmetadatamap) |
int | CheckFieldDefinition (const FieldDefinitionsSharedPtr &fielddefs) |
int | Deflate (std::vector< NekDouble > &in, string &out) |
int | Inflate (string &in, std::vector< NekDouble > &out) |
Private Attributes | |
LibUtilities::CommSharedPtr | m_comm |
Communicator to use when writing parallel format. |
Nektar::LibUtilities::FieldIO::FieldIO | ( | LibUtilities::CommSharedPtr | pComm | ) |
|
private |
add information about provenance and fieldmetadata
Definition at line 1005 of file FieldIO.cpp.
References Nektar::NekConstants::kGitBranch, Nektar::NekConstants::kGitSha1, NEKTAR_VERSION, and Nektar::LibUtilities::NullFieldMetaDataMap.
Referenced by Write(), and WriteMultiFldFileIDs().
|
private |
Definition at line 1336 of file FieldIO.cpp.
References ASSERTL0, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::ePyramid, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, and Nektar::LibUtilities::StdSegData::getNumberOfCoefficients().
Referenced by ImportFieldData(), and Write().
|
private |
Compress a vector of NekDouble values into a string using zlib.
Definition at line 1221 of file FieldIO.cpp.
References ASSERTL0, CHUNK, and Nektar::void.
Referenced by Write().
|
private |
Definition at line 1064 of file FieldIO.cpp.
Referenced by Write(), and WriteMultiFldFileIDs().
void Nektar::LibUtilities::FieldIO::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.
Definition at line 383 of file FieldIO.cpp.
References ASSERTL0, ImportFieldData(), ImportFieldDefs(), ImportFieldMetaData(), ImportMultiFldFileIDs(), Nektar::iterator, Nektar::NullInt1DArray, Nektar::LibUtilities::NullVectorNekDoubleVector, and Nektar::LibUtilities::PortablePath().
Referenced by Nektar::MultiRegions::ExpList::ExtractFileBCs(), and Nektar::LibUtilities::Import().
void Nektar::LibUtilities::FieldIO::ImportFieldData | ( | TiXmlDocument & | doc, |
const std::vector< FieldDefinitionsSharedPtr > & | fielddefs, | ||
std::vector< std::vector< NekDouble > > & | fielddata | ||
) |
Imports the data fileds.
Definition at line 947 of file FieldIO.cpp.
References ASSERTL0, CheckFieldDefinition(), and Inflate().
Referenced by Import().
void Nektar::LibUtilities::FieldIO::ImportFieldDefs | ( | TiXmlDocument & | doc, |
std::vector< FieldDefinitionsSharedPtr > & | fielddefs, | ||
bool | expChild | ||
) |
Imports the definition of the fields.
The bool decides if the FieldDefs are in <EXPANSIONS> or in <NEKTAR>.
Definition at line 697 of file FieldIO.cpp.
References ASSERTL0, ASSERTL1, Nektar::LibUtilities::BasisTypeMap, Nektar::ParseUtils::GenerateOrderedStringVector(), Nektar::ParseUtils::GenerateOrderedVector(), Nektar::ParseUtils::GenerateSeqVector(), Nektar::ParseUtils::GenerateUnOrderedVector(), Nektar::LibUtilities::kPointsTypeStr, Nektar::LibUtilities::ShapeTypeMap, Nektar::LibUtilities::SIZE_BasisType, Nektar::LibUtilities::SIZE_PointsType, and Nektar::LibUtilities::SIZE_ShapeType.
Referenced by Import(), and Nektar::SpatialDomains::MeshGraph::ReadExpansions().
void Nektar::LibUtilities::FieldIO::ImportFieldMetaData | ( | std::string | filename, |
FieldMetaDataMap & | fieldmetadatamap | ||
) |
Imports the definition of the meta data.
Definition at line 608 of file FieldIO.cpp.
References ASSERTL0.
Referenced by Import().
void Nektar::LibUtilities::FieldIO::ImportFieldMetaData | ( | TiXmlDocument & | doc, |
FieldMetaDataMap & | fieldmetadatamap | ||
) |
Imports the definition of the meta data.
Definition at line 624 of file FieldIO.cpp.
References ASSERTL0.
|
private |
Definition at line 548 of file FieldIO.cpp.
References ASSERTL0, and Nektar::ParseUtils::GenerateSeqVector().
Referenced by Import().
|
private |
Decompress a zlib-compressed string into a vector of NekDouble values.
Definition at line 1274 of file FieldIO.cpp.
References ASSERTL0, CHUNK, and Nektar::void.
Referenced by ImportFieldData().
|
private |
Definition at line 1110 of file FieldIO.cpp.
References ASSERTL0, m_comm, Nektar::LibUtilities::PortablePath(), Nektar::LibUtilities::ReduceMax, and WriteMultiFldFileIDs().
Referenced by Write().
void Nektar::LibUtilities::FieldIO::Write | ( | const std::string & | outFile, |
std::vector< FieldDefinitionsSharedPtr > & | fielddefs, | ||
std::vector< std::vector< NekDouble > > & | fielddata, | ||
const FieldMetaDataMap & | fieldinfomap = NullFieldMetaDataMap |
||
) |
Write data in FLD format.
Definition at line 150 of file FieldIO.cpp.
References AddInfoTag(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::BasisTypeMap, CheckFieldDefinition(), Deflate(), GenerateSeqString(), SetUpOutput(), and Nektar::LibUtilities::ShapeTypeMap.
Referenced by main(), and Nektar::LibUtilities::Write().
void Nektar::LibUtilities::FieldIO::WriteMultiFldFileIDs | ( | const std::string & | outfile, |
const std::vector< std::string > | fileNames, | ||
std::vector< std::vector< unsigned int > > & | elementList, | ||
const FieldMetaDataMap & | fieldinfomap = NullFieldMetaDataMap |
||
) |
Definition at line 508 of file FieldIO.cpp.
References AddInfoTag(), ASSERTL0, and GenerateSeqString().
Referenced by SetUpOutput().
|
private |
Communicator to use when writing parallel format.
Definition at line 204 of file FieldIO.h.
Referenced by SetUpOutput().