Peano 4
No Matches
toolbox::particles::FileReader Class Reference

A file reader. More...

#include <FileReader.h>

Collaboration diagram for toolbox::particles::FileReader:

Public Member Functions

void readDatFile (const std::string &filename, const double scale)
 Read DAT file.
std::list< tarch::la::Vector< Dimensions, double > > getParticlesWithinVoxel (const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h, bool remove)
 Take particles from database which fall into given voxel.
void clear ()
bool empty () const
bool getNumberOfCoordinates () const

Private Attributes

std::list< tarch::la::Vector< Dimensions, double > > _data

Static Private Attributes

static tarch::logging::Log _log

Detailed Description

A file reader.

The file reader realises one big table

Definition at line 25 of file FileReader.h.

Member Function Documentation

◆ clear()

void toolbox::particles::FileReader::clear ( )

Definition at line 43 of file FileReader.cpp.

Referenced by peano4.output.Makefile.Makefile::__init__().

Here is the caller graph for this function:

◆ empty()

bool toolbox::particles::FileReader::empty ( ) const

Definition at line 48 of file FileReader.cpp.

◆ getNumberOfCoordinates()

bool toolbox::particles::FileReader::getNumberOfCoordinates ( ) const

Definition at line 53 of file FileReader.cpp.

◆ getParticlesWithinVoxel()

std::list< tarch::la::Vector< Dimensions, double > > toolbox::particles::FileReader::getParticlesWithinVoxel ( const tarch::la::Vector< Dimensions, double > & x,
const tarch::la::Vector< Dimensions, double > & h,
bool remove )

Take particles from database which fall into given voxel.

Overlapping vs. non-overlapping domain decomposition

In an SPMD environment, it is convenient to make each rank maintain its own input database. As a consequence, ranks have redundant particles and we will have to clean up eventually. To mirror this behaviour in the multithreaded context, we can remove particles whenever we assign them to an inner vertex, but we should also hand them out redundantly for boundary vertices.

xCenter of voxel. If you use this within touchVertexFirstTime(), you can use the vertex position, i.e. the x() operation of the marker. If you use this function within a cell event, you can use x() as well, as it returns the centre.
hSize of voxel. If you use this function within a cell event, just pass in h(). If you use it within a vertex event, you should scale h with 0.5.
removeRemove a particle form the internal database if it is a match. In most cases, removing the particles immediately speeds up things, even though we then have a lot of (uneccessary) locks.
See also

Definition at line 58 of file FileReader.cpp.

References tarch::la::greaterEquals(), h, and tarch::la::smallerEquals().

Here is the call graph for this function:

◆ readDatFile()

void toolbox::particles::FileReader::readDatFile ( const std::string & filename,
const double scale )

Read DAT file.

A dat file is a simple text file where we have one particle description per line. Each line holds exactly Dimensions double values.

Definition at line 12 of file FileReader.cpp.

References _data, logError, and logInfo.

Field Documentation

◆ _data

◆ _log

tarch::logging::Log toolbox::particles::FileReader::_log

Definition at line 27 of file FileReader.h.

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