Nektar++
|
Class for operating on FLD files. More...
#include <FieldIO.h>
Public Member Functions | |
FieldIO (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem=false) | |
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) |
Protected 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) |
void | SetUpFieldMetaData (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) |
virtual std::string | GetFileEnding () const |
Protected Attributes | |
LibUtilities::CommSharedPtr | m_comm |
Communicator to use when writing parallel format. More... | |
bool | m_sharedFilesystem |
True if same filesystem accessible by all processes. More... | |
Nektar::LibUtilities::FieldIO::FieldIO | ( | LibUtilities::CommSharedPtr | pComm, |
bool | sharedFilesystem = false |
||
) |
Constructor.
Definition at line 149 of file FieldIO.cpp.
|
protected |
add information about provenance and fieldmetadata
Definition at line 1087 of file FieldIO.cpp.
References Nektar::NekConstants::kGitBranch, Nektar::NekConstants::kGitSha1, NEKTAR_VERSION, and Nektar::LibUtilities::NullFieldMetaDataMap.
Referenced by Write(), and WriteMultiFldFileIDs().
|
protected |
Definition at line 1355 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().
|
protected |
|
inlineprotectedvirtual |
Reimplemented in Nektar::LibUtilities::PtsIO.
Definition at line 218 of file FieldIO.h.
Referenced by SetUpFieldMetaData(), and SetUpOutput().
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 409 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 1018 of file FieldIO.cpp.
References ASSERTL0, CheckFieldDefinition(), Nektar::LibUtilities::CompressData::GetCompressString(), WARNINGL0, and Nektar::LibUtilities::CompressData::ZlibDecodeFromBase64Str().
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 726 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::CompressData::GetCompressString(), Nektar::LibUtilities::kPointsTypeStr, Nektar::LibUtilities::ShapeTypeMap, Nektar::LibUtilities::SIZE_BasisType, Nektar::LibUtilities::SIZE_PointsType, Nektar::LibUtilities::SIZE_ShapeType, and WARNINGL0.
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 637 of file FieldIO.cpp.
References ASSERTL0.
Referenced by Nektar::LibUtilities::PtsIO::Import(), and Import().
void Nektar::LibUtilities::FieldIO::ImportFieldMetaData | ( | TiXmlDocument & | doc, |
FieldMetaDataMap & | fieldmetadatamap | ||
) |
Imports the definition of the meta data.
Definition at line 653 of file FieldIO.cpp.
References ASSERTL0.
|
protected |
Definition at line 577 of file FieldIO.cpp.
References ASSERTL0, and Nektar::ParseUtils::GenerateSeqVector().
Referenced by Nektar::LibUtilities::PtsIO::Import(), and Import().
|
protected |
Definition at line 1285 of file FieldIO.cpp.
References ASSERTL0, GetFileEnding(), m_comm, Nektar::LibUtilities::PortablePath(), Nektar::LibUtilities::ReduceMax, and WriteMultiFldFileIDs().
Referenced by Write().
|
protected |
Definition at line 1192 of file FieldIO.cpp.
References ASSERTL0, GetFileEnding(), m_comm, m_sharedFilesystem, and Nektar::LibUtilities::PortablePath().
Referenced by Nektar::LibUtilities::PtsIO::Write(), and 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 160 of file FieldIO.cpp.
References AddInfoTag(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::BasisTypeMap, CheckFieldDefinition(), GenerateSeqString(), Nektar::LibUtilities::CompressData::GetBitSizeStr(), Nektar::LibUtilities::CompressData::GetCompressString(), m_comm, SetUpFieldMetaData(), SetUpOutput(), Nektar::LibUtilities::ShapeTypeMap, and Nektar::LibUtilities::CompressData::ZlibEncodeToBase64Str().
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 537 of file FieldIO.cpp.
References AddInfoTag(), ASSERTL0, and GenerateSeqString().
Referenced by Nektar::LibUtilities::PtsIO::SetUpFieldMetaData(), and SetUpFieldMetaData().
|
protected |
Communicator to use when writing parallel format.
Definition at line 191 of file FieldIO.h.
Referenced by Nektar::LibUtilities::PtsIO::Import(), Nektar::LibUtilities::PtsIO::SetUpFieldMetaData(), SetUpFieldMetaData(), SetUpOutput(), and Write().
|
protected |
True if same filesystem accessible by all processes.
Definition at line 194 of file FieldIO.h.
Referenced by SetUpOutput().