|
Peano
|
A file reader. More...
#include <FileReader.h>

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 |
| void toolbox::particles::FileReader::clear | ( | ) |
Referenced by peano4.api.output.Makefile.Makefile::__init__().

| bool toolbox::particles::FileReader::empty | ( | ) | const |
| bool toolbox::particles::FileReader::getNumberOfCoordinates | ( | ) | const |
| 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.
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.
| x | Center 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. |
| h | Size 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. |
| remove | Remove 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. |
| 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.
|
private |
Definition at line 29 of file FileReader.h.
Referenced by peano4.api.datamodel.DaStGen2.DaStGen2Generator::construct_output(), peano4.api.datamodel.DaStGen2.DaStGen2GeneratorForObjectsWithSmartPointers::construct_output(), peano4.api.toolbox.particles.ParticleSet.ParticleSetGenerator_ScatteredOnHeap_IndexByList::construct_output(), peano4.api.toolbox.particles.ParticleSet.ParticleSetGenerator_ScatteredOnHeap_IndexByVector::construct_output(), peano4.api.toolbox.particles.ParticleSet.ParticleSetGenerator_ContinuousPerVertex::construct_output(), peano4.api.toolbox.particles.ParticleSet.ParticleSetGenerator_GlobalContinuous::construct_output(), peano4.api.datamodel.DaStGen2.DaStGen2Generator::get_header_file_include(), peano4.api.datamodel.DaStGen2.DaStGen2GeneratorForObjectsWithSmartPointers::get_header_file_include(), peano4.api.toolbox.particles.ParticleSet.AbstractParticleSetGenerator::get_header_file_include(), peano4.api.datamodel.DaStGen2.DaStGen2Generator::get_stack_container(), peano4.api.datamodel.DaStGen2.DaStGen2GeneratorForObjectsWithSmartPointers::get_stack_container(), peano4.api.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector::get_stack_container(), and peano4.api.toolbox.particles.ParticleSet.AbstractParticleSetGenerator::get_stack_container().
|
staticprivate |
Definition at line 27 of file FileReader.h.