Skip to content

Commit a8949cd

Browse files
authored
Merge branch 'develop' into develop
2 parents 24e406d + c0bf007 commit a8949cd

37 files changed

+1011
-91
lines changed

.github/workflows/regression.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ jobs:
5454
key: ${{ matrix.config_set }}-${{ github.sha }}
5555
restore-keys: ${{ matrix.config_set }}
5656
- name: Pre Cleanup
57-
uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536
57+
uses: docker://ghcr.io/su2code/su2/build-su2:250717-1402
5858
with:
5959
entrypoint: /bin/rm
6060
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
6161
- name: Build
62-
uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536
62+
uses: docker://ghcr.io/su2code/su2/build-su2:250717-1402
6363
with:
6464
args: -b ${{github.ref}} -f "${{matrix.flags}}"
6565
- name: Compress binaries
@@ -70,7 +70,7 @@ jobs:
7070
name: ${{ matrix.config_set }}
7171
path: install_bin.tgz
7272
- name: Post Cleanup
73-
uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536
73+
uses: docker://ghcr.io/su2code/su2/build-su2:250717-1402
7474
with:
7575
entrypoint: /bin/rm
7676
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -97,12 +97,12 @@ jobs:
9797
key: ${{ matrix.config_set }}-${{ github.sha }}
9898
restore-keys: ${{ matrix.config_set }}
9999
- name: Pre Cleanup
100-
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536
100+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:250717-1402
101101
with:
102102
entrypoint: /bin/rm
103103
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
104104
- name: Build
105-
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536
105+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:250717-1402
106106
with:
107107
args: -b ${{github.ref}} -f "${{matrix.flags}}"
108108
- name: Compress binaries
@@ -113,7 +113,7 @@ jobs:
113113
name: ${{ matrix.config_set }}
114114
path: install_bin.tgz
115115
- name: Post Cleanup
116-
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536
116+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:250717-1402
117117
with:
118118
entrypoint: /bin/rm
119119
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -137,12 +137,12 @@ jobs:
137137
key: ${{ matrix.config_set }}-${{ github.sha }}
138138
restore-keys: ${{ matrix.config_set }}
139139
- name: Pre Cleanup
140-
uses: docker://ghcr.io/su2code/su2/build-su2-asan:240320-1536
140+
uses: docker://ghcr.io/su2code/su2/build-su2-asan:250717-1402
141141
with:
142142
entrypoint: /bin/rm
143143
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
144144
- name: Build
145-
run: docker run --rm --cap-add SYS_PTRACE -v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}"
145+
run: docker run --rm --cap-add SYS_PTRACE -v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:250717-1402 -b ${{github.ref}} -f "${{matrix.flags}}"
146146
- name: Compress binaries
147147
run: tar -zcvf install_bin.tgz install/*
148148
- name: Upload Binaries
@@ -151,7 +151,7 @@ jobs:
151151
name: ${{ matrix.config_set }}
152152
path: install_bin.tgz
153153
- name: Post Cleanup
154-
uses: docker://ghcr.io/su2code/su2/build-su2-asan:240320-1536
154+
uses: docker://ghcr.io/su2code/su2/build-su2-asan:250717-1402
155155
with:
156156
entrypoint: /bin/rm
157157
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -182,7 +182,7 @@ jobs:
182182
tag: OMP
183183
steps:
184184
- name: Pre Cleanup
185-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
185+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
186186
with:
187187
entrypoint: /bin/rm
188188
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -208,12 +208,12 @@ jobs:
208208
chmod a+x $BIN_FOLDER/*
209209
ls -lahR $BIN_FOLDER
210210
- name: Run Tests in Container
211-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
211+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
212212
with:
213213
# -t <Tutorials-branch> -c <Testcases-branch>
214214
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
215215
- name: Cleanup
216-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
216+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
217217
with:
218218
entrypoint: /bin/rm
219219
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -231,7 +231,7 @@ jobs:
231231
tag: TagNoMPI
232232
steps:
233233
- name: Pre Cleanup
234-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
234+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
235235
with:
236236
entrypoint: /bin/rm
237237
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -257,12 +257,12 @@ jobs:
257257
chmod a+x $BIN_FOLDER/*
258258
ls -lahR $BIN_FOLDER
259259
- name: Run Tests in Container
260-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
260+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
261261
with:
262262
# -t <Tutorials-branch> -c <Testcases-branch>
263263
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tapetests"
264264
- name: Cleanup
265-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
265+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
266266
with:
267267
entrypoint: /bin/rm
268268
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -277,7 +277,7 @@ jobs:
277277
testscript: ['hybrid_regression.py', 'hybrid_regression_AD.py']
278278
steps:
279279
- name: Pre Cleanup
280-
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536
280+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:250717-1402
281281
with:
282282
entrypoint: /bin/rm
283283
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -303,12 +303,12 @@ jobs:
303303
chmod a+x $BIN_FOLDER/*
304304
ls -lahR $BIN_FOLDER
305305
- name: Run Tests in Container
306-
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536
306+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:250717-1402
307307
with:
308308
# -t <Tutorials-branch> -c <Testcases-branch>
309309
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan"
310310
- name: Cleanup
311-
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536
311+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:250717-1402
312312
with:
313313
entrypoint: /bin/rm
314314
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -322,7 +322,7 @@ jobs:
322322
testscript: ['serial_regression.py', 'serial_regression_AD.py']
323323
steps:
324324
- name: Pre Cleanup
325-
uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536
325+
uses: docker://ghcr.io/su2code/su2/test-su2-asan:250717-1402
326326
with:
327327
entrypoint: /bin/rm
328328
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -348,12 +348,12 @@ jobs:
348348
chmod a+x $BIN_FOLDER/*
349349
ls -lahR $BIN_FOLDER
350350
- name: Run Tests in Container
351-
uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536
351+
uses: docker://ghcr.io/su2code/su2/test-su2-asan:250717-1402
352352
with:
353353
# -t <Tutorials-branch> -c <Testcases-branch>
354354
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--asan"
355355
- name: Cleanup
356-
uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536
356+
uses: docker://ghcr.io/su2code/su2/test-su2-asan:250717-1402
357357
with:
358358
entrypoint: /bin/rm
359359
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -374,7 +374,7 @@ jobs:
374374
tag: MPI
375375
steps:
376376
- name: Pre Cleanup
377-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
377+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
378378
with:
379379
entrypoint: /bin/rm
380380
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -435,11 +435,11 @@ jobs:
435435
echo $PWD
436436
ls -lahR
437437
- name: Run Unit Tests
438-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
438+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
439439
with:
440440
entrypoint: install/bin/${{matrix.testdriver}}
441441
- name: Post Cleanup
442-
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
442+
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
443443
with:
444444
entrypoint: /bin/rm
445445
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:230813-0103
38+
uses: docker://ghcr.io/su2code/su2/build-su2-cross:250717-1402
3939
with:
4040
args: -b ${{ github.sha }} -f "${{matrix.flags}}"
4141
- name: Create Archive

Common/include/CConfig.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ class CConfig {
707707
Wrt_Restart_Overwrite, /*!< \brief Overwrite restart files or append iteration number.*/
708708
Wrt_Surface_Overwrite, /*!< \brief Overwrite surface output files or append iteration number.*/
709709
Wrt_Volume_Overwrite, /*!< \brief Overwrite volume output files or append iteration number.*/
710+
PyCustomSource, /*!< \brief Use a user-defined custom source term .*/
710711
Restart_Flow; /*!< \brief Restart flow solution for adjoint and linearized problems. */
711712
unsigned short nMarker_Monitoring, /*!< \brief Number of markers to monitor. */
712713
nMarker_Designing, /*!< \brief Number of markers for the objective function. */
@@ -1091,6 +1092,7 @@ class CConfig {
10911092
su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */
10921093
su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */
10931094
su2double Max_Vel2; /*!< \brief The maximum velocity^2 in the domain for the incompressible preconditioner. */
1095+
su2double RangePressure[2]; /*!< \brief The pressure difference pmax-pmin in the domain for the target mass flow rate scaling. */
10941096
bool topology_optimization; /*!< \brief If the structural solver should consider a variable density field to penalize element stiffness. */
10951097
string top_optim_output_file; /*!< \brief File to where the derivatives w.r.t. element densities will be written to. */
10961098
su2double simp_exponent; /*!< \brief Exponent for the density-based stiffness penalization of the SIMP method. */
@@ -3087,6 +3089,12 @@ class CConfig {
30873089
*/
30883090
unsigned short GetnMarker_PyCustom(void) const { return nMarker_PyCustom; }
30893091

3092+
/*!
3093+
* \brief Get the Python custom source term activation.
3094+
* \return Custom source term is active or not.
3095+
*/
3096+
bool GetPyCustomSource(void) const { return PyCustomSource; }
3097+
30903098
/*!
30913099
* \brief Get the total number of moving markers.
30923100
* \return Total number of moving markers.
@@ -9215,6 +9223,18 @@ class CConfig {
92159223
*/
92169224
void SetMax_Vel2(su2double val_max_vel2) { Max_Vel2 = val_max_vel2; }
92179225

9226+
/*!
9227+
* \brief Get the maximum pressure (pmax - pmin) in the domain.
9228+
* \return Value of the maximum pressure in the domain.
9229+
*/
9230+
su2double GetRangePressure(int minmax) const { return RangePressure[minmax]; }
9231+
9232+
/*!
9233+
* \brief Set the maximum pressure in the domain.
9234+
* \param[in] Value of the maximum pressure in the domain.
9235+
*/
9236+
void SetRangePressure(su2double val_dp_min,su2double val_dp_max) { RangePressure[0] = val_dp_min;RangePressure[1]=val_dp_max; }
9237+
92189238
/*!
92199239
* \brief Get the maximum velocity^2 in the domain for the incompressible preconditioner.
92209240
* \return Value of the maximum velocity^2 in the domain for the incompressible preconditioner.

Common/include/containers/CPyWrapperMatrixView.hpp

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
/*! \brief Gets the value for a (row, column) pair. */ \
5656
passivedouble operator()(unsigned long row, unsigned long col) const { return Get(row, col); } \
5757
\
58+
/*! \brief Gets the values for a row of the matrix. */ \
59+
std::vector<passivedouble> operator()(unsigned long row) const { return Get(row); } \
60+
\
5861
/*! \brief Gets the value for a (row, column) pair. */ \
5962
passivedouble Get(unsigned long row, unsigned long col) const { return SU2_TYPE::GetValue(Access(row, col)); } \
6063
\
@@ -163,3 +166,77 @@ class CPyWrapperMarkerMatrixView {
163166
/*--- Use the macro to generate the interface. ---*/
164167
PY_WRAPPER_MATRIX_INTERFACE
165168
};
169+
170+
/*!
171+
* \class CPyWrapper3DMatrixView
172+
* \ingroup PySU2
173+
* \brief This class wraps C3DDoubleMatrix for the python wrapper matrix interface.
174+
* It is generaly used to wrap access to solver gradients defined for the entire volume.
175+
*/
176+
class CPyWrapper3DMatrixView {
177+
protected:
178+
static_assert(su2activematrix::IsRowMajor, "");
179+
su2double* data_ = nullptr;
180+
unsigned long rows_ = 0, cols_ = 0, dims_ = 0;
181+
std::string name_;
182+
bool read_only_ = false;
183+
184+
/*--- Define the functions required by the interface macro. ---*/
185+
inline const su2double& Access(unsigned long row, unsigned long col, unsigned long dim) const {
186+
if (row > rows_ || col > cols_ || dim > dims_) SU2_MPI::Error(name_ + " out of bounds", "CPyWrapper3DMatrixView");
187+
return data_[row * (cols_ * dims_) + col * dims_ + dim];
188+
}
189+
inline su2double& Access(unsigned long row, unsigned long col, unsigned long dim) {
190+
if (read_only_) SU2_MPI::Error(name_ + " is read-only", "CPyWrapper3DMatrixView");
191+
const auto& const_me = *this;
192+
return const_cast<su2double&>(const_me.Access(row, col, dim));
193+
}
194+
195+
public:
196+
CPyWrapper3DMatrixView() = default;
197+
198+
/*!
199+
* \brief Construct the view of the matrix.
200+
* \note "name" should be set to the variable name being returned to give better information to users.
201+
* \note "read_only" can be set to true to prevent the data from being modified.
202+
*/
203+
CPyWrapper3DMatrixView(C3DDoubleMatrix& mat, const std::string& name, bool read_only)
204+
: data_(mat.data()),
205+
rows_(mat.length()),
206+
cols_(mat.rows()),
207+
dims_(mat.cols()),
208+
name_(name),
209+
read_only_(read_only) {}
210+
211+
/*! \brief Returns the shape of the matrix. */
212+
std::vector<unsigned long> Shape() const { return {rows_, cols_, dims_}; }
213+
214+
/*! \brief Returns whether the data is read-only [true] or if it can be modified [false]. */
215+
bool IsReadOnly() const { return read_only_; }
216+
217+
/*! \brief Gets the value for a (row, column, dimension) triplet. */
218+
passivedouble operator()(unsigned long row, unsigned long col, unsigned long dim) const { return Get(row, col, dim); }
219+
220+
/*! \brief Gets the values for a row and column of the matrix. */
221+
std::vector<passivedouble> operator()(unsigned long row, unsigned long col) const { return Get(row, col); }
222+
223+
/*! \brief Gets the value for a (row, column, dimension) triplet. */
224+
passivedouble Get(unsigned long row, unsigned long col, unsigned long dim) const {
225+
return SU2_TYPE::GetValue(Access(row, col, dim));
226+
}
227+
228+
/*! \brief Gets the values for a row and column of the matrix. */
229+
std::vector<passivedouble> Get(unsigned long row, unsigned long col) const {
230+
std::vector<passivedouble> vals(dims_);
231+
for (unsigned long j = 0; j < dims_; ++j) vals[j] = Get(row, col, j);
232+
return vals;
233+
}
234+
/*! \brief Sets the value for a (row, column, dimension) triplet. This clears derivative information. */
235+
void Set(unsigned long row, unsigned long col, unsigned long dim, passivedouble val) { Access(row, col, dim) = val; }
236+
237+
/*! \brief Sets the values for a row and column of the matrix. */
238+
void Set(unsigned long row, unsigned long col, std::vector<passivedouble> vals) {
239+
unsigned long j = 0;
240+
for (const auto& val : vals) Set(row, col, j++, val);
241+
}
242+
};

Common/include/containers/container_decorators.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ class C3DContainerDecorator {
165165
FORCEINLINE StaticContainer get(Int i, Index j = 0) const noexcept {
166166
return m_storage.template get<StaticContainer>(i, j * m_innerSz);
167167
}
168+
169+
/*!
170+
* \brief Raw data access, for Python wrapper.
171+
*/
172+
FORCEINLINE Scalar* data() { return m_storage.data(); }
168173
};
169174

170175
/*!

Common/include/geometry/dual_grid/CPoint.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,9 @@ class CPoint {
8282
su2activematrix Coord; /*!< \brief vector with the coordinates of the node. */
8383
su2activematrix
8484
Coord_Old; /*!< \brief Old coordinates vector for primal solution reloading for Disc.Adj. with dynamic grid. */
85-
su2activematrix Coord_Sum; /*!< \brief Sum of coordinates vector for geometry smoothing. */
86-
su2activematrix Coord_n; /*!< \brief Coordinates at time n for use with dynamic meshes. */
87-
su2activematrix Coord_n1; /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */
88-
su2activematrix Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */
85+
su2activematrix Coord_n; /*!< \brief Coordinates at time n for use with dynamic meshes. */
86+
su2activematrix Coord_n1; /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */
87+
su2activematrix Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */
8988

9089
su2activematrix GridVel; /*!< \brief Velocity of the grid for dynamic mesh cases. */
9190
CVectorOfMatrix GridVel_Grad; /*!< \brief Gradient of the grid velocity for dynamic meshes. */

Common/include/option_structure.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ enum ENUM_FLUIDMODEL {
550550
FLUID_MIXTURE = 9, /*!< \brief Species mixture model. */
551551
COOLPROP = 10, /*!< \brief Thermodynamics library. */
552552
FLUID_FLAMELET = 11, /*!< \brief lookup table (LUT) method for premixed flamelets. */
553-
DATADRIVEN_FLUID = 12, /*!< \brief multi-layer perceptron driven fluid model. */
553+
DATADRIVEN_FLUID = 12, /*!< \brief multi-layer perceptron driven fluid model. */
554554
};
555555
static const MapType<std::string, ENUM_FLUIDMODEL> FluidModel_Map = {
556556
MakePair("STANDARD_AIR", STANDARD_AIR)

Common/src/CConfig.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,9 @@ void CConfig::SetConfig_Options() {
15481548
/*!\brief MARKER_PYTHON_CUSTOM\n DESCRIPTION: Python customizable marker(s) \ingroup Config*/
15491549
addStringListOption("MARKER_PYTHON_CUSTOM", nMarker_PyCustom, Marker_PyCustom);
15501550

1551+
/*!\brief PYTHON_CUSTOM_SOURCE\n DESCRIPTION: Python custom source \ingroup Config*/
1552+
addBoolOption("PYTHON_CUSTOM_SOURCE", PyCustomSource, false);
1553+
15511554
/*!\brief MARKER_WALL_FUNCTIONS\n DESCRIPTION: Viscous wall markers for which wall functions must be applied.
15521555
Format: (Wall function marker, wall function type, ...) \ingroup Config*/
15531556
addWallFunctionOption("MARKER_WALL_FUNCTIONS", nMarker_WallFunctions, Marker_WallFunctions,
@@ -5601,7 +5604,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
56015604
"to be equal to the number of entries of SPECIES_INIT +1",
56025605
CURRENT_FUNCTION);
56035606

5604-
// Helper function that checks scalar variable bounds,
5607+
/*--- Helper function that checks scalar variable bounds. ---*/
56055608
auto checkScalarBounds = [&](su2double scalar, const string& name, su2double lowerBound, su2double upperBound) {
56065609
if (scalar < lowerBound || scalar > upperBound)
56075610
SU2_MPI::Error(string("Variable: ") + name + string(", is out of bounds."), CURRENT_FUNCTION);

0 commit comments

Comments
 (0)