Documentation 6b54b78464
Loading...
Searching...
No Matches
CSU2ASCIIMeshReaderBase.hpp
Go to the documentation of this file.
1/*!
2 * \file CSU2ASCIIMeshReaderBase.hpp
3 * \brief Header file for the class CSU2ASCIIMeshReaderBase.
4 * The implementations are in the <i>CSU2ASCIIMeshReaderBase.cpp</i> file.
5 * \author T. Economon
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include <array>
32
34
35/*!
36 * \class CSU2ASCIIMeshReaderBase
37 * \brief Base class for the reading of a native SU2 ASCII grid.
38 * \author T. Economon
39 */
41 protected:
42 enum class FileSection { POINTS, ELEMENTS, MARKERS }; /*!< \brief Different sections of the file. */
43 std::array<FileSection, 3> SectionOrder{}; /*!< \brief Order of the sections in the file. */
44
45 ifstream mesh_file; /*!< \brief File object for the SU2 ASCII mesh file. */
46
47 /*!
48 * \brief Reads all SU2 ASCII mesh metadata and checks for errors.
49 * \param[in] single_pass - Try to read the contents together with the metadata if the order allows (points before
50 * elements). \param[in,out] config - Problem configuration where some metadata is updated (e.g. AoA). \returns True
51 * if single_pass was successful.
52 */
53 bool ReadMetadata(bool single_pass, CConfig* config);
54
55 /*!
56 * \brief Reads the grid points from an SU2 zone into linear partitions across all ranks.
57 */
58 virtual void ReadPointCoordinates(bool single_pass = false);
59
60 /*!
61 * \brief Reads the interior volume elements from one section of an SU2 zone into linear partitions across all ranks.
62 */
63 virtual void ReadVolumeElementConnectivity(bool single_pass = false);
64
65 /*!
66 * \brief Reads the surface (boundary) elements from the SU2 zone.
67 */
68 virtual void ReadSurfaceElementConnectivity(bool single_pass = false);
69
70 /*!
71 * \brief Helper function to find the current zone in an SU2 ASCII mesh object.
72 */
74
75 public:
76 /*!
77 * \brief Constructor of the CSU2ASCIIMeshReaderBase class.
78 */
79 CSU2ASCIIMeshReaderBase(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone);
80
81 /*!
82 * \brief Destructor of the CSU2ASCIIMeshReaderBase class.
83 */
84 virtual ~CSU2ASCIIMeshReaderBase(void) override;
85};
Header file for the class CSU2MeshReaderBase. The implementations are in the CSU2MeshReaderBase....
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
const CConfig * config
Local pointer to the config parameter object.
Definition CMeshReaderBase.hpp:49
Base class for the reading of a native SU2 ASCII grid.
Definition CSU2ASCIIMeshReaderBase.hpp:40
FileSection
Definition CSU2ASCIIMeshReaderBase.hpp:42
ifstream mesh_file
File object for the SU2 ASCII mesh file.
Definition CSU2ASCIIMeshReaderBase.hpp:45
virtual void ReadVolumeElementConnectivity(bool single_pass=false)
Reads the interior volume elements from one section of an SU2 zone into linear partitions across all ...
Definition CSU2ASCIIMeshReaderBase.cpp:293
virtual ~CSU2ASCIIMeshReaderBase(void) override
Destructor of the CSU2ASCIIMeshReaderBase class.
bool ReadMetadata(bool single_pass, CConfig *config)
Reads all SU2 ASCII mesh metadata and checks for errors.
Definition CSU2ASCIIMeshReaderBase.cpp:37
void FastForwardToMyZone()
Helper function to find the current zone in an SU2 ASCII mesh object.
Definition CSU2ASCIIMeshReaderBase.cpp:503
std::array< FileSection, 3 > SectionOrder
Order of the sections in the file.
Definition CSU2ASCIIMeshReaderBase.hpp:43
virtual void ReadPointCoordinates(bool single_pass=false)
Reads the grid points from an SU2 zone into linear partitions across all ranks.
Definition CSU2ASCIIMeshReaderBase.cpp:224
virtual void ReadSurfaceElementConnectivity(bool single_pass=false)
Reads the surface (boundary) elements from the SU2 zone.
Definition CSU2ASCIIMeshReaderBase.cpp:375
Base class for the reading of a native SU2 grid.
Definition CSU2MeshReaderBase.hpp:40