Peano 4
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.

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.


  • 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 ( )

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 )

◆ extractTreeNumberFromFileName()

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

Definition at line 31 of file PeanoTextPatchFileReader.cpp.

◆ getData()

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

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 ( )

◆ parsePatch()

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

◆ parseVariablesDeclaration()

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

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

Definition at line 50 of file PeanoTextPatchFileReader.h.

◆ _log

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

Definition at line 48 of file PeanoTextPatchFileReader.h.

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