From 0e4d278e6167ea5fd704ee70cb9f208b22087833 Mon Sep 17 00:00:00 2001
From: acrovato <a.crovato@uliege.be>
Date: Mon, 29 Aug 2022 13:45:11 +0200
Subject: [PATCH] Adapt plot to change in amfe.

---
 dart/api/internal/polar.py | 6 +++---
 dart/tests/lift.py         | 2 +-
 dart/tests/morpher.py      | 4 ++--
 dart/tests/nonlift.py      | 2 +-
 dart/validation/agard.py   | 2 +-
 dart/validation/onera.py   | 2 +-
 ext/amfe                   | 2 +-
 vii/src/DDriver.cpp        | 2 +-
 vii/tests/bli2D.py         | 6 +++---
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/dart/api/internal/polar.py b/dart/api/internal/polar.py
index 682dc6e..695312c 100644
--- a/dart/api/internal/polar.py
+++ b/dart/api/internal/polar.py
@@ -132,6 +132,6 @@ class Polar:
         print(self.tms)
         # plot results
         if self.alphas[0] != self.alphas[-1]:
-            tU.plot(self.alphas, self.Cls, 'alpha', 'Cl', '')
-            tU.plot(self.alphas, self.Cds, 'alpha', 'Cd', '')
-            tU.plot(self.alphas, self.Cms, 'alpha', 'Cm', '')
+            tU.plot(self.alphas, self.Cls, {'xlabel': 'alpha', 'ylabel': 'Cl'})
+            tU.plot(self.alphas, self.Cds, {'xlabel': 'alpha', 'ylabel': 'Cd'})
+            tU.plot(self.alphas, self.Cms, {'xlabel': 'alpha', 'ylabel': 'Cm'})
diff --git a/dart/tests/lift.py b/dart/tests/lift.py
index aeeaea9..345eacf 100644
--- a/dart/tests/lift.py
+++ b/dart/tests/lift.py
@@ -80,7 +80,7 @@ def main():
 
     # visualize solution and plot results
     floD.initViewer(pbl)
-    tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True)
+    tboxU.plot(Cp[:,0], Cp[:,3], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), 'invert': True})
 
     # check results
     print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
diff --git a/dart/tests/morpher.py b/dart/tests/morpher.py
index 5bca5c1..1c9e6a3 100644
--- a/dart/tests/morpher.py
+++ b/dart/tests/morpher.py
@@ -128,8 +128,8 @@ def main():
     print(tms)
 
     # visualize solution and plot results
-    tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True)
-    tboxU.plot(Cp_ref[:,0], Cp_ref[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver_ref.Cl, solver_ref.Cd, solver_ref.Cm, 4), True)
+    tboxU.plot(Cp[:,0], Cp[:,3], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), 'invert': True})
+    tboxU.plot(Cp_ref[:,0], Cp_ref[:,3], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver_ref.Cl, solver_ref.Cd, solver_ref.Cm, 4), 'invert': True})
 
     # check results
     print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
diff --git a/dart/tests/nonlift.py b/dart/tests/nonlift.py
index 4a70f23..c9c543b 100644
--- a/dart/tests/nonlift.py
+++ b/dart/tests/nonlift.py
@@ -80,7 +80,7 @@ def main():
 
     # visualize solution and plot results
     floD.initViewer(pbl)
-    tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True)
+    tboxU.plot(Cp[:,0], Cp[:,3], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), 'invert': True})
 
     # check results
     print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
diff --git a/dart/validation/agard.py b/dart/validation/agard.py
index f1085d7..b2debb1 100644
--- a/dart/validation/agard.py
+++ b/dart/validation/agard.py
@@ -85,7 +85,7 @@ def main():
     if canPost:
         floU.writeSlices(msh.name,[0.01, 0.37, 0.75],5)
         data = tbxU.read('agard445_slice_1.dat')
-        tbxU.plot(data[:,3], data[:,4], 'x', 'Cp', 'Pressure distribution at MAC', True)
+        tbxU.plot(data[:,3], data[:,4], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Pressure distribution at MAC', 'invert': True})
     tms['post'].stop()
 
     # display timers
diff --git a/dart/validation/onera.py b/dart/validation/onera.py
index 2b13015..90d6595 100644
--- a/dart/validation/onera.py
+++ b/dart/validation/onera.py
@@ -83,7 +83,7 @@ def main():
     if canPost:
         floU.writeSlices(msh.name,[0.01, 0.239, 0.526, 0.777, 0.957, 1.076, 1.136, 1.184],5)
         data = tbxU.read('oneraM6_slice_2.dat')
-        tbxU.plot(data[:,3], data[:,4], 'x', 'Cp', 'Pressure distribution at MAC', True)
+        tbxU.plot(data[:,3], data[:,4], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Pressure distribution at MAC', 'invert': True})
     tms['post'].stop()
 
     # display timers
diff --git a/ext/amfe b/ext/amfe
index fab1af1..bed0e7b 160000
--- a/ext/amfe
+++ b/ext/amfe
@@ -1 +1 @@
-Subproject commit fab1af115a6197d8d31f9746d33436fd99ce5851
+Subproject commit bed0e7b82d06153dfa5822ba62bb34fa74261faa
diff --git a/vii/src/DDriver.cpp b/vii/src/DDriver.cpp
index a5d8b1a..f226c03 100644
--- a/vii/src/DDriver.cpp
+++ b/vii/src/DDriver.cpp
@@ -357,7 +357,7 @@ void Driver::averageTransition(size_t iPoint, BoundaryLayer *bl, int forced)
  */
 void Driver::computeSectionalDrag(std::vector<BoundaryLayer *> const &bl, size_t i)
 {
-    unsigned int nVar = bl[0]->getnVar();
+    size_t nVar = bl[0]->getnVar();
     size_t lastWkPt = (bl[2]->mesh->getnMarkers() - 1) * nVar;
 
     // Normalize friction and dissipation coefficients.
diff --git a/vii/tests/bli2D.py b/vii/tests/bli2D.py
index 34a8247..c793806 100644
--- a/vii/tests/bli2D.py
+++ b/vii/tests/bli2D.py
@@ -25,7 +25,7 @@
 # - Transition routines.
 # - Compressible flow routines.
 # - Laminar and turbulent flow.
-# 
+#
 # Untested functionalities.
 # - Separation routines.
 # - Multiple failure case at one iteration.
@@ -114,8 +114,8 @@ def main():
     tests.run()
 
     # Plot results
-    tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(iSolverAPI.getCl(), vSolver.Cdt, iSolverAPI.getCm(), 4), True)
-    tboxU.plot(vSolution['x/c'], vSolution['Cf'], '$x/c$', '$c_f$', 'Cdt = {0:.{3}f}, Cdf = {1:.{3}f}, Cdp = {2:.{3}f}'.format(vSolver.Cdt, vSolver.Cdf, vSolver.Cdp, 4))
+    tboxU.plot(Cp[:,0], Cp[:,3], {'xlabel': 'x', 'ylabel': 'Cp', 'title': 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(iSolverAPI.getCl(), vSolver.Cdt, iSolverAPI.getCm(), 4), 'invert': True})
+    tboxU.plot(vSolution['x/c'], vSolution['Cf'], {'xlabel': '$x/c$', 'ylabel': '$c_f$', 'title': 'Cdt = {0:.{3}f}, Cdf = {1:.{3}f}, Cdp = {2:.{3}f}'.format(vSolver.Cdt, vSolver.Cdf, vSolver.Cdp, 4), 'xlim': [0, 1]})
     # eof.
     print('')
 
-- 
GitLab