From 6f16bb570f56f2f5a33ecceb8fcb7009dba9bb85 Mon Sep 17 00:00:00 2001
From: acrovato <a.crovato@uliege.be>
Date: Mon, 18 Nov 2024 12:04:47 +0100
Subject: [PATCH] Update clang-format to v14. Update formatting options.
 Format.

---
 .clang-format                  | 20 +++++++++++++++++++-
 dart/src/dart.h                |  2 +-
 dart/src/wAdjoint.cpp          |  2 +-
 dart/src/wAdjoint.h            |  2 +-
 dart/src/wAssign.h             |  2 +-
 dart/src/wBlowing.h            |  2 +-
 dart/src/wBlowingResidual.h    |  2 +-
 dart/src/wF0Ps.h               |  2 +-
 dart/src/wF1Ct.h               |  2 +-
 dart/src/wF1El.h               |  2 +-
 dart/src/wFace.h               |  2 +-
 dart/src/wFluid.h              |  2 +-
 dart/src/wFpeLSFunction.h      |  2 +-
 dart/src/wFreestream.h         |  2 +-
 dart/src/wFreestreamResidual.h |  2 +-
 dart/src/wKutta.cpp            |  4 ++--
 dart/src/wKutta.h              |  2 +-
 dart/src/wKuttaElement.h       |  2 +-
 dart/src/wKuttaResidual.cpp    |  2 +-
 dart/src/wKuttaResidual.h      |  2 +-
 dart/src/wLoadFunctional.h     |  2 +-
 dart/src/wNewton.cpp           |  4 ++--
 dart/src/wNewton.h             |  2 +-
 dart/src/wPicard.cpp           |  2 +-
 dart/src/wPicard.h             |  2 +-
 dart/src/wPotentialResidual.h  |  2 +-
 dart/src/wProblem.h            |  2 +-
 dart/src/wSolver.h             |  2 +-
 dart/src/wWake.cpp             |  4 ++--
 dart/src/wWake.h               |  2 +-
 dart/src/wWakeElement.h        |  2 +-
 dart/src/wWakeResidual.h       |  2 +-
 vii/src/DDiscretization.cpp    |  2 +-
 33 files changed, 54 insertions(+), 36 deletions(-)

diff --git a/.clang-format b/.clang-format
index 60cf9d5..754996e 100644
--- a/.clang-format
+++ b/.clang-format
@@ -4,7 +4,25 @@
 BasedOnStyle: LLVM
 UseTab: Never
 IndentWidth: 4
-BreakBeforeBraces: Allman
+BreakBeforeBraces: Custom
+BraceWrapping:
+  AfterNamespace: true
+  AfterClass: true
+  AfterStruct: true
+  AfterFunction: true
+  BeforeLambdaBody: false
+  AfterControlStatement: Always
+  BeforeElse: true
+  AfterCaseLabel: true
+  BeforeWhile: false
+  BeforeCatch: true
+  AfterEnum: true
+  AfterUnion: true
+  AfterExternBlock: true
+  SplitEmptyNamespace: false
+  SplitEmptyFunction: false
+  SplitEmptyRecord: false
+  IndentBraces: false
 AccessModifierOffset: -4
 SortIncludes: false
 ColumnLimit: 0
diff --git a/dart/src/dart.h b/dart/src/dart.h
index 4770c32..60c5692 100644
--- a/dart/src/dart.h
+++ b/dart/src/dart.h
@@ -90,4 +90,4 @@ class FaceEq;
 
 } // namespace dart
 
-#endif //DART_H
+#endif // DART_H
diff --git a/dart/src/wAdjoint.cpp b/dart/src/wAdjoint.cpp
index 1d75d8a..4dd690b 100644
--- a/dart/src/wAdjoint.cpp
+++ b/dart/src/wAdjoint.cpp
@@ -525,7 +525,7 @@ void Adjoint::buildGradientResidualMesh(Eigen::SparseMatrix<double, Eigen::RowMa
     tbb::parallel_for_each(fluid->adjMap.begin(), fluid->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> p) {
         // Current element
         Element *e = p.first;
-        //Upwind element
+        // Upwind element
         Element *eU = p.second[0];
         // Build elementary matrices
         Eigen::MatrixXd Ae1, Ae2;
diff --git a/dart/src/wAdjoint.h b/dart/src/wAdjoint.h
index b2dc8ff..a8c678e 100644
--- a/dart/src/wAdjoint.h
+++ b/dart/src/wAdjoint.h
@@ -105,4 +105,4 @@ private:
 };
 
 } // namespace dart
-#endif //WADJOINT_H
+#endif // WADJOINT_H
diff --git a/dart/src/wAssign.h b/dart/src/wAssign.h
index 5f8b47a..86207a9 100644
--- a/dart/src/wAssign.h
+++ b/dart/src/wAssign.h
@@ -83,4 +83,4 @@ public:
 
 } // namespace dart
 
-#endif //WASSIGN_H
+#endif // WASSIGN_H
diff --git a/dart/src/wBlowing.h b/dart/src/wBlowing.h
index ca06a0b..7334194 100644
--- a/dart/src/wBlowing.h
+++ b/dart/src/wBlowing.h
@@ -53,4 +53,4 @@ private:
 
 } // namespace dart
 
-#endif //WBLOWING_H
+#endif // WBLOWING_H
diff --git a/dart/src/wBlowingResidual.h b/dart/src/wBlowingResidual.h
index 0844cb3..f2857b8 100644
--- a/dart/src/wBlowingResidual.h
+++ b/dart/src/wBlowingResidual.h
@@ -36,4 +36,4 @@ public:
 };
 
 } // namespace dart
-#endif //WBLOWINGRESIDUAL_H
+#endif // WBLOWINGRESIDUAL_H
diff --git a/dart/src/wF0Ps.h b/dart/src/wF0Ps.h
index 05e8686..8c769a1 100644
--- a/dart/src/wF0Ps.h
+++ b/dart/src/wF0Ps.h
@@ -54,4 +54,4 @@ public:
 
 } // namespace dart
 
-#endif //WF0PS_H
+#endif // WF0PS_H
diff --git a/dart/src/wF1Ct.h b/dart/src/wF1Ct.h
index 3041a2f..096868c 100644
--- a/dart/src/wF1Ct.h
+++ b/dart/src/wF1Ct.h
@@ -96,4 +96,4 @@ public:
 
 } // namespace dart
 
-#endif //WF1CT_H
+#endif // WF1CT_H
diff --git a/dart/src/wF1El.h b/dart/src/wF1El.h
index 90889f2..3a911b5 100644
--- a/dart/src/wF1El.h
+++ b/dart/src/wF1El.h
@@ -62,4 +62,4 @@ public:
 
 } // namespace dart
 
-#endif //WF1EL_H
+#endif // WF1EL_H
diff --git a/dart/src/wFace.h b/dart/src/wFace.h
index a585f5e..9b46b6c 100644
--- a/dart/src/wFace.h
+++ b/dart/src/wFace.h
@@ -85,4 +85,4 @@ public:
 
 } // namespace dart
 
-#endif //WFACE_H
+#endif // WFACE_H
diff --git a/dart/src/wFluid.h b/dart/src/wFluid.h
index ec10d01..600c35d 100644
--- a/dart/src/wFluid.h
+++ b/dart/src/wFluid.h
@@ -59,4 +59,4 @@ public:
 
 } // namespace dart
 
-#endif //WFLUID_H
+#endif // WFLUID_H
diff --git a/dart/src/wFpeLSFunction.h b/dart/src/wFpeLSFunction.h
index de81d0c..495f9e9 100644
--- a/dart/src/wFpeLSFunction.h
+++ b/dart/src/wFpeLSFunction.h
@@ -49,4 +49,4 @@ public:
 
 } // namespace dart
 
-#endif //WFPELSFUNCTION_H
+#endif // WFPELSFUNCTION_H
diff --git a/dart/src/wFreestream.h b/dart/src/wFreestream.h
index 4b7d032..a3d1c0c 100644
--- a/dart/src/wFreestream.h
+++ b/dart/src/wFreestream.h
@@ -45,4 +45,4 @@ public:
 
 } // namespace dart
 
-#endif //WFREESTREAM_H
+#endif // WFREESTREAM_H
diff --git a/dart/src/wFreestreamResidual.h b/dart/src/wFreestreamResidual.h
index cafe98c..46a1ac8 100644
--- a/dart/src/wFreestreamResidual.h
+++ b/dart/src/wFreestreamResidual.h
@@ -38,4 +38,4 @@ public:
 };
 
 } // namespace dart
-#endif //WFREESTREAMRESIDUAL_H
+#endif // WFREESTREAMRESIDUAL_H
diff --git a/dart/src/wKutta.cpp b/dart/src/wKutta.cpp
index a8bc12d..5eda552 100644
--- a/dart/src/wKutta.cpp
+++ b/dart/src/wKutta.cpp
@@ -82,10 +82,10 @@ void Kutta::connectNodes()
     // Create the node map
     for (auto nUp : nodesUp)
     {
-        //std::cout << "MASTER: " << nUp->pos(0) << ',' << nUp->pos(1) << ',' << nUp->pos(2) << std::endl;
+        // std::cout << "MASTER: " << nUp->pos(0) << ',' << nUp->pos(1) << ',' << nUp->pos(2) << std::endl;
         for (auto nLw : nodesLw)
         {
-            //std::cout << "    SLAVE: " << nLw->pos(0) << ',' << nLw->pos(1) << ',' << nLw->pos(2) << std::endl;
+            // std::cout << "    SLAVE: " << nLw->pos(0) << ',' << nLw->pos(1) << ',' << nLw->pos(2) << std::endl;
             if ((nUp->pos - nLw->pos).norm() <= 1e-14)
             {
                 nodMap.push_back(std::pair<Node *, Node *>(nUp, nLw));
diff --git a/dart/src/wKutta.h b/dart/src/wKutta.h
index dbe15e2..fe04443 100644
--- a/dart/src/wKutta.h
+++ b/dart/src/wKutta.h
@@ -56,4 +56,4 @@ private:
 
 } // namespace dart
 
-#endif //WKUTTA_H
+#endif // WKUTTA_H
diff --git a/dart/src/wKuttaElement.h b/dart/src/wKuttaElement.h
index f3fe8d8..7fe70d4 100644
--- a/dart/src/wKuttaElement.h
+++ b/dart/src/wKuttaElement.h
@@ -65,4 +65,4 @@ private:
 
 } // namespace dart
 
-#endif //WKUTTAELEMENT_H
+#endif // WKUTTAELEMENT_H
diff --git a/dart/src/wKuttaResidual.cpp b/dart/src/wKuttaResidual.cpp
index 8884b5f..ae8ff72 100644
--- a/dart/src/wKuttaResidual.cpp
+++ b/dart/src/wKuttaResidual.cpp
@@ -131,7 +131,7 @@ Eigen::MatrixXd KuttaResidual::buildGradientFlow(KuttaElement const &ke, std::ve
 
 /**
  * @brief Build the gradient of the residual vector with respect to the nodes, on one Kutta element
- * 
+ *
  * A = d( 1/S * \int (psi + grad_psi*v_inf) * (grad_phi)^2 dS )
  *   = d1/S * \int (psi + grad_psi*v_inf) * (grad_phi)^2 dS
  *   + 1/S * \int dgrad_psi*v_inf * (grad_phi)^2 dS
diff --git a/dart/src/wKuttaResidual.h b/dart/src/wKuttaResidual.h
index 2fff0c1..277a4b9 100644
--- a/dart/src/wKuttaResidual.h
+++ b/dart/src/wKuttaResidual.h
@@ -41,4 +41,4 @@ public:
 };
 
 } // namespace dart
-#endif //WKUTTARESIDUAL_H
+#endif // WKUTTARESIDUAL_H
diff --git a/dart/src/wLoadFunctional.h b/dart/src/wLoadFunctional.h
index 338f71e..225f151 100644
--- a/dart/src/wLoadFunctional.h
+++ b/dart/src/wLoadFunctional.h
@@ -39,4 +39,4 @@ public:
 };
 
 } // namespace dart
-#endif //WLOADFUNCTIONAL_H
+#endif // WLOADFUNCTIONAL_H
diff --git a/dart/src/wNewton.cpp b/dart/src/wNewton.cpp
index 37dfb4b..f4b932f 100644
--- a/dart/src/wNewton.cpp
+++ b/dart/src/wNewton.cpp
@@ -115,7 +115,7 @@ Status Newton::run()
     // Linesearch
     FpeLSFunction fpe(*this, phi, phi, dPhi_, rPhi_);
     BankRoseLS ls(fpe);
-    //FleuryLS ls(fpe, 1., 1e-2, false);
+    // FleuryLS ls(fpe, 1., 1e-2, false);
     ls.set(maxLsIt, lsTol, verbose);
 
     // Display residual
@@ -291,7 +291,7 @@ void Newton::buildJac(Eigen::SparseMatrix<double, Eigen::RowMajor> &J)
     tbb::parallel_for_each(fluid->adjMap.begin(), fluid->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> p) {
         // Current element
         Element *e = p.first;
-        //Upwind element
+        // Upwind element
         Element *eU = p.second[0];
         // Build elementary matrices
         Eigen::MatrixXd Ae1, Ae2;
diff --git a/dart/src/wNewton.h b/dart/src/wNewton.h
index 83950e3..aa1150a 100644
--- a/dart/src/wNewton.h
+++ b/dart/src/wNewton.h
@@ -63,4 +63,4 @@ private:
 
 } // namespace dart
 
-#endif //WNEWTON_H
+#endif // WNEWTON_H
diff --git a/dart/src/wPicard.cpp b/dart/src/wPicard.cpp
index 6648a8c..52b9078 100644
--- a/dart/src/wPicard.cpp
+++ b/dart/src/wPicard.cpp
@@ -205,7 +205,7 @@ Status Picard::run()
 
 /**
  * @brief Build LHS matrix and RHS vector for Picard iteration
- * 
+ *
  * A = \int rho * grad_phi * grad_psi dV
  * b = \int rho * grad_phi * n * psi dS
  */
diff --git a/dart/src/wPicard.h b/dart/src/wPicard.h
index 6998089..063a94b 100644
--- a/dart/src/wPicard.h
+++ b/dart/src/wPicard.h
@@ -52,4 +52,4 @@ private:
 
 } // namespace dart
 
-#endif //WPICARD_H
+#endif // WPICARD_H
diff --git a/dart/src/wPotentialResidual.h b/dart/src/wPotentialResidual.h
index 6d17570..5007fe1 100644
--- a/dart/src/wPotentialResidual.h
+++ b/dart/src/wPotentialResidual.h
@@ -43,4 +43,4 @@ public:
 };
 
 } // namespace dart
-#endif //WPOTENTIALRESIDUAL_H
+#endif // WPOTENTIALRESIDUAL_H
diff --git a/dart/src/wProblem.h b/dart/src/wProblem.h
index c57042a..2ef363d 100644
--- a/dart/src/wProblem.h
+++ b/dart/src/wProblem.h
@@ -95,4 +95,4 @@ private:
 
 } // namespace dart
 
-#endif //WPROBLEM_H
+#endif // WPROBLEM_H
diff --git a/dart/src/wSolver.h b/dart/src/wSolver.h
index 605f0c0..8055299 100644
--- a/dart/src/wSolver.h
+++ b/dart/src/wSolver.h
@@ -86,4 +86,4 @@ protected:
 };
 
 } // namespace dart
-#endif //WSOLVER_H
+#endif // WSOLVER_H
diff --git a/dart/src/wWake.cpp b/dart/src/wWake.cpp
index 1aaba02..a584e00 100644
--- a/dart/src/wWake.cpp
+++ b/dart/src/wWake.cpp
@@ -112,10 +112,10 @@ void Wake::connectNodes()
     // Create the node map
     for (auto nUp : nodesUp)
     {
-        //std::cout << "MASTER: " << nUp->pos(0) << ',' << nUp->pos(1) << ',' << nUp->pos(2) << std::endl;
+        // std::cout << "MASTER: " << nUp->pos(0) << ',' << nUp->pos(1) << ',' << nUp->pos(2) << std::endl;
         for (auto nLw : nodesLw)
         {
-            //std::cout << "    SLAVE: " << nLw->pos(0) << ',' << nLw->pos(1) << ',' << nLw->pos(2) << std::endl;
+            // std::cout << "    SLAVE: " << nLw->pos(0) << ',' << nLw->pos(1) << ',' << nLw->pos(2) << std::endl;
             if ((nUp->pos - nLw->pos).norm() <= 1e-14)
             {
                 nodMap[nUp] = nLw;
diff --git a/dart/src/wWake.h b/dart/src/wWake.h
index 72670e8..2f7a10c 100644
--- a/dart/src/wWake.h
+++ b/dart/src/wWake.h
@@ -59,4 +59,4 @@ private:
 
 } // namespace dart
 
-#endif //WWAKE_H
+#endif // WWAKE_H
diff --git a/dart/src/wWakeElement.h b/dart/src/wWakeElement.h
index 43ead69..de2add6 100644
--- a/dart/src/wWakeElement.h
+++ b/dart/src/wWakeElement.h
@@ -67,4 +67,4 @@ private:
 
 } // namespace dart
 
-#endif //WWAKEELEMENT_H
+#endif // WWAKEELEMENT_H
diff --git a/dart/src/wWakeResidual.h b/dart/src/wWakeResidual.h
index 8501d7f..5b6fad0 100644
--- a/dart/src/wWakeResidual.h
+++ b/dart/src/wWakeResidual.h
@@ -41,4 +41,4 @@ public:
 };
 
 } // namespace dart
-#endif //WWAKERESIDUAL_H
+#endif // WWAKERESIDUAL_H
diff --git a/vii/src/DDiscretization.cpp b/vii/src/DDiscretization.cpp
index 8f4e561..872c555 100644
--- a/vii/src/DDiscretization.cpp
+++ b/vii/src/DDiscretization.cpp
@@ -34,7 +34,7 @@ void Discretization::setGlob(std::vector<double> &_x, std::vector<double> &_y, s
 
 /**
  * @brief Compute x/chord coordinate.
-*/
+ */
 void Discretization::computeOCcoord()
 {
     // Find min and max of array x
-- 
GitLab