GridFormat 0.2.1
I/O-Library for grid-like data structures
|
Interface to the readers for all supported file formats. More...
#include <reader.hpp>
Typically you would construct this class with one of the predefined file format instances. For example, with the .vtu file format:
Public Types | |
using | ReaderFactoryFunctor = ReaderDetail::ReaderFactoryFunctor |
Public Types inherited from GridFormat::GridReader | |
using | Vector = std::array< double, 3 > |
using | CellVisitor = std::function< void(CellType, const std::vector< std::size_t > &)> |
Public Member Functions | |
Reader (ReaderFactoryFunctor f=ReaderDetail::default_reader_factory()) | |
Reader (const FileFormat::Any &, ReaderFactoryFunctor f=ReaderDetail::default_reader_factory()) | |
template<Concepts::Communicator C> | |
Reader (const FileFormat::Any &, const C &c) | |
template<ReaderDetail::SequentiallyConstructible FileFormat> | |
Reader (const FileFormat &f) | |
template<typename FileFormat , Concepts::Communicator Communicator> requires (ReaderDetail::ParallelConstructible<FileFormat, Communicator>) | |
Reader (const FileFormat &f, const Communicator &c) | |
Reader & | with_opened (const std::string &filename) & |
Read the data from the given file and return this reader. | |
Reader && | with_opened (const std::string &filename) && |
Read the data from the given file and return this reader (lvalue references overload) | |
Public Member Functions inherited from GridFormat::GridReader | |
GridReader (GridReader &&)=default | |
GridReader (const GridReader &)=delete | |
GridReader & | operator= (GridReader &&)=default |
GridReader & | operator= (const GridReader &)=delete |
GridReader (const std::string &filename) | |
std::string | name () const |
Return the name of this reader. | |
void | open (const std::string &filename) |
Open the given grid file. | |
void | close () |
Close the grid file. | |
const std::string & | filename () const |
Return the name of the opened grid file (empty string until open() is called) | |
std::size_t | number_of_cells () const |
Return the number of cells in the grid read from the file. | |
std::size_t | number_of_points () const |
Return the number of points in the grid read from the file. | |
std::size_t | number_of_pieces () const |
std::array< std::size_t, 3 > | extents () const |
Return the extents of the grid (only available for structured grid formats) | |
PieceLocation | location () const |
Return the location of this piece in a structured grid (only available for structured grid formats) | |
std::vector< double > | ordinates (unsigned int direction) const |
Return the ordinates of the grid (only available for rectilinear grid formats) | |
Vector | spacing () const |
Return the spacing of the grid (only available for image grid formats) | |
Vector | origin () const |
Return the origin of the grid (only available for image grid formats) | |
Vector | basis_vector (unsigned int direction) const |
Return the basis vector of the grid in the given direction (only available for image grid formats) | |
bool | is_sequence () const |
Return true if the read file is a sequence. | |
std::size_t | number_of_steps () const |
Return the number of available steps (only available for sequence formats) | |
double | time_at_step (std::size_t step_idx) const |
Return the time at the current step (only available for sequence formats) | |
void | set_step (std::size_t step_idx) |
Set the step from which to read data (only available for sequence formats) | |
template<std::size_t space_dim = 3, Concepts::GridFactory< space_dim > Factory> | |
void | export_grid (Factory &factory) const |
Export the grid read from the file into the given grid factory. | |
void | visit_cells (const CellVisitor &visitor) const |
Visit all cells in the grid read from the file. | |
FieldPtr | points () const |
Return the points of the grid as field. | |
FieldPtr | cell_field (std::string_view name) const |
Return the cell field with the given name. | |
FieldPtr | point_field (std::string_view name) const |
Return the point field with the given name. | |
FieldPtr | meta_data_field (std::string_view name) const |
Return the meta data field with the given name. | |
void | set_ignore_warnings (bool value) |
Static Public Member Functions | |
template<typename... ConstructorArgs> | |
static Reader | from (const std::string &filename, ConstructorArgs &&... args) |
Construct a reader instance from the given arguments, while directly opening the given file. | |
Additional Inherited Members | |
Protected Member Functions inherited from GridFormat::GridReader | |
void | _log_warning (std::string_view warning) const |