35#include "../../Common/include/option_structure.hpp"
115 inline bool noSource(
const std::string& name_var)
const {
116 if (name_var.compare(
"NULL") == 0 || name_var.compare(
"Null") == 0 || name_var.compare(
"null") == 0 ||
117 name_var.compare(
"ZERO") == 0 || name_var.compare(
"Zero") == 0 || name_var.compare(
"zero") == 0) {
128 inline const su2double*
GetDataP(
const std::string& name_var,
unsigned long i_level = 0)
const {
175 std::array<su2double, 3>& interp_coeffs)
const;
185 std::array<su2double, 3>& val_interp_coeffs);
209 std::vector<su2double>& lower_values, std::vector<su2double>& upper_values,
210 std::vector<su2double>& var_vals)
const;
228 const std::vector<std::string>&
names_var, std::vector<su2double*>& var_vals,
229 const unsigned long i_level = 0);
239 const std::vector<unsigned long>& idx_var, std::vector<su2double>& var_vals,
240 const unsigned long i_level = 0);
250 const std::vector<unsigned long>& idx_var, std::vector<su2double*>& var_vals,
251 const unsigned long i_level = 0);
261 su2double* var_val,
const unsigned long i_level = 0);
271 std::array<std::array<su2double, 2>, 2>
ComputeNormalizedXY(std::pair<unsigned long, unsigned long>& inclusion_levels,
284 const unsigned long iLevel = 0);
294 const unsigned long iLevel = 0);
313 const unsigned long i_level = 0);
323 bool LookUp_XY(
const std::vector<unsigned long>& idx_var, std::vector<su2double>& val_vars,
const su2double val_CV1,
324 const su2double val_CV2,
const unsigned long i_level = 0);
334 bool LookUp_XY(
const std::vector<unsigned long>& idx_var, std::vector<su2double*>& val_vars,
const su2double val_CV1,
335 su2double val_CV2,
const unsigned long i_level = 0);
353 bool LookUp_XYZ(
const std::vector<unsigned long>& idx_var, std::vector<su2double>& val_vars,
const su2double val_CV1,
363 bool LookUp_XYZ(
const std::vector<unsigned long>& idx_var, std::vector<su2double*>& val_vars,
const su2double val_CV1,
377 inline std::pair<su2double*, su2double*>
GetTableLimitsY(
const unsigned long i_level = 0)
const {
385 inline std::pair<su2double*, su2double*>
GetTableLimitsX(
const unsigned long i_level = 0)
const {
403 std::string error_msg =
"Variable '";
404 error_msg.append(nameVar);
405 error_msg.append(
"' is not in the lookup table.");
reading lookup table for tabulated fluid properties
Memory-efficient trapezoidal map for 2D lookup table queries, based on the LUT implementation of P....
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
static void Error(const std::string &ErrorMsg, const std::string &FunctionName)
Definition mpi_structure.cpp:131
Look up table.
Definition CLookUpTable.hpp:43
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).
Definition CLookUpTable.cpp:640
su2vector< unsigned long > n_points
Number of data poins per table level.
Definition CLookUpTable.hpp:57
su2vector< std::pair< su2double *, su2double * > > limits_table_x
Definition CLookUpTable.hpp:70
std::pair< su2double *, su2double * > GetTableLimitsY(const unsigned long i_level=0) const
Determine the minimum and maximum value of the second controlling variable.
Definition CLookUpTable.hpp:377
unsigned long n_table_levels
Definition CLookUpTable.hpp:61
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...
Definition CLookUpTable.cpp:516
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.
Definition CLookUpTable.cpp:399
su2vector< su2vector< std::vector< unsigned long > > > edge_to_triangle
Definition CLookUpTable.hpp:95
su2vector< su2matrix< unsigned long > > triangles
Holds all connectivity data stored in the table for each level. First index addresses the variable wh...
Definition CLookUpTable.hpp:89
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.
Definition CLookUpTable.cpp:607
su2vector< unsigned long > n_triangles
Number of triangles per table level.
Definition CLookUpTable.hpp:58
std::string name_CV1
Name of controlling variable 1.
Definition CLookUpTable.hpp:50
bool noSource(const std::string &name_var) const
Returns true if the string is null or zero (ignores case).
Definition CLookUpTable.hpp:115
unsigned int GetIndexOfVar(const std::string &nameVar) const
Returns the index to the variable in the lookup table.
Definition CLookUpTable.hpp:399
std::pair< su2double *, su2double * > GetTableLimitsX(const unsigned long i_level=0) const
Determine the minimum and maximum value of the first controlling variable.
Definition CLookUpTable.hpp:385
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.
Definition CLookUpTable.cpp:613
su2vector< CTrapezoidalMap > trap_map_x_y
Trapezoidal map objects for the table levels.
Definition CLookUpTable.hpp:105
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.
Definition CLookUpTable.cpp:375
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,...
std::vector< su2double > z_values_levels
Constant z-values of each table level.
Definition CLookUpTable.hpp:63
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.
Definition CLookUpTable.cpp:480
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,...
Definition CLookUpTable.cpp:424
unsigned long GetNullIndex() const
Returns the table variable index which will always return zero when looked up.
Definition CLookUpTable.hpp:414
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.
Definition CLookUpTable.cpp:740
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...
Definition CLookUpTable.cpp:156
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,...
std::string version_lut
LUT version as specified in LUT file.
Definition CLookUpTable.hpp:48
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.
Definition CLookUpTable.cpp:627
bool CheckForVariables(const std::vector< std::string > &vars_to_check) const
Check whether requested set of variables are included in the table.
Definition CLookUpTable.cpp:765
su2vector< std::pair< su2double *, su2double * > > limits_table_y
Definition CLookUpTable.hpp:70
void ComputeInterpCoeffs()
Compute vector of all (inverse) interpolation coefficients "interp_mat_inv_x_y" of all triangles.
Definition CLookUpTable.cpp:351
su2vector< std::vector< std::array< unsigned long, 2 > > > edges
Edge information for each table level.
Definition CLookUpTable.hpp:94
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,...
Definition CLookUpTable.hpp:128
std::string version_reader
Reader version (should be equal or above LUT version).
Definition CLookUpTable.hpp:49
int rank
MPI Rank.
Definition CLookUpTable.hpp:45
std::string file_name_lut
LUT file name.
Definition CLookUpTable.hpp:47
unsigned long idx_CV1
Table variable index of controlling variable 1.
Definition CLookUpTable.hpp:53
su2vector< su2vector< unsigned long > > hull
The hull contains the boundary of the lookup table.
Definition CLookUpTable.hpp:100
su2vector< su2vector< su2activematrix > > interp_mat_inv_x_y
Vector of all the weight factors for the interpolation.
Definition CLookUpTable.hpp:110
unsigned short table_dim
Table dimension.
Definition CLookUpTable.hpp:65
su2vector< unsigned long > n_hull_points
Number of outer boundary points per table level.
Definition CLookUpTable.hpp:59
unsigned long n_variables
Definition CLookUpTable.hpp:61
double memory_footprint_data
Memory footprint of the loaded table data.
Definition CLookUpTable.hpp:83
std::pair< su2double *, su2double * > limits_table_z
The lower and upper limits of the z, y and x variable for each table level.
Definition CLookUpTable.hpp:69
unsigned long idx_CV2
Table variable index of controlling variable 2.
Definition CLookUpTable.hpp:54
void LoadTableRaw(const std::string &file_name_lut)
Read the lookup table from file and store the data.
Definition CLookUpTable.cpp:112
su2vector< std::string > names_var
Holds the variable names stored in the table file. Order is in sync with data.
Definition CLookUpTable.hpp:75
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,...
Definition CLookUpTable.cpp:589
su2vector< su2activematrix > table_data
Holds all data stored in the table. First index addresses the variable while second index addresses t...
Definition CLookUpTable.hpp:81
void PrintTableInfo()
Print information to screen.
Definition CLookUpTable.cpp:173
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,...
Definition CLookUpTable.cpp:675
std::string name_CV2
Name of controlling variable 2.
Definition CLookUpTable.hpp:51
unsigned long idx_null
Variable index corresponding to NULL variable.
Definition CLookUpTable.hpp:55
void IdentifyUniqueEdges()
Construct a list of all the edges and a list of the pair of elements left and right of the edge.
Definition CLookUpTable.cpp:246
passivedouble su2double
Definition code_config.hpp:181
#define CURRENT_FUNCTION
Definition mpi_structure.hpp:59