Skip to content

Commit 9c16769

Browse files
committed
Split the function SetColorFEMGrid_Parallel in several smaller functions to improve readability
1 parent 5271d3e commit 9c16769

File tree

3 files changed

+550
-421
lines changed

3 files changed

+550
-421
lines changed

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,35 @@ class CPhysicalGeometry final : public CGeometry {
499499
*/
500500
void SetColorFEMGrid_Parallel(CConfig* config) override;
501501

502+
/*!
503+
* \brief Determine the donor elements for the boundary elements on viscous
504+
wall boundaries when wall functions are used.
505+
* \param[in] config - Definition of the particular problem.
506+
*/
507+
void DetermineDonorElementsWallFunctions(CConfig* config);
508+
509+
#ifdef HAVE_MPI
510+
#ifdef HAVE_PARMETIS
511+
/*!
512+
* \brief Function, which converts the input the format for ParMETIS and calls
513+
* ParMETIS to determine the actual colors of the elements.
514+
* \param[in] adjacency - Adjacency information of the elements.
515+
* \param[in] vwgt - Weights of the vertices of the graph, which are the elements.
516+
* \param[in] adjwgt - Weights of the adjacencies of the graph.
517+
*/
518+
void DetermineFEMColorsViaParMETIS(vector<vector<unsigned long> > &adjacency,
519+
vector<passivedouble> &vwgt,
520+
vector<vector<passivedouble> > &adjwgt);
521+
#endif
522+
#endif
523+
524+
/*!
525+
* \brief Determine whether or not the Jacobians of the elements and faces
526+
are constant and a length scale of the elements.
527+
* \param[in] config - Definition of the particular problem.
528+
*/
529+
void DetermineFEMConstantJacobiansAndLenScale(CConfig* config);
530+
502531
/*!
503532
* \brief Compute the weights of the FEM graph for ParMETIS.
504533
* \param[in] config - Definition of the particular problem.
@@ -509,24 +538,44 @@ class CPhysicalGeometry final : public CGeometry {
509538
* \param[out] vwgt - Weights of the vertices of the graph, i.e. the elements.
510539
* \param[out] adjwgt - Weights of the edges of the graph.
511540
*/
512-
void ComputeFEMGraphWeights(CConfig* config, const vector<CFaceOfElement>& localFaces,
513-
const vector<vector<unsigned long> >& adjacency,
514-
const map<unsigned long, CUnsignedShort2T>& mapExternalElemIDToTimeLevel,
515-
vector<su2double>& vwgt, vector<vector<su2double> >& adjwgt);
541+
void DetermineFEMGraphWeights(CConfig* config, const vector<CFaceOfElement>& localFaces,
542+
const vector<vector<unsigned long> >& adjacency,
543+
const map<unsigned long, CUnsignedShort2T>& mapExternalElemIDToTimeLevel,
544+
vector<passivedouble>& vwgt, vector<vector<passivedouble> >& adjwgt);
516545

517546
/*!
518-
* \brief Determine the donor elements for the boundary elements on viscous
519-
wall boundaries when wall functions are used.
520-
* \param[in] config - Definition of the particular problem.
547+
* \brief Function, which determines the adjacency information of the graph
548+
* representation of the grid.
549+
* \param[in] localFaces - Vector containing the local matching faces of the FEM grid.
550+
* \param[out] adjacency - Vector of vectors to store the adjacency.
521551
*/
522-
void DetermineDonorElementsWallFunctions(CConfig* config);
552+
void DetermineGraphAdjacency(const vector<CFaceOfElement>& localFaces,
553+
vector<vector<unsigned long> >& adjacency);
523554

524555
/*!
525-
* \brief Determine whether or not the Jacobians of the elements and faces
526-
are constant and a length scale of the elements.
527-
* \param[in] config - Definition of the particular problem.
556+
* \brief Function, which determines the matching faces of a FEM grid.
557+
* \param[in] config - Definition of the particular problem.
558+
* \param[out] localFaces - Vector containing the local faces of the FEM grid.
559+
* On output the matching faces are stored as one face.
528560
*/
529-
void DetermineFEMConstantJacobiansAndLenScale(CConfig* config);
561+
void DetermineMatchingFacesFEMGrid(const CConfig* config, vector<CFaceOfElement>& localFaces);
562+
563+
/*!
564+
* \brief Function, which determines the non-matching faces of a FEM grid.
565+
* \param[in] config - Definition of the particular problem.
566+
* \param[in,out] localMatchingFaces - Vector containing the local faces of the FEM grid.
567+
* On output the non-matching faces are removed.
568+
*/
569+
void DetermineNonMatchingFacesFEMGrid(const CConfig* config, vector<CFaceOfElement>& localMatchingFaces);
570+
571+
/*!
572+
* \brief Function, which determines the owner of the internal faces, i.e. which element
573+
* is responsible for computing the fluxes through the face.
574+
* \param[in] localFaces - Vector, which contains the element faces of this rank.
575+
* \param[out] mapExternalElemIDToTimeLevel - Map from the external element ID's to their time level and number of DOFs.
576+
*/
577+
void DetermineOwnershipInternalFaces(vector<CFaceOfElement> &localFaces,
578+
map<unsigned long, CUnsignedShort2T> &mapExternalElemIDToTimeLevel);
530579

531580
/*!
532581
* \brief Determine the neighboring information for periodic faces of a FEM grid.
@@ -545,6 +594,13 @@ class CPhysicalGeometry final : public CGeometry {
545594
void DetermineTimeLevelElements(CConfig* config, const vector<CFaceOfElement>& localFaces,
546595
map<unsigned long, CUnsignedShort2T>& mapExternalElemIDToTimeLevel);
547596

597+
/*!
598+
* \brief Function, which stores the information of the local matching faces in the
599+
* data structures of the local elements.
600+
* \param[in] localFaces - Vector, which contains the internal matching faces of this rank.
601+
*/
602+
void StoreFaceInfoInLocalElements(const vector<CFaceOfElement> &localFaces);
603+
548604
/*!
549605
* \brief Compute 3 grid quality metrics: orthogonality angle, dual cell aspect ratio, and dual cell volume ratio.
550606
* \param[in] config - Definition of the particular problem.

Common/include/toolboxes/fem/CReorderElements.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#pragma once
3030

31-
3231
#include <iostream>
3332

3433
using namespace std;

0 commit comments

Comments
 (0)