Nektar++
|
#include <PtsIO.h>
Public Member Functions | |
PtsIO (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem=false) | |
virtual | ~PtsIO () |
void | Import (const std::string &inFile, PtsFieldSharedPtr &ptsField, FieldMetaDataMap &fieldmetadatamap=NullFieldMetaDataMap) |
Import a pts field from file. More... | |
void | Write (const std::string &outFile, const PtsFieldSharedPtr &ptsField, const bool backup=false) |
Save a pts field to a file. More... | |
void | ImportFieldData (const std::string inFile, PtsFieldSharedPtr &ptsField) |
![]() | |
FieldIOXml (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem) | |
Default constructor. More... | |
virtual | ~FieldIOXml () |
void | ImportFieldDefs (DataSourceSharedPtr dataSource, std::vector< FieldDefinitionsSharedPtr > &fielddefs, bool expChild) |
Import field definitions from the target file. More... | |
void | ImportFieldData (DataSourceSharedPtr dataSource, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata) |
Import field data from a target file. More... | |
void | WriteMultiFldFileIDs (const std::string &outfile, const std::vector< std::string > fileNames, std::vector< std::vector< unsigned int > > &elementList, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap) |
Write out a file containing element ID to partition mapping. More... | |
void | SetUpFieldMetaData (const std::string &outname, const std::vector< FieldDefinitionsSharedPtr > &fielddefs, const FieldMetaDataMap &fieldmetadatamap) |
Set up field meta data map. More... | |
void | ImportMultiFldFileIDs (const std::string &inFile, std::vector< std::string > &fileNames, std::vector< std::vector< unsigned int > > &elementList, FieldMetaDataMap &fieldmetadatamap) |
Read file containing element ID to partition mapping. More... | |
void | v_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) |
Import an XML format file. More... | |
virtual const std::string & | GetClassName () const |
Returns the class name. More... | |
![]() | |
FieldIO (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem) | |
Constructor for FieldIO base class. More... | |
virtual | ~FieldIO () |
void | Write (const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap, const bool backup=false) |
Write out the field information to the file outFile . 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) |
Read field information from the file infilename . More... | |
DataSourceSharedPtr | ImportFieldMetaData (const std::string &filename, FieldMetaDataMap &fieldmetadatamap) |
Import the metadata from a field file. More... | |
Protected Member Functions | |
virtual void | v_ImportFieldData (const std::string inFile, PtsFieldSharedPtr &ptsField) |
void | SetUpFieldMetaData (const std::string outname) |
virtual std::string | GetFileEnding () const |
Helper function that determines default file extension. More... | |
![]() | |
int | CheckFieldDefinition (const FieldDefinitionsSharedPtr &fielddefs) |
Check field definitions for correctness and return storage size. More... | |
std::string | SetUpOutput (const std::string outname, bool perRank, bool backup=false) |
Set up the filesystem ready for output. More... | |
Additional Inherited Members | |
![]() | |
static FieldIOSharedPtr | create (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem) |
Creates an instance of this class. More... | |
![]() | |
static const std::string | GetFileType (const std::string &filename, CommSharedPtr comm) |
Determine file type of given input file. More... | |
static std::shared_ptr< FieldIO > | CreateDefault (const LibUtilities::SessionReaderSharedPtr session) |
Returns an object for the default FieldIO method. More... | |
static std::shared_ptr< FieldIO > | CreateForFile (const LibUtilities::SessionReaderSharedPtr session, const std::string &filename) |
Construct a FieldIO object for a given input filename. More... | |
static void | AddInfoTag (TagWriterSharedPtr root, const FieldMetaDataMap &fieldmetadatamap) |
Add provenance information to the field metadata map. More... | |
![]() | |
static std::string | className |
Name of class. More... | |
![]() | |
LibUtilities::CommSharedPtr | m_comm |
Communicator to use when writing parallel format. More... | |
bool | m_sharedFilesystem |
Boolean dictating whether we are on a shared filesystem. More... | |
Nektar::LibUtilities::PtsIO::PtsIO | ( | LibUtilities::CommSharedPtr | pComm, |
bool | sharedFilesystem = false |
||
) |
Definition at line 58 of file PtsIO.cpp.
|
inlinevirtual |
Definition at line 66 of file PtsIO.h.
References Import(), ImportFieldData(), LIB_UTILITIES_EXPORT, Nektar::LibUtilities::NullFieldMetaDataMap, SetUpFieldMetaData(), v_ImportFieldData(), and Write().
|
inlineprotectedvirtual |
Helper function that determines default file extension.
Reimplemented from Nektar::LibUtilities::FieldIO.
Reimplemented in Nektar::LibUtilities::CsvIO.
Definition at line 90 of file PtsIO.h.
Referenced by Import(), and SetUpFieldMetaData().
void Nektar::LibUtilities::PtsIO::Import | ( | const std::string & | inFile, |
PtsFieldSharedPtr & | ptsField, | ||
FieldMetaDataMap & | fieldmetadatamap = NullFieldMetaDataMap |
||
) |
Import a pts field from file.
inFile | filename of the file to read |
ptsField | the resulting pts field. |
Definition at line 69 of file PtsIO.cpp.
References CellMLToNektar.pycml::format, GetFileEnding(), ImportFieldData(), Nektar::LibUtilities::FieldIO::ImportFieldMetaData(), Nektar::LibUtilities::FieldIOXml::ImportMultiFldFileIDs(), Nektar::LibUtilities::FieldIO::m_comm, and Nektar::LibUtilities::PortablePath().
Referenced by Nektar::SolverUtils::SessionFunction::EvaluatePts(), and ~PtsIO().
void Nektar::LibUtilities::PtsIO::ImportFieldData | ( | const std::string | inFile, |
PtsFieldSharedPtr & | ptsField | ||
) |
Definition at line 211 of file PtsIO.cpp.
References v_ImportFieldData().
Referenced by Import(), and ~PtsIO().
|
protected |
Definition at line 307 of file PtsIO.cpp.
References ASSERTL0, CellMLToNektar.pycml::format, GetFileEnding(), Nektar::LibUtilities::FieldIO::m_comm, Nektar::LibUtilities::PortablePath(), and Nektar::LibUtilities::FieldIOXml::WriteMultiFldFileIDs().
Referenced by Nektar::LibUtilities::CsvIO::Write(), Write(), and ~PtsIO().
|
protectedvirtual |
Reimplemented in Nektar::LibUtilities::CsvIO.
Definition at line 217 of file PtsIO.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::ErrorUtil::efatal, Nektar::LibUtilities::eIsEquiSpacedData, Nektar::LibUtilities::ePtsPerElmtEdge, Nektar::ParseUtils::GenerateVector(), NEKERROR, and Nektar::LibUtilities::NullPtsInfoMap.
Referenced by ImportFieldData(), and ~PtsIO().
void Nektar::LibUtilities::PtsIO::Write | ( | const std::string & | outFile, |
const PtsFieldSharedPtr & | ptsField, | ||
const bool | backup = false |
||
) |
Save a pts field to a file.
outFile | filename of the file |
ptsField | the pts field |
Definition at line 135 of file PtsIO.cpp.
References SetUpFieldMetaData(), and Nektar::LibUtilities::FieldIO::SetUpOutput().
Referenced by Nektar::FieldUtils::OutputPts::OutputFromPts(), and ~PtsIO().