Skip to content

Commit 48b19e9

Browse files
authored
Merge branch 'develop' into geometry_unit_test
2 parents a5321b6 + 388604c commit 48b19e9

162 files changed

Lines changed: 9496 additions & 10569 deletions

File tree

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: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ class CConfig {
396396
unsigned long InnerIter; /*!< \brief Current inner iterations for multizone problems. */
397397
unsigned long TimeIter; /*!< \brief Current time iterations for multizone problems. */
398398
unsigned long Unst_nIntIter; /*!< \brief Number of internal iterations (Dual time Method). */
399-
unsigned long Dyn_nIntIter; /*!< \brief Number of internal iterations (Newton-Raphson Method for nonlinear structural analysis). */
400399
long Unst_RestartIter; /*!< \brief Iteration number to restart an unsteady simulation (Dual time Method). */
401400
long Unst_AdjointIter; /*!< \brief Iteration number to begin the reverse time integration in the direct solver for the unsteady adjoint. */
402401
long Iter_Avg_Objective; /*!< \brief Iteration the number of time steps to be averaged, counting from the back */
@@ -412,6 +411,8 @@ class CConfig {
412411
unsigned short nRKStep; /*!< \brief Number of steps of the explicit Runge-Kutta method. */
413412
su2double *RK_Alpha_Step; /*!< \brief Runge-Kutta beta coefficients. */
414413

414+
unsigned short nQuasiNewtonSamples; /*!< \brief Number of samples used in quasi-Newton solution methods. */
415+
415416
unsigned short nMGLevels; /*!< \brief Number of multigrid levels (coarse levels). */
416417
unsigned short nCFL; /*!< \brief Number of CFL, one for each multigrid level. */
417418
su2double
@@ -783,8 +784,6 @@ class CConfig {
783784
unsigned short
784785
Console_Output_Verb, /*!< \brief Level of verbosity for console output */
785786
Kind_Average; /*!< \brief Particular average for the marker analyze. */
786-
unsigned short
787-
nPolyCoeffs; /*!< \brief Number of coefficients in temperature polynomial fits for fluid models. */
788787
su2double Gamma, /*!< \brief Ratio of specific heats of the gas. */
789788
Bulk_Modulus, /*!< \brief Value of the bulk modulus for incompressible flows. */
790789
Beta_Factor, /*!< \brief Value of the epsilon^2 multiplier for Beta for the incompressible preconditioner. */
@@ -818,14 +817,14 @@ class CConfig {
818817
Mu_Temperature_Ref, /*!< \brief Reference temperature for Sutherland model. */
819818
Mu_Temperature_RefND, /*!< \brief Non-dimensional reference temperature for Sutherland model. */
820819
Mu_S, /*!< \brief Reference S for Sutherland model. */
821-
Mu_SND, /*!< \brief Non-dimensional reference S for Sutherland model. */
822-
*CpPolyCoefficients, /*!< \brief Definition of the temperature polynomial coefficients for specific heat Cp. */
823-
*MuPolyCoefficients, /*!< \brief Definition of the temperature polynomial coefficients for viscosity. */
824-
*KtPolyCoefficients, /*!< \brief Definition of the temperature polynomial coefficients for thermal conductivity. */
825-
*CpPolyCoefficientsND, /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */
826-
*MuPolyCoefficientsND, /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */
827-
*KtPolyCoefficientsND, /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */
828-
Thermal_Conductivity_Solid, /*!< \brief Thermal conductivity in solids. */
820+
Mu_SND; /*!< \brief Non-dimensional reference S for Sutherland model. */
821+
su2double* CpPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for specific heat Cp. */
822+
su2double* MuPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for viscosity. */
823+
su2double* KtPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for thermal conductivity. */
824+
array<su2double, N_POLY_COEFFS> CpPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */
825+
array<su2double, N_POLY_COEFFS> MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */
826+
array<su2double, N_POLY_COEFFS> KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */
827+
su2double Thermal_Conductivity_Solid, /*!< \brief Thermal conductivity in solids. */
829828
Thermal_Diffusivity_Solid, /*!< \brief Thermal diffusivity in solids. */
830829
Temperature_Freestream_Solid, /*!< \brief Temperature in solids at freestream conditions. */
831830
Density_Solid, /*!< \brief Total density in solids. */
@@ -1018,9 +1017,9 @@ class CConfig {
10181017
su2double FinalRotation_Rate_Z; /*!< \brief Final rotation rate Z if Ramp rotating frame is activated. */
10191018
su2double FinalOutletPressure; /*!< \brief Final outlet pressure if Ramp outlet pressure is activated. */
10201019
su2double MonitorOutletPressure; /*!< \brief Monitor outlet pressure if Ramp outlet pressure is activated. */
1021-
su2double *default_cp_polycoeffs; /*!< \brief Array for specific heat polynomial coefficients. */
1022-
su2double *default_mu_polycoeffs; /*!< \brief Array for viscosity polynomial coefficients. */
1023-
su2double *default_kt_polycoeffs; /*!< \brief Array for thermal conductivity polynomial coefficients. */
1020+
array<su2double, N_POLY_COEFFS> default_cp_polycoeffs{{0.0}}; /*!< \brief Array for specific heat polynomial coefficients. */
1021+
array<su2double, N_POLY_COEFFS> default_mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */
1022+
array<su2double, N_POLY_COEFFS> default_kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */
10241023
su2double *ExtraRelFacGiles; /*!< \brief coefficient for extra relaxation factor for Giles BC*/
10251024
bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */
10261025
su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */
@@ -2943,12 +2942,6 @@ class CConfig {
29432942
*/
29442943
unsigned long GetUnst_nIntIter(void) const { return Unst_nIntIter; }
29452944

2946-
/*!
2947-
* \brief Get the number of internal iterations for the Newton-Raphson Method in nonlinear structural applications.
2948-
* \return Number of internal iterations.
2949-
*/
2950-
unsigned long GetDyn_nIntIter(void) const { return Dyn_nIntIter; }
2951-
29522945
/*!
29532946
* \brief Get the starting direct iteration number for the unsteady adjoint (reverse time integration).
29542947
* \return Starting direct iteration number for the unsteady adjoint.
@@ -3818,7 +3811,7 @@ class CConfig {
38183811
* \brief Get the number of coefficients in the temperature polynomial models.
38193812
* \return The the number of coefficients in the temperature polynomial models.
38203813
*/
3821-
unsigned short GetnPolyCoeffs(void) const { return nPolyCoeffs; }
3814+
unsigned short GetnPolyCoeffs(void) const { return N_POLY_COEFFS; }
38223815

38233816
/*!
38243817
* \brief Get the temperature polynomial coefficient for specific heat Cp.
@@ -3852,7 +3845,7 @@ class CConfig {
38523845
* \brief Get the temperature polynomial coefficients for viscosity.
38533846
* \return Non-dimensional temperature polynomial coefficients for viscosity.
38543847
*/
3855-
su2double* GetMu_PolyCoeffND(void) { return MuPolyCoefficientsND; }
3848+
const su2double* GetMu_PolyCoeffND(void) const { return MuPolyCoefficientsND.data(); }
38563849

38573850
/*!
38583851
* \brief Get the temperature polynomial coefficient for thermal conductivity.
@@ -3872,7 +3865,7 @@ class CConfig {
38723865
* \brief Get the temperature polynomial coefficients for thermal conductivity.
38733866
* \return Non-dimensional temperature polynomial coefficients for thermal conductivity.
38743867
*/
3875-
su2double* GetKt_PolyCoeffND(void) { return KtPolyCoefficientsND; }
3868+
const su2double* GetKt_PolyCoeffND(void) const { return KtPolyCoefficientsND.data(); }
38763869

38773870
/*!
38783871
* \brief Set the value of the non-dimensional constant viscosity.
@@ -4028,6 +4021,11 @@ class CConfig {
40284021
*/
40294022
su2double GetRelaxation_Factor_CHT(void) const { return Relaxation_Factor_CHT; }
40304023

4024+
/*!
4025+
* \brief Get the number of samples used in quasi-Newton methods.
4026+
*/
4027+
unsigned short GetnQuasiNewtonSamples(void) const { return nQuasiNewtonSamples; }
4028+
40314029
/*!
40324030
* \brief Get the relaxation coefficient of the linear solver for the implicit formulation.
40334031
* \return relaxation coefficient of the linear solver for the implicit formulation.
@@ -6339,17 +6337,17 @@ class CConfig {
63396337
/*!
63406338
* \brief Center of rotation for a rotational periodic boundary.
63416339
*/
6342-
su2double *GetPeriodicRotCenter(string val_marker);
6340+
const su2double *GetPeriodicRotCenter(string val_marker) const;
63436341

63446342
/*!
63456343
* \brief Angles of rotation for a rotational periodic boundary.
63466344
*/
6347-
su2double *GetPeriodicRotAngles(string val_marker);
6345+
const su2double *GetPeriodicRotAngles(string val_marker) const;
63486346

63496347
/*!
63506348
* \brief Translation vector for a rotational periodic boundary.
63516349
*/
6352-
su2double *GetPeriodicTranslation(string val_marker);
6350+
const su2double *GetPeriodicTranslation(string val_marker) const;
63536351

63546352
/*!
63556353
* \brief Get the rotationally periodic donor marker for boundary <i>val_marker</i>.

Common/include/basic_types/ad_structure.hpp

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,18 @@ namespace AD{
249249
*/
250250
inline void Push_TapePosition() {}
251251

252+
/*!
253+
* \brief Start a passive region, i.e. stop recording.
254+
* \return True is tape was active.
255+
*/
256+
inline bool BeginPassive() { return false; }
257+
258+
/*!
259+
* \brief End a passive region, i.e. start recording if we were recording before.
260+
* \param[in] wasActive - Whether we were recording before entering the passive region.
261+
*/
262+
inline void EndPassive(bool wasActive) {}
263+
252264
#else
253265
using CheckpointHandler = codi::DataStore;
254266

@@ -488,27 +500,19 @@ namespace AD{
488500

489501
FORCEINLINE void EndExtFunc() { delete FuncHelper; }
490502

491-
#endif // CODI_REVERSE_TYPE
503+
FORCEINLINE bool BeginPassive() {
504+
if(AD::globalTape.isActive()) {
505+
StopRecording();
506+
return true;
507+
}
508+
return false;
509+
}
492510

493-
} // namespace AD
511+
FORCEINLINE void EndPassive(bool wasActive) { if(wasActive) StartRecording(); }
494512

495-
/*--- Macro to begin and end sections with a passive tape ---*/
513+
#endif // CODI_REVERSE_TYPE
496514

497-
#ifdef CODI_REVERSE_TYPE
498-
#define AD_BEGIN_PASSIVE \
499-
if(AD::globalTape.isActive()) {\
500-
AD::globalTape.setPassive();\
501-
AD::Status = true; \
502-
}
503-
#define AD_END_PASSIVE \
504-
if(AD::Status) { \
505-
AD::globalTape.setActive(); \
506-
AD::Status = false; \
507-
}
508-
#else
509-
#define AD_BEGIN_PASSIVE
510-
#define AD_END_PASSIVE
511-
#endif
515+
} // namespace AD
512516

513517

514518
/*--- If we compile under OSX we have to overload some of the operators for

Common/include/fem/fem_geometry_structure.hpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class CSortFaces {
174174
* \author E. van der Weide
175175
* \version 7.0.5 "Blackbird"
176176
*/
177-
class CSurfaceElementFEM; // Forward declaration to avoid problems.
177+
struct CSurfaceElementFEM; // Forward declaration to avoid problems.
178178
struct CSortBoundaryFaces {
179179
/*!
180180
* \brief Operator used for the comparison.
@@ -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

0 commit comments

Comments
 (0)