ioutils Namespace Reference

AMR-Wind API: amr_wind::ioutils Namespace Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
amr_wind::ioutils Namespace Reference

Functions

void goto_next_line (std::istream &is)
 
void read_flat_grid_file (const std::string &fname, amrex::Vector< amrex::Real > &xs, amrex::Vector< amrex::Real > &ys, amrex::Vector< amrex::Real > &zs)
 
std::string amr_wind_version ()
 
std::string timestamp ()
 
void add_var_names (amrex::Vector< std::string > &vnames, const std::string &fname, const int ncomp)
 
template<typename T >
bool all_distinct (const amrex::Vector< T > &vec)
 
void assert_with_message (const bool val, const std::string &msg)
 

Function Documentation

◆ add_var_names()

void amr_wind::ioutils::add_var_names ( amrex::Vector< std::string > & vnames,
const std::string & fname,
const int ncomp )
inline

Generate field names for multi-component fields

Function generates variable names based on the number of components in the field. If the field is a scalar, it just inserts the variable name. For vectors it appends "x, y, z" to the components, and for all other fields it numbers the components start with 0.

◆ all_distinct()

template<typename T >
bool amr_wind::ioutils::all_distinct ( const amrex::Vector< T > & vec)
inline

◆ amr_wind_version()

std::string amr_wind::ioutils::amr_wind_version ( )
inline

◆ assert_with_message()

void amr_wind::ioutils::assert_with_message ( const bool val,
const std::string & msg )
inline

◆ goto_next_line()

void amr_wind::ioutils::goto_next_line ( std::istream & is)

◆ read_flat_grid_file()

void amr_wind::ioutils::read_flat_grid_file ( const std::string & fname,
amrex::Vector< amrex::Real > & xs,
amrex::Vector< amrex::Real > & ys,
amrex::Vector< amrex::Real > & zs )

Read a flattened 2D grid file

File is assumed to contain a single column with the following data: [nx, ny, x values (len = nx), y values (len = ny), z values (len = nx * ny)]

◆ timestamp()

std::string amr_wind::ioutils::timestamp ( )
inline