Skip to content

Commit 1ea9a2b

Browse files
authored
Merge pull request #1149 from su2code/more_vectorization
Support for UQ and NICF with vectorized (SIMD) centered schemes
2 parents 1f1e6e3 + 518754a commit 1ea9a2b

37 files changed

Lines changed: 1036 additions & 1725 deletions

Common/include/grid_movement/CFreeFormDefBox.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -756,13 +756,4 @@ class CFreeFormDefBox : public CGridMovement {
756756
*/
757757
inline unsigned short GetLevel() const { return Level; }
758758

759-
/*!
760-
* \brief Compute the determinant of a 3 by 3 matrix.
761-
* \param[in] val_matrix 3 by 3 matrix.
762-
* \result Determinant of the matrix
763-
*/
764-
inline su2double Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
765-
return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
766-
}
767-
768759
};

Common/include/grid_movement/CVolumetricMovement.hpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -361,26 +361,6 @@ class CVolumetricMovement : public CGridMovement {
361361
*/
362362
void UpdateGridCoord_Derivatives(CGeometry *geometry, CConfig *config);
363363

364-
/*!
365-
* \brief Compute the determinant of a 3 by 3 matrix.
366-
* 3 by 3 matrix elements
367-
* \param[in] A00
368-
* \param[in] A01
369-
* \param[in] A02
370-
* \param[in] A10
371-
* \param[in] A11
372-
* \param[in] A12
373-
* \param[in] A20
374-
* \param[in] A21
375-
* \param[in] A22
376-
* \result Determinant of the matrix
377-
*/
378-
inline su2double Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
379-
return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
380-
}
381-
382-
383-
384364
/*!
385365
* \brief Store the number of iterations when moving the mesh.
386366
* \param[in] val_nIterMesh - Number of iterations.

Common/include/linear_algebra/CSysVector.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ class CSysVector : public VecExpr::CVecExpr<CSysVector<ScalarType>, ScalarType>
6767
unsigned long nElm = 0; /*!< \brief Total number of elements (or number elements on this processor). */
6868
unsigned long nElmDomain = 0; /*!< \brief Total number of elements without Ghost cells. */
6969
unsigned long nVar = 0; /*!< \brief Number of elements in a block. */
70-
mutable ScalarType dotRes = 0.0; /*!< \brief Result of dot product. to perform a reduction with OpenMP the
71-
variable needs to be declared outside the parallel region. */
7270

7371
/*!
7472
* \brief Generic initialization from a scalar or array.
@@ -101,7 +99,7 @@ class CSysVector : public VecExpr::CVecExpr<CSysVector<ScalarType>, ScalarType>
10199
/*!
102100
* \brief Default constructor of the class.
103101
*/
104-
CSysVector() {}
102+
CSysVector() = default;
105103

106104
/*!
107105
* \brief Destructor
@@ -291,8 +289,10 @@ class CSysVector : public VecExpr::CVecExpr<CSysVector<ScalarType>, ScalarType>
291289
*/
292290
template <class T>
293291
ScalarType dot(const VecExpr::CVecExpr<T, ScalarType>& expr) const {
292+
static ScalarType dotRes;
294293
/*--- All threads get the same "view" of the vectors and shared variable. ---*/
295294
SU2_OMP_BARRIER
295+
SU2_OMP_MASTER
296296
dotRes = 0.0;
297297
SU2_OMP_BARRIER
298298

0 commit comments

Comments
 (0)