From 64f8724aa813a20284c4439f5804ee8c6319ccb2 Mon Sep 17 00:00:00 2001
From: acrovato <a.crovato@uliege.be>
Date: Tue, 11 Oct 2022 13:37:17 +0200
Subject: [PATCH] Fix install VII. Minor improvments before release 1.2

---
 dart/api/core.py       | 2 +-
 dart/src/wNewton.cpp   | 4 ++--
 dart/src/wPicard.cpp   | 4 ++--
 dart/src/wSolver.cpp   | 6 +++---
 dart/validation/crm.py | 2 +-
 vii/CMakeLists.txt     | 1 +
 vii/tests/bli2D.py     | 9 +++++----
 7 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/dart/api/core.py b/dart/api/core.py
index 3dd8799..4bd4eba 100644
--- a/dart/api/core.py
+++ b/dart/api/core.py
@@ -155,7 +155,7 @@ def initDart(cfg, scenario='aerodynamic', task='analysis', viscous=False):
 
     # Mesh morpher creation
     if scenario == 'aerostructural' or task == 'optimization':
-        _mrf = tbox.MshDeform(_msh, tbox.Gmres(1, 1e-6, 30, 1e-8), _dim, nthrds=nthrd, vrb=verb)
+        _mrf = tbox.MshDeform(_msh, tbox.Gmres(2, 1e-6, 50, 1e-8, 500), _dim, nthrds=nthrd, vrb=verb)
         _mrf.setField(cfg['Fluid'])
         for tag in cfg['Farfield']:
             _mrf.addFixed(tag)
diff --git a/dart/src/wNewton.cpp b/dart/src/wNewton.cpp
index 91ac0a2..7943ae5 100644
--- a/dart/src/wNewton.cpp
+++ b/dart/src/wNewton.cpp
@@ -243,7 +243,7 @@ STATUS Newton::run()
     if (relRes < relTol || absRes < absTol)
     {
         if (verbose > 0)
-            std::cout << ANSI_COLOR_GREEN << "Newton solver converged!" << ANSI_COLOR_RESET << std::endl;
+            std::cout << ANSI_COLOR_GREEN << "Newton solver converged." << ANSI_COLOR_RESET << std::endl;
         if (verbose > 2)
             std::cout << "Newton solver CPU" << std::endl
                       << tms;
@@ -265,7 +265,7 @@ STATUS Newton::run()
     else
     {
         if (verbose > 0)
-            std::cout << ANSI_COLOR_YELLOW << "Newton solver not fully converged!" << ANSI_COLOR_RESET << std::endl;
+            std::cout << ANSI_COLOR_YELLOW << "Newton solver not fully converged." << ANSI_COLOR_RESET << std::endl;
         if (verbose > 2)
             std::cout << "Newton solver CPU" << std::endl
                       << tms;
diff --git a/dart/src/wPicard.cpp b/dart/src/wPicard.cpp
index 15177eb..537f127 100644
--- a/dart/src/wPicard.cpp
+++ b/dart/src/wPicard.cpp
@@ -171,7 +171,7 @@ STATUS Picard::run()
     if (relRes < relTol || absRes < absTol)
     {
         if (verbose > 0)
-            std::cout << ANSI_COLOR_GREEN << "Picard solver converged!" << ANSI_COLOR_RESET << std::endl;
+            std::cout << ANSI_COLOR_GREEN << "Picard solver converged." << ANSI_COLOR_RESET << std::endl;
         if (verbose > 2)
             std::cout << "Picard solver CPU" << std::endl
                       << tms;
@@ -193,7 +193,7 @@ STATUS Picard::run()
     else
     {
         if (verbose > 0)
-            std::cout << ANSI_COLOR_YELLOW << "Picard solver not fully converged!" << ANSI_COLOR_RESET << std::endl;
+            std::cout << ANSI_COLOR_YELLOW << "Picard solver not fully converged." << ANSI_COLOR_RESET << std::endl;
         if (verbose > 2)
             std::cout << "Picard solver CPU" << std::endl
                       << tms;
diff --git a/dart/src/wSolver.cpp b/dart/src/wSolver.cpp
index 32e8c70..2c2d60c 100644
--- a/dart/src/wSolver.cpp
+++ b/dart/src/wSolver.cpp
@@ -64,7 +64,7 @@ Solver::Solver(std::shared_ptr<Problem> _pbl,
               << "**                      _  /_/ /_  ___ |  __ _/_  /                          **\n"
               << "**                      /_____/ /_/  |_/_/ |_| /_/                           **\n"
               << "*******************************************************************************\n"
-              << "** Hi! My name is DART v1.2.0-22.04                                          **\n"
+              << "** Hi! My name is DART v1.2.0-22.10                                          **\n"
               << "** Adrien Crovato                                                            **\n"
               << "** ULiege 2018-2022                                                          **\n"
               << "*******************************************************************************\n"
@@ -274,6 +274,6 @@ void Solver::computeFlow()
     });
 
     // Check maximum Mach number
-    if (*std::max_element(M.begin(), M.end()) >= 1.25 && verbose > 0)
-        std::cout << ANSI_COLOR_YELLOW << "Max. Mach greater than 1.25!" << ANSI_COLOR_RESET << std::endl;
+    if (*std::max_element(M.begin(), M.end()) >= 1.3 && verbose > 0)
+        std::cout << ANSI_COLOR_YELLOW << "Max. Mach greater than 1.3." << ANSI_COLOR_RESET << std::endl;
 }
diff --git a/dart/validation/crm.py b/dart/validation/crm.py
index c70fd7a..c773d86 100644
--- a/dart/validation/crm.py
+++ b/dart/validation/crm.py
@@ -75,7 +75,7 @@ def cfg():
     'z_ref' : 4.520, # z-coordinate of reference point for moment computation
     # Numerical
     'LSolver' : 'GMRES', # inner solver (PARDISO, MUMPS or GMRES)
-    'G_fill' : 2, # fill-in factor for GMRES preconditioner (optional, default=2)
+    'G_fill' : 3, # fill-in factor for GMRES preconditioner (optional, default=2)
     'G_tol' : 1e-5, # tolerance for GMRES (optional, default=1e-5)
     'G_restart' : 50, # restart for GMRES (optional, default=50)
     'Rel_tol' : 1e-6, # relative tolerance on solver residual
diff --git a/vii/CMakeLists.txt b/vii/CMakeLists.txt
index 62fe065..fba4e43 100644
--- a/vii/CMakeLists.txt
+++ b/vii/CMakeLists.txt
@@ -21,6 +21,7 @@ MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests)
 
 # Add to install
 INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/__init__.py
+              ${CMAKE_CURRENT_LIST_DIR}/coupler.py
               ${CMAKE_CURRENT_LIST_DIR}/utils.py
         DESTINATION vii)
 INSTALL(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/api
diff --git a/vii/tests/bli2D.py b/vii/tests/bli2D.py
index c793806..e661a8b 100644
--- a/vii/tests/bli2D.py
+++ b/vii/tests/bli2D.py
@@ -102,6 +102,10 @@ def main():
     print('SOLVERS statistics')
     print(Coupler.tms)
 
+    # Plot results.
+    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]})
+
     # Check results.
     # Test for n0012 (le=0.01, te=0.01), alpha=2, M=.2, Re=1e7.
     print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
@@ -113,10 +117,7 @@ def main():
     tests.add(CTest('xtr_bot', vSolution['xtrB'], 0.50, 0.03, forceabs=True)) # XFOIL 0.4998
     tests.run()
 
-    # Plot results
-    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.
+    # eof
     print('')
 
 if __name__ == "__main__":
-- 
GitLab