Nektar++
|
#include <PtsIO.h>
Public Member Functions | |
PtsIO (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem=false) | |
~PtsIO () override | |
void | Import (const std::string &inFile, PtsFieldSharedPtr &ptsField, FieldMetaDataMap &fieldmetadatamap=NullFieldMetaDataMap, DomainRangeShPtr &Range=NullDomainRangeShPtr) |
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... | |
Public Member Functions inherited from Nektar::LibUtilities::FieldIOXml | |
FieldIOXml (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem) | |
Default constructor. More... | |
~FieldIOXml () override | |
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... | |
Public Member Functions inherited from Nektar::LibUtilities::FieldIO | |
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... | |
const std::string & | GetClassName () const |
std::string | GetFileEnding () const |
Helper function that determines default file extension. More... | |
Protected Member Functions | |
virtual void | v_ImportPtsFieldData (const std::string inFile, PtsFieldSharedPtr &ptsField, DomainRangeShPtr &Range=NullDomainRangeShPtr) |
std::string | v_GetFileEnding () const override |
void | SetUpFieldMetaData (const std::string outname) |
Protected Member Functions inherited from Nektar::LibUtilities::FieldIOXml | |
void | v_Write (const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap, const bool backup=false) override |
Write an XML file to outFile given the field definitions fielddefs , field data fielddata and metadata fieldmetadatamap . 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) override |
Import an XML format file. More... | |
DataSourceSharedPtr | v_ImportFieldMetaData (const std::string &filename, FieldMetaDataMap &fieldmetadatamap) override |
Import field metadata from filename and return the data source which wraps filename . More... | |
const std::string & | v_GetClassName () const override |
Returns the class name. More... | |
Protected Member Functions inherited from Nektar::LibUtilities::FieldIO | |
int | CheckFieldDefinition (const FieldDefinitionsSharedPtr &fielddefs) |
Check field definitions for correctness and return storage size. More... | |
std::vector< unsigned int > | GetNumberOfCoeffsPerElement (const FieldDefinitionsSharedPtr &fielddefs) |
Compute number of data points needed to store expansion inside each element. More... | |
std::string | SetUpOutput (const std::string outname, bool perRank, bool backup=false) |
Set up the filesystem ready for output. More... | |
virtual void | v_Write (const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap, const bool backup=false)=0 |
Write out the field information to the file outFile . More... | |
virtual 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)=0 |
Read field information from the file infilename . More... | |
virtual DataSourceSharedPtr | v_ImportFieldMetaData (const std::string &filename, FieldMetaDataMap &fieldmetadatamap)=0 |
Import the metadata from a field file. More... | |
virtual std::string | v_GetFileEnding () const |
virtual const std::string & | v_GetClassName () const =0 |
Additional Inherited Members | |
Static Public Member Functions inherited from Nektar::LibUtilities::FieldIOXml | |
static FieldIOSharedPtr | create (LibUtilities::CommSharedPtr pComm, bool sharedFilesystem) |
Creates an instance of this class. More... | |
Static Public Member Functions inherited from Nektar::LibUtilities::FieldIO | |
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 Public Attributes inherited from Nektar::LibUtilities::FieldIOXml | |
static std::string | className |
Name of class. More... | |
Protected Attributes inherited from Nektar::LibUtilities::FieldIO | |
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 55 of file PtsIO.cpp.
|
inlineoverride |
void Nektar::LibUtilities::PtsIO::Import | ( | const std::string & | inFile, |
PtsFieldSharedPtr & | ptsField, | ||
FieldMetaDataMap & | fieldmetadatamap = NullFieldMetaDataMap , |
||
DomainRangeShPtr & | Range = NullDomainRangeShPtr |
||
) |
Import a pts field from file.
inFile | filename of the file to read |
ptsField | the resulting pts field. |
Definition at line 66 of file PtsIO.cpp.
References CellMLToNektar.pycml::format, Nektar::LibUtilities::FieldIO::GetFileEnding(), Nektar::LibUtilities::FieldIO::ImportFieldMetaData(), Nektar::LibUtilities::FieldIOXml::ImportMultiFldFileIDs(), Nektar::LibUtilities::FieldIO::m_comm, Nektar::LibUtilities::PortablePath(), and v_ImportPtsFieldData().
Referenced by Nektar::SolverUtils::SessionFunction::EvaluatePts(), and Nektar::FieldUtils::ProcessPointDataToFld::v_Process().
|
protected |
Definition at line 268 of file PtsIO.cpp.
References ASSERTL0, CellMLToNektar.pycml::format, Nektar::LibUtilities::FieldIO::GetFileEnding(), Nektar::LibUtilities::FieldIO::m_comm, Nektar::LibUtilities::PortablePath(), and Nektar::LibUtilities::FieldIOXml::WriteMultiFldFileIDs().
Referenced by Nektar::LibUtilities::CsvIO::Write(), and Write().
|
inlineoverrideprotectedvirtual |
Reimplemented from Nektar::LibUtilities::FieldIO.
Definition at line 83 of file PtsIO.h.
|
protectedvirtual |
Reimplemented in Nektar::LibUtilities::CsvIO.
Definition at line 173 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 Import().
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 130 of file PtsIO.cpp.
References SetUpFieldMetaData(), and Nektar::LibUtilities::FieldIO::SetUpOutput().
Referenced by Nektar::FieldUtils::OutputPts::v_OutputFromPts(), and Nektar::SolverUtils::CouplingFile::v_Send().