Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2b55895
serial hacked implementation using Eigen
pcarruscag Jun 4, 2020
b899d85
parallel version via normal equations
pcarruscag Jun 5, 2020
b1315e1
Merge branch 'hybrid_parallel_mpi' into feature_quasi_newton_adjoint
pcarruscag Jun 5, 2020
2c60d29
Merge branch 'iteration_class' into feature_quasi_newton_adjoint
pcarruscag Jun 6, 2020
4f95689
native implementation, without Eigen
pcarruscag Jun 6, 2020
a489b1c
a little cleanup and allow omp SIMD in AD builds
pcarruscag Jun 7, 2020
b2396a0
Merge branch 'iteration_class' into feature_quasi_newton_adjoint
pcarruscag Jun 7, 2020
61a0ca0
add config option, generic get/set solution methods in CDriver
pcarruscag Jun 7, 2020
07b3c51
support for multizone, does not work as well...
pcarruscag Jun 7, 2020
360b390
optimization and reset before multizone inner iters (works better)
pcarruscag Jun 8, 2020
d65c487
fix build
pcarruscag Jun 8, 2020
d7933df
fix nompi build
pcarruscag Jun 8, 2020
1f4232a
fix compilation error on gcc 5.4, remove obsolete option from testcases
pcarruscag Jun 9, 2020
eabe878
fix #1025
pcarruscag Jun 17, 2020
f417862
fix bug introduced in #1009
pcarruscag Jun 18, 2020
9e60d30
Merge remote-tracking branch 'upstream/develop' into feature_quasi_ne…
pcarruscag Jun 18, 2020
2c762d1
little cleanup and add new option to config template
pcarruscag Jun 18, 2020
88fc0f7
address review comments
pcarruscag Jun 26, 2020
f71148b
add unit test
pcarruscag Jun 26, 2020
74c0d91
fix compilation error with constexpr arrays
pcarruscag Jun 26, 2020
f3e6172
fix it again...
pcarruscag Jun 26, 2020
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
26 changes: 13 additions & 13 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ class CConfig {
unsigned long InnerIter; /*!< \brief Current inner iterations for multizone problems. */
unsigned long TimeIter; /*!< \brief Current time iterations for multizone problems. */
unsigned long Unst_nIntIter; /*!< \brief Number of internal iterations (Dual time Method). */
unsigned long Dyn_nIntIter; /*!< \brief Number of internal iterations (Newton-Raphson Method for nonlinear structural analysis). */
long Unst_RestartIter; /*!< \brief Iteration number to restart an unsteady simulation (Dual time Method). */
long Unst_AdjointIter; /*!< \brief Iteration number to begin the reverse time integration in the direct solver for the unsteady adjoint. */
long Iter_Avg_Objective; /*!< \brief Iteration the number of time steps to be averaged, counting from the back */
Expand All @@ -412,6 +411,8 @@ class CConfig {
unsigned short nRKStep; /*!< \brief Number of steps of the explicit Runge-Kutta method. */
su2double *RK_Alpha_Step; /*!< \brief Runge-Kutta beta coefficients. */

unsigned short nQuasiNewtonSamples; /*!< \brief Number of samples used in quasi-Newton solution methods. */

unsigned short nMGLevels; /*!< \brief Number of multigrid levels (coarse levels). */
unsigned short nCFL; /*!< \brief Number of CFL, one for each multigrid level. */
su2double
Expand Down Expand Up @@ -820,9 +821,9 @@ class CConfig {
su2double* CpPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for specific heat Cp. */
su2double* MuPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for viscosity. */
su2double* KtPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for thermal conductivity. */
array<su2double, N_POLY_COEFFS> CpPolyCoefficientsND{0.0}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */
array<su2double, N_POLY_COEFFS>MuPolyCoefficientsND{0.0}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */
array<su2double, N_POLY_COEFFS>KtPolyCoefficientsND{0.0}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */
array<su2double, N_POLY_COEFFS> CpPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */
array<su2double, N_POLY_COEFFS> MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */
array<su2double, N_POLY_COEFFS> KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */
su2double Thermal_Conductivity_Solid, /*!< \brief Thermal conductivity in solids. */
Thermal_Diffusivity_Solid, /*!< \brief Thermal diffusivity in solids. */
Temperature_Freestream_Solid, /*!< \brief Temperature in solids at freestream conditions. */
Expand Down Expand Up @@ -1016,9 +1017,9 @@ class CConfig {
su2double FinalRotation_Rate_Z; /*!< \brief Final rotation rate Z if Ramp rotating frame is activated. */
su2double FinalOutletPressure; /*!< \brief Final outlet pressure if Ramp outlet pressure is activated. */
su2double MonitorOutletPressure; /*!< \brief Monitor outlet pressure if Ramp outlet pressure is activated. */
array<su2double, N_POLY_COEFFS> default_cp_polycoeffs{0.0}; /*!< \brief Array for specific heat polynomial coefficients. */
array<su2double, N_POLY_COEFFS> default_mu_polycoeffs{0.0}; /*!< \brief Array for viscosity polynomial coefficients. */
array<su2double, N_POLY_COEFFS> default_kt_polycoeffs{0.0}; /*!< \brief Array for thermal conductivity polynomial coefficients. */
array<su2double, N_POLY_COEFFS> default_cp_polycoeffs{{0.0}}; /*!< \brief Array for specific heat polynomial coefficients. */
array<su2double, N_POLY_COEFFS> default_mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */
array<su2double, N_POLY_COEFFS> default_kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */
su2double *ExtraRelFacGiles; /*!< \brief coefficient for extra relaxation factor for Giles BC*/
bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */
su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */
Expand Down Expand Up @@ -2941,12 +2942,6 @@ class CConfig {
*/
unsigned long GetUnst_nIntIter(void) const { return Unst_nIntIter; }

/*!
* \brief Get the number of internal iterations for the Newton-Raphson Method in nonlinear structural applications.
* \return Number of internal iterations.
*/
unsigned long GetDyn_nIntIter(void) const { return Dyn_nIntIter; }

/*!
* \brief Get the starting direct iteration number for the unsteady adjoint (reverse time integration).
* \return Starting direct iteration number for the unsteady adjoint.
Expand Down Expand Up @@ -4026,6 +4021,11 @@ class CConfig {
*/
su2double GetRelaxation_Factor_CHT(void) const { return Relaxation_Factor_CHT; }

/*!
* \brief Get the number of samples used in quasi-Newton methods.
*/
unsigned short GetnQuasiNewtonSamples(void) const { return nQuasiNewtonSamples; }

/*!
* \brief Get the relaxation coefficient of the linear solver for the implicit formulation.
* \return relaxation coefficient of the linear solver for the implicit formulation.
Expand Down
24 changes: 12 additions & 12 deletions Common/include/mpi_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ class CBaseMPIWrapper;
typedef CBaseMPIWrapper SU2_MPI;
#endif // defined CODI_REVERSE_TYPE || defined CODI_FORWARD_TYPE

/*--- Select the appropriate MPI wrapper based on datatype, to use in templated classes. ---*/
template<class T> struct SelectMPIWrapper { typedef SU2_MPI W; };

/*--- In AD we specialize for the passive wrapper. ---*/
#if defined CODI_REVERSE_TYPE
class CBaseMPIWrapper;
template<> struct SelectMPIWrapper<passivedouble> { typedef CBaseMPIWrapper W; };
#if defined USE_MIXED_PRECISION
template<> struct SelectMPIWrapper<su2mixedfloat> { typedef CBaseMPIWrapper W; };
#endif
#endif

/*!
* \class CMPIWrapper
* \brief Class for defining the MPI wrapper routines; this class features as a base class for
Expand Down Expand Up @@ -326,6 +314,7 @@ class CMediMPIWrapper: public CBaseMPIWrapper {
#define MPI_UNSIGNED_LONG 1
#define MPI_LONG 2
#define MPI_UNSIGNED_SHORT 3
#define MPI_FLOAT 4
#define MPI_DOUBLE 4
#define MPI_ANY_SOURCE 5
#define MPI_SUM 6
Expand Down Expand Up @@ -455,6 +444,17 @@ typedef CBaseMPIWrapper SU2_MPI;

#endif

/*--- Select the appropriate MPI wrapper based on datatype, to use in templated classes. ---*/
template<class T> struct SelectMPIWrapper { typedef SU2_MPI W; };

/*--- In AD we specialize for the passive wrapper. ---*/
#if defined CODI_REVERSE_TYPE
template<> struct SelectMPIWrapper<passivedouble> { typedef CBaseMPIWrapper W; };
#if defined USE_MIXED_PRECISION
template<> struct SelectMPIWrapper<su2mixedfloat> { typedef CBaseMPIWrapper W; };
#endif
#endif

/* Depending on the compiler, define the correct macro to get the current function name */

#if defined(__GNUC__) || (defined(__ICC) && (__ICC >= 600))
Expand Down
25 changes: 12 additions & 13 deletions Common/include/omp_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
/*--- The generic start of OpenMP constructs. ---*/
#define SU2_OMP(ARGS) PRAGMIZE(omp ARGS)

/*--- Detect SIMD support (version 4+, after Jul 2013). ---*/
#if _OPENMP >= 201307
#define HAVE_OMP_SIMD
#endif

#else // Compile without OpenMP

/*--- Disable pragmas to quiet compilation warnings. ---*/
Expand Down Expand Up @@ -98,10 +93,20 @@ inline void omp_set_lock(omp_lock_t*){}
inline void omp_unset_lock(omp_lock_t*){}
inline void omp_destroy_lock(omp_lock_t*){}

#endif // end OpenMP detection

/*--- Detect SIMD support (version 4+, after Jul 2013). ---*/
#ifdef _OPENMP
#if _OPENMP >= 201307
#define HAVE_OMP_SIMD
#define SU2_OMP_SIMD PRAGMIZE(omp simd)
#endif
#endif
#ifndef SU2_OMP_SIMD
#define SU2_OMP_SIMD
#endif

/*--- Convenience macros (do not use excessive nesting of macros). ---*/
#define SU2_OMP_SIMD SU2_OMP(simd)
/*--- Convenience macros (do not use excessive nesting). ---*/

#define SU2_OMP_MASTER SU2_OMP(master)
#define SU2_OMP_ATOMIC SU2_OMP(atomic)
Expand All @@ -115,12 +120,6 @@ inline void omp_destroy_lock(omp_lock_t*){}
#define SU2_OMP_FOR_DYN(CHUNK) SU2_OMP(for schedule(dynamic,CHUNK))
#define SU2_OMP_FOR_STAT(CHUNK) SU2_OMP(for schedule(static,CHUNK))

/*--- Disable some unsupported features. ---*/
#ifndef HAVE_OMP_SIMD
#undef SU2_OMP_SIMD
#define SU2_OMP_SIMD
#endif

/*--- Convenience functions (e.g. to compute chunk sizes). ---*/

/*!
Expand Down
Loading