Loading...
Searching...
No Matches
lookup_table_2d_reader.hpp File Reference
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
#include "Kokkos_Macros.hpp"
#include "terra/kokkos/kokkos_wrapper.hpp"

Go to the source code of this file.

Classes

struct  terra::io::GridLayout2D
 Describes the 2D grid layout for a linearized data column. More...
 
struct  terra::io::ScalarLookupTable2D< ScalarType >
 Device-capable 2D scalar lookup table with bilinear interpolation. More...
 

Namespaces

namespace  terra
 
namespace  terra::io
 
namespace  terra::io::detail
 

Functions

std::vector< std::string > terra::io::detail::split_flexible (const std::string &line)
 Split a line on any combination of spaces, tabs, and commas.
 
void terra::io::detail::flat_to_grid (int k, const GridLayout2D &layout, int &ix, int &iy)
 Given a flat index k, return (ix, iy) according to the layout strides.
 
template<typename ScalarType = double>
std::vector< ScalarLookupTable2D< ScalarType > > terra::io::read_lookup_tables_2d (const std::string &filename, const std::vector< int > &column_indices, const GridLayout2D &layout, const std::string &label="lookup_table")
 Read selected columns from a delimited data file into 2D lookup tables.
 
template<typename ScalarType = double>
ScalarLookupTable2D< ScalarType > terra::io::read_lookup_table_2d (const std::string &filename, int column_index, const GridLayout2D &layout, const std::string &label="lookup_table")
 Convenience overload: read a single column from a data file.