Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
sierra::nalu::HDF5Table Class Reference

Object to manage property evaluation as a function of a set of input chemical state variables. More...

#include <HDF5Table.h>

Public Types

typedef std::map< std::string, std::string > Attributes
 

Public Member Functions

 HDF5Table ()
 Construct an empty HDF5Table This can be filled later with read_hdf5( H5IO fileIO ). More...
 
 HDF5Table (H5IO *fileIO, std::string tablePropName, std::vector< std::string > &indVarNameVec, std::vector< std::string > &indVarTableNameVec)
 Construct an HDF5Table starting with the HDF5 file pointer fileIO and calling read_hdf5() method to pull data from disk. More...
 
virtual ~HDF5Table ()
 
void add_converter (const Converter *converter)
 Insert the provided Converter into this HDF5Table object. More...
 
const std::string & name () const
 Get the name of the variable returned by a query to this HDF5Table. More...
 
const std::vector< std::string > & input_names () const
 Get the list of input variables required by calls to query(), in the order that they are to be provided. More...
 
unsigned int dimension () const
 
double query (const std::vector< double > &inputs) const
 Return the property value as a function of the provided input variables. More...
 
double raw_query (const std::vector< double > &inputs) const
 Return the property value as a function of the provided input variables. More...
 
void set_clipping_log_size (unsigned int size)
 Set the number of clipping events we want to log. More...
 
unsigned int num_clipping_events () const
 Return the current count of clipping events that have occurred. More...
 
const ClipEventLogclipping_event_log () const
 Return the buffer of input coordinates that resulted in a clipping event. More...
 
const std::vector< std::string > & clipping_event_input_names () const
 Return the list of input variables corresponding to the values in the clipping event log. More...
 
const std::vector< double > & clipping_event_min_bounds () const
 Return the list of minimum internal clipping bounds. More...
 
const std::vector< double > & clipping_event_max_bounds () const
 Return the list of maximum internal clipping bounds. More...
 
void clear_clipping_log ()
 Reset the internal clipping event logging. More...
 
unsigned int num_converters () const
 Return the number of Converters. More...
 
bool has_attribute (const std::string &name) const
 Query if the table contains the named attribute. More...
 
const std::string & attribute (const std::string &name) const
 Request the named attribute. More...
 
void read_hdf5_property ()
 Read tablePropName_ entry from HDF5Table specified in fileIO_. More...
 
void read_hdf5_table (H5IO &io)
 Read HDF5Table from the specified HDF5 device, an already-specified subtable. More...
 

Private Member Functions

void log_clip_event (const std::vector< double > &values) const
 
void update_input_mapping ()
 Rewire the inputs and outputs of the Table and any optional Converters so that they talk to each other properly and inputs to the HDF5Table will be sent to the correct object. More...
 
int findix (const std::vector< std::string > &nameVector, const std::string &name)
 Return the index correspondig to the variable name in nameVector. More...
 

Private Attributes

H5IOfileIO_
 
std::string tablePropName_
 
std::vector< std::string > indVarTableNameVec_
 
const size_t indVarSize_
 
unsigned int dimension_
 
std::string name_
 
std::vector< std::string > inputNames_
 
std::vector< const Converter * > converters_
 
std::vector< unsigned int > directInputIndex_
 
std::vector< unsigned int > convTableIndex_
 
std::vector< std::vector< unsigned int > > convInputIndex_
 
std::vector< unsigned int > indexIndVar_
 
std::vector< unsigned int > inputLogScale_
 
std::vector< double > meshMin_
 
std::vector< double > meshMax_
 
std::vector< double > inputMin_
 
std::vector< double > inputMax_
 
std::vector< std::vector< double > > mesh_
 
double valueMin_
 
double valueMax_
 
Attributes attributes_
 
BSplinespline_
 
unsigned int clipEventLogSize_
 
unsigned int numClipped_
 
ClipEventLog clipEventLog_
 
std::vector< double > converterBuf_
 
std::vector< double > lookupBuffer_
 
std::vector< double > lookupBufferChecked_
 

Detailed Description

Object to manage property evaluation as a function of a set of input chemical state variables.

This class provides the public interface for performing property evaluations as a function of chemical state variables. It acts as a wrapper for a contained multidimensional lookup table and any number of (optional) input conversion operations required by the particular turbulence/chemistry interaction model being used. The internal structure does not matter to the calling routine.

Member Typedef Documentation

typedef std::map<std::string, std::string> sierra::nalu::HDF5Table::Attributes

Constructor & Destructor Documentation

sierra::nalu::HDF5Table::HDF5Table ( )

Construct an empty HDF5Table This can be filled later with read_hdf5( H5IO fileIO ).

sierra::nalu::HDF5Table::HDF5Table ( H5IO fileIO,
std::string  tablePropName,
std::vector< std::string > &  indVarNameVec,
std::vector< std::string > &  indVarTableNameVec 
)

Construct an HDF5Table starting with the HDF5 file pointer fileIO and calling read_hdf5() method to pull data from disk.

References indVarSize_, and read_hdf5_property().

sierra::nalu::HDF5Table::~HDF5Table ( )
virtual

References converters_.

Member Function Documentation

void sierra::nalu::HDF5Table::add_converter ( const Converter converter)

Insert the provided Converter into this HDF5Table object.

It will be automatically wired into the central Table, given synchronization of input and output variables. More than one converter may be added to a HDF5Table.

References converters_, and update_input_mapping().

const std::string & sierra::nalu::HDF5Table::attribute ( const std::string &  name) const

Request the named attribute.

An empty string is returned if not found.

References attributes_.

void sierra::nalu::HDF5Table::clear_clipping_log ( )

Reset the internal clipping event logging.

References clipEventLog_, and numClipped_.

const std::vector<std::string>& sierra::nalu::HDF5Table::clipping_event_input_names ( ) const
inline

Return the list of input variables corresponding to the values in the clipping event log.

This is essentially the inputs to the internal interpolation table.

const ClipEventLog & sierra::nalu::HDF5Table::clipping_event_log ( ) const

Return the buffer of input coordinates that resulted in a clipping event.

References clipEventLog_.

const std::vector< double > & sierra::nalu::HDF5Table::clipping_event_max_bounds ( ) const

Return the list of maximum internal clipping bounds.

References inputMax_.

const std::vector< double > & sierra::nalu::HDF5Table::clipping_event_min_bounds ( ) const

Return the list of minimum internal clipping bounds.

References inputMin_.

unsigned int sierra::nalu::HDF5Table::dimension ( ) const
inline
int sierra::nalu::HDF5Table::findix ( const std::vector< std::string > &  nameVector,
const std::string &  name 
)
private

Return the index correspondig to the variable name in nameVector.

References name().

Referenced by update_input_mapping().

bool sierra::nalu::HDF5Table::has_attribute ( const std::string &  name) const

Query if the table contains the named attribute.

References attributes_.

const std::vector<std::string>& sierra::nalu::HDF5Table::input_names ( ) const
inline

Get the list of input variables required by calls to query(), in the order that they are to be provided.

Referenced by sierra::nalu::GammaConverter::read_hdf5(), and update_input_mapping().

void sierra::nalu::HDF5Table::log_clip_event ( const std::vector< double > &  values) const
private
const std::string& sierra::nalu::HDF5Table::name ( ) const
inline

Get the name of the variable returned by a query to this HDF5Table.

Referenced by findix(), read_hdf5_table(), and update_input_mapping().

unsigned int sierra::nalu::HDF5Table::num_clipping_events ( ) const

Return the current count of clipping events that have occurred.

References numClipped_.

unsigned int sierra::nalu::HDF5Table::num_converters ( ) const
inline

Return the number of Converters.

If the number is zero, then the inputs to the HDF5Table will match the inputs to the internal Table, and the Table can be queried for overall HDF5Table configuration like independent variable min, max, and log scale.

References sierra::nalu::ClipEvent::values.

double sierra::nalu::HDF5Table::query ( const std::vector< double > &  inputs) const

Return the property value as a function of the provided input variables.

Input bounds clipping of the internal lookup table is enforced, and a log of clipped queries is stored.

Parameters
inputs: Array of independent variable values
Returns
: The property as a function of the inputs

References clipEventLogSize_, converterBuf_, converters_, convInputIndex_, convTableIndex_, dimension_, directInputIndex_, indexIndVar_, inputLogScale_, inputMax_, inputMin_, log_clip_event(), lookupBuffer_, lookupBufferChecked_, numClipped_, spline_, and sierra::nalu::BSpline::value().

Referenced by sierra::nalu::HDF5TablePropAlgorithm::execute(), sierra::nalu::ChiConverter::query(), and sierra::nalu::GammaConverter::query().

double sierra::nalu::HDF5Table::raw_query ( const std::vector< double > &  inputs) const

Return the property value as a function of the provided input variables.

WARNING: No input bounds clipping is enforced, and no logs are stored of out-of-bounds queries. This query method allows extrapolation, which can be dangerous! Only use this if you know what you are doing!

Parameters
inputs: Array of independent variable values
Returns
: The property as a function of the inputs

References converterBuf_, converters_, convInputIndex_, convTableIndex_, directInputIndex_, lookupBuffer_, spline_, and sierra::nalu::BSpline::value().

void sierra::nalu::HDF5Table::read_hdf5_property ( )
void sierra::nalu::HDF5Table::read_hdf5_table ( H5IO io)
void sierra::nalu::HDF5Table::set_clipping_log_size ( unsigned int  size)

Set the number of clipping events we want to log.

References clipEventLogSize_.

void sierra::nalu::HDF5Table::update_input_mapping ( )
private

Rewire the inputs and outputs of the Table and any optional Converters so that they talk to each other properly and inputs to the HDF5Table will be sent to the correct object.

References converterBuf_, converters_, convInputIndex_, convTableIndex_, dimension_, directInputIndex_, findix(), indexIndVar_, indVarTableNameVec_, input_names(), inputNames_, lookupBuffer_, lookupBufferChecked_, and name().

Referenced by add_converter(), and read_hdf5_property().

Member Data Documentation

Attributes sierra::nalu::HDF5Table::attributes_
private
ClipEventLog sierra::nalu::HDF5Table::clipEventLog_
mutableprivate
unsigned int sierra::nalu::HDF5Table::clipEventLogSize_
mutableprivate
std::vector<double> sierra::nalu::HDF5Table::converterBuf_
mutableprivate
std::vector<const Converter *> sierra::nalu::HDF5Table::converters_
private
std::vector<std::vector<unsigned int> > sierra::nalu::HDF5Table::convInputIndex_
private
std::vector<unsigned int> sierra::nalu::HDF5Table::convTableIndex_
private
unsigned int sierra::nalu::HDF5Table::dimension_
private
std::vector<unsigned int> sierra::nalu::HDF5Table::directInputIndex_
private
H5IO* sierra::nalu::HDF5Table::fileIO_
private

Referenced by read_hdf5_property().

std::vector<unsigned int> sierra::nalu::HDF5Table::indexIndVar_
private

Referenced by query(), and update_input_mapping().

const size_t sierra::nalu::HDF5Table::indVarSize_
private

Referenced by HDF5Table().

std::vector<std::string> sierra::nalu::HDF5Table::indVarTableNameVec_
private

Referenced by update_input_mapping().

std::vector<unsigned int> sierra::nalu::HDF5Table::inputLogScale_
private

Referenced by query(), and read_hdf5_table().

std::vector<double> sierra::nalu::HDF5Table::inputMax_
private
std::vector<double> sierra::nalu::HDF5Table::inputMin_
private
std::vector<std::string> sierra::nalu::HDF5Table::inputNames_
private
std::vector<double> sierra::nalu::HDF5Table::lookupBuffer_
mutableprivate
std::vector<double> sierra::nalu::HDF5Table::lookupBufferChecked_
mutableprivate
std::vector<std::vector<double> > sierra::nalu::HDF5Table::mesh_
private

Referenced by read_hdf5_table().

std::vector<double> sierra::nalu::HDF5Table::meshMax_
private

Referenced by read_hdf5_table().

std::vector<double> sierra::nalu::HDF5Table::meshMin_
private

Referenced by read_hdf5_table().

std::string sierra::nalu::HDF5Table::name_
private
unsigned int sierra::nalu::HDF5Table::numClipped_
mutableprivate
BSpline* sierra::nalu::HDF5Table::spline_
private

Referenced by query(), raw_query(), and read_hdf5_table().

std::string sierra::nalu::HDF5Table::tablePropName_
private

Referenced by read_hdf5_property().

double sierra::nalu::HDF5Table::valueMax_
private

Referenced by read_hdf5_table().

double sierra::nalu::HDF5Table::valueMin_
private

Referenced by read_hdf5_table().


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