GridFormat 0.4.0
I/O-Library for grid-like data structures
Loading...
Searching...
No Matches
GridFormat::GridReader Class Referenceabstract

Abstract base class for all readers, defines the common interface.

#include <reader.hpp>

Inheritance diagram for GridFormat::GridReader:
GridFormat::PVDReader< C > GridFormat::Reader GridFormat::VTIReader GridFormat::VTK::PXMLReaderBase< PieceReader > GridFormat::VTKHDFImageGridReader GridFormat::VTKHDFReader< Communicator > GridFormat::VTKHDFUnstructuredGridReader< Communicator > GridFormat::VTPReader GridFormat::VTRReader GridFormat::VTSReader GridFormat::VTUReader

Classes

struct  FieldNames
 
struct  PieceLocation
 Describes the location of a piece within a distributed structured grid. More...
 

Public Types

using Vector = std::array< double, 3 >
 
using CellVisitor = std::function< void(CellType, const std::vector< std::size_t > &)>
 

Public Member Functions

 GridReader (GridReader &&)=default
 
 GridReader (const GridReader &)=delete
 
GridReaderoperator= (GridReader &&)=default
 
GridReaderoperator= (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)
 

Protected Member Functions

void _log_warning (std::string_view warning) const
 

Friends

std::ranges::range auto cell_field_names (const GridReader &reader)
 Return a range over the names of all read cell fields.
 
std::ranges::range auto point_field_names (const GridReader &reader)
 Return a range over the names of all read point fields.
 
std::ranges::range auto meta_data_field_names (const GridReader &reader)
 Return a range over the names of all read metadata fields.
 
std::ranges::range auto cell_fields (const GridReader &reader)
 Return a range over name-field pairs for all read cell fields.
 
std::ranges::range auto point_fields (const GridReader &reader)
 Return a range over name-field pairs for all read point fields.
 
std::ranges::range auto meta_data_fields (const GridReader &reader)
 Return a range over name-field pairs for all read metadata fields.
 

Member Function Documentation

◆ number_of_pieces()

std::size_t GridFormat::GridReader::number_of_pieces ( ) const
inline

Return the number of pieces contained in the read file (when constructing readers in parallel, this reader instance contains the data of only one or some of these pieces)


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