Skip to content

Commit 1740007

Browse files
committed
Fix conflicts and merge with develop.
2 parents 3b03170 + a2da75e commit 1740007

42 files changed

Lines changed: 5347 additions & 10252 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/include/CConfig.hpp

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ class CConfig {
398398
unsigned long OuterIter; /*!< \brief Current Outer iterations for multizone problems. */
399399
unsigned long InnerIter; /*!< \brief Current inner iterations for multizone problems. */
400400
unsigned long TimeIter; /*!< \brief Current time iterations for multizone problems. */
401-
unsigned long Unst_nIntIter; /*!< \brief Number of internal iterations (Dual time Method). */
402401
long Unst_RestartIter; /*!< \brief Iteration number to restart an unsteady simulation (Dual time Method). */
403402
long Unst_AdjointIter; /*!< \brief Iteration number to begin the reverse time integration in the direct solver for the unsteady adjoint. */
404403
long Iter_Avg_Objective; /*!< \brief Iteration the number of time steps to be averaged, counting from the back */
@@ -733,7 +732,6 @@ class CConfig {
733732
RefElemLength, /*!< \brief Reference element length for computing the slope limiting epsilon. */
734733
RefSharpEdges, /*!< \brief Reference coefficient for detecting sharp edges. */
735734
RefLength, /*!< \brief Reference length for moment computation. */
736-
*RefOriginMoment, /*!< \brief Origin for moment computation. */
737735
*RefOriginMoment_X, /*!< \brief X Origin for moment computation. */
738736
*RefOriginMoment_Y, /*!< \brief Y Origin for moment computation. */
739737
*RefOriginMoment_Z, /*!< \brief Z Origin for moment computation. */
@@ -1376,7 +1374,8 @@ class CConfig {
13761374
* \param[in] val_marker - the marker we are monitoring.
13771375
* \return Reference origin (in cartesians coordinates) for moment computation.
13781376
*/
1379-
su2double *GetRefOriginMoment(unsigned short val_marker) {
1377+
std::array<su2double,3> GetRefOriginMoment(unsigned short val_marker) const {
1378+
std::array<su2double,3> RefOriginMoment{{0.0}};
13801379
if(val_marker < nMarker_Monitoring) {
13811380
RefOriginMoment[0] = RefOriginMoment_X[val_marker];
13821381
RefOriginMoment[1] = RefOriginMoment_Y[val_marker];
@@ -2949,12 +2948,6 @@ class CConfig {
29492948
*/
29502949
void SetnMarker_All(unsigned short val_nmarker) { nMarker_All = val_nmarker; }
29512950

2952-
/*!
2953-
* \brief Get the number of internal iterations.
2954-
* \return Number of internal iterations.
2955-
*/
2956-
unsigned long GetUnst_nIntIter(void) const { return Unst_nIntIter; }
2957-
29582951
/*!
29592952
* \brief Get the starting direct iteration number for the unsteady adjoint (reverse time integration).
29602953
* \return Starting direct iteration number for the unsteady adjoint.
@@ -5405,20 +5398,14 @@ class CConfig {
54055398
*/
54065399
string GetVolume_FileName(void) const { return Volume_FileName; }
54075400

5408-
/*!
5409-
* \brief Get the name of the restart file for the heat variables.
5410-
* \return Name of the restart file for the flow variables.
5411-
*/
5412-
string GetRestart_HeatFileName(void);
5413-
54145401
/*!
54155402
* \brief Add any numbers necessary to the filename (iteration number, zone ID ...)
54165403
* \param[in] config - Definition of the particular problem.
54175404
* \param[in] filename - the base filename.
54185405
* \param[in] ext - the extension to be added.
54195406
* \return The new filename
54205407
*/
5421-
string GetFilename(string filename, string ext, unsigned long Iter);
5408+
string GetFilename(string filename, string ext, unsigned long Iter) const;
54225409

54235410
/*!
54245411
* \brief Append the zone index to the restart or the solution files.
@@ -5436,13 +5423,13 @@ class CConfig {
54365423
* \brief Append the instance index to the restart or the solution files.
54375424
* \return Name of the restart file for the flow variables.
54385425
*/
5439-
string GetMultiInstance_FileName(string val_filename, int val_iInst, string ext);
5426+
string GetMultiInstance_FileName(string val_filename, int val_iInst, string ext) const;
54405427

54415428
/*!
54425429
* \brief Append the instance index to the restart or the solution files.
54435430
* \return Name of the restart file for the flow variables.
54445431
*/
5445-
string GetMultiInstance_HistoryFileName(string val_filename, int val_iInst);
5432+
string GetMultiInstance_HistoryFileName(string val_filename, int val_iInst) const;
54465433

54475434
/*!
54485435
* \brief Get the name of the restart file for the flow variables.
@@ -5511,7 +5498,7 @@ class CConfig {
55115498
* \param[in] val_filename - String value of the base filename.
55125499
* \return Name of the file with the appropriate objective function extension.
55135500
*/
5514-
string GetObjFunc_Extension(string val_filename);
5501+
string GetObjFunc_Extension(string val_filename) const;
55155502

55165503
/*!
55175504
* \brief Get the criteria for structural residual (relative/absolute).
@@ -6583,7 +6570,7 @@ class CConfig {
65836570
* \param[in] val_index - Index corresponding to the inlet boundary.
65846571
* \return The flow direction vector.
65856572
*/
6586-
su2double* GetInlet_FlowDir(string val_index);
6573+
const su2double* GetInlet_FlowDir(string val_index) const;
65876574

65886575
/*!
65896576
* \brief Get the back pressure (static) at an outlet boundary.
@@ -8391,14 +8378,14 @@ class CConfig {
83918378
* \brief Start the timer for profiling subroutines.
83928379
* \param[in] val_start_time - the value of the start time.
83938380
*/
8394-
void GEMM_Tick(double *val_start_time);
8381+
void GEMM_Tick(double *val_start_time) const;
83958382

83968383
/*!
83978384
* \brief Stop the timer for the GEMM profiling and store results.
83988385
* \param[in] val_start_time - The value of the start time.
83998386
* \param[in] M, N, K - Matrix size of the GEMM call.
84008387
*/
8401-
void GEMM_Tock(double val_start_time, int M, int N, int K);
8388+
void GEMM_Tock(double val_start_time, int M, int N, int K) const;
84028389

84038390
/*!
84048391
* \brief Write a CSV file containing the results of the profiling.

Common/include/blas_structure.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929

3030
#pragma once
3131

32-
#include "CConfig.hpp"
33-
3432
/* LIBXSMM include files, if supported. */
3533
#ifdef HAVE_LIBXSMM
3634
#include "libxsmm.h"
3735
#endif
3836

37+
class CConfig;
38+
3939
/*!
4040
* \class CBlasStructure
4141
* \brief Class, which serves as an interface to the BLAS functionalities needed.
@@ -66,7 +66,7 @@ class CBlasStructure {
6666
*/
6767
void gemm(const int M, const int N, const int K,
6868
const su2double *A, const su2double *B, su2double *C,
69-
CConfig *config);
69+
const CConfig *config);
7070

7171
/*!
7272
* \brief Function, which carries out a dense matrix vector product

Common/include/mpi_structure.hpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,16 @@
5050
#include <medi/medi.hpp>
5151
using namespace medi;
5252

53+
#include <codi/externals/codiMpiTypes.hpp>
54+
5355
class CMediMPIWrapper;
5456
typedef CMediMPIWrapper SU2_MPI;
5557

56-
#if defined CODI_REVERSE_TYPE
57-
#include <codi/externals/codiMediPackTypes.hpp>
58-
#if CODI_PRIMAL_INDEX_TAPE
59-
typedef CoDiPackToolPrimalRestore<su2double> MediTool;
60-
#else
61-
typedef CoDiPackTool<su2double> MediTool;
62-
#endif // defined CODI_REVERSE_TYPE
63-
#elif defined CODI_FORWARD_TYPE
64-
#include <codi/externals/codiForwardMediPackTypes.hpp>
65-
typedef CoDiPackForwardTool<su2double> MediTool;
66-
#endif // defined CODI_FORWARD_TYPE
67-
#define AMPI_ADOUBLE ((medi::MpiTypeInterface*)MediTool::MPI_TYPE)
58+
typedef CoDiMpiTypes<su2double> MediTypes;
59+
typedef MediTypes::Tool MediTool;
60+
61+
extern MediTypes* mediTypes;
62+
#define AMPI_ADOUBLE ((medi::MpiTypeInterface*)mediTypes->MPI_TYPE)
6863

6964
#else
7065
class CBaseMPIWrapper;

Common/include/mpi_structure.inl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ inline passivedouble CBaseMPIWrapper::Wtime(void) {
286286

287287
inline void CMediMPIWrapper::Init(int *argc, char ***argv) {
288288
AMPI_Init(argc,argv);
289-
MediTool::init();
289+
mediTypes = new MediTypes();
290290
AMPI_Comm_rank(convertComm(currentComm), &Rank);
291291
AMPI_Comm_size(convertComm(currentComm), &Size);
292292

@@ -298,7 +298,7 @@ inline void CMediMPIWrapper::Init(int *argc, char ***argv) {
298298

299299
inline void CMediMPIWrapper::Init_thread(int *argc, char ***argv, int required, int* provided) {
300300
AMPI_Init_thread(argc,argv,required,provided);
301-
MediTool::init();
301+
mediTypes = new MediTypes();
302302
AMPI_Comm_rank(convertComm(currentComm), &Rank);
303303
AMPI_Comm_size(convertComm(currentComm), &Size);
304304

@@ -310,7 +310,7 @@ inline void CMediMPIWrapper::Init_thread(int *argc, char ***argv, int required,
310310

311311
inline void CMediMPIWrapper::Init_AMPI(void) {
312312
AMPI_Init_common();
313-
MediTool::init();
313+
mediTypes = new MediTypes();
314314
}
315315

316316
inline void CMediMPIWrapper::SetComm(Comm newComm){
@@ -391,6 +391,8 @@ inline void CMediMPIWrapper::Comm_size(Comm comm, int *size){
391391

392392
inline void CMediMPIWrapper::Finalize(){
393393
if( winMinRankErrorInUse ) MPI_Win_free(&winMinRankError);
394+
395+
delete mediTypes;
394396
AMPI_Finalize();
395397
}
396398

Common/include/omp_structure.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#pragma once
4040

4141
#include <type_traits>
42+
#include <cstdlib>
4243

4344
#if defined(_MSC_VER)
4445
#define PRAGMIZE(X) __pragma(X)

Common/include/toolboxes/geometry_toolbox.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#pragma once
2828

29+
#include <cmath>
30+
2931
namespace GeometryToolbox {
3032

3133
/*! \return ||a-b||^2 */

Common/src/CConfig.cpp

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,6 @@ void CConfig::SetPointersNull(void) {
911911
Velocity_FreeStream = nullptr;
912912
Inc_Velocity_Init = nullptr;
913913

914-
RefOriginMoment = nullptr;
915914
CFL_AdaptParam = nullptr;
916915
CFL = nullptr;
917916
HTP_Axis = nullptr;
@@ -3859,10 +3858,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
38593858
}*/
38603859

38613860

3862-
/*--- Initialize the RefOriginMoment Pointer ---*/
3863-
3864-
RefOriginMoment = new su2double[3]();
3865-
38663861
/*--- In case the moment origin coordinates have not been declared in the
38673862
config file, set them equal to zero for safety. Also check to make sure
38683863
that for each marker, a value has been declared for the moment origin.
@@ -6299,28 +6294,28 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
62996294
case TIME_STEPPING:
63006295
cout << "Unsteady simulation using a time stepping strategy."<< endl;
63016296
if (Unst_CFL != 0.0) {
6302-
cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl;
6303-
if (Delta_UnstTime != 0.0) {
6304-
cout << "Synchronization time provided by the user (s): "<< Delta_UnstTime << "." << endl;
6305-
}
6306-
}
6297+
cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl;
6298+
if (Delta_UnstTime != 0.0) {
6299+
cout << "Synchronization time provided by the user (s): "<< Delta_UnstTime << "." << endl;
6300+
}
6301+
}
63076302
else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl;
63086303
break;
63096304
case DT_STEPPING_1ST: case DT_STEPPING_2ND:
63106305
if (TimeMarching == DT_STEPPING_1ST) cout << "Unsteady simulation, dual time stepping strategy (first order in time)."<< endl;
63116306
if (TimeMarching == DT_STEPPING_2ND) cout << "Unsteady simulation, dual time stepping strategy (second order in time)."<< endl;
63126307
if (Unst_CFL != 0.0) cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl;
63136308
else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl;
6314-
cout << "Total number of internal Dual Time iterations: "<< Unst_nIntIter <<"." << endl;
6309+
cout << "Total number of internal Dual Time iterations: "<< InnerIter <<"." << endl;
63156310
break;
63166311
}
63176312
}
63186313
else {
63196314
if (Time_Domain) {
6320-
cout << "Dynamic structural analysis."<< endl;
6321-
cout << "Time step provided by the user for the dynamic analysis(s): "<< Delta_DynTime << "." << endl;
6322-
} else {
6323-
cout << "Static structural analysis." << endl;
6315+
cout << "Dynamic structural analysis."<< endl;
6316+
cout << "Time step provided by the user for the dynamic analysis(s): "<< Delta_DynTime << "." << endl;
6317+
} else {
6318+
cout << "Static structural analysis." << endl;
63246319
}
63256320
}
63266321

@@ -7379,7 +7374,6 @@ CConfig::~CConfig(void) {
73797374

73807375
/*--- reference origin for moments ---*/
73817376

7382-
delete [] RefOriginMoment;
73837377
delete [] RefOriginMoment_X;
73847378
delete [] RefOriginMoment_Y;
73857379
delete [] RefOriginMoment_Z;
@@ -7752,7 +7746,7 @@ CConfig::~CConfig(void) {
77527746

77537747
}
77547748

7755-
string CConfig::GetFilename(string filename, string ext, unsigned long Iter){
7749+
string CConfig::GetFilename(string filename, string ext, unsigned long Iter) const {
77567750

77577751
/*--- Remove any extension --- */
77587752

@@ -7840,33 +7834,33 @@ string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone,
78407834
return multizone_filename;
78417835
}
78427836

7843-
string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, string ext) {
7837+
string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, string ext) const {
78447838

7845-
string multizone_filename = val_filename;
7846-
char buffer[50];
7839+
string multizone_filename = val_filename;
7840+
char buffer[50];
78477841

7848-
unsigned short lastindex = multizone_filename.find_last_of(".");
7849-
multizone_filename = multizone_filename.substr(0, lastindex);
7850-
SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst));
7851-
multizone_filename.append(string(buffer));
7852-
multizone_filename += ext;
7853-
return multizone_filename;
7842+
unsigned short lastindex = multizone_filename.find_last_of(".");
7843+
multizone_filename = multizone_filename.substr(0, lastindex);
7844+
SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst));
7845+
multizone_filename.append(string(buffer));
7846+
multizone_filename += ext;
7847+
return multizone_filename;
78547848
}
78557849

7856-
string CConfig::GetMultiInstance_HistoryFileName(string val_filename, int val_iInst) {
7850+
string CConfig::GetMultiInstance_HistoryFileName(string val_filename, int val_iInst) const {
78577851

7858-
string multizone_filename = val_filename;
7859-
char buffer[50];
7852+
string multizone_filename = val_filename;
7853+
char buffer[50];
78607854

7861-
unsigned short lastindex = multizone_filename.find_last_of(".");
7862-
multizone_filename = multizone_filename.substr(0, lastindex);
7863-
SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst));
7864-
multizone_filename.append(string(buffer));
7855+
unsigned short lastindex = multizone_filename.find_last_of(".");
7856+
multizone_filename = multizone_filename.substr(0, lastindex);
7857+
SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst));
7858+
multizone_filename.append(string(buffer));
78657859

7866-
return multizone_filename;
7860+
return multizone_filename;
78677861
}
78687862

7869-
string CConfig::GetObjFunc_Extension(string val_filename) {
7863+
string CConfig::GetObjFunc_Extension(string val_filename) const {
78707864

78717865
string AdjExt, Filename = val_filename;
78727866

@@ -8444,7 +8438,7 @@ void CConfig::SetInlet_Ptotal(su2double val_pressure, string val_marker) {
84448438
Inlet_Ptotal[iMarker_Inlet] = val_pressure;
84458439
}
84468440

8447-
su2double* CConfig::GetInlet_FlowDir(string val_marker) {
8441+
const su2double* CConfig::GetInlet_FlowDir(string val_marker) const {
84488442
unsigned short iMarker_Inlet;
84498443
for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++)
84508444
if (Marker_Inlet[iMarker_Inlet] == val_marker) break;
@@ -9379,7 +9373,7 @@ void CConfig::SetProfilingCSV(void) {
93799373

93809374
}
93819375

9382-
void CConfig::GEMM_Tick(double *val_start_time) {
9376+
void CConfig::GEMM_Tick(double *val_start_time) const {
93839377

93849378
#ifdef PROFILE
93859379

@@ -9393,7 +9387,7 @@ void CConfig::GEMM_Tick(double *val_start_time) {
93939387

93949388
}
93959389

9396-
void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) {
9390+
void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const {
93979391

93989392
#ifdef PROFILE
93999393

0 commit comments

Comments
 (0)