@@ -42,27 +42,28 @@ class CFileReaderLUT {
4242 protected:
4343 int rank;
4444
45+ unsigned short table_dim = 2 ;
4546 std::string version_lut;
4647 std::string version_reader;
47- unsigned long n_points ;
48- unsigned long n_triangles;
49- unsigned long n_hull_points;
48+ unsigned long n_levels = 1 ;
49+ su2vector< unsigned long > n_points, n_triangles, n_hull_points ;
50+
5051 unsigned long n_variables;
52+ su2vector<su2double> table_levels;
5153
5254 /* ! \brief Holds the variable names stored in the table file.
5355 * Order is in sync with tableFlamelet.
5456 */
55- std::vector <std::string> names_var;
57+ su2vector <std::string> names_var;
5658
5759 /* ! \brief Holds all data stored in the table.
5860 * First index addresses the variable while second index addresses the point.
5961 */
60- su2activematrix table_data;
61-
62- su2matrix<unsigned long > triangles;
62+ su2vector<su2activematrix> table_data;
6363
64- std::vector< unsigned long > hull ;
64+ su2vector<su2matrix< unsigned long >> triangles ;
6565
66+ su2vector<su2vector<unsigned long >> hull;
6667 /* ! \brief Searches for the position of flag in file_stream and
6768 * sets the stream position of file_stream to that position.
6869 */
@@ -78,22 +79,74 @@ class CFileReaderLUT {
7879 bool GetStrippedLine (std::ifstream& file_stream, std::string& line) const ;
7980
8081 public:
81- CFileReaderLUT (){};
82-
82+ /* ! \brief Get table version as listed in input file.
83+ */
8384 inline const std::string& GetVersionLUT () const { return version_lut; }
85+
86+ /* ! \brief Get table reader version.
87+ */
8488 inline const std::string& GetVersionReader () const { return version_reader; }
85- inline unsigned long GetNPoints () const { return n_points; }
86- inline unsigned long GetNTriangles () const { return n_triangles; }
87- inline unsigned long GetNHullPoints () const { return n_hull_points; }
89+
90+ /* ! \brief Get number of data points at specific table level.
91+ * \param[in] i_level - table level index.
92+ * \returns data point count at table level.
93+ */
94+ inline unsigned long GetNPoints (std::size_t i_level = 0 ) const { return n_points[i_level]; }
95+
96+ /* ! \brief Get number of triangles at specific table level.
97+ * \param[in] i_level - table level index.
98+ * \returns triangle count at table level.
99+ */
100+ inline unsigned long GetNTriangles (std::size_t i_level = 0 ) const { return n_triangles[i_level]; }
101+
102+ /* ! \brief Get number of hull points at specific table level.
103+ * \param[in] i_level - table level index.
104+ * \returns hull point count at table level.
105+ */
106+ inline unsigned long GetNHullPoints (std::size_t i_level = 0 ) const { return n_hull_points[i_level]; }
107+
108+ /* ! \brief Get number of variables for which data is stored in the table
109+ */
88110 inline unsigned long GetNVariables () const { return n_variables; }
89111
90- inline const std::vector<std::string>& GetNamesVar () const { return names_var; }
112+ /* ! \brief Get number of table levels.
113+ */
114+ inline unsigned long GetNLevels () const { return n_levels; }
115+
116+ /* ! \brief Get variable names for which data is stored in the table
117+ */
118+ inline const su2vector<std::string>& GetNamesVar () const { return names_var; }
119+
120+ /* ! \brief Get table data at a specific level.
121+ * \param[in] i_level - table level index.
122+ * \returns table data
123+ */
124+ inline const su2activematrix& GetTableData (std::size_t i_level = 0 ) const { return table_data[i_level]; }
125+
126+ /* ! \brief Get table connectivity at a specific level.
127+ * \param[in] i_level - table level index.
128+ * \returns data connectivity
129+ */
130+ inline const su2matrix<unsigned long >& GetTriangles (std::size_t i_level = 0 ) const { return triangles[i_level]; }
91131
92- inline const su2activematrix& GetTableData () const { return table_data; }
132+ /* ! \brief Get hull node information at a specific table level.
133+ * \param[in] i_level - table level index.
134+ * \returns hull node indices.
135+ */
136+ inline const su2vector<unsigned long >& GetHull (std::size_t i_level = 0 ) const { return hull[i_level]; }
93137
94- inline const su2matrix<unsigned long >& GetTriangles () const { return triangles; };
138+ /* ! \brief Get table level value.
139+ * \param[in] i_level - table level index.
140+ * \returns value of the third controlling variable at table level.
141+ */
142+ inline su2double GetTableLevel (std::size_t i_level) const { return table_levels[i_level]; }
95143
96- inline const std::vector<unsigned long >& GetHull () const { return hull; };
144+ /* ! \brief Get table dimension
145+ */
146+ inline unsigned short GetTableDim () const { return table_dim; }
97147
148+ /* ! \brief Read LUT file and store information
149+ * \param[in] file_name - LUT input file name.
150+ */
98151 void ReadRawLUT (const std::string& file_name);
99152};
0 commit comments