Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructured the reading of the high order grids for the FEM solver #2440

Merged
merged 16 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ class CConfig {
nRefOriginMoment_Z; /*!< \brief Number of Z-coordinate moment computation origins. */
unsigned short nMesh_Box_Size;
short *Mesh_Box_Size; /*!< \brief Array containing the number of grid points in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */
unsigned short Mesh_Box_PSolFEM; /*!< \brief FEM polynomial degree of the solution for the RECTANGLE and BOX grid formats. */
string Mesh_FileName, /*!< \brief Mesh input file. */
Mesh_Out_FileName, /*!< \brief Mesh output file. */
Solution_FileName, /*!< \brief Flow solution input file. */
Expand Down Expand Up @@ -9606,6 +9607,12 @@ class CConfig {
*/
su2double GetMeshBoxOffset(unsigned short val_iDim) const { return mesh_box_offset[val_iDim]; }

/*!
* \brief Get the polynomial degree of the FEM solution for the analytic RECTANGLE or BOX.
* \return The polynomial degree of the FEM solution.
*/
unsigned short GetMeshBoxPSolFEM(void) const { return Mesh_Box_PSolFEM; }

/*!
* \brief Get the number of screen output variables requested (maximum 6)
*/
Expand Down
198 changes: 0 additions & 198 deletions Common/include/fem/fem_cgns_elements.hpp

This file was deleted.

3 changes: 0 additions & 3 deletions Common/include/fem/fem_geometry_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@

#include "../geometry/CGeometry.hpp"
#include "fem_standard_element.hpp"
#ifdef HAVE_CGNS
#include "fem_cgns_elements.hpp"
#endif
#include "../wall_model.hpp"
#include "../linear_algebra/blas_structure.hpp"

Expand Down
50 changes: 24 additions & 26 deletions Common/include/geometry/CPhysicalGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#pragma once

#include "CGeometry.hpp"
#include "meshreader/CMeshReaderFVM.hpp"
#include "meshreader/CMeshReaderBase.hpp"
#include "../containers/C2DContainer.hpp"

/*!
Expand Down Expand Up @@ -285,51 +285,49 @@ class CPhysicalGeometry final : public CGeometry {
* \param[in] val_iZone - Domain to be read from the grid file.
* \param[in] val_nZone - Total number of domains in the grid file.
*/
void Read_Mesh_FVM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone,
unsigned short val_nZone);
void Read_Mesh(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone);

/*!
* \brief Reads for the FEM solver the geometry of the grid and adjust the boundary
* conditions with the configuration file in parallel (for parmetis).
* \param[in] config - Definition of the particular problem.
* \param[in] val_mesh_filename - Name of the file with the grid information.
* \param[in] val_iZone - Domain to be read from the grid file.
* \param[in] val_nZone - Total number of domains in the grid file.
*/
void Read_SU2_Format_Parallel_FEM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone,
unsigned short val_nZone);

/*!
* \brief Reads for the FEM solver the geometry of the grid and adjust the boundary
* conditions with the configuration file in parallel (for parmetis).
* \param[in] config - Definition of the particular problem.
* \param[in] val_mesh_filename - Name of the file with the grid information.
* \param[in] val_iZone - Domain to be read from the grid file.
* \param[in] val_nZone - Total number of domains in the grid file.
* \brief Routine to load the CGNS grid points from a single zone into the proper SU2 data structures.
* \param[in] config - definition of the particular problem.
* \param[in] mesh - mesh reader object containing the current zone data.
*/
void Read_CGNS_Format_Parallel_FEM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone,
unsigned short val_nZone);
void LoadLinearlyPartitionedPoints(CConfig* config, CMeshReaderBase* mesh);

/*!
* \brief Routine to load the CGNS grid points from a single zone into the proper SU2 data structures.
* \brief Routine to load the grid points from a single zone into the proper SU2 data structures for the FEM solver.
* \param[in] config - definition of the particular problem.
* \param[in] mesh - mesh reader object containing the current zone data.
*/
void LoadLinearlyPartitionedPoints(CConfig* config, CMeshReaderFVM* mesh);
void LoadLinearlyPartitionedPointsFEM(CConfig* config, CMeshReaderBase* mesh);

/*!
* \brief Loads the interior volume elements from the mesh reader object into the primal element data structures.
* \param[in] config - definition of the particular problem.
* \param[in] mesh - mesh reader object containing the current zone data.
*/
void LoadLinearlyPartitionedVolumeElements(CConfig* config, CMeshReaderFVM* mesh);
void LoadLinearlyPartitionedVolumeElements(CConfig* config, CMeshReaderBase* mesh);

/*!
* \brief Loads the interior volume elements from the mesh reader object into the primal element data structures for
* the FEM solver. \param[in] config - definition of the particular problem. \param[in] mesh - mesh reader object
* containing the current zone data.
*/
void LoadLinearlyPartitionedVolumeElementsFEM(CConfig* config, CMeshReaderBase* mesh);

/*!
* \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures.
* \param[in] config - definition of the particular problem.
* \param[in] mesh - mesh reader object containing the current zone data.
*/
void LoadUnpartitionedSurfaceElements(CConfig* config, CMeshReaderFVM* mesh);
void LoadUnpartitionedSurfaceElements(CConfig* config, CMeshReaderBase* mesh);

/*!
* \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures
* for the FEM solver. \param[in] config - definition of the particular problem. \param[in] mesh - mesh reader
* object containing the current zone data.
*/
void LoadLinearlyPartitionedSurfaceElementsFEM(CConfig* config, CMeshReaderBase* mesh);

/*!
* \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph
Expand Down
82 changes: 82 additions & 0 deletions Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*!
* \file CBoxMeshReaderFEM.hpp
* \brief Header file for the class CBoxMeshReaderFEM.
* The implementations are in the <i>CBoxMeshReaderFEM.cpp</i> file.
* \author T. Economon
* \version 8.1.0 "Harrier"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2024, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "CMeshReaderBase.hpp"

/*!
* \class CBoxMeshReaderFEM
* \brief Reads a 3D box grid into linear partitions for the finite element solver (FEM).
* \author: T. Economon, E. van der Weide
*/
class CBoxMeshReaderFEM final : public CMeshReaderBase {
private:
unsigned long nNode; /*!< \brief Number of grid nodes in the x-direction. */
unsigned long mNode; /*!< \brief Number of grid nodes in the y-direction. */
unsigned long pNode; /*!< \brief Number of grid nodes in the z-direction. */

su2double Lx; /*!< \brief Length of the domain in the x-direction. */
su2double Ly; /*!< \brief Length of the domain in the y-direction. */
su2double Lz; /*!< \brief Length of the domain in the z-direction. */

su2double Ox; /*!< \brief Offset of the domain from 0.0 in the x-direction. */
su2double Oy; /*!< \brief Offset of the domain from 0.0 in the y-direction. */
su2double Oz; /*!< \brief Offset of the domain from 0.0 in the z-direction. */

unsigned short KindElem; /*!< \brief VTK identifier of the interior elements. */
unsigned short KindBound; /*!< \brief VTK identifier of the surface elements. */

unsigned short nPolySol; /*!< \brief Polynomial degree of the solution. */

/*!
* \brief Computes and stores the grid points based on an analytic definition of a box grid.
*/
void ComputeBoxPointCoordinates();

/*!
* \brief Computes and stores the volume element connectivity based on an analytic definition of a box grid.
*/
void ComputeBoxVolumeConnectivity();

/*!
* \brief Computes and stores the surface element connectivity based on an analytic definition of a box grid.
*/
void ComputeBoxSurfaceConnectivity();

public:
/*!
* \brief Constructor of the CBoxMeshReaderFEM class.
*/
CBoxMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone);

/*!
* \brief Destructor of the CBoxMeshReaderFEM class.
*/
~CBoxMeshReaderFEM(void) override;
};
Loading