Skip to content

Commit 659ef3f

Browse files
authored
Merge branch 'develop' into develop
2 parents 0089498 + efe8a67 commit 659ef3f

110 files changed

Lines changed: 3328 additions & 2292 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.

.github/workflows/regression.yml

Lines changed: 100 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP]
2727
include:
2828
- config_set: BaseMPI
29-
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-tests=true --warnlevel=2 --werror'
29+
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2 --werror'
3030
- config_set: ReverseMPI
3131
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3232
- config_set: ForwardMPI
3333
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror'
3434
- config_set: BaseNoMPI
35-
flags: '-Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror'
35+
flags: '-Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true -Denable-tests=true --warnlevel=3 --werror'
3636
- config_set: ReverseNoMPI
3737
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3838
- config_set: ForwardNoMPI
@@ -52,12 +52,12 @@ jobs:
5252
key: ${{ matrix.config_set }}-${{ github.sha }}
5353
restore-keys: ${{ matrix.config_set }}
5454
- name: Pre Cleanup
55-
uses: docker://ghcr.io/su2code/su2/build-su2:230225-2136
55+
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
5656
with:
5757
entrypoint: /bin/rm
5858
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
5959
- name: Build
60-
uses: docker://ghcr.io/su2code/su2/build-su2:230225-2136
60+
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
6161
with:
6262
args: -b ${{github.ref}} -f "${{matrix.flags}}"
6363
- name: Compress binaries
@@ -68,7 +68,50 @@ jobs:
6868
name: ${{ matrix.config_set }}
6969
path: install_bin.tgz
7070
- name: Post Cleanup
71-
uses: docker://ghcr.io/su2code/su2/build-su2:230225-2136
71+
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
72+
with:
73+
entrypoint: /bin/rm
74+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
75+
build_tsan:
76+
name: Build SU2 (tsan)
77+
if: inputs.runner != 'ARM64'
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
config_set: [BaseOMP-tsan, ReverseOMP-tsan] #ForwardOMP-tsan
82+
include:
83+
- config_set: BaseOMP-tsan
84+
flags: '--buildtype=debugoptimized -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3'
85+
- config_set: ReverseOMP-tsan
86+
flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3'
87+
#- config_set: ForwardOMP-tsan
88+
# flags: '--buildtype=debug -Denable-directdiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-pywrapper=true -Denable-tecio=false --warnlevel=3 --werror'
89+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
90+
steps:
91+
- name: Cache Object Files
92+
uses: actions/cache@v3
93+
with:
94+
path: ccache
95+
key: ${{ matrix.config_set }}-${{ github.sha }}
96+
restore-keys: ${{ matrix.config_set }}
97+
- name: Pre Cleanup
98+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
99+
with:
100+
entrypoint: /bin/rm
101+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
102+
- name: Build
103+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
104+
with:
105+
args: -b ${{github.ref}} -f "${{matrix.flags}}"
106+
- name: Compress binaries
107+
run: tar -zcvf install_bin.tgz install/bin
108+
- name: Upload Binaries
109+
uses: actions/upload-artifact@v3
110+
with:
111+
name: ${{ matrix.config_set }}
112+
path: install_bin.tgz
113+
- name: Post Cleanup
114+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
72115
with:
73116
entrypoint: /bin/rm
74117
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -99,7 +142,7 @@ jobs:
99142
tag: OMP
100143
steps:
101144
- name: Pre Cleanup
102-
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
145+
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
103146
with:
104147
entrypoint: /bin/rm
105148
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -125,12 +168,58 @@ jobs:
125168
chmod a+x $BIN_FOLDER/*
126169
ls -lahR $BIN_FOLDER
127170
- name: Run Tests in Container
128-
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
171+
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
129172
with:
130173
# -t <Tutorials-branch> -c <Testcases-branch>
131174
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
132175
- name: Cleanup
133-
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
176+
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
177+
with:
178+
entrypoint: /bin/rm
179+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
180+
thread_sanitizer_tests:
181+
if: inputs.runner != 'ARM64'
182+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
183+
name: Thread Sanitizer Tests
184+
needs: build_tsan
185+
strategy:
186+
fail-fast: false
187+
matrix:
188+
testscript: ['hybrid_regression.py', 'hybrid_regression_AD.py']
189+
steps:
190+
- name: Pre Cleanup
191+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
192+
with:
193+
entrypoint: /bin/rm
194+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
195+
- name: Download All artifacts
196+
uses: actions/download-artifact@v3
197+
- name: Uncompress and Move Binaries
198+
run: |
199+
BIN_FOLDER="$PWD/install/bin"
200+
mkdir -p $BIN_FOLDER
201+
ls -lah $BIN_FOLDER
202+
for type in Base Reverse Forward; do
203+
TYPE_FOLDER="${type}OMP-tsan"
204+
echo "Processing '$TYPE_FOLDER' ..."
205+
if [ -d $TYPE_FOLDER ]; then
206+
pushd $TYPE_FOLDER
207+
ls -lah
208+
tar -zxvf install_bin.tgz
209+
ls -lah install/bin/
210+
cp -r install/bin/* $BIN_FOLDER;
211+
popd;
212+
fi
213+
done
214+
chmod a+x $BIN_FOLDER/*
215+
ls -lahR $BIN_FOLDER
216+
- name: Run Tests in Container
217+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
218+
with:
219+
# -t <Tutorials-branch> -c <Testcases-branch>
220+
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan"
221+
- name: Cleanup
222+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
134223
with:
135224
entrypoint: /bin/rm
136225
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -151,7 +240,7 @@ jobs:
151240
tag: MPI
152241
steps:
153242
- name: Pre Cleanup
154-
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
243+
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
155244
with:
156245
entrypoint: /bin/rm
157246
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -212,11 +301,11 @@ jobs:
212301
echo $PWD
213302
ls -lahR
214303
- name: Run Unit Tests
215-
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
304+
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
216305
with:
217306
entrypoint: install/bin/${{matrix.testdriver}}
218307
- name: Post Cleanup
219-
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
308+
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
220309
with:
221310
entrypoint: /bin/rm
222311
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}

.github/workflows/release-management.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
key: ${{ matrix.os_bin }}-${{ github.sha }}
3636
restore-keys: ${{ matrix.os_bin }}
3737
- name: Build
38-
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230225-2136
38+
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230704-1323
3939
with:
4040
args: -b ${{ github.sha }} -f "${{matrix.flags}}"
4141
- name: Create Archive

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@
2424
[submodule "externals/mel"]
2525
path = externals/mel
2626
url = https://github.com/pcarruscag/MEL.git
27+
[submodule "subprojects/MLPCpp"]
28+
path = subprojects/MLPCpp
29+
url = https://github.com/EvertBunschoten/MLPCpp.git

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Jessie Lauzon
9292
João Loureiro
9393
Johannes Blühdorn
9494
JonathanSmith1936
95+
Joseph Signorelli
9596
Josy P. Pullockara
9697
Kedar Naik
9798
Kürşat Yurt

Common/include/CConfig.hpp

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,12 @@ class CConfig {
519519
Kind_TimeIntScheme_AdjTurb, /*!< \brief Time integration for the adjoint turbulence model. */
520520
Kind_TimeIntScheme_Species, /*!< \brief Time integration for the species model. */
521521
Kind_TimeIntScheme_Heat, /*!< \brief Time integration for the wave equations. */
522-
Kind_TimeStep_Heat; /*!< \brief Time stepping method for the (fvm) heat equation. */
522+
Kind_TimeStep_Heat, /*!< \brief Time stepping method for the (fvm) heat equation. */
523+
n_Datadriven_files;
524+
ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method; /*!< \brief Method used for datset regression in data-driven fluid models. */
525+
526+
su2double DataDriven_Relaxation_Factor; /*!< \brief Relaxation factor for Newton solvers in data-driven fluid models. */
527+
523528
STRUCT_TIME_INT Kind_TimeIntScheme_FEA; /*!< \brief Time integration for the FEA equations. */
524529
STRUCT_SPACE_ITE Kind_SpaceIteScheme_FEA; /*!< \brief Iterative scheme for nonlinear structural analysis. */
525530
unsigned short
@@ -800,7 +805,8 @@ class CConfig {
800805
SurfAdjCoeff_FileName, /*!< \brief Output file with the adjoint variables on the surface. */
801806
SurfSens_FileName, /*!< \brief Output file for the sensitivity on the surface (discrete adjoint). */
802807
VolSens_FileName, /*!< \brief Output file for the sensitivity in the volume (discrete adjoint). */
803-
ObjFunc_Hess_FileName; /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */
808+
ObjFunc_Hess_FileName, /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */
809+
*DataDriven_Method_FileNames; /*!< \brief Dataset information for data-driven fluid models. */
804810

805811
bool
806812
Wrt_Performance, /*!< \brief Write the performance summary at the end of a calculation. */
@@ -903,6 +909,7 @@ class CConfig {
903909
Tke_FreeStreamND, /*!< \brief Farfield kinetic energy (external flow). */
904910
Omega_FreeStreamND, /*!< \brief Specific dissipation (external flow). */
905911
Omega_FreeStream; /*!< \brief Specific dissipation (external flow). */
912+
bool Variable_Density; /*!< \brief Variable density for incompressible flow. */
906913
unsigned short nElectric_Constant; /*!< \brief Number of different electric constants. */
907914
su2double *Electric_Constant; /*!< \brief Dielectric constant modulus. */
908915
su2double Knowles_B, /*!< \brief Knowles material model constant B. */
@@ -1223,9 +1230,10 @@ class CConfig {
12231230
unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */
12241231
unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */
12251232

1233+
string* controlling_variable_names;
1234+
string* cv_source_names;
12261235
vector<string> table_scalar_names; /*!< \brief Names of transported scalar variables. */
1227-
string* table_lookup_names; /*!< \brief Names of LUT variables. */
1228-
string file_name_lut; /*!< \brief Filename of the LUT. */
1236+
string* lookup_names; /*!< \brief Names of passive look-up variables. */
12291237
string* user_scalar_names; /*!< \brief Names of the user defined (auxiliary) transported scalars .*/
12301238
string* user_source_names; /*!< \brief Names of the source terms for the user defined transported scalars. */
12311239

@@ -2145,6 +2153,19 @@ class CConfig {
21452153
*/
21462154
unsigned short GetNUserScalars() const { return n_user_scalars; }
21472155

2156+
/*!
2157+
* \brief Get the name of a specific controlling variable.
2158+
*/
2159+
const string& GetControllingVariableName(unsigned short i_cv) const {
2160+
return controlling_variable_names[i_cv];
2161+
}
2162+
2163+
/*!
2164+
* \brief Get the name of the source term variable for a specific controlling variable.
2165+
*/
2166+
const string& GetControllingVariableSourceName(unsigned short i_cv) const {
2167+
return cv_source_names[i_cv];
2168+
}
21482169
/*!
21492170
* \brief Get the name of the user scalar.
21502171
*/
@@ -2169,13 +2190,7 @@ class CConfig {
21692190
/*!
21702191
* \brief Get the name of the variable that we want to retrieve from the lookup table.
21712192
*/
2172-
const string& GetLUTLookupName(unsigned short i_lookup) const { return table_lookup_names[i_lookup]; }
2173-
2174-
/*!
2175-
* \brief Get the file name of the look up table.
2176-
* \return File name of the look up table.
2177-
*/
2178-
const string& GetFileNameLUT() const { return file_name_lut; }
2193+
const string& GetLookupName(unsigned short i_lookup) const { return lookup_names[i_lookup]; }
21792194

21802195
/*!
21812196
* \brief Get the Young's modulus of elasticity.
@@ -3844,6 +3859,29 @@ class CConfig {
38443859
*/
38453860
unsigned short GetKind_FluidModel(void) const { return Kind_FluidModel; }
38463861

3862+
/*!
3863+
* \brief Datadriven method for EoS evaluation.
3864+
*/
3865+
ENUM_DATADRIVEN_METHOD GetKind_DataDriven_Method(void) const { return Kind_DataDriven_Method; }
3866+
3867+
/*!
3868+
* \brief Get name of the input file for the data-driven fluid model interpolation method.
3869+
* \return Name of the input file for the interpolation method.
3870+
*/
3871+
const string* GetDataDriven_FileNames(void) const { return DataDriven_Method_FileNames; }
3872+
3873+
/*!
3874+
* \brief Get number of listed look-up table or multi-layer perceptron input files.
3875+
* \return Number of listed data-driven method input files.
3876+
*/
3877+
unsigned short GetNDataDriven_Files(void) const { return n_Datadriven_files; }
3878+
3879+
/*!
3880+
* \brief Get Newton solver relaxation factor for data-driven fluid models.
3881+
* \return Newton solver relaxation factor.
3882+
*/
3883+
su2double GetRelaxation_DataDriven(void) const { return DataDriven_Relaxation_Factor; }
3884+
38473885
/*!
38483886
* \brief Returns the name of the fluid we are using in CoolProp.
38493887
*/
@@ -3855,6 +3893,12 @@ class CConfig {
38553893
*/
38563894
INC_DENSITYMODEL GetKind_DensityModel() const { return Kind_DensityModel; }
38573895

3896+
/*!
3897+
* \brief Selection of variable density option for incompressible flows.
3898+
* \return Flag for variable density for incompressible flows.
3899+
*/
3900+
bool GetVariable_Density_Model() const { return Variable_Density; }
3901+
38583902
/*!
38593903
* \brief Flag for whether to solve the energy equation for incompressible flows.
38603904
* \return Flag for energy equation

Common/include/basic_types/ad_structure.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,16 +384,14 @@ FORCEINLINE void SetDerivative(int index, const double val) {
384384
if (index == 0) // Allow multiple threads to "set the derivative" of passive variables without causing data races.
385385
return;
386386

387-
using BoundsChecking = codi::GradientAccessTapeInterface<su2double::Gradient, su2double::Identifier>::BoundsChecking;
388-
AD::getTape().setGradient(index, val, BoundsChecking::False);
387+
AD::getTape().setGradient(index, val, codi::AdjointsManagement::Manual);
389388
}
390389

391390
// WARNING: For performance reasons, this method does not perform bounds checking.
392391
// If called after tape evaluations, the adjoints should exist.
393392
// Otherwise, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints().
394393
FORCEINLINE double GetDerivative(int index) {
395-
using BoundsChecking = codi::GradientAccessTapeInterface<su2double::Gradient, su2double::Identifier>::BoundsChecking;
396-
return AD::getTape().getGradient(index, BoundsChecking::False);
394+
return AD::getTape().getGradient(index, codi::AdjointsManagement::Manual);
397395
}
398396

399397
FORCEINLINE bool IsIdentifierActive(su2double const& value) {

Common/include/containers/CLookUpTable.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class CLookUpTable {
7676
*/
7777
su2vector<su2activematrix> table_data;
7878

79+
double memory_footprint_data = 0; /*!< \brief Memory footprint of the loaded table data. */
80+
7981
/*! \brief
8082
* Holds all connectivity data stored in the table for each level. First index
8183
* addresses the variable while second index addresses the point.
@@ -216,7 +218,7 @@ class CLookUpTable {
216218
*/
217219
void Linear_Interpolation(const su2double val_CV3, const unsigned long lower_level, const unsigned long upper_level,
218220
std::vector<su2double>& lower_values, std::vector<su2double>& upper_values,
219-
std::vector<su2double*>& var_vals) const;
221+
std::vector<su2double>& var_vals) const;
220222

221223
/*!
222224
* \brief Find the point on the hull (boundary of the table) that is closest to the point P(val_CV1,val_CV2).
@@ -345,7 +347,7 @@ class CLookUpTable {
345347
* \param[in] val_CV3 - Value of controlling variable 3.
346348
* \returns 1 if the lookup and subsequent interpolation was a success, 0 if not.
347349
*/
348-
unsigned long LookUp_XYZ(const std::vector<std::string>& val_names_var, std::vector<su2double*>& val_vars,
350+
unsigned long LookUp_XYZ(const std::vector<std::string>& val_names_var, std::vector<su2double>& val_vars,
349351
su2double val_CV1, su2double val_CV2, su2double val_CV3 = 0);
350352

351353
/*!

Common/include/containers/CTrapezoidalMap.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ class CTrapezoidalMap {
5454
* same band. Used to sort the edges */
5555
su2vector<std::vector<std::pair<su2double, unsigned long> > > y_edge_at_band_mid;
5656

57+
double memory_footprint = 0;
58+
5759
public:
5860
CTrapezoidalMap() = default;
5961

6062
CTrapezoidalMap(const su2double* samples_x, const su2double* samples_y, const unsigned long size,
6163
const std::vector<std::array<unsigned long, 2> >& edges,
62-
const su2vector<std::vector<unsigned long> >& edge_to_triangle);
64+
const su2vector<std::vector<unsigned long> >& edge_to_triangle, bool display = false);
6365

6466
/*!
6567
* \brief return the index to the triangle that contains the coordinates (val_x,val_y)
@@ -97,4 +99,10 @@ class CTrapezoidalMap {
9799
inline bool IsInsideHullX(su2double val_x) {
98100
return (val_x >= unique_bands_x.front()) && (val_x <= unique_bands_x.back());
99101
}
102+
103+
/*!
104+
* \brief get memory footprint of trapezoidal map.
105+
* \return - memory footprint in mega bytes.
106+
*/
107+
double GetMemoryFootprint() const { return memory_footprint; }
100108
};

0 commit comments

Comments
 (0)