Nektar++
|
Class for operating on FLD files. More...
#include <FieldIO.h>
Public Member Functions | |
FieldIO (LibUtilities::CommSharedPtr pComm) | |
Constructor. More... | |
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. More... | |
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. More... | |
void | ImportFieldMetaData (std::string filename, FieldMetaDataMap &fieldmetadatamap) |
Imports the definition of the meta data. More... | |
void | ImportFieldMetaData (TiXmlDocument &doc, FieldMetaDataMap &fieldmetadatamap) |
Imports the definition of the meta data. More... | |
void | ImportFieldDefs (TiXmlDocument &doc, std::vector< FieldDefinitionsSharedPtr > &fielddefs, bool expChild) |
Imports the definition of the fields. More... | |
void | ImportFieldData (TiXmlDocument &doc, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata) |
Imports the data fileds. More... | |
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 More... | |
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. More... | |
Nektar::LibUtilities::FieldIO::FieldIO | ( | LibUtilities::CommSharedPtr | pComm | ) |
Constructor.
Definition at line 140 of file FieldIO.cpp.
|
private |
add information about provenance and fieldmetadata
Definition at line 1008 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 1339 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, Nektar::LibUtilities::StdTriData::getNumberOfCoefficients(), Nektar::LibUtilities::StdTetData::getNumberOfCoefficients(), Nektar::LibUtilities::StdPyrData::getNumberOfCoefficients(), and Nektar::LibUtilities::StdPrismData::getNumberOfCoefficients().
Referenced by ImportFieldData(), and Write().
|
private |
Compress a vector of NekDouble values into a string using zlib.
Definition at line 1224 of file FieldIO.cpp.
References ASSERTL0, CHUNK, and Nektar::void.
Referenced by Write().
|
private |
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 950 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 700 of file FieldIO.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), 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 611 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 627 of file FieldIO.cpp.
References ASSERTL0.
|
private |
Definition at line 551 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 1277 of file FieldIO.cpp.
References ASSERTL0, CHUNK, and Nektar::void.
Referenced by ImportFieldData().
|
private |
Definition at line 1113 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 511 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().