Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Common/include/CMultiGridQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <vector>

#include "mpi_structure.hpp"
#include "geometry_structure.hpp"
#include "geometry/CGeometry.hpp"

using namespace std;

Expand Down
14 changes: 9 additions & 5 deletions Common/include/fem_geometry_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@

#pragma once

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

Expand Down Expand Up @@ -1042,9 +1046,9 @@ class CMeshFEM_DG: public CMeshFEM {

/*!
* \brief Retrieve total number of nodes in a simulation across all processors (excluding halos).
* \returns Total number of nodes in a simulation across all processors (excluding halos).
* \return Total number of nodes in a simulation across all processors (excluding halos).
*/
unsigned long GetGlobal_nPointDomain();
unsigned long GetGlobal_nPointDomain() const override;

/*!
* \brief Set the local index that correspond with the global numbering index.
Expand All @@ -1054,9 +1058,9 @@ class CMeshFEM_DG: public CMeshFEM {
/*!
* \brief Get the local index that correspond with the global numbering index.
* \param[in] val_ipoint - Global point.
* \returns Local index that correspond with the global index, -1 if not found on the current rank.
* \return Local index that correspond with the global index, -1 if not found on the current rank.
*/
long GetGlobal_to_Local_Point(unsigned long val_ipoint);
long GetGlobal_to_Local_Point(unsigned long val_ipoint) const override;

/*!
* \brief Function, which carries out the preprocessing tasks
Expand Down
14 changes: 6 additions & 8 deletions Common/include/fem_geometry_structure.inl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ inline CMeshFEM_DG::~CMeshFEM_DG(void) { }

inline void CMeshFEM_DG::SetGlobal_nPointDomain(unsigned long val_global_npoint) { Global_nPointDomain = val_global_npoint; }

inline unsigned long CMeshFEM_DG::GetGlobal_nPointDomain(void) { return Global_nPointDomain; }
inline unsigned long CMeshFEM_DG::GetGlobal_nPointDomain(void) const { return Global_nPointDomain; }

inline void CMeshFEM_DG::SetGlobal_to_Local_Point(void) {
Global_to_Local_Point.clear();
Expand All @@ -158,13 +158,11 @@ inline void CMeshFEM_DG::SetGlobal_to_Local_Point(void) {
}
}

inline long CMeshFEM_DG::GetGlobal_to_Local_Point(unsigned long val_ipoint) {
map<unsigned long, unsigned long>::const_iterator MI = Global_to_Local_Point.find(val_ipoint);
if (MI != Global_to_Local_Point.end()) {
return Global_to_Local_Point[val_ipoint];
} else {
return -1;
}
inline long CMeshFEM_DG::GetGlobal_to_Local_Point(unsigned long val_ipoint) const {
auto it = Global_to_Local_Point.find(val_ipoint);
if (it != Global_to_Local_Point.cend())
return it->second;
return -1;
}

inline su2double* CMeshFEM_DG::GetTimeCoefADER_DG(void) {return timeCoefADER_DG.data();}
Expand Down
54 changes: 54 additions & 0 deletions Common/include/geometry/CDummyGeometry.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*!
* \file CDummyGeometry.hpp
* \brief Headers of the dummy geometry class used in "dry run" mode.
* \author T. Albring
* \version 7.0.0 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2019, 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 "CGeometry.hpp"

/*!
* \class CDummyGeometry
* \brief Class for defining a geometry that does not contain any points/elements.
* Can be used for initializing other classes that depend on the geometry without
* going through the time-consuming mesh initialization and paritioning.
* \author T. Albring
*/
class CDummyGeometry final : public CGeometry{

public:
/*!
* \brief Constructor of the class
* \param[in] config - Definition of the particular problem.
*/
CDummyGeometry(CConfig *config);

/*!
* \brief Destructor of the class.
*/
~CDummyGeometry();

};

1,545 changes: 1,545 additions & 0 deletions Common/include/geometry/CGeometry.hpp

Large diffs are not rendered by default.

173 changes: 173 additions & 0 deletions Common/include/geometry/CMultiGridGeometry.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/*!
* \file CMultiGridGeometry.hpp
* \brief Headers of the multigrid geometry class.
* \author F. Palacios, T. Economon
* \version 7.0.0 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2019, 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 "CGeometry.hpp"

/*!
* \class CMultiGridGeometry
* \brief Class for defining the multigrid geometry, the main delicated part is the
* agglomeration stage, which is done in the declaration.
* \author F. Palacios
*/
class CMultiGridGeometry final : public CGeometry {

public:
/*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/
using CGeometry::SetVertex;
using CGeometry::SetMeshFile;
using CGeometry::SetControlVolume;
using CGeometry::SetBoundControlVolume;
using CGeometry::SetPoint_Connectivity;

/*!
* \brief Constructor of the class.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
* \param[in] iMesh - Level of the multigrid.
* \param[in] iZone - Current zone in the mesh.
*/
CMultiGridGeometry(CGeometry **geometry, CConfig *config_container, unsigned short iMesh);

/*!
* \brief Destructor of the class.
*/
~CMultiGridGeometry(void);

/*!
* \brief Determine if a CVPoint van be agglomerated, if it have the same marker point as the seed.
* \param[in] CVPoint - Control volume to be agglomerated.
* \param[in] marker_seed - Marker of the seed.
* \param[in] fine_grid - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
* \return <code>TRUE</code> or <code>FALSE</code> depending if the control volume can be agglomerated.
*/
bool SetBoundAgglomeration(unsigned long CVPoint, short marker_seed, CGeometry *fine_grid, CConfig *config);

/*!
* \brief Determine if a can be agglomerated using geometrical criteria.
* \param[in] iPoint - Seed point.
* \param[in] fine_grid - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
*/
bool GeometricalCheck(unsigned long iPoint, CGeometry *fine_grid, CConfig *config);

/*!
* \brief Determine if a CVPoint van be agglomerated, if it have the same marker point as the seed.
* \param[in] Suitable_Indirect_Neighbors - List of Indirect Neighbours that can be agglomerated.
* \param[in] iPoint - Seed point.
* \param[in] Index_CoarseCV - Index of agglomerated point.
* \param[in] fine_grid - Geometrical definition of the problem.
*/
void SetSuitableNeighbors(vector<unsigned long> *Suitable_Indirect_Neighbors, unsigned long iPoint,
unsigned long Index_CoarseCV, CGeometry *fine_grid);

/*!
* \brief Set boundary vertex.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
*/
void SetVertex(CGeometry *geometry, CConfig *config) override;

/*!
* \brief Set points which surround a point.
* \param[in] geometry - Geometrical definition of the problem.
*/
void SetPoint_Connectivity(CGeometry *geometry) override;

/*!
* \brief Set the edge structure of the agglomerated control volume.
* \param[in] config - Definition of the particular problem.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] action - Allocate or not the new elements.
*/
void SetControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) override;

/*!
* \brief Mach the near field boundary condition.
* \param[in] config - Definition of the particular problem.
*/
void MatchNearField(CConfig *config) override;

/*!
* \brief Mach the near field boundary condition.
* \param[in] config - Definition of the particular problem.
*/
void MatchActuator_Disk(CConfig *config) override;

/*!
* \brief Mach the periodic boundary conditions.
* \param[in] config - Definition of the particular problem.
* \param[in] val_periodic - Index of the first periodic face in a pair.
*/
void MatchPeriodic(CConfig *config, unsigned short val_periodic) override;

/*!
* \brief Set boundary vertex structure of the agglomerated control volume.
* \param[in] config - Definition of the particular problem.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] action - Allocate or not the new elements.
*/
void SetBoundControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) override;

/*!
* \brief Set a representative coordinates of the agglomerated control volume.
* \param[in] geometry - Geometrical definition of the problem.
*/
void SetCoord(CGeometry *geometry) override;

/*!
* \brief Set a representative wall normal heat flux of the agglomerated control volume on a particular boundary marker.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] val_marker - Index of the boundary marker.
*/
void SetMultiGridWallHeatFlux(CGeometry *geometry, unsigned short val_marker) override;

/*!
* \brief Set a representative wall temperature of the agglomerated control volume on a particular boundary marker.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] val_marker - Index of the boundary marker.
*/
void SetMultiGridWallTemperature(CGeometry *geometry, unsigned short val_marker) override;

/*!
* \brief Set the grid velocity at each node in the coarse mesh level based
* on a restriction from a finer mesh.
* \param[in] fine_mesh - Geometry container for the finer mesh level.
* \param[in] config - Definition of the particular problem.
*/
void SetRestricted_GridVelocity(CGeometry *fine_mesh, CConfig *config) override;

/*!
* \brief Find and store the closest neighbor to a vertex.
* \param[in] config - Definition of the particular problem.
*/
void FindNormal_Neighbor(CConfig *config) override;

};

Loading