Peano 4
Loading...
Searching...
No Matches
convert::input::PeanoTextPatchFileReader Class Reference

Represent a Peano reader. More...

#include <PeanoTextPatchFileReader.h>

Inheritance diagram for convert::input::PeanoTextPatchFileReader:
Collaboration diagram for convert::input::PeanoTextPatchFileReader:

Public Member Functions

 PeanoTextPatchFileReader (const std::string &file)
 Read in one file.
 
virtual ~PeanoTextPatchFileReader ()
 
virtual void parse () override
 
virtual std::vector< convert::data::DataSetgetData () const override
 A file can hold a series of datasets.
 

Private Member Functions

void parsePatch (int dataSetCounter, int treeNumber, const std::vector< std::string > &patchDescription)
 
void parseVariablesDeclaration (int dataSetCounter, const std::vector< std::string > &patchDescription, const std::string &name, convert::data::PeanoDataType type)
 
void addDataToPatch (int dataSetCounter, const std::string &variableName, double *offset, double *size, int treeNumber, const std::vector< std::string > &textData)
 
int extractTreeNumberFromFileName () const
 

Private Attributes

const std::string _file
 
int _dimensions
 
std::vector< convert::data::DataSet_data
 

Static Private Attributes

static tarch::logging::Log _log
 

Detailed Description

Represent a Peano reader.

A reader is an object which basically takes one file and gives the content of this file.

If you just want to read in one file, open it with this file and pass the field patches into the PeanoConverter. So this class has two purposes:

  • It can read a single file. In this case, getData() gives you back only one entry.
  • It can read a set of datasets (meta file). In this case, getData() gives you back a sequence of datasets. Internally, the reader creates new readers.

At the moment, a file either includes other files and thus holds a sequence of data sets, or it holds real data. Mixtures are not allowed. Therefore, there's no recursion of reads.

Author
Tobias Weinzierl

Definition at line 46 of file PeanoTextPatchFileReader.h.

Constructor & Destructor Documentation

◆ PeanoTextPatchFileReader()

convert::input::PeanoTextPatchFileReader::PeanoTextPatchFileReader ( const std::string & file)

Read in one file.

process

  • Load the whole files into a vector called lines, i.e. we load line by line.

Definition at line 21 of file PeanoTextPatchFileReader.cpp.

◆ ~PeanoTextPatchFileReader()

convert::input::PeanoTextPatchFileReader::~PeanoTextPatchFileReader ( )
virtual

Definition at line 27 of file PeanoTextPatchFileReader.cpp.

Member Function Documentation

◆ addDataToPatch()

void convert::input::PeanoTextPatchFileReader::addDataToPatch ( int dataSetCounter,
const std::string & variableName,
double * offset,
double * size,
int treeNumber,
const std::vector< std::string > & textData )
private

◆ extractTreeNumberFromFileName()

int convert::input::PeanoTextPatchFileReader::extractTreeNumberFromFileName ( ) const
private

Definition at line 31 of file PeanoTextPatchFileReader.cpp.

◆ getData()

std::vector< convert::data::DataSet > convert::input::PeanoTextPatchFileReader::getData ( ) const
overridevirtual

A file can hold a series of datasets.

Implements convert::input::PatchFileReader.

Definition at line 405 of file PeanoTextPatchFileReader.cpp.

◆ parse()

void convert::input::PeanoTextPatchFileReader::parse ( )
overridevirtual

◆ parsePatch()

void convert::input::PeanoTextPatchFileReader::parsePatch ( int dataSetCounter,
int treeNumber,
const std::vector< std::string > & patchDescription )
private

◆ parseVariablesDeclaration()

void convert::input::PeanoTextPatchFileReader::parseVariablesDeclaration ( int dataSetCounter,
const std::vector< std::string > & patchDescription,
const std::string & name,
convert::data::PeanoDataType type )
private

Definition at line 191 of file PeanoTextPatchFileReader.cpp.

References tarch::mpi::Rank::abort(), logDebug, logError, and convert::input::Parser::tokenise().

Here is the call graph for this function:

Field Documentation

◆ _data

◆ _dimensions

◆ _file

const std::string convert::input::PeanoTextPatchFileReader::_file
private

Definition at line 50 of file PeanoTextPatchFileReader.h.

◆ _log

tarch::logging::Log convert::input::PeanoTextPatchFileReader::_log
staticprivate

Definition at line 48 of file PeanoTextPatchFileReader.h.


The documentation for this class was generated from the following files: