|
| 1 | +/*! |
| 2 | + * \file CFileReaderLUT.hpp |
| 3 | + * \brief reading lookup table for tabulated fluid properties |
| 4 | + * \author D. Mayer, T. Economon |
| 5 | + * \version 7.3.1 "Blackbird" |
| 6 | + * |
| 7 | + * SU2 Project Website: https://su2code.github.io |
| 8 | + * |
| 9 | + * The SU2 Project is maintained by the SU2 Foundation |
| 10 | + * (http://su2foundation.org) |
| 11 | + * |
| 12 | + * Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md) |
| 13 | + * |
| 14 | + * SU2 is free software; you can redistribute it and/or |
| 15 | + * modify it under the terms of the GNU Lesser General Public |
| 16 | + * License as published by the Free Software Foundation; either |
| 17 | + * version 2.1 of the License, or (at your option) any later version. |
| 18 | + * |
| 19 | + * SU2 is distributed in the hope that it will be useful, |
| 20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | + * Lesser General Public License for more details. |
| 23 | + * |
| 24 | + * You should have received a copy of the GNU Lesser General Public |
| 25 | + * License along with SU2. If not, see <http://www.gnu.org/licenses/>. |
| 26 | + */ |
| 27 | +#pragma once |
| 28 | + |
| 29 | +#include <fstream> |
| 30 | +#include <string> |
| 31 | +#include <vector> |
| 32 | + |
| 33 | +#include "../../Common/include/parallelization/mpi_structure.hpp" |
| 34 | +#include "../../../Common/include/linear_algebra/blas_structure.hpp" |
| 35 | +#include "../../../Common/include/toolboxes/CSquareMatrixCM.hpp" |
| 36 | + |
| 37 | +class CFileReaderLUT { |
| 38 | + protected: |
| 39 | + int rank; |
| 40 | + |
| 41 | + std::string version_lut; |
| 42 | + std::string version_reader; |
| 43 | + unsigned long n_points; |
| 44 | + unsigned long n_triangles; |
| 45 | + unsigned long n_hull_points; |
| 46 | + unsigned long n_variables; |
| 47 | + |
| 48 | + /*! \brief Holds the variable names stored in the table file. |
| 49 | + * Order is in sync with tableFlamelet. |
| 50 | + */ |
| 51 | + std::vector<std::string> names_var; |
| 52 | + |
| 53 | + /*! \brief Holds all data stored in the table. |
| 54 | + * First index addresses the variable while second index addresses the point. |
| 55 | + */ |
| 56 | + su2activematrix table_data; |
| 57 | + |
| 58 | + su2matrix<unsigned long> triangles; |
| 59 | + |
| 60 | + std::vector<unsigned long> hull; |
| 61 | + |
| 62 | + std::string SkipToFlag(std::ifstream* file_stream, const std::string& flag); |
| 63 | + |
| 64 | + public: |
| 65 | + CFileReaderLUT(){}; |
| 66 | + |
| 67 | + inline const std::string& GetVersionLUT() const { return version_lut; } |
| 68 | + inline const std::string& GetVersionReader() const { return version_reader; } |
| 69 | + inline unsigned long GetNPoints() const { return n_points; } |
| 70 | + inline unsigned long GetNTriangles() const { return n_triangles; } |
| 71 | + inline unsigned long GetNHullPoints() const { return n_hull_points; } |
| 72 | + inline unsigned long GetNVariables() const { return n_variables; } |
| 73 | + |
| 74 | + inline const std::vector<std::string>& GetNamesVar() const { return names_var; } |
| 75 | + |
| 76 | + inline const su2activematrix& GetTableData() const { return table_data; } |
| 77 | + |
| 78 | + inline const su2matrix<unsigned long>& GetTriangles() const { return triangles; }; |
| 79 | + |
| 80 | + inline const std::vector<unsigned long>& GetHull() const { return hull; }; |
| 81 | + |
| 82 | + void ReadRawDRG(const std::string& file_name); |
| 83 | +}; |
0 commit comments