![]() |
Documentation 6b54b78464
|
Look up table. More...
#include <CLookUpTable.hpp>
Public Member Functions | |
| CLookUpTable (const std::string &file_name_lut, std::string name_CV1_in, std::string name_CV2_in) | |
| void | PrintTableInfo () |
| Print information to screen. | |
| bool | LookUp_XY (const unsigned long idx_var, su2double *val_var, const su2double val_CV1, const su2double val_CV2, const unsigned long i_level=0) |
| Lookup value of variable stored under idx_var using controlling variable values(val_CV1,val_CV2). | |
| bool | LookUp_XY (const std::vector< unsigned long > &idx_var, std::vector< su2double > &val_vars, const su2double val_CV1, const su2double val_CV2, const unsigned long i_level=0) |
| Lookup the value of the variable stored under idx_var using controlling variable values(val_CV1,val_CV2). | |
| bool | LookUp_XY (const std::vector< unsigned long > &idx_var, std::vector< su2double * > &val_vars, const su2double val_CV1, su2double val_CV2, const unsigned long i_level=0) |
| Lookup the values of the variables stored under idx_var using controlling variable values(val_CV1,val_CV2). | |
| bool | LookUp_XYZ (const unsigned long idx_var, su2double *val_var, const su2double val_CV1, const su2double val_CV2, const su2double val_CV3) |
| Lookup the value of the variable stored under idx_var using controlling variable values(val_CV1,val_CV2,
val_CV3). | |
| bool | LookUp_XYZ (const std::vector< unsigned long > &idx_var, std::vector< su2double > &val_vars, const su2double val_CV1, const su2double val_CV2, const su2double val_CV3=0) |
| Lookup the values of the variables stored under idx_var using controlling variable values (val_CV1,val_CV2,val_z). | |
| bool | LookUp_XYZ (const std::vector< unsigned long > &idx_var, std::vector< su2double * > &val_vars, const su2double val_CV1, const su2double val_CV2, const su2double val_CV3=0) |
| Lookup the values of the variables stored under idx_var using controlling variable values (val_CV1,val_CV2,val_z). | |
| std::pair< unsigned long, unsigned long > | FindInclusionLevels (const su2double val_CV3) |
| Find the table levels with constant z-values directly above and below query val_z. | |
| std::pair< su2double *, su2double * > | GetTableLimitsY (const unsigned long i_level=0) const |
| Determine the minimum and maximum value of the second controlling variable. | |
| std::pair< su2double *, su2double * > | GetTableLimitsX (const unsigned long i_level=0) const |
| Determine the minimum and maximum value of the first controlling variable. | |
| bool | CheckForVariables (const std::vector< std::string > &vars_to_check) const |
| Check whether requested set of variables are included in the table. | |
| unsigned int | GetIndexOfVar (const std::string &nameVar) const |
| Returns the index to the variable in the lookup table. | |
| unsigned long | GetNullIndex () const |
| Returns the table variable index which will always return zero when looked up. | |
Protected Member Functions | |
| bool | noSource (const std::string &name_var) const |
| Returns true if the string is null or zero (ignores case). | |
| const su2double * | GetDataP (const std::string &name_var, unsigned long i_level=0) const |
| Get the pointer to the column data of the table (density, temperature, source terms, ...). | |
| void | FindTableLimits (const std::string &name_CV1, const std::string &name_CV2) |
| Find the table limits, i.e. the minimum and maximum values of the 2 independent controlling variables. We put the values in the variables. limits_table_x[2] and limit_table_y[2]. | |
| void | IdentifyUniqueEdges () |
| Construct a list of all the edges and a list of the pair of elements left and right of the edge. | |
| void | LoadTableRaw (const std::string &file_name_lut) |
| Read the lookup table from file and store the data. | |
| void | ComputeInterpCoeffs () |
| Compute vector of all (inverse) interpolation coefficients "interp_mat_inv_x_y" of all triangles. | |
| void | GetInterpMatInv (const su2double *vec_CV1, const su2double *vec_CV2, std::array< unsigned long, 3 > &point_ids, su2activematrix &interp_mat_inv) |
| Compute the inverse matrix for interpolation. | |
| void | GetInterpCoeffs (su2double val_CV1, su2double val_CV2, const su2activematrix &interp_mat_inv, std::array< su2double, 3 > &interp_coeffs) const |
| Compute the interpolation coefficients for the triangular interpolation. | |
| su2double | Interpolate (const su2double *val_samples, std::array< unsigned long, 3 > &val_triangle, std::array< su2double, 3 > &val_interp_coeffs) |
| Compute interpolated value of a point P in the triangle. | |
| void | Linear_Interpolation (const su2double val_CV3, const unsigned long lower_level, const unsigned long upper_level, su2double &lower_value, su2double &upper_value, su2double *&var_vals) const |
| Perform linear interpolation between two table levels for a single variable. | |
| void | Linear_Interpolation (const su2double val_CV3, const unsigned long lower_level, const unsigned long upper_level, std::vector< su2double > &lower_values, std::vector< su2double > &upper_values, std::vector< su2double > &var_vals) const |
| Perform linear interpolation between two table levels for a vector of variables. | |
| unsigned long | FindNearestNeighborOnHull (su2double val_CV1, su2double val_CV2, unsigned long i_level=0) |
| Find the point on the hull (boundary of the table) that is closest to the point P(val_CV1,val_CV2). | |
| void | InterpolateToNearestNeighbors (const su2double val_CV1, const su2double val_CV2, const std::vector< std::string > &names_var, std::vector< su2double * > &var_vals, const unsigned long i_level=0) |
| Interpolate data based on distance-weighted averaging on the nearest two table nodes. | |
| void | InterpolateToNearestNeighbors (const su2double val_CV1, const su2double val_CV2, const std::vector< unsigned long > &idx_var, std::vector< su2double > &var_vals, const unsigned long i_level=0) |
| Interpolate data based on distance-weighted averaging on the nearest two table nodes. | |
| void | InterpolateToNearestNeighbors (const su2double val_CV1, const su2double val_CV2, const std::vector< unsigned long > &idx_var, std::vector< su2double * > &var_vals, const unsigned long i_level=0) |
| Interpolate data based on distance-weighted averaging on the nearest two table nodes. | |
| void | InterpolateToNearestNeighbors (const su2double val_CV1, const su2double val_CV2, const std::string &name_var, su2double *var_val, const unsigned long i_level=0) |
| Interpolate data based on distance-weighted averaging on the nearest two table nodes for a single variable. | |
| std::array< std::array< su2double, 2 >, 2 > | ComputeNormalizedXY (std::pair< unsigned long, unsigned long > &inclusion_levels, const su2double val_CV1, const su2double val_CV2, const su2double val_CV3) |
| Compute the values of the first and second controlling variable based on normalized query coordinates. | |
| bool | FindInclusionTriangle (const su2double val_CV1, const su2double val_CV2, unsigned long &id_triangle, const unsigned long iLevel=0) |
| Find the triangle within which the query point (val_CV1, val_CV2) is located. | |
| std::pair< unsigned long, unsigned long > | FindNearestNeighbors (const su2double val_CV1, const su2double val_CV2, const unsigned long iLevel=0) |
| Identify the nearest second nearest hull nodes w.r.t. the query point (val_CV1, val_CV2). | |
Protected Attributes | |
| int | rank |
| MPI Rank. | |
| std::string | file_name_lut |
| LUT file name. | |
| std::string | version_lut |
| LUT version as specified in LUT file. | |
| std::string | version_reader |
| Reader version (should be equal or above LUT version). | |
| std::string | name_CV1 |
| Name of controlling variable 1. | |
| std::string | name_CV2 |
| Name of controlling variable 2. | |
| unsigned long | idx_CV1 |
| Table variable index of controlling variable 1. | |
| unsigned long | idx_CV2 |
| Table variable index of controlling variable 2. | |
| unsigned long | idx_null |
| Variable index corresponding to NULL variable. | |
| su2vector< unsigned long > | n_points |
| Number of data poins per table level. | |
| su2vector< unsigned long > | n_triangles |
| Number of triangles per table level. | |
| su2vector< unsigned long > | n_hull_points |
| Number of outer boundary points per table level. | |
| unsigned long | n_variables |
| unsigned long | n_table_levels = 1 |
| std::vector< su2double > | z_values_levels |
| Constant z-values of each table level. | |
| unsigned short | table_dim = 2 |
| Table dimension. | |
| std::pair< su2double *, su2double * > | limits_table_z |
| The lower and upper limits of the z, y and x variable for each table level. | |
| su2vector< std::pair< su2double *, su2double * > > | limits_table_y |
| su2vector< std::pair< su2double *, su2double * > > | limits_table_x |
| su2vector< std::string > | names_var |
| Holds the variable names stored in the table file. Order is in sync with data. | |
| su2vector< su2activematrix > | table_data |
| Holds all data stored in the table. First index addresses the variable while second index addresses the point. | |
| double | memory_footprint_data = 0 |
| Memory footprint of the loaded table data. | |
| su2vector< su2matrix< unsigned long > > | triangles |
| Holds all connectivity data stored in the table for each level. First index addresses the variable while second index addresses the point. | |
| su2vector< std::vector< std::array< unsigned long, 2 > > > | edges |
| Edge information for each table level. | |
| su2vector< su2vector< std::vector< unsigned long > > > | edge_to_triangle |
| su2vector< su2vector< unsigned long > > | hull |
| The hull contains the boundary of the lookup table. | |
| su2vector< CTrapezoidalMap > | trap_map_x_y |
| Trapezoidal map objects for the table levels. | |
| su2vector< su2vector< su2activematrix > > | interp_mat_inv_x_y |
| Vector of all the weight factors for the interpolation. | |
Look up table.
| CLookUpTable::CLookUpTable | ( | const std::string & | file_name_lut, |
| std::string | name_CV1_in, | ||
| std::string | name_CV2_in | ||
| ) |
| bool CLookUpTable::CheckForVariables | ( | const std::vector< std::string > & | vars_to_check | ) | const |
Check whether requested set of variables are included in the table.
|
protected |
Compute vector of all (inverse) interpolation coefficients "interp_mat_inv_x_y" of all triangles.
|
protected |
Compute the values of the first and second controlling variable based on normalized query coordinates.
| [in] | inclusion_levels | - Pair containing lower(first) and upper(second) table inclusion level indices. |
| [in] | val_CV1 | - First controlling variable value. |
| [in] | val_CV2 | - Second controlling variable value. |
| [in] | val_CV3 | - Third controlling variable value. |
| std::pair< unsigned long, unsigned long > CLookUpTable::FindInclusionLevels | ( | const su2double | val_CV3 | ) |
Find the table levels with constant z-values directly above and below query val_z.
| [in] | val_CV3 | - Value of controlling variable 3. |
|
protected |
Find the triangle within which the query point (val_CV1, val_CV2) is located.
| [in] | val_CV1 | - First controlling variable value. |
| [in] | val_CV2 | - Second controlling variable value. |
| [in] | id_triangle | - Reference to inclusion triangle index. |
| [in] | iLevel | - Table level index. |
|
protected |
Find the point on the hull (boundary of the table) that is closest to the point P(val_CV1,val_CV2).
| [in] | val_CV1 | - First coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | val_CV2 | - Second coordinate of point P(val_CV1,val_CV2) to check. |
|
protected |
Identify the nearest second nearest hull nodes w.r.t. the query point (val_CV1, val_CV2).
| [in] | val_CV1 | - First controlling variable value. |
| [in] | val_CV2 | - Second controlling variable value. |
| [in] | iLevel | - Table level index. |
|
protected |
Find the table limits, i.e. the minimum and maximum values of the 2 independent controlling variables. We put the values in the variables. limits_table_x[2] and limit_table_y[2].
| [in] | name_CV1 | - The string name for the first controlling variable. |
| [in] | name_CV2 | - The string name of the second controlling variable. |
|
inlineprotected |
Get the pointer to the column data of the table (density, temperature, source terms, ...).
|
inline |
Returns the index to the variable in the lookup table.
| [in] | nameVar | - Variable name for which to retrieve the column index. |
|
protected |
Compute the interpolation coefficients for the triangular interpolation.
| [in] | val_CV1 | - Value of first coordinate (progress variable). |
| [in] | val_CV2 | - Value of second coordinate (enthalpy). |
| [in] | interp_mat_inv | - Inverse matrix for interpolation. |
| [out] | interp_coeffs | - Interpolation coefficients. |
|
protected |
Compute the inverse matrix for interpolation.
| [in] | vec_CV1 | - Pointer to first coordinate (progress variable). |
| [in] | vec_CV2 | - Pointer to second coordinate (enthalpy). |
| [in] | point_ids | - Single triangle data. |
| [out] | interp_mat_inv | - Inverse matrix for interpolation. |
|
inline |
Returns the table variable index which will always return zero when looked up.
|
inline |
Determine the minimum and maximum value of the first controlling variable.
|
inline |
Determine the minimum and maximum value of the second controlling variable.
|
protected |
Construct a list of all the edges and a list of the pair of elements left and right of the edge.
|
protected |
Compute interpolated value of a point P in the triangle.
| [in] | val_samples | - Pointer to the variable data. |
| [in] | val_triangle | - ID to the triangle. |
| [in] | val_interp_coeffs | - Interpolation coefficients using the point data in P. |
|
protected |
Interpolate data based on distance-weighted averaging on the nearest two table nodes for a single variable.
| [in] | val_CV1 | - First coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | val_CV2 | - Second coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | name_var | - Variable name to look up. |
| [out] | var_val | - Pointer to the to be interpolated variable. |
|
protected |
Interpolate data based on distance-weighted averaging on the nearest two table nodes.
| [in] | val_CV1 | - First coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | val_CV2 | - Second coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | val_names_var | - Vector of string names of the variables to look up. |
| [out] | val_vars | - Pointer to the vector of stored values of the variables to look up. |
|
protected |
Interpolate data based on distance-weighted averaging on the nearest two table nodes.
| [in] | val_CV1 | - First coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | val_CV2 | - Second coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | idx_var | - Vector of table variable indices to be looked up. |
| [out] | val_vars | - Pointer to the vector of stored values of the variables to look up. |
|
protected |
Interpolate data based on distance-weighted averaging on the nearest two table nodes.
| [in] | val_CV1 | - First coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | val_CV2 | - Second coordinate of point P(val_CV1,val_CV2) to check. |
| [in] | idx_var | - Vector of table variable indices to be looked up. |
| [out] | val_vars | - Pointer to the vector of stored values of the variables to look up. |
|
protected |
Perform linear interpolation between two table levels for a vector of variables.
| [in] | val_CV3 | - Value of the third controlling variable at the query point. |
| [in] | lower_level | - Table level index of the table level directly below the query point. |
| [in] | upper_level | - Table level index of the table level directly above the query point. |
| [in] | lower_values | - Results from x-y interpolation on the lower table level. |
| [in] | upper_values | - Results from x-y interpolation on the upper table level. |
| [in] | val_vars | - Pointer to interpolation results for all interpolation variables. |
|
protected |
Perform linear interpolation between two table levels for a single variable.
| [in] | val_CV3 | - Value of the third controlling variable at the query point. |
| [in] | lower_level | - Table level index of the table level directly below the query point. |
| [in] | upper_level | - Table level index of the table level directly above the query point. |
| [in] | lower_value | - Result from x-y interpolation on the lower table level. |
| [in] | upper_value | - Result from x-y interpolation on the upper table level. |
| [in] | val_vars | - Pointer to interpolation result. |
|
protected |
Read the lookup table from file and store the data.
| [in] | file_name_lut | - the filename of the lookup table. |
| bool CLookUpTable::LookUp_XY | ( | const std::vector< unsigned long > & | idx_var, |
| std::vector< su2double * > & | val_vars, | ||
| const su2double | val_CV1, | ||
| su2double | val_CV2, | ||
| const unsigned long | i_level = 0 |
||
| ) |
Lookup the values of the variables stored under idx_var using controlling variable values(val_CV1,val_CV2).
| [in] | idx_var | - Table data column indices corresponding to look-up variables. |
| [out] | val_var | - The stored value of the variable to look up. |
| [in] | val_CV1 | - Value of controlling variable 1. |
| [in] | val_CV2 | - Value of controlling variable 2. |
| bool CLookUpTable::LookUp_XY | ( | const std::vector< unsigned long > & | idx_var, |
| std::vector< su2double > & | val_vars, | ||
| const su2double | val_CV1, | ||
| const su2double | val_CV2, | ||
| const unsigned long | i_level = 0 |
||
| ) |
Lookup the value of the variable stored under idx_var using controlling variable values(val_CV1,val_CV2).
| [in] | idx_var | - Table data column indices corresponding to look-up variables. |
| [out] | val_var | - The stored value of the variable to look up. |
| [in] | val_CV1 | - Value of controlling variable 1. |
| [in] | val_CV2 | - Value of controlling variable 2. |
| bool CLookUpTable::LookUp_XY | ( | const unsigned long | idx_var, |
| su2double * | val_var, | ||
| const su2double | val_CV1, | ||
| const su2double | val_CV2, | ||
| const unsigned long | i_level = 0 |
||
| ) |
Lookup value of variable stored under idx_var using controlling variable values(val_CV1,val_CV2).
| [in] | idx_var | - Column index corresponding to look-up data. |
| [out] | val_var | - The stored value of the variable to look up. |
| [in] | val_CV1 | - Value of controlling variable 1. |
| [in] | val_CV2 | - Value of controlling variable 2. |
| bool CLookUpTable::LookUp_XYZ | ( | const std::vector< unsigned long > & | idx_var, |
| std::vector< su2double * > & | val_vars, | ||
| const su2double | val_CV1, | ||
| const su2double | val_CV2, | ||
| const su2double | val_CV3 = 0 |
||
| ) |
Lookup the values of the variables stored under idx_var using controlling variable values (val_CV1,val_CV2,val_z).
| [in] | idx_var | - Table variable index to look up. |
| [out] | val_var | - The stored value of the variable to look up. |
| [in] | val_CV1 | - Value of controlling variable 1. |
| [in] | val_CV2 | - Value of controlling variable 2. |
| [in] | val_CV3 | - Value of controlling variable 3. |
| bool CLookUpTable::LookUp_XYZ | ( | const std::vector< unsigned long > & | idx_var, |
| std::vector< su2double > & | val_vars, | ||
| const su2double | val_CV1, | ||
| const su2double | val_CV2, | ||
| const su2double | val_CV3 = 0 |
||
| ) |
Lookup the values of the variables stored under idx_var using controlling variable values (val_CV1,val_CV2,val_z).
| [in] | idx_var | - Table variable index to look up. |
| [out] | val_var | - The stored value of the variable to look up. |
| [in] | val_CV1 | - Value of controlling variable 1. |
| [in] | val_CV2 | - Value of controlling variable 2. |
| [in] | val_CV3 | - Value of controlling variable 3. |
| bool CLookUpTable::LookUp_XYZ | ( | const unsigned long | idx_var, |
| su2double * | val_var, | ||
| const su2double | val_CV1, | ||
| const su2double | val_CV2, | ||
| const su2double | val_CV3 | ||
| ) |
Lookup the value of the variable stored under idx_var using controlling variable values(val_CV1,val_CV2, val_CV3).
| [in] | val_name_var | - String name of the variable to look up. |
| [out] | val_var | - The stored value of the variable to look up. |
| [in] | val_CV1 | - Value of controlling variable 1. |
| [in] | val_CV2 | - Value of controlling variable 2. |
| [in] | val_CV3 | - Value of controlling variable 3. |
|
inlineprotected |
Returns true if the string is null or zero (ignores case).
| void CLookUpTable::PrintTableInfo | ( | ) |
Print information to screen.
|
protected |
Edge information for each table level.
|
protected |
LUT file name.
The hull contains the boundary of the lookup table.
|
protected |
Table variable index of controlling variable 1.
|
protected |
Table variable index of controlling variable 2.
|
protected |
Variable index corresponding to NULL variable.
|
protected |
Vector of all the weight factors for the interpolation.
The lower and upper limits of the z, y and x variable for each table level.
|
protected |
Memory footprint of the loaded table data.
|
protected |
Number of outer boundary points per table level.
|
protected |
Number of data poins per table level.
|
protected |
|
protected |
Number of triangles per table level.
|
protected |
|
protected |
Name of controlling variable 1.
|
protected |
Name of controlling variable 2.
|
protected |
Holds the variable names stored in the table file. Order is in sync with data.
|
protected |
MPI Rank.
|
protected |
Holds all data stored in the table. First index addresses the variable while second index addresses the point.
|
protected |
Table dimension.
|
protected |
Trapezoidal map objects for the table levels.
Holds all connectivity data stored in the table for each level. First index addresses the variable while second index addresses the point.
|
protected |
LUT version as specified in LUT file.
|
protected |
Reader version (should be equal or above LUT version).
|
protected |
Constant z-values of each table level.