Skip to content

Commit d6be66a

Browse files
committed
move inits of CGeometry and co. to declaration
1 parent 623152f commit d6be66a

16 files changed

Lines changed: 266 additions & 822 deletions

Common/include/fem/fem_geometry_structure.hpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ struct CBoundaryFEM {
442442
*/
443443
class CMeshFEM: public CGeometry {
444444
protected:
445-
unsigned long nVolElemTot; /*!< \brief Total number of local volume elements, including halos. */
446-
unsigned long nVolElemOwned; /*!< \brief Number of owned local volume elements. */
445+
unsigned long nVolElemTot{0}; /*!< \brief Total number of local volume elements, including halos. */
446+
unsigned long nVolElemOwned{0}; /*!< \brief Number of owned local volume elements. */
447447

448448
vector<unsigned long> nVolElemOwnedPerTimeLevel; /*!< \brief Number of owned local volume elements
449449
per time level. Cumulative storage. */
@@ -489,13 +489,13 @@ class CMeshFEM: public CGeometry {
489489
vector<CFEMStandardBoundaryFace> standardBoundaryFacesGrid; /*!< \brief Vector that contains the standard boundary
490490
faces used for the geometry of the DG solver. */
491491

492-
CBlasStructure *blasFunctions; /*!< \brief Pointer to the object to carry out the BLAS functionalities. */
492+
CBlasStructure *blasFunctions{nullptr}; /*!< \brief Pointer to the object to carry out the BLAS functionalities. */
493493

494494
public:
495495
/*!
496496
* \brief Constructor of the class.
497497
*/
498-
CMeshFEM(void) : CGeometry() { blasFunctions = nullptr; }
498+
CMeshFEM(void) : CGeometry() { }
499499

500500
/*!
501501
* \overload
@@ -1250,9 +1250,4 @@ class CDummyMeshFEM_DG : public CMeshFEM_DG {
12501250
*/
12511251
CDummyMeshFEM_DG(CConfig *config);
12521252

1253-
/*!
1254-
* \brief Destructor of the class.
1255-
*/
1256-
~CDummyMeshFEM_DG() override;
1257-
12581253
};

Common/include/geometry/CDummyGeometry.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,5 @@ class CDummyGeometry final : public CGeometry{
4545
*/
4646
CDummyGeometry(CConfig *config);
4747

48-
/*!
49-
* \brief Destructor of the class.
50-
*/
51-
~CDummyGeometry() override;
52-
5348
};
5449

Common/include/geometry/CGeometry.hpp

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

Common/include/geometry/CMultiGridGeometry.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ class CMultiGridGeometry final : public CGeometry {
5454
*/
5555
CMultiGridGeometry(CGeometry **geometry, CConfig *config_container, unsigned short iMesh);
5656

57-
/*!
58-
* \brief Destructor of the class.
59-
*/
60-
~CMultiGridGeometry(void) override;
61-
6257
/*!
6358
* \brief Determine if a CVPoint van be agglomerated, if it have the same marker point as the seed.
6459
* \param[in] CVPoint - Control volume to be agglomerated.

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -39,71 +39,71 @@
3939
class CPhysicalGeometry final : public CGeometry {
4040

4141
unordered_map<unsigned long, unsigned long>
42-
Global_to_Local_Point; /*!< \brief Global-local indexation for the points. */
43-
long *Local_to_Global_Point; /*!< \brief Local-global indexation for the points. */
44-
unsigned short *Local_to_Global_Marker; /*!< \brief Local to Global marker. */
45-
unsigned short *Global_to_Local_Marker; /*!< \brief Global to Local marker. */
46-
unsigned long *adj_counter; /*!< \brief Adjacency counter. */
47-
unsigned long **adjacent_elem; /*!< \brief Adjacency element list. */
48-
su2activematrix Sensitivity; /*!< \brief Matrix holding the sensitivities at each point. */
42+
Global_to_Local_Point; /*!< \brief Global-local indexation for the points. */
43+
long *Local_to_Global_Point{nullptr}; /*!< \brief Local-global indexation for the points. */
44+
unsigned short *Local_to_Global_Marker{nullptr}; /*!< \brief Local to Global marker. */
45+
unsigned short *Global_to_Local_Marker{nullptr}; /*!< \brief Global to Local marker. */
46+
unsigned long *adj_counter{nullptr}; /*!< \brief Adjacency counter. */
47+
unsigned long **adjacent_elem{nullptr}; /*!< \brief Adjacency element list. */
48+
su2activematrix Sensitivity; /*!< \brief Matrix holding the sensitivities at each point. */
4949

5050
vector<vector<unsigned long> > Neighbors;
5151
unordered_map<unsigned long, unsigned long> Color_List;
5252
vector<string> Marker_Tags;
53-
unsigned long nLocal_Point,
54-
nLocal_PointDomain,
55-
nLocal_PointGhost,
56-
nLocal_PointPeriodic,
57-
nLocal_Elem,
58-
nLocal_Bound_Elem,
59-
nGlobal_Elem,
60-
nGlobal_Bound_Elem,
61-
nLocal_Line,
62-
nLocal_BoundTria,
63-
nLocal_BoundQuad,
64-
nLinear_Line,
65-
nLinear_BoundTria,
66-
nLinear_BoundQuad,
67-
nLocal_Tria,
68-
nLocal_Quad,
69-
nLocal_Tetr,
70-
nLocal_Hexa,
71-
nLocal_Pris,
72-
nLocal_Pyra;
73-
unsigned long nMarker_Global;
74-
su2double *Local_Coords;
75-
unsigned long *Local_Points;
76-
unsigned long *Local_Colors;
77-
unsigned long *Conn_Line;
78-
unsigned long *Conn_BoundTria;
79-
unsigned long *Conn_BoundQuad;
80-
unsigned long *Conn_Line_Linear;
81-
unsigned long *Conn_BoundTria_Linear;
82-
unsigned long *Conn_BoundQuad_Linear;
83-
unsigned long *Conn_Tria;
84-
unsigned long *Conn_Quad;
85-
unsigned long *Conn_Tetr;
86-
unsigned long *Conn_Hexa;
87-
unsigned long *Conn_Pris;
88-
unsigned long *Conn_Pyra;
89-
unsigned long *ID_Line;
90-
unsigned long *ID_BoundTria;
91-
unsigned long *ID_BoundQuad;
92-
unsigned long *ID_Line_Linear;
93-
unsigned long *ID_BoundTria_Linear;
94-
unsigned long *ID_BoundQuad_Linear;
95-
unsigned long *ID_Tria;
96-
unsigned long *ID_Quad;
97-
unsigned long *ID_Tetr;
98-
unsigned long *ID_Hexa;
99-
unsigned long *ID_Pris;
100-
unsigned long *ID_Pyra;
101-
unsigned long *Elem_ID_Line;
102-
unsigned long *Elem_ID_BoundTria;
103-
unsigned long *Elem_ID_BoundQuad;
104-
unsigned long *Elem_ID_Line_Linear;
105-
unsigned long *Elem_ID_BoundTria_Linear;
106-
unsigned long *Elem_ID_BoundQuad_Linear;
53+
unsigned long nLocal_Point{0},
54+
nLocal_PointDomain{0},
55+
nLocal_PointGhost{0},
56+
nLocal_PointPeriodic{0},
57+
nLocal_Elem{0},
58+
nLocal_Bound_Elem{0},
59+
nGlobal_Elem{0},
60+
nGlobal_Bound_Elem{0},
61+
nLocal_Line{0},
62+
nLocal_BoundTria{0},
63+
nLocal_BoundQuad{0},
64+
nLinear_Line{0},
65+
nLinear_BoundTria{0},
66+
nLinear_BoundQuad{0},
67+
nLocal_Tria{0},
68+
nLocal_Quad{0},
69+
nLocal_Tetr{0},
70+
nLocal_Hexa{0},
71+
nLocal_Pris{0},
72+
nLocal_Pyra{0};
73+
unsigned long nMarker_Global{0};
74+
su2double *Local_Coords{nullptr};
75+
unsigned long *Local_Points{nullptr};
76+
unsigned long *Local_Colors{nullptr};
77+
unsigned long *Conn_Line{nullptr};
78+
unsigned long *Conn_BoundTria{nullptr};
79+
unsigned long *Conn_BoundQuad{nullptr};
80+
unsigned long *Conn_Line_Linear{nullptr};
81+
unsigned long *Conn_BoundTria_Linear{nullptr};
82+
unsigned long *Conn_BoundQuad_Linear{nullptr};
83+
unsigned long *Conn_Tria{nullptr};
84+
unsigned long *Conn_Quad{nullptr};
85+
unsigned long *Conn_Tetr{nullptr};
86+
unsigned long *Conn_Hexa{nullptr};
87+
unsigned long *Conn_Pris{nullptr};
88+
unsigned long *Conn_Pyra{nullptr};
89+
unsigned long *ID_Line{nullptr};
90+
unsigned long *ID_BoundTria{nullptr};
91+
unsigned long *ID_BoundQuad{nullptr};
92+
unsigned long *ID_Line_Linear{nullptr};
93+
unsigned long *ID_BoundTria_Linear{nullptr};
94+
unsigned long *ID_BoundQuad_Linear{nullptr};
95+
unsigned long *ID_Tria{nullptr};
96+
unsigned long *ID_Quad{nullptr};
97+
unsigned long *ID_Tetr{nullptr};
98+
unsigned long *ID_Hexa{nullptr};
99+
unsigned long *ID_Pris{nullptr};
100+
unsigned long *ID_Pyra{nullptr};
101+
unsigned long *Elem_ID_Line{nullptr};
102+
unsigned long *Elem_ID_BoundTria{nullptr};
103+
unsigned long *Elem_ID_BoundQuad{nullptr};
104+
unsigned long *Elem_ID_Line_Linear{nullptr};
105+
unsigned long *Elem_ID_BoundTria_Linear{nullptr};
106+
unsigned long *Elem_ID_BoundQuad_Linear{nullptr};
107107

108108
public:
109109
/*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/

Common/include/linear_algebra/CSysMatrix.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class CSysMatrix {
7878

7979
enum { OMP_MAX_SIZE_L = 8192 }; /*!< \brief Max. chunk size used in light parallel for loops. */
8080
enum { OMP_MAX_SIZE_H = 512 }; /*!< \brief Max. chunk size used in heavy parallel for loops. */
81+
enum { OMP_MIN_SIZE = 32 }; /*!< \brief Chunk size for finer grain operations. */
8182
unsigned long omp_light_size; /*!< \brief Actual chunk size used in light loops (e.g. over non zeros). */
8283
unsigned long omp_heavy_size; /*!< \brief Actual chunk size used in heavy loops (e.g. over rows). */
8384
unsigned long omp_num_parts; /*!< \brief Number of threads used in thread-parallel LU_SGS and ILU. */

Common/include/omp_structure.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ inline size_t computeStaticChunkSize(size_t totalWork,
161161
template<class T, class U>
162162
void parallelCopy(size_t size, const T* src, U* dst)
163163
{
164-
SU2_OMP_FOR_STAT(4096)
164+
SU2_OMP_FOR_STAT(2048)
165165
for(size_t i=0; i<size; ++i) dst[i] = src[i];
166166
}
167167

@@ -174,7 +174,7 @@ void parallelCopy(size_t size, const T* src, U* dst)
174174
template<class T, class U>
175175
void parallelSet(size_t size, T val, U* dst)
176176
{
177-
SU2_OMP_FOR_STAT(4096)
177+
SU2_OMP_FOR_STAT(2048)
178178
for(size_t i=0; i<size; ++i) dst[i] = val;
179179
}
180180

Common/src/fem/fem_geometry_structure.cpp

Lines changed: 3 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -6867,122 +6867,15 @@ void CMeshFEM_DG::InitStaticMeshMovement(CConfig *config,
68676867

68686868
CDummyMeshFEM_DG::CDummyMeshFEM_DG(CConfig *config): CMeshFEM_DG() {
68696869

6870-
size = SU2_MPI::GetSize();
6871-
rank = SU2_MPI::GetRank();
6872-
6873-
nEdge = 0;
6874-
nPoint = 0;
6875-
nPointDomain = 0;
6876-
nPointNode = 0;
6877-
nElem = 0;
6878-
nMarker = 0;
68796870
nZone = config->GetnZone();
68806871

6881-
nVolElemOwned = 0;
6882-
nVolElemTot = 0;
6872+
nPoint_P2PSend = new int[size] ();
6873+
nPoint_P2PRecv = new int[size] ();
68836874

6884-
nElem_Bound = nullptr;
6885-
Tag_to_Marker = nullptr;
6886-
elem = nullptr;
6887-
face = nullptr;
6888-
bound = nullptr;
6889-
nodes = nullptr;
6890-
edges = nullptr;
6891-
vertex = nullptr;
6892-
nVertex = nullptr;
6893-
newBound = nullptr;
6894-
nNewElem_Bound = nullptr;
6895-
Marker_All_SendRecv = nullptr;
6896-
6897-
XCoordList.clear();
6898-
Xcoord_plane.clear();
6899-
Ycoord_plane.clear();
6900-
Zcoord_plane.clear();
6901-
FaceArea_plane.clear();
6902-
Plane_points.clear();
6903-
6904-
/*--- Arrays for defining the linear partitioning ---*/
6905-
6906-
beg_node = nullptr;
6907-
end_node = nullptr;
6908-
6909-
nPointLinear = nullptr;
6910-
nPointCumulative = nullptr;
6911-
6912-
/*--- Containers for customized boundary conditions ---*/
6913-
6914-
CustomBoundaryHeatFlux = nullptr; //Customized heat flux wall
6915-
CustomBoundaryTemperature = nullptr; //Customized temperature wall
6916-
6917-
/*--- MPI point-to-point data structures ---*/
6918-
6919-
nP2PSend = 0;
6920-
nP2PRecv = 0;
6921-
6922-
maxCountPerPoint = 0;
6923-
6924-
bufD_P2PSend = nullptr;
6925-
bufD_P2PRecv = nullptr;
6926-
6927-
bufS_P2PSend = nullptr;
6928-
bufS_P2PRecv = nullptr;
6929-
6930-
req_P2PSend = nullptr;
6931-
req_P2PRecv = nullptr;
6932-
6933-
nPoint_P2PSend = new int[size];
6934-
nPoint_P2PRecv = new int[size];
6935-
6936-
Neighbors_P2PSend = nullptr;
6937-
Neighbors_P2PRecv = nullptr;
6938-
6939-
Local_Point_P2PSend = nullptr;
6940-
Local_Point_P2PRecv = nullptr;
6941-
6942-
/*--- MPI periodic data structures ---*/
6943-
6944-
nPeriodicSend = 0;
6945-
nPeriodicRecv = 0;
6946-
6947-
maxCountPerPeriodicPoint = 0;
6948-
6949-
bufD_PeriodicSend = nullptr;
6950-
bufD_PeriodicRecv = nullptr;
6951-
6952-
bufS_PeriodicSend = nullptr;
6953-
bufS_PeriodicRecv = nullptr;
6954-
6955-
req_PeriodicSend = nullptr;
6956-
req_PeriodicRecv = nullptr;
6957-
6958-
nPoint_PeriodicSend = nullptr;
6959-
nPoint_PeriodicRecv = nullptr;
6960-
6961-
Neighbors_PeriodicSend = nullptr;
6962-
Neighbors_PeriodicRecv = nullptr;
6963-
6964-
Local_Point_PeriodicSend = nullptr;
6965-
Local_Point_PeriodicRecv = nullptr;
6966-
6967-
Local_Marker_PeriodicSend = nullptr;
6968-
Local_Marker_PeriodicRecv = nullptr;
6969-
6970-
nVertex = new unsigned long[config->GetnMarker_All()];
6971-
6972-
for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++){
6973-
nVertex[iMarker] = 0;
6974-
}
6875+
nVertex = new unsigned long[config->GetnMarker_All()] ();
69756876

69766877
Tag_to_Marker = new string[config->GetnMarker_All()];
69776878

6978-
this->nDim = nDim;
6979-
6980-
6981-
for (unsigned short iRank = 0; iRank < size; iRank++){
6982-
nPoint_P2PRecv[iRank] = 0;
6983-
nPoint_P2PSend[iRank] = 0;
6984-
}
6985-
69866879
for (unsigned short i=0; i <= config->GetnLevels_TimeAccurateLTS(); i++){
69876880
nMatchingFacesWithHaloElem.push_back(0);
69886881
}
@@ -6992,5 +6885,3 @@ CDummyMeshFEM_DG::CDummyMeshFEM_DG(CConfig *config): CMeshFEM_DG() {
69926885
nDim = CConfig::GetnDim(config->GetMesh_FileName(), config->GetMesh_FileFormat());
69936886

69946887
}
6995-
6996-
CDummyMeshFEM_DG::~CDummyMeshFEM_DG(){}

Common/src/fem/geometry_structure_fem_part.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,7 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config,
508508
}
509509

510510
/*--- Allocate space for elements ---*/
511-
elem = new CPrimalGrid*[nElem];
512-
for (unsigned long i = 0; i < nElem; i++) elem[i] = nullptr;
511+
elem = new CPrimalGrid*[nElem] ();
513512

514513
/*--- Loop over all the elements and store the elements to be stored on
515514
this rank. Furthermore, determine the total amount of DOFs for
@@ -984,8 +983,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config,
984983
}
985984

986985
/*--- Allocate space for elements ---*/
987-
elem = new CPrimalGrid*[nElem];
988-
for(unsigned long i=0; i<nElem; ++i) elem[i] = NULL;
986+
elem = new CPrimalGrid*[nElem] ();
989987

990988
/*--- Loop over over the connectivities and read the elements to be stored on
991989
this rank. Furthermore, determine the local amount of DOFs for the

0 commit comments

Comments
 (0)