diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2e953b0445259b0f8b7f576e6887418036485c11..b20741692e44419102f489f2b7e6830d8bf01ffa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c373e09084802ea2b448465a8d52b288807e5b8..4a43728c66bad33059d2c862f2163edcc202d406 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/CREDITS.txt b/CREDITS.txt
index f2c6efa6a98f3bf0c913ca21335688da30e89afe..d1769d857a77f926c2bedd217f19f8337b657bc2 100644
--- a/CREDITS.txt
+++ b/CREDITS.txt
@@ -1,4 +1,4 @@
-                 Gmsh is copyright (C) 1997-2020
+                 Gmsh is copyright (C) 1997-2021
 
                        Christophe Geuzaine
                      <cgeuzaine at uliege.be>
diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt
index 9b2812de56556b462e18b1cee1a014b7522b0c65..b389bbc11ff91df30d63292ba6e782a901f7e3f4 100644
--- a/Common/CMakeLists.txt
+++ b/Common/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/Colors.h b/Common/Colors.h
index b3eedfcb1662ccd82539f13d33c31388dddc8f25..2c7d4c87b00b773de96a221c1348514c85747634 100644
--- a/Common/Colors.h
+++ b/Common/Colors.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -666,7 +666,7 @@ StringX4Int ColorString[] = {
   { "DarkMagenta"              ,  139,   0, 139, 255 } ,
   { "DarkRed"                  ,  139,   0,   0, 255 } ,
   { "LightGreen"               ,  144, 238, 144, 255 } ,
-  { 0                          ,  0  ,   0,   0, 255 }
+  { nullptr                    ,  0  ,   0,   0, 255 }
 } ;
 
 #endif
diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp
index 1485bdf42c4b2f88918f565c12e8348546017db1..e1b778f568c294d03f13ac2965d96f60044f6463 100644
--- a/Common/CommandLine.cpp
+++ b/Common/CommandLine.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -1285,13 +1285,13 @@ void GetOptions(bool readConfigFiles, bool exitOnError)
       else if(argv[i] == "-help" || argv[i] == "--help") {
         Msg::Direct(
           "Gmsh, a 3D mesh generator with pre- and post-processing facilities");
-        Msg::Direct("Copyright (C) 1997-2020 C. Geuzaine and J.-F. Remacle");
+        Msg::Direct("Copyright (C) 1997-2021 C. Geuzaine and J.-F. Remacle");
         PrintUsage(argv[0]);
         Msg::Exit(0);
       }
       else if(argv[i] == "-help_options") {
         std::vector<std::string> s;
-        PrintOptions(0, GMSH_FULLRC, 0, 1, 0, &s);
+        PrintOptions(0, GMSH_FULLRC, 0, 1, nullptr, &s);
         for(std::size_t i = 0; i < s.size(); i++)
           Msg::Direct("%s\n", s[i].c_str());
         Msg::Exit(0);
diff --git a/Common/CommandLine.h b/Common/CommandLine.h
index 9c2ddfb0af384de8e805db30cd7585baa61d7485..0fb4ea0ca6c0d0fc816d92220e7b26ad46ce692c 100644
--- a/Common/CommandLine.h
+++ b/Common/CommandLine.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/Context.cpp b/Common/Context.cpp
index 273a62dba40d7b16bb43b3d2742180b84138547b..995d4bfe670167b93065c63d4abf9ee2535a69a8 100644
--- a/Common/Context.cpp
+++ b/Common/Context.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -79,7 +79,7 @@ void CTX::init()
   numWindows = numTiles = 1;
   deltaFontSize = 0;
   recentFiles.resize(10);
-  gamepad = 0;
+  gamepad = nullptr;
   mesh.switchElementTags = 0;
   terminal = 0;
 
@@ -113,10 +113,10 @@ void CTX::init()
   mesh.minCircPoints = mesh.order = 0;
   mesh.secondOrderLinear = mesh.secondOrderIncomplete = 0;
   mesh.lightLines = 2;
-  mesh.lcCallback = NULL;
+  mesh.lcCallback = nullptr;
 }
 
-CTX *CTX::_instance = NULL;
+CTX *CTX::_instance = nullptr;
 
 CTX *CTX::instance()
 {
diff --git a/Common/Context.h b/Common/Context.h
index 58828d8dc7111939c7b210cc2442b17488aa6ece..a5a821ccc0d29fef6c54fc5fa31ddbc0c70f7693 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp
index 23b5f3648f40f154f5303fc37177b2dfa87973f4..af0969558ab93ba4de4c443d82cd93af53dec017 100644
--- a/Common/CreateFile.cpp
+++ b/Common/CreateFile.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -179,7 +179,7 @@ std::string GetKnownFileFormats(bool onlyMeshFormats)
 #if defined(HAVE_FLTK)
 static PixelBuffer *GetCompositePixelBuffer(GLenum format, GLenum type)
 {
-  openglWindow *newg = 0;
+  openglWindow *newg = nullptr;
 
   if(CTX::instance()->print.width > 0 || CTX::instance()->print.height > 0){
     GLint width = FlGui::instance()->getCurrentOpenglWindow()->pixel_w();
@@ -259,7 +259,7 @@ static PixelBuffer *GetCompositePixelBuffer(GLenum format, GLenum type)
   }
 
   if(newg){
-    openglWindow::setLastHandled(0);
+    openglWindow::setLastHandled(nullptr);
     newg->hide();
     delete newg;
   }
@@ -588,7 +588,7 @@ void CreateOutputFile(const std::string &fileName, int format,
       while(res == GL2PS_OVERFLOW) {
         buffsize += 2048 * 2048;
         gl2psBeginPage(base.c_str(), "Gmsh", pixel_viewport,
-                       psformat, pssort, psoptions, GL_RGBA, 0, NULL,
+                       psformat, pssort, psoptions, GL_RGBA, 0, nullptr,
                        15, 20, 10, buffsize, fp, base.c_str());
         if(CTX::instance()->print.epsQuality == 0){
           double modelview[16], projection[16];
@@ -647,7 +647,7 @@ void CreateOutputFile(const std::string &fileName, int format,
         gl2psBeginPage(base.c_str(), "Gmsh", pixel_viewport,
                        GL2PS_TEX, GL2PS_NO_SORT,
                        CTX::instance()->print.texForceFontSize ? GL2PS_NONE :
-                       GL2PS_NO_TEX_FONTSIZE, GL_RGBA, 0, NULL,
+                       GL2PS_NO_TEX_FONTSIZE, GL_RGBA, 0, nullptr,
                        0, 0, 0, buffsize, fp, base.c_str());
         gl2psSetTexScaling(scaling);
         int oldtext = CTX::instance()->print.text;
@@ -706,7 +706,7 @@ void CreateOutputFile(const std::string &fileName, int format,
       }
 
       std::string parFileName = CTX::instance()->homeDir + ".gmsh-mpeg_encode.par";
-      FILE *fp = 0;
+      FILE *fp = nullptr;
       if(format != FORMAT_MPEG_PREVIEW){
         fp = Fopen(parFileName.c_str(), "w");
         if(!fp){
diff --git a/Common/CreateFile.h b/Common/CreateFile.h
index 6f7f53b2e2f26179d405d116eb4ff7dc100849ca..f3a2e6a9eb27f1212af0b3b9933da03dc3bb1b0e 100644
--- a/Common/CreateFile.h
+++ b/Common/CreateFile.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -9,9 +9,9 @@
 #include <string>
 
 int GetFileFormatFromExtension(const std::string &fileName,
-                               double *version = 0);
+                               double *version = nullptr);
 int GuessFileFormatFromFileName(const std::string &fileName,
-                                double *version = 0);
+                                double *version = nullptr);
 std::string GetDefaultFileExtension(int format, bool onlyMeshFormats = false);
 std::string GetDefaultFileName(int format);
 std::string GetKnownFileFormats(bool onlyMeshFormats = false);
diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index 9667f9c4b94cba71fd68ac8d6ddcb053ffebf22b..37b67a59b8a775c9d08233a90639a474e0afc72a 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -136,7 +136,7 @@ StringXString GeneralOptions_String[] = {
   { F, "WatchFilePattern", opt_general_watch_file_pattern , "" ,
      "Pattern of files to merge as they become available"},
 
-   { 0, 0 , 0 , "" , 0 }
+   { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 StringXString GeometryOptions_String[] = {
@@ -161,11 +161,11 @@ StringXString GeometryOptions_String[] = {
     "imported by OpenCASCADE, e.g. 'M' for meters (leave empty to use OpenCASCADE "
     "default bahavior)"},
 
-  { 0, 0 , 0 , "" , 0 }
+  { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 StringXString MeshOptions_String[] = {
-  { 0, 0 , 0 , "" , 0 }
+  { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 StringXString SolverOptions_String[] = {
@@ -269,7 +269,7 @@ StringXString SolverOptions_String[] = {
     "by appending the unique client id. If baseport is 0 or is not provided, the "
     "port is chosen automatically (recommended))"},
 
-  { 0, 0 , 0 , "" , 0 }
+  { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 StringXString PostProcessingOptions_String[] = {
@@ -280,7 +280,7 @@ StringXString PostProcessingOptions_String[] = {
   { F|O, "GraphPointCommand" , opt_post_double_clicked_graph_point_command, "" ,
     "Synonym for `DoubleClickedGraphPointCommand'" },
 
-  { 0, 0 , 0 , "" , 0 }
+  { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 StringXString ViewOptions_String[] = {
@@ -344,7 +344,7 @@ StringXString ViewOptions_String[] = {
   { F|O, "Stipple9" , opt_view_stipple9 , "1*0xFFFF" ,
     "Tenth stippling pattern" },
 
-  { 0, 0 , 0 , "" , 0 }
+  { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 StringXString PrintOptions_String[] = {
@@ -353,7 +353,7 @@ StringXString PrintOptions_String[] = {
     "General.Clip0D=Print.Parameter; SetChanged;" ,
     "Command parsed when the print parameter is changed" },
 
-  { 0, 0 , 0 , "" , 0 }
+  { 0, nullptr , nullptr , "" , nullptr }
 } ;
 
 // NUMBERS
@@ -848,7 +848,7 @@ StringXNumber GeneralOptions_Number[] = {
   { F|O, "ZoomFactor" , opt_general_zoom_factor , 4.0 ,
     "Middle mouse button zoom acceleration factor" },
 
-  { 0, 0 , 0 , 0. , 0 }
+  { 0, nullptr , nullptr , 0. , nullptr }
 } ;
 
 StringXNumber GeometryOptions_Number[] = {
@@ -1036,7 +1036,7 @@ StringXNumber GeometryOptions_Number[] = {
   { F|O, "VolumeNumbers" , opt_geometry_volumes_num , 0. ,
     "Display volume labels?" },
 
-  { 0, 0 , 0 , 0. , 0 }
+  { 0, nullptr , nullptr , 0. , nullptr }
 } ;
 
 StringXNumber MeshOptions_Number[] = {
@@ -1495,7 +1495,7 @@ StringXNumber MeshOptions_Number[] = {
   { F|O, "ZoneDefinition" , opt_mesh_zone_definition , 0. ,
     "Method for defining a zone (0: single zone, 1: by partition, 2: by physical)" },
 
-  { 0, 0 , 0 , 0. , 0 }
+  { 0, nullptr , nullptr , 0. , nullptr }
 } ;
 
 StringXNumber SolverOptions_Number[] = {
@@ -1530,7 +1530,7 @@ StringXNumber SolverOptions_Number[] = {
   { F|O, "Timeout" , opt_solver_timeout , 5. ,
     "Time (in seconds) before closing the socket if no connection is happening" },
 
-  { 0, 0 , 0 , 0. , 0 }
+  { 0, nullptr , nullptr , 0. , nullptr }
 } ;
 
 StringXNumber PostProcessingOptions_Number[] = {
@@ -1587,7 +1587,7 @@ StringXNumber PostProcessingOptions_Number[] = {
   { F|O, "Smoothing" , opt_post_smooth , 0. ,
     "Apply (non-reversible) smoothing to post-processing view when merged" },
 
-  { 0, 0 , 0 , 0. }
+  { 0, nullptr , nullptr , 0. }
 } ;
 
 StringXNumber ViewOptions_Number[] = {
@@ -1879,7 +1879,7 @@ StringXNumber ViewOptions_Number[] = {
   { F|O, "Width" , opt_view_size0 , 300. ,
     "Width (in pixels) of the scale or 2D plot" },
 
-  { 0, 0 , 0 , 0. , 0 }
+  { 0, nullptr , nullptr , 0. , nullptr }
 } ;
 
 StringXNumber PrintOptions_Number[] = {
@@ -2001,7 +2001,7 @@ StringXNumber PrintOptions_Number[] = {
   { F|O, "Width" , opt_print_width , -1. ,
     "Width of printed image; use (possibly scaled) current width if < 0)" },
 
-  { 0, 0 , 0 , 0. }
+  { 0, nullptr , nullptr , 0. }
 } ;
 
 // COLORS
@@ -2039,7 +2039,7 @@ StringXColor GeneralOptions_Color[] = {
   { F|O, "SpecularLight" , opt_general_color_specular_light,
     {255, 255, 255, 255}, {255, 255, 255, 255}, {255, 255, 255, 255}, {255, 255, 255, 255},
     "Specular light color" },
-  { 0, 0 , 0 ,  {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr ,  {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , {0, 0, 0, 0} , nullptr }
 } ;
 
 StringXColor GeometryOptions_Color[] = {
@@ -2079,7 +2079,7 @@ StringXColor GeometryOptions_Color[] = {
   { F|O, "Projection" , opt_geometry_color_projection ,
     {0, 255, 0, 255}, {0, 255, 0, 255}, {0, 0, 0, 255}, {0, 255, 0, 255},
     "Projection surface color" },
-  { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , nullptr }
 } ;
 
 #define COLW  {210, 210, 210, 255}
@@ -2187,15 +2187,15 @@ StringXColor MeshOptions_Color[] = {
     "Color 18 in color carousel" },
   { F|O, "Nineteen" , opt_mesh_color_19, COL19, COL19, COLW, COL19,
     "Color 19 in color carousel" },
-  { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , {0, 0, 0, 0} , nullptr }
 } ;
 
 StringXColor SolverOptions_Color[] = {
-  { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , nullptr }
 } ;
 
 StringXColor PostProcessingOptions_Color[] = {
-  { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , nullptr }
 } ;
 
 #define ELECOL  {0, 0, 0, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}, {245, 245, 245, 255}
@@ -2222,11 +2222,11 @@ StringXColor ViewOptions_Color[] = {
   { F|O, "Background2D" , opt_view_color_background2d ,
     {255, 255, 255, 200}, {255, 255, 255, 200}, {255, 255, 255, 200}, {245, 245, 245, 200},
     "Bacground color for 2D plots" },
-  { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , nullptr }
 } ;
 
 StringXColor PrintOptions_Color[] = {
-  { 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
+  { 0, nullptr , nullptr , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , nullptr }
 } ;
 
 #undef S
diff --git a/Common/GamePad.cpp b/Common/GamePad.cpp
index 3f3a891a67182c83300c8140fe4186df69d653f8..fc64dd6342a7376a36ba9b27fae31f4939c0014b 100644
--- a/Common/GamePad.cpp
+++ b/Common/GamePad.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/GamePad.h b/Common/GamePad.h
index b66212e2b5bbf0cd73a90004327157c18b803afb..90b15087ae0e17b6fc94591f0067dfdc1f1816d5 100644
--- a/Common/GamePad.h
+++ b/Common/GamePad.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/GmshConfig.h.in b/Common/GmshConfig.h.in
index 0e127c028fbab67196bc71d3b66d68362d06bf88..b021061f91ea98f5db640a75f72cf1551a5ce44e 100644
--- a/Common/GmshConfig.h.in
+++ b/Common/GmshConfig.h.in
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/GmshDefines.h b/Common/GmshDefines.h
index e93861ed9a61329c40fc572c6155c89aae5cca0f..47d900278fa45264efdb697ec3d7aa0f7f5ae3ae 100644
--- a/Common/GmshDefines.h
+++ b/Common/GmshDefines.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/GmshGlobal.cpp b/Common/GmshGlobal.cpp
index 06c6aad1453f03c2c18644d356e8b958eec49c18..3b3ad16113912c8c2148df277f34a8f02344a3c7 100644
--- a/Common/GmshGlobal.cpp
+++ b/Common/GmshGlobal.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -73,7 +73,7 @@ int GmshInitialize(int argc, char **argv, bool readConfigFiles,
 #endif
 
   // we need at least one model during option parsing
-  GModel *dummy = 0;
+  GModel *dummy = nullptr;
   if(GModel::list.empty()) dummy = new GModel();
 
   // Initialize messages (parallel stuff, etc.)
@@ -479,7 +479,7 @@ int GmshFLTK(int argc, char **argv)
   }
 
   // launch solver (if requested) and fill onelab tree
-  solver_cb(0, (void *)(intptr_t)CTX::instance()->launchSolverAtStartup);
+  solver_cb(nullptr, (void *)(intptr_t)CTX::instance()->launchSolverAtStartup);
 
   // loop
   return FlGui::instance()->run();
diff --git a/Common/GmshGlobal.h b/Common/GmshGlobal.h
index d7360d97149e42ac2b46d294aed296fa2ff7210c..aba386a46d5d99fb23976589787509a56e1611ae 100644
--- a/Common/GmshGlobal.h
+++ b/Common/GmshGlobal.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -9,7 +9,7 @@
 #include <string>
 #include "GmshMessage.h"
 
-int GmshInitialize(int argc = 0, char **argv = 0, bool readConfigFiles = false,
+int GmshInitialize(int argc = 0, char **argv = nullptr, bool readConfigFiles = false,
                    bool exitOnCommandLineError = true);
 int GmshSetMessageHandler(GmshMessage *callback);
 GmshMessage *GmshGetMessageHandler();
@@ -47,7 +47,7 @@ int GmshMergePostProcessingFile(const std::string &fileName);
 int GmshWriteFile(const std::string &fileName);
 int GmshFinalize();
 int GmshBatch();
-int GmshFLTK(int argc = 0, char **argv = 0);
+int GmshFLTK(int argc = 0, char **argv = nullptr);
 
 // these two functions are the only functions exported in addition to the
 // functions of the official stable API, so that we can also build the main Gmsh
diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index dafae22cc512ea712a78736d3e37af0390417562..dbc524d1b9f7e6d44f372d4a542ef40817270998 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -71,19 +71,19 @@ int Msg::_atLeastOneErrorInRun = 0;
 std::string Msg::_firstWarning;
 std::string Msg::_firstError;
 std::string Msg::_lastError;
-GmshMessage *Msg::_callback = 0;
+GmshMessage *Msg::_callback = nullptr;
 std::vector<std::string> Msg::_commandLineArgs;
 std::string Msg::_launchDate;
 std::map<std::string, std::vector<double> > Msg::_commandLineNumbers;
 std::map<std::string, std::string> Msg::_commandLineStrings;
-GmshClient *Msg::_client = 0;
+GmshClient *Msg::_client = nullptr;
 std::string Msg::_execName;
 #if defined(HAVE_ONELAB)
-onelab::client *Msg::_onelabClient = 0;
-onelab::server *onelab::server::_server = 0;
+onelab::client *Msg::_onelabClient = nullptr;
+onelab::server *onelab::server::_server = nullptr;
 #endif
 std::string Msg::_logFileName;
-FILE *Msg::_logFile = 0;
+FILE *Msg::_logFile = nullptr;
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1310) //NET 2003
 #define vsnprintf _vsnprintf
@@ -235,7 +235,7 @@ void Msg::SetLogFile(const std::string &name)
       Msg::Error("Could not open file '%s'", name.c_str());
   }
   else
-    _logFile = 0;
+    _logFile = nullptr;
 }
 
 std::string Msg::GetLaunchDate()
@@ -361,7 +361,7 @@ void Msg::Exit(int level)
 
   if(_logFile){
     fclose(_logFile);
-    _logFile = 0;
+    _logFile = nullptr;
   }
 
   // exit directly on abnormal program termination (level != 0). We
@@ -456,8 +456,8 @@ static int streamIsVT100(FILE *stream)
      "rxvt-cygwin", "rxvt-cygwin-native", "rxvt-unicode", "rxvt-unicode-256color",
      "screen", "screen-256color", "screen-256color-bce", "screen-bce", "screen-w",
      "screen.linux", "vt100", "xterm", "xterm-16color", "xterm-256color",
-     "xterm-88color", "xterm-color", "xterm-debian", 0};
-  const char** t = 0;
+     "xterm-88color", "xterm-color", "xterm-debian", nullptr};
+  const char** t = nullptr;
   const char* term = getenv("TERM");
   if(term){
     for(t = names; *t && strcmp(term, *t) != 0; ++t) {}
@@ -858,7 +858,7 @@ void Msg::PrintTimers()
 {
   // do a single stdio call!
   std::string str;
-  for(std::map<std::string, double>::iterator it = _timers.begin();
+  for(auto it = _timers.begin();
       it != _timers.end(); it++){
     if(it != _timers.begin()) str += ", ";
     char tmp[256];
@@ -1249,7 +1249,7 @@ std::string Msg::GetOnelabAction()
 void Msg::LoadOnelabClient(const std::string &clientName, const std::string &sockName)
 {
 #if defined(HAVE_ONELAB)
-  onelab::remoteNetworkClient *client = 0;
+  onelab::remoteNetworkClient *client = nullptr;
   client = new onelab::remoteNetworkClient(clientName, sockName);
   if(client){
     std::string action, cmd;
@@ -1544,7 +1544,7 @@ void Msg::ImportPhysicalGroupsInOnelab()
 
     int index = 1;
     for(int dim = 0; dim <= 3; dim++){
-      for(std::map<int, std::vector<GEntity*> >::iterator it = groups[dim].begin();
+      for(auto it = groups[dim].begin();
           it != groups[dim].end(); it++){
         int num = it->first;
         std::string name = GModel::current()->getPhysicalName(dim, it->first);
@@ -1614,15 +1614,15 @@ void Msg::FinalizeOnelab()
 {
 #if defined(HAVE_ONELAB)
   // kill any running clients
-  for(onelab::server::citer it = onelab::server::instance()->firstClient();
+  for(auto it = onelab::server::instance()->firstClient();
       it != onelab::server::instance()->lastClient(); it++){
     (*it)->kill();
   }
   // delete local client
   if(_onelabClient){
     delete _onelabClient;
-    _onelabClient = 0;
-    _client = 0;
+    _onelabClient = nullptr;
+    _client = nullptr;
   }
 #endif
 }
diff --git a/Common/GmshMessage.h b/Common/GmshMessage.h
index 201dd89297cfa4ef63265ecdb6df2a6f71ea4674..cd33486491c384b168e38e9b18b4be47d1a3c6fc 100644
--- a/Common/GmshMessage.h
+++ b/Common/GmshMessage.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -123,7 +123,7 @@ public:
   static double GetValue(const char *text, double defaultval);
   static std::string GetString(const char *text, const std::string &defaultval);
   static int GetAnswer(const char *question, int defaultval, const char *zero,
-                       const char *one, const char *two = 0);
+                       const char *one, const char *two = nullptr);
   static void InitializeOnelab(const std::string &name,
                                const std::string &sockname = "");
   static void SetExecutableName(const std::string &name);
diff --git a/Common/GmshRemote.cpp b/Common/GmshRemote.cpp
index 095a0ccbcdf4ea10f7769d1709dfcbb3e3a6cc0a..47f58a67b8ee32a113bea6048bdef4b6c84f90f8 100644
--- a/Common/GmshRemote.cpp
+++ b/Common/GmshRemote.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/GmshRemote.h b/Common/GmshRemote.h
index 7ecfb4a66f1bc1f67d91883302419c838e256e3c..f8f3f85330cd73d85ee306a2fba20843b9e8a098 100644
--- a/Common/GmshRemote.h
+++ b/Common/GmshRemote.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/GmshSocket.h b/Common/GmshSocket.h
index 10f3ccefc831d5c688066e2334ea991854e1d175..752febe75f1286e7c6a310384206ac2417c3b307 100644
--- a/Common/GmshSocket.h
+++ b/Common/GmshSocket.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // Permission is hereby granted, free of charge, to any person
 // obtaining a copy of this software and associated documentation
@@ -178,7 +178,7 @@ class GmshSocket{
     FD_SET(s, &rfds);
     // select checks all IO descriptors between 0 and its first arg, minus 1;
     // hence the +1 below
-    return select(s + 1, &rfds, NULL, NULL, &tv);
+    return select(s + 1, &rfds, nullptr, nullptr, &tv);
   }
   void SendMessage(int type, int length, const void *msg)
   {
diff --git a/Common/GmshVersion.h.in b/Common/GmshVersion.h.in
index 79c6b17d523a8a9ca498bf758a0b8a6af14ca97f..0f2fce53e5b92fe5c1e320894ac5d04a3860829e 100644
--- a/Common/GmshVersion.h.in
+++ b/Common/GmshVersion.h.in
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/Hash.h b/Common/Hash.h
index eec10de10bd15f30656fd41ba1d3544ba4819fb6..b8517cb391185ccdad0ced4854c5fbfddf17ee5c 100644
--- a/Common/Hash.h
+++ b/Common/Hash.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/ListUtils.cpp b/Common/ListUtils.cpp
index b6322fd61bbf9a347be6fd107a8679a9e79bc3f7..c1c6ada38171a2a49308358b4dab44004a840848 100644
--- a/Common/ListUtils.cpp
+++ b/Common/ListUtils.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -57,7 +57,7 @@ List_T *List_Create(int n, int incr, int size)
   liste->size = size;
   liste->n = 0;
   liste->isorder = 0;
-  liste->array = NULL;
+  liste->array = nullptr;
 
   List_Realloc(liste, n);
   return (liste);
@@ -74,7 +74,7 @@ void List_Realloc(List_T *liste, int n)
 {
   if(!liste || n <= 0) return;
 
-  if(liste->array == NULL) {
+  if(liste->array == nullptr) {
     // This does not permit to allocate lists smaller that liste->incr:
     // liste->nmax = ((n - 1) / liste->incr + 1) * liste->incr;
     // So this is much better
@@ -202,7 +202,7 @@ int List_Search(List_T *liste, void *data,
     liste->isorder = 1;
   }
   ptr = (void *)bsearch(data, liste->array, liste->n, liste->size, fcmp);
-  if(ptr == NULL) return (0);
+  if(ptr == nullptr) return (0);
   return (1);
 }
 
@@ -220,7 +220,7 @@ int List_ISearchSeq(List_T *liste, void *data,
 void *List_PQuery(List_T *liste, void *data,
                   int (*fcmp)(const void *a, const void *b))
 {
-  if(!liste) return 0;
+  if(!liste) return nullptr;
   void *ptr;
   if(liste->isorder != 1) List_Sort(liste, fcmp);
   liste->isorder = 1;
@@ -233,7 +233,7 @@ int List_Suppress(List_T *liste, void *data,
 {
   if(!liste) return 0;
   char *ptr = (char *)List_PQuery(liste, data, fcmp);
-  if(ptr == NULL) return (0);
+  if(ptr == nullptr) return (0);
   liste->n--;
   int len = liste->n - (((intptr_t)ptr - (intptr_t)liste->array) / liste->size);
   if(len > 0) memmove(ptr, ptr + liste->size, len * liste->size);
@@ -244,7 +244,7 @@ int List_PSuppress(List_T *liste, int index)
 {
   if(!liste) return 0;
   char *ptr = (char *)List_Pointer_NoChange(liste, index);
-  if(ptr == NULL) return (0);
+  if(ptr == nullptr) return (0);
   liste->n--;
   int len = liste->n - (((intptr_t)ptr - (intptr_t)liste->array) / liste->size);
   if(len > 0) memmove(ptr, ptr + liste->size, len * liste->size);
diff --git a/Common/ListUtils.h b/Common/ListUtils.h
index 2a15ff65f2c14190bc81c4772c8cbf8f094fb46a..cab10577d3fc91e61038fd2459c24aa94e6e5fe7 100644
--- a/Common/ListUtils.h
+++ b/Common/ListUtils.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/Main.cpp b/Common/Main.cpp
index e486979a5e48d2c76acb7dc2db43458775e0b0de..a03e7e0935884436001d357e0fbd1aa77a9de05e 100644
--- a/Common/Main.cpp
+++ b/Common/Main.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/MallocUtils.cpp b/Common/MallocUtils.cpp
index 239513bc07e947b9080c30ed90df7f0434a41736..8154a2985aade3ac31a1dfa979b3ecb5a09b931d 100644
--- a/Common/MallocUtils.cpp
+++ b/Common/MallocUtils.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -13,9 +13,9 @@ void *Malloc(size_t size)
 {
   void *ptr;
 
-  if(!size) return (NULL);
+  if(!size) return (nullptr);
   ptr = malloc(size);
-  if(ptr == NULL) Msg::Error("Out of memory (buy some more RAM!)");
+  if(ptr == nullptr) Msg::Error("Out of memory (buy some more RAM!)");
   return ptr;
 }
 
@@ -23,22 +23,22 @@ void *Calloc(size_t num, size_t size)
 {
   void *ptr;
 
-  if(!size) return (NULL);
+  if(!size) return (nullptr);
   ptr = calloc(num, size);
-  if(ptr == NULL) Msg::Error("Out of memory (buy some more RAM!)");
+  if(ptr == nullptr) Msg::Error("Out of memory (buy some more RAM!)");
   return ptr;
 }
 
 void *Realloc(void *ptr, size_t size)
 {
-  if(!size) return (NULL);
+  if(!size) return (nullptr);
   ptr = realloc(ptr, size);
-  if(ptr == NULL) Msg::Error("Out of memory (buy some more RAM!)");
+  if(ptr == nullptr) Msg::Error("Out of memory (buy some more RAM!)");
   return ptr;
 }
 
 void Free(void *ptr)
 {
-  if(ptr == NULL) return;
+  if(ptr == nullptr) return;
   free(ptr);
 }
diff --git a/Common/MallocUtils.h b/Common/MallocUtils.h
index a277441ab46568b56a3397e677c2027910f4ecbe..aa5d374a9dc4b80ab50bb261a66e576bccd9788f 100644
--- a/Common/MallocUtils.h
+++ b/Common/MallocUtils.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/OS.cpp b/Common/OS.cpp
index 3fb04212c419d8c0d4014c0b105658b639d141c0..b62ded014757bb6dbd58d274b0b165431127bcad 100644
--- a/Common/OS.cpp
+++ b/Common/OS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -378,7 +378,7 @@ double TotalRam()
   int name[] = {CTL_HW, HW_MEMSIZE};
   int64_t value;
   size_t len = sizeof(value);
-  if(sysctl(name, 2, &value, &len, NULL, 0) != -1) ram = value / (1024 * 1024);
+  if(sysctl(name, 2, &value, &len, nullptr, 0) != -1) ram = value / (1024 * 1024);
 #elif defined(WIN32)
   MEMORYSTATUSEX status;
   status.dwLength = sizeof(status);
@@ -617,7 +617,7 @@ int SystemCallExe(const std::string &exe, const std::string &argsOrCommand,
       cmd = "./" + cmd;
     }
   }
-  if(!system(NULL)) {
+  if(!system(nullptr)) {
     Msg::Error("Could not find /bin/sh: aborting system call");
     return 1;
   }
diff --git a/Common/OS.h b/Common/OS.h
index 2705f49a029ead71111e439eea386576f11e0801..f22265cfe37348190935d47e260b1fb875c5f367 100644
--- a/Common/OS.h
+++ b/Common/OS.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/Octree.cpp b/Common/Octree.cpp
index ed20f480b41484579d4af66b9253f0ed75b088c3..ea3057c57e5ce585886fc4aa2c7afb002e7df65d 100644
--- a/Common/Octree.cpp
+++ b/Common/Octree.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -27,9 +27,9 @@ void free_buckets(octantBucket *bucket)
   int i, numBuck = 8;
   ELink ptr1, ptr2;
 
-  if(bucket->next == NULL) {
+  if(bucket->next == nullptr) {
     ptr1 = bucket->lhead;
-    while(ptr1 != NULL) {
+    while(ptr1 != nullptr) {
       ptr2 = ptr1;
       ptr1 = ptr1->next;
       delete ptr2;
@@ -80,7 +80,7 @@ void Octree_Arrange(Octree *myOctree)
 
 void *Octree_Search(double *pt, Octree *myOctree)
 {
-  if(!myOctree) return 0;
+  if(!myOctree) return nullptr;
   return searchElement(myOctree->root, pt, myOctree->info,
                        myOctree->function_BB, myOctree->function_inElement);
 }
diff --git a/Common/Octree.h b/Common/Octree.h
index 9d7409efef745a6c19bc4310b72d48c765f82dff..742b8e718499bcad7509781736161ea8585015e7 100644
--- a/Common/Octree.h
+++ b/Common/Octree.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/OctreeInternals.cpp b/Common/OctreeInternals.cpp
index 73d43592c7f329554a2e6ddc5c11cf5765a7c97d..db3cbdc593fd328539a57432a1db6c16b4df898e 100644
--- a/Common/OctreeInternals.cpp
+++ b/Common/OctreeInternals.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -33,7 +33,7 @@ int initializeOctantBuckets(double *_orig, double *_size, int _maxElem,
   (*globalPara) = new globalInfo;
   (*globalPara)->maxPrecision = 1;
   (*globalPara)->maxElements = _maxElem;
-  (*globalPara)->ptrToPrevElement = NULL;
+  (*globalPara)->ptrToPrevElement = nullptr;
 
   for(i = 0; i < 3; i++) {
     (*globalPara)->origin[i] = _orig[i];
@@ -54,9 +54,9 @@ int initializeOctantBuckets(double *_orig, double *_size, int _maxElem,
   }
 
   (*buckets_head)->next = buckets;
-  (*buckets_head)->parent = NULL;
+  (*buckets_head)->parent = nullptr;
   (*buckets_head)->numElements = 0;
-  (*buckets_head)->lhead = NULL;
+  (*buckets_head)->lhead = nullptr;
   (*buckets_head)->precision = 0;
   for(i = 0; i < 3; i++) {
     (*buckets_head)->minPt[i] = _orig[i] - error[i];
@@ -65,8 +65,8 @@ int initializeOctantBuckets(double *_orig, double *_size, int _maxElem,
 
   for(i = 0; i < (*globalPara)->numBuckets; i++) {
     buckets[i].numElements = 0;
-    buckets[i].lhead = NULL;
-    buckets[i].next = NULL;
+    buckets[i].lhead = nullptr;
+    buckets[i].next = nullptr;
     buckets[i].parent = *buckets_head;
     buckets[i].precision = 1;
   }
@@ -165,11 +165,11 @@ int addElement2Bucket(octantBucket *_bucket, void *_element, double *_minBB,
       // printf("finish subdivede \n");
 
       ptr1 = _bucket->lhead;
-      while(ptr1 != NULL) {
+      while(ptr1 != nullptr) {
         ptrBucket = findElementBucket(_bucket, ptr1->centroid);
         ptr2 = ptr1;
         ptr1 = ptr1->next;
-        if(ptrBucket == NULL) {
+        if(ptrBucket == nullptr) {
           Msg::Error("Null bucket in octree");
           return 0;
         }
@@ -178,11 +178,11 @@ int addElement2Bucket(octantBucket *_bucket, void *_element, double *_minBB,
         (ptrBucket->numElements)++;
         if(ptrBucket->numElements > _globalPara->maxElements) {
           flag = 1;
-          _bucket->lhead = NULL;
+          _bucket->lhead = nullptr;
           _bucket = ptrBucket;
         }
       }
-      if(flag == 0) _bucket->lhead = NULL;
+      if(flag == 0) _bucket->lhead = nullptr;
     }
   }
   return 1;
@@ -194,7 +194,7 @@ int checkElementInBucket(octantBucket *_bucket, void *_element)
 // otherwise, return 0
 {
   ELink ptr;
-  for(ptr = _bucket->lhead; ptr != NULL; ptr = ptr->next) {
+  for(ptr = _bucket->lhead; ptr != nullptr; ptr = ptr->next) {
     // changed ****, compare the objected pointed by the void *.
     if(ptr->region == _element) return 1;
   }
@@ -210,10 +210,10 @@ octantBucket *findElementBucket(octantBucket *_buckets_head, double *_pt)
 {
   int i, j;
   int num = 8;
-  octantBucket *prevbucket = NULL;
+  octantBucket *prevbucket = nullptr;
   octantBucket *tmpbucket = _buckets_head->next;
 
-  while(tmpbucket != NULL) {
+  while(tmpbucket != nullptr) {
     for(i = 0; i < num; i++) {
       for(j = 0; j < 3; j++) {
         if(tmpbucket[i].minPt[j] > _pt[j] || tmpbucket[i].maxPt[j] < _pt[j])
@@ -227,7 +227,7 @@ octantBucket *findElementBucket(octantBucket *_buckets_head, double *_pt)
     } // for loop i
     if(i == num) {
       // Msg::Error("No bucket contains the given point!");
-      return NULL;
+      return nullptr;
     }
   } // for while loop
   return prevbucket;
@@ -254,8 +254,8 @@ int subdivideOctantBucket(octantBucket *_bucket, globalInfo *_globalPara)
     _globalPara->maxPrecision++;
   for(i = 0; i < numBuck; i++) {
     (_bucket->next[i]).numElements = 0;
-    (_bucket->next[i]).lhead = NULL;
-    (_bucket->next[i]).next = NULL;
+    (_bucket->next[i]).lhead = nullptr;
+    (_bucket->next[i]).next = nullptr;
     (_bucket->next[i]).parent = _bucket;
     (_bucket->next[i]).precision = _bucket->precision + 1;
   }
@@ -304,10 +304,10 @@ void *searchElement(octantBucket *_buckets_head, double *_pt,
   }
 
   ptrBucket = findElementBucket(_buckets_head, _pt);
-  if(ptrBucket == NULL) {
+  if(ptrBucket == nullptr) {
     // this is not an error
     Msg::Debug("Could not find point in octree");
-    return NULL;
+    return nullptr;
   }
 
   ptr1 = ptrBucket->lhead;
@@ -321,7 +321,7 @@ void *searchElement(octantBucket *_buckets_head, double *_pt,
   }
 #endif
 
-  while(ptr1 != NULL) {
+  while(ptr1 != nullptr) {
     flag = xyzInElementBB(_pt, ptr1->region, BBElement);
     if(flag == 1) flag = xyzInElement(ptr1->region, _pt);
     if(flag == 1) {
@@ -343,7 +343,7 @@ void *searchElement(octantBucket *_buckets_head, double *_pt,
 
   // printf("This point is not found in all elements! It is not in the domain
   // \n");
-  return NULL;
+  return nullptr;
 }
 
 int xyzInElementBB(double *_xyz, void *_region, BBFunction _bbElement)
@@ -371,9 +371,9 @@ void insertOneBB(void *_region, double *_minPt, double *_maxPt,
   for(i = 0; i < 3; i++) {
     if(_bucket->minPt[i] > _maxPt[i] || _bucket->maxPt[i] < _minPt[i]) return;
   }
-  if(_bucket->next == NULL) {
+  if(_bucket->next == nullptr) {
     ptr = _bucket->lhead;
-    while(ptr != NULL) {
+    while(ptr != nullptr) {
       if(ptr->region == _region) return;
       ptr = ptr->next;
     }
@@ -398,9 +398,9 @@ void *searchAllElements(octantBucket *_buckets_head, double *_pt,
   std::vector<void *>::iterator iter;
 
   ptrBucket = findElementBucket(_buckets_head, _pt);
-  if(ptrBucket == NULL) {
+  if(ptrBucket == nullptr) {
     Msg::Debug("Could not find point in octree");
-    return NULL;
+    return nullptr;
   }
 
 #if 0
@@ -415,7 +415,7 @@ void *searchAllElements(octantBucket *_buckets_head, double *_pt,
 
   flag1 = 0;
   ELink ptr1 = ptrBucket->lhead;
-  while(ptr1 != NULL) {
+  while(ptr1 != nullptr) {
     flag = xyzInElementBB(_pt, ptr1->region, BBElement);
     if(flag == 1) flag = xyzInElement(ptr1->region, _pt);
     if(flag == 1) {
@@ -439,5 +439,5 @@ void *searchAllElements(octantBucket *_buckets_head, double *_pt,
 
   // Msg::Warning("This point is not found in any element! It is not in the
   // domain");
-  return NULL;
+  return nullptr;
 }
diff --git a/Common/OctreeInternals.h b/Common/OctreeInternals.h
index 35d589baa7642e7547c50adbfa003c7f777ee489..7ffeb6ed27aba40ae1c2d96f61780b1a95376f92 100644
--- a/Common/OctreeInternals.h
+++ b/Common/OctreeInternals.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp
index 85f84bb4afab2e640e86381e2945d88c1fa0ed43..310d0fe4815720d2fa119a7b7b82eb6951156230 100644
--- a/Common/OpenFile.cpp
+++ b/Common/OpenFile.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -722,11 +722,11 @@ void OpenProject(const std::string &fileName, bool errorIfMissing)
   gmsh_yysymbols.clear();
   gmsh_yystringsymbols.clear();
   std::map<std::string, std::vector<double> > cln(Msg::GetCommandLineNumbers());
-  for(std::map<std::string, std::vector<double> >::iterator it = cln.begin();
+  for(auto it = cln.begin();
       it != cln.end(); it++)
     gmsh_yysymbols[it->first].value = it->second;
   std::map<std::string, std::string> cls(Msg::GetCommandLineStrings());
-  for(std::map<std::string, std::string>::iterator it = cls.begin();
+  for(auto it = cls.begin();
       it != cls.end(); it++)
     gmsh_yystringsymbols[it->first] = std::vector<std::string>(1, it->second);
   gmsh_yyfactory.clear();
@@ -762,7 +762,7 @@ void OpenProject(const std::string &fileName, bool errorIfMissing)
 
 #if defined(HAVE_FLTK)
   if(FlGui::available()) {
-    file_watch_cb(0, 0);
+    file_watch_cb(nullptr, nullptr);
     FlGui::instance()->resetVisibility();
     FlGui::instance()->updateViews(true, false);
     FlGui::instance()->updateFields();
@@ -783,7 +783,7 @@ void OpenProjectMacFinder(const char *fileName)
     OpenProject(fileName);
     drawContext::global()->draw();
     if(CTX::instance()->launchSolverAtStartup >= 0)
-      solver_cb(0, (void *)(intptr_t)CTX::instance()->launchSolverAtStartup);
+      solver_cb(nullptr, (void *)(intptr_t)CTX::instance()->launchSolverAtStartup);
   }
 #endif
 }
diff --git a/Common/OpenFile.h b/Common/OpenFile.h
index 19b43a975113013e6d64f070976e8622e9ff44d2..7453a908c0029813395b51724b50138a4eccf49b 100644
--- a/Common/OpenFile.h
+++ b/Common/OpenFile.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/Options.cpp b/Common/Options.cpp
index a179e44d182a974f47c8168ce7e5b31526472238..2fd925d10fb59cb9f614e9e9bc54a468c6cb8f7f 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -63,7 +63,7 @@
 bool StringOption(int action, const char *category, int num, const char *name,
                   std::string &val, bool warnIfUnknown)
 {
-  StringXString *s = 0;
+  StringXString *s = nullptr;
   if(!strcmp(category, "General"))
     s = GeneralOptions_String;
   else if(!strcmp(category, "Geometry"))
@@ -121,7 +121,7 @@ static void SetStringOptionsGUI(int num, StringXString s[])
 
 static void PrintStringOptions(int num, int level, int diff, int help,
                                StringXString s[], const char *prefix,
-                               FILE *file, std::vector<std::string> *vec = 0)
+                               FILE *file, std::vector<std::string> *vec = nullptr)
 {
   int i = 0;
   while(s[i].str) {
@@ -185,7 +185,7 @@ static void PrintStringOptionsDoc(StringXString s[], const char *prefix,
 bool NumberOption(int action, const char *category, int num, const char *name,
                   double &val, bool warnIfUnknown)
 {
-  StringXNumber *s = 0;
+  StringXNumber *s = nullptr;
   if(!strcmp(category, "General"))
     s = GeneralOptions_Number;
   else if(!strcmp(category, "Geometry"))
@@ -244,7 +244,7 @@ static void SetNumberOptionsGUI(int num, StringXNumber s[])
 
 static void PrintNumberOptions(int num, int level, int diff, int help,
                                StringXNumber s[], const char *prefix,
-                               FILE *file, std::vector<std::string> *vec = 0)
+                               FILE *file, std::vector<std::string> *vec = nullptr)
 {
   int i = 0;
   char tmp[1024];
@@ -287,7 +287,7 @@ static void PrintNumberOptionsDoc(StringXNumber s[], const char *prefix,
 bool ColorOption(int action, const char *category, int num, const char *name,
                  unsigned int &val, bool warnIfUnknown)
 {
-  StringXColor *s = 0;
+  StringXColor *s = nullptr;
   if(!strcmp(category, "General"))
     s = GeneralOptions_Color;
   else if(!strcmp(category, "Geometry"))
@@ -543,7 +543,7 @@ void InitOptionsGUI(int num)
 }
 
 static void PrintOptionCategory(int level, int diff, int help, const char *cat,
-                                FILE *file, std::vector<std::string> *vec = 0)
+                                FILE *file, std::vector<std::string> *vec = nullptr)
 {
   if(diff || !help || !(level & GMSH_FULLRC)) return;
   if(file) {
@@ -650,7 +650,7 @@ void PrintOptions(int num, int level, int diff, int help, const char *filename,
     }
   }
   else
-    file = 0;
+    file = nullptr;
 
   if((level & GMSH_SESSIONRC) && file) {
     fprintf(file, "// Gmsh Session File\n");
@@ -902,7 +902,7 @@ void PrintOptionsDoc()
       return;
     }
     fprintf(file, "%s@ftable @code\n", warn);
-    for(std::map<std::string, GMSH_Plugin *>::iterator it =
+    for(auto it =
           PluginManager::instance()->begin();
         it != PluginManager::instance()->end(); ++it) {
       GMSH_Plugin *p = it->second;
@@ -948,7 +948,7 @@ void PrintOptionsDoc()
     }
     fprintf(file, "%s@ftable @code\n", warn);
     FieldManager &fields = *GModel::current()->getFields();
-    for(std::map<std::string, FieldFactory *>::iterator it =
+    for(auto it =
           fields.mapTypeName.begin(); it != fields.mapTypeName.end(); it++) {
       fprintf(file, "@item %s\n", it->first.c_str());
       Field *f = (*it->second)();
@@ -958,7 +958,7 @@ void PrintOptionsDoc()
       if(!f->options.empty()) {
         fprintf(file, "Options:@*\n");
         fprintf(file, "@table @code\n");
-        for(std::map<std::string, FieldOption *>::iterator it2 =
+        for(auto it2 =
               f->options.begin(); it2 != f->options.end(); it2++) {
           if(it2->second->isDeprecated()) continue;
           fprintf(file, "@item %s\n", it2->first.c_str());
@@ -974,7 +974,7 @@ void PrintOptionsDoc()
       if(!f->callbacks.empty()) {
         fprintf(file, "Actions:@*\n");
         fprintf(file, "@table @code\n");
-        for(std::map<std::string, FieldCallback *>::iterator it2 =
+        for(auto it2 =
               f->callbacks.begin();
             it2 != f->callbacks.end(); it2++) {
           fprintf(file, "@item %s\n", it2->first.c_str());
@@ -3527,7 +3527,7 @@ double opt_general_gamepad(OPT_ARGS_NUM)
     else {
       if(CTX::instance()->gamepad) {
         delete CTX::instance()->gamepad;
-        CTX::instance()->gamepad = 0;
+        CTX::instance()->gamepad = nullptr;
       }
     }
   }
@@ -4163,7 +4163,7 @@ double opt_geometry_transform(OPT_ARGS_NUM)
       }
       else {
         drawTransform *tr = gl->getDrawContext()->getTransform();
-        gl->getDrawContext()->setTransform(0);
+        gl->getDrawContext()->setTransform(nullptr);
         if(tr) delete tr;
       }
     }
diff --git a/Common/Options.h b/Common/Options.h
index c6fb81cf89ffde5b87cb9e5a3411679b6c3c34c0..4b862eed49567362da9822cb89d98b6aa71501e0 100644
--- a/Common/Options.h
+++ b/Common/Options.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -915,7 +915,7 @@ void InitOptions(int num);
 void InitOptionsGUI(int num);
 void ReInitOptions(int num);
 void PrintOptions(int num, int level, int diff, int help, const char *filename,
-                  std::vector<std::string> *vec = 0);
+                  std::vector<std::string> *vec = nullptr);
 void PrintOptionsDoc();
 
 bool StringOption(int action, const char *category, int num, const char *name,
diff --git a/Common/SmoothData.cpp b/Common/SmoothData.cpp
index 932b46710fcd5ec50712fba8aab9a59b47ba38c4..603c2526bf3c4878f37baab9510b340620ba8e7c 100644
--- a/Common/SmoothData.cpp
+++ b/Common/SmoothData.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -26,7 +26,7 @@ xyzv::xyzv(const xyzv &other)
     for(int i = 0; i < nbvals; i++) vals[i] = other.vals[i];
   }
   else
-    vals = 0;
+    vals = nullptr;
 }
 
 xyzv &xyzv::operator=(const xyzv &other)
@@ -79,7 +79,7 @@ void xyzv::scale_update(double scale_inp)
 void smooth_data::add(double x, double y, double z, int n, double *vals)
 {
   xyzv xyz(x, y, z);
-  std::set<xyzv, lessthanxyzv>::const_iterator it = c.find(xyz);
+  auto it = c.find(xyz);
   if(it == c.end()) {
     xyz.update(n, vals);
     c.insert(xyz);
@@ -96,7 +96,7 @@ void smooth_data::add(double x, double y, double z, int n, double *vals)
 void smooth_data::add_scale(double x, double y, double z, double scale_val)
 {
   xyzv xyz(x, y, z);
-  std::set<xyzv, lessthanxyzv>::const_iterator it = c.find(xyz);
+  auto it = c.find(xyz);
   if(it == c.end()) {
     xyz.scale_update(scale_val);
     c.insert(xyz);
@@ -111,7 +111,7 @@ void smooth_data::add_scale(double x, double y, double z, double scale_val)
 
 bool smooth_data::get(double x, double y, double z, int n, double *vals) const
 {
-  std::set<xyzv, lessthanxyzv>::const_iterator it = c.find(xyzv(x, y, z));
+  auto it = c.find(xyzv(x, y, z));
   if(it == c.end()) return false;
   for(int k = 0; k < n; k++) vals[k] = it->vals[k];
   return true;
@@ -120,7 +120,7 @@ bool smooth_data::get(double x, double y, double z, int n, double *vals) const
 // added by Trevor Strickler
 bool smooth_data::get_scale(double x, double y, double z, double *scale_val) const
 {
-  std::set<xyzv, lessthanxyzv>::const_iterator it = c.find(xyzv(x, y, z));
+  auto it = c.find(xyzv(x, y, z));
   if(it == c.end()) return false;
   (*scale_val) = it->scaleValue;
   return true;
@@ -128,7 +128,7 @@ bool smooth_data::get_scale(double x, double y, double z, double *scale_val) con
 
 void smooth_data::normalize()
 {
-  std::set<xyzv, lessthanxyzv>::iterator it = c.begin();
+  auto it = c.begin();
   while(it != c.end()) {
     if(it->nbvals == 3) norme(it->vals);
     it++;
@@ -140,7 +140,7 @@ bool smooth_data::exportview(const std::string &filename) const
   FILE *fp = Fopen(filename.c_str(), "w");
   if(!fp) return false;
   fprintf(fp, "View \"data\" {\n");
-  std::set<xyzv, lessthanxyzv>::const_iterator it = c.begin();
+  auto it = c.begin();
   while(it != c.end()) {
     switch(it->nbvals) {
     case 1:
@@ -216,7 +216,7 @@ void smooth_normals::add(double x, double y, double z, double nx, double ny,
                          double nz)
 {
   xyzn xyz((float)x, (float)y, (float)z);
-  std::set<xyzn, lessthanxyzn>::const_iterator it = c.find(xyz);
+  auto it = c.find(xyz);
   if(it == c.end()) {
     xyz.update(float2char((float)nx), float2char((float)ny),
                float2char((float)nz), tol);
@@ -234,7 +234,7 @@ void smooth_normals::add(double x, double y, double z, double nx, double ny,
 bool smooth_normals::get(double x, double y, double z, double &nx, double &ny,
                          double &nz) const
 {
-  std::set<xyzn, lessthanxyzn>::const_iterator it =
+  auto it =
     c.find(xyzn((float)x, (float)y, (float)z));
 
   if(it == c.end()) return false;
diff --git a/Common/SmoothData.h b/Common/SmoothData.h
index 018c4cf6fbae7d37e2d3b79e0316c54e1a77b9e5..98ff5848cd690e09b6ca84dafd0104eb5b10882e 100644
--- a/Common/SmoothData.h
+++ b/Common/SmoothData.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,7 +22,7 @@ struct xyzv {
   int scale_numvals;
   static double eps;
   xyzv(double xx, double yy, double zz)
-    : x(xx), y(yy), z(zz), vals(0), nbvals(0), nboccurrences(0),
+    : x(xx), y(yy), z(zz), vals(nullptr), nbvals(0), nboccurrences(0),
       scaleValue(1.0), scale_numvals(0)
   {
   }
diff --git a/Common/StringUtils.cpp b/Common/StringUtils.cpp
index 6dea4f367f7093bfb7c43c234ab4a354f5dbf246..5b318fdae54e276acb81f9f93045d75e50ce856f 100644
--- a/Common/StringUtils.cpp
+++ b/Common/StringUtils.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/StringUtils.h b/Common/StringUtils.h
index 3f66dc897f52642109215eecff2de3d83017ef55..8df583ca1a84b4fe4ec03846481e6ce4dba4877c 100644
--- a/Common/StringUtils.h
+++ b/Common/StringUtils.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/TreeUtils.cpp b/Common/TreeUtils.cpp
index 04006a19c1d055cdb7647a2b48098974762f1f35..b2e00e8d1bbe122cb8c17ab4e1670577586eb51f 100644
--- a/Common/TreeUtils.cpp
+++ b/Common/TreeUtils.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -23,20 +23,20 @@ Tree_T *Tree_Create(int size, int (*fcmp)(const void *a, const void *b))
 void Tree_Delete(Tree_T *tree)
 {
   if(!tree) return;
-  avl_free_table(tree->root, Free, 0);
+  avl_free_table(tree->root, Free, nullptr);
   Free(tree);
 }
 
 void Tree_Delete(Tree_T *tree, void (*freefn)(void *))
 {
   if(!tree) return;
-  avl_free_table(tree->root, freefn, 0);
+  avl_free_table(tree->root, freefn, nullptr);
   Free(tree);
 }
 
 void *Tree_Add(Tree_T *tree, void *data)
 {
-  if(!tree) return 0;
+  if(!tree) return nullptr;
   void *ptr = Malloc(tree->size);
   memcpy(ptr, data, tree->size);
   avl_insert(tree->root, ptr, ptr);
@@ -76,9 +76,9 @@ int Tree_Query(Tree_T *tree, void *data)
 
 void *Tree_PQuery(Tree_T *tree, void *data)
 {
-  if(!tree) return 0;
+  if(!tree) return nullptr;
   void *ptr;
-  if(!avl_lookup(tree->root, data, &ptr)) return 0;
+  if(!avl_lookup(tree->root, data, &ptr)) return nullptr;
   return ptr;
 }
 
diff --git a/Common/TreeUtils.h b/Common/TreeUtils.h
index b438f917a01c74d4ab8ff0653c5b876b2c01b41b..ace664b7aa1a2d625c6a1ffea8cf024205922528 100644
--- a/Common/TreeUtils.h
+++ b/Common/TreeUtils.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/VertexArray.cpp b/Common/VertexArray.cpp
index 80aae769277e245c28ff495d0547373d804f0316..99353e2d46d2194895f5581fd61719d601450ad9 100644
--- a/Common/VertexArray.cpp
+++ b/Common/VertexArray.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -93,7 +93,7 @@ void VertexArray::add(double *x, double *y, double *z, SVector3 *n,
     add(x, y, z, n, r, g, b, a, ele, unique, boundary);
   }
   else
-    add(x, y, z, n, 0, 0, 0, 0, ele, unique, boundary);
+    add(x, y, z, n, nullptr, nullptr, nullptr, nullptr, ele, unique, boundary);
 }
 
 void VertexArray::add(double *x, double *y, double *z, SVector3 *n, unsigned char *r,
@@ -105,7 +105,7 @@ void VertexArray::add(double *x, double *y, double *z, SVector3 *n, unsigned cha
   if(boundary && npe == 3){
     ElementData<3> e(x, y, z, n, r, g, b, a, ele);
     ElementDataLessThan<3>::tolerance = (float)(CTX::instance()->lc * 1.e-12);
-    std::set<ElementData<3>, ElementDataLessThan<3> >::iterator it = _data3.find(e);
+    auto it = _data3.find(e);
     if(it == _data3.end())
       _data3.insert(e);
     else
@@ -138,7 +138,7 @@ void VertexArray::add(double *x, double *y, double *z, SVector3 *n, unsigned cha
 void VertexArray::finalize()
 {
   if(_data3.size()){
-    std::set<ElementData<3>, ElementDataLessThan<3> >::iterator it = _data3.begin();
+    auto it = _data3.begin();
     for(; it != _data3.end(); it++){
       for(int i = 0; i < 3; i++){
         _addVertex(it->x(i), it->y(i), it->z(i));
@@ -200,8 +200,8 @@ void VertexArray::sort(double x, double y, double z)
   elements.reserve(n);
   for(int i = 0; i < n; i++){
     float *vp = &_vertices[3 * npe * i];
-    normal_type *np = _normals.empty() ? 0 : &_normals[3 * npe * i];
-    unsigned char *cp = _colors.empty() ? 0 : &_colors[4 * npe * i];
+    normal_type *np = _normals.empty() ? nullptr : &_normals[3 * npe * i];
+    unsigned char *cp = _colors.empty() ? nullptr : &_colors[4 * npe * i];
     elements.push_back(AlphaElement(vp, np, cp));
   }
   std::sort(elements.begin(), elements.end(), AlphaElementLessThan());
diff --git a/Common/VertexArray.h b/Common/VertexArray.h
index 65f5e63c7f3b3e99353fcac1460a9054f6b81489..76e00b7090d9180c1d0c4931497444302a5da6f4 100644
--- a/Common/VertexArray.h
+++ b/Common/VertexArray.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -208,10 +208,10 @@ public:
   // element if another one with the same barycenter is not already
   // present)
   void add(double *x, double *y, double *z, SVector3 *n, unsigned int *col,
-           MElement *ele = 0, bool unique = true, bool boundary = false);
-  void add(double *x, double *y, double *z, SVector3 *n, unsigned char *r = 0,
-           unsigned char *g = 0, unsigned char *b = 0, unsigned char *a = 0,
-           MElement *ele = 0, bool unique = true, bool boundary = false);
+           MElement *ele = nullptr, bool unique = true, bool boundary = false);
+  void add(double *x, double *y, double *z, SVector3 *n, unsigned char *r = nullptr,
+           unsigned char *g = nullptr, unsigned char *b = nullptr, unsigned char *a = nullptr,
+           MElement *ele = nullptr, bool unique = true, bool boundary = false);
   // finalize the arrays
   void finalize();
   // sort the arrays with elements back to front wrt the eye position
diff --git a/Common/avl.cpp b/Common/avl.cpp
index 64678336c88257ffe8aee44ba02280b018e17279..e9aee4e48bda4a46ae617d237050a35d2d46fb09 100644
--- a/Common/avl.cpp
+++ b/Common/avl.cpp
@@ -142,7 +142,7 @@ int avl_delete(avl_tree *tree, void **key_p, void **value_p)
     /* prepare to delete node and replace it with rightmost of left tree */
   delete_item:
     *key_p = node->key;
-    if (value_p != 0) *value_p = node->value;
+    if (value_p != nullptr) *value_p = node->value;
     if (node->left == NIL(avl_node)) {
         *node_p = node->right;
     } else {
@@ -330,8 +330,8 @@ static void free_entry(avl_node *node, void (*key_free)(void *key), void (*value
     if (node != NIL(avl_node)) {
         free_entry(node->left, key_free, value_free);
         free_entry(node->right, key_free, value_free);
-        if (key_free != 0) (*key_free)(node->key);
-        if (value_free != 0) (*value_free)(node->value);
+        if (key_free != nullptr) (*key_free)(node->key);
+        if (value_free != nullptr) (*value_free)(node->value);
         FREE(node);
     }
 }
diff --git a/Common/gmsh.cpp b/Common/gmsh.cpp
index 2ee1a912aa4a0caa40f39e752ae667cadb1374b5..64408901b5601be09e9d13c25b289bbd1eb12dc3 100644
--- a/Common/gmsh.cpp
+++ b/Common/gmsh.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -101,7 +101,7 @@ extern "C" {
 
 static int _initialized = 0;
 static int _argc = 0;
-static char **_argv = 0;
+static char **_argv = nullptr;
 
 static bool _checkInit()
 {
@@ -146,7 +146,7 @@ GMSH_API void gmsh::finalize()
   if(GmshFinalize()) {
     _argc = 0;
     if(_argv) delete[] _argv;
-    _argv = 0;
+    _argv = nullptr;
     _initialized = 0;
     return;
   }
@@ -336,7 +336,7 @@ GMSH_API void gmsh::model::getPhysicalGroups(vectorpair &dimTags, const int dim)
   GModel::current()->getPhysicalGroups(groups);
   for(int d = 0; d < 4; d++) {
     if(dim < 0 || d == dim) {
-      for(std::map<int, std::vector<GEntity *> >::iterator it =
+      for(auto it =
             groups[d].begin();
           it != groups[d].end(); it++)
         dimTags.push_back(std::pair<int, int>(d, it->first));
@@ -365,7 +365,7 @@ GMSH_API void gmsh::model::getEntitiesForPhysicalGroup(const int dim,
   tags.clear();
   std::map<int, std::vector<GEntity *> > groups;
   GModel::current()->getPhysicalGroups(dim, groups);
-  std::map<int, std::vector<GEntity *> >::iterator it = groups.find(tag);
+  auto it = groups.find(tag);
   if(it != groups.end()) {
     for(std::size_t j = 0; j < it->second.size(); j++)
       tags.push_back(it->second[j]->tag());
@@ -581,7 +581,7 @@ GMSH_API int gmsh::model::addDiscreteEntity(const int dim, const int tag,
     break;
   }
   case 1: {
-    GVertex *v0 = 0, *v1 = 0;
+    GVertex *v0 = nullptr, *v1 = nullptr;
     if(boundary.size() >= 1)
       v0 = GModel::current()->getVertexByTag(boundary[0]);
     if(boundary.size() >= 2)
@@ -1294,7 +1294,7 @@ static void _getAdditionalNodesOnBoundary(GEntity *entity,
   if(entity->dim() > 2) f = entity->faces();
   if(entity->dim() > 1) e = entity->edges();
   if(entity->dim() > 0) v = entity->vertices();
-  for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); it++) {
+  for(auto it = f.begin(); it != f.end(); it++) {
     GFace *gf = *it;
     for(std::size_t j = 0; j < gf->mesh_vertices.size(); j++) {
       MVertex *v = gf->mesh_vertices[j];
@@ -1304,7 +1304,7 @@ static void _getAdditionalNodesOnBoundary(GEntity *entity,
       coord.push_back(v->z());
     }
   }
-  for(std::vector<GEdge *>::iterator it = e.begin(); it != e.end(); it++) {
+  for(auto it = e.begin(); it != e.end(); it++) {
     GEdge *ge = *it;
     for(std::size_t j = 0; j < ge->mesh_vertices.size(); j++) {
       MVertex *v = ge->mesh_vertices[j];
@@ -1322,7 +1322,7 @@ static void _getAdditionalNodesOnBoundary(GEntity *entity,
       }
     }
   }
-  for(std::vector<GVertex *>::iterator it = v.begin(); it != v.end(); it++) {
+  for(auto it = v.begin(); it != v.end(); it++) {
     GVertex *gv = *it;
     for(std::size_t j = 0; j < gv->mesh_vertices.size(); j++) {
       MVertex *v = gv->mesh_vertices[j];
@@ -1554,7 +1554,7 @@ GMSH_API void gmsh::model::mesh::addNodes(
     double x = coord[3 * i];
     double y = coord[3 * i + 1];
     double z = coord[3 * i + 2];
-    MVertex *vv = 0;
+    MVertex *vv = nullptr;
     if(param && dim == 1) {
       double u = parametricCoord[i];
       vv = new MEdgeVertex(x, y, z, ge, u, tag);
@@ -1942,7 +1942,7 @@ GMSH_API void gmsh::model::mesh::getElementProperties(
   MElement::getInfoMSH(elementType, &n);
   name = n;
   int parentType = ElementType::getParentType(elementType);
-  nodalBasis *basis = 0;
+  nodalBasis *basis = nullptr;
   if(parentType == TYPE_PYR)
     basis = new pyramidalBasis(elementType);
   else
@@ -2452,7 +2452,7 @@ GMSH_API void gmsh::model::mesh::getBasisFunctions(
       }
     }
 
-    const nodalBasis *basis = 0;
+    const nodalBasis *basis = nullptr;
     if(numComponents) {
       if(fsOrder == -1) { // isoparametric
         basis = BasisFactory::getNodalBasis(elementType);
@@ -2489,7 +2489,7 @@ GMSH_API void gmsh::model::mesh::getBasisFunctions(
     numOrientations = 1;
   }
   else { // Hierarchical type
-    HierarchicalBasis *basis(0);
+    HierarchicalBasis *basis(nullptr);
     if(fsName == "H1Legendre" || fsName == "GradH1Legendre") {
       switch(familyType) {
       case TYPE_HEX: {
@@ -2597,9 +2597,9 @@ GMSH_API void gmsh::model::mesh::getBasisFunctions(
 
     std::vector<MVertex *> vertices(numVertices);
     for(unsigned int i = 0; i < numVertices; ++i) {
-      vertices[i] = new MVertex(0., 0., 0., 0, i + 1);
+      vertices[i] = new MVertex(0., 0., 0., nullptr, i + 1);
     }
-    MElement *element = 0;
+    MElement *element = nullptr;
     switch(familyType) {
     case TYPE_HEX: {
       element = new MHexahedron(vertices);
@@ -2691,7 +2691,7 @@ GMSH_API void gmsh::model::mesh::getBasisFunctions(
       for(unsigned int iOrientation = 0; iOrientation < maxOrientation;
           ++iOrientation) {
         if(wantedOrientations.size() != 0) {
-          std::vector<int>::const_iterator it = std::find(
+          auto it = std::find(
             wantedOrientations.begin(), wantedOrientations.end(), iOrientation);
           if(it != wantedOrientations.end()) {
             iOrientationIndex = &(*it) - &wantedOrientations[0];
@@ -2851,7 +2851,7 @@ GMSH_API void gmsh::model::mesh::getBasisFunctions(
       for(unsigned int iOrientation = 0; iOrientation < maxOrientation;
           ++iOrientation) {
         if(wantedOrientations.size() != 0) {
-          std::vector<int>::const_iterator it = std::find(
+          auto it = std::find(
             wantedOrientations.begin(), wantedOrientations.end(), iOrientation);
           if(it != wantedOrientations.end()) {
             iOrientationIndex = &(*it) - &wantedOrientations[0];
@@ -3038,14 +3038,14 @@ GMSH_API void gmsh::model::mesh::getBasisFunctionsOrientationForElements(
           std::size_t max = 0;
           std::size_t maxPos = 0;
           for(std::size_t j = 0; j < numVertices; ++j) {
-            if(vertices[j] != 0) {
+            if(vertices[j] != nullptr) {
               if(max < vertices[j]->getNum()) {
                 max = vertices[j]->getNum();
                 maxPos = j;
               }
             }
           }
-          vertices[maxPos] = 0;
+          vertices[maxPos] = nullptr;
           verticesOrder[maxPos] = numVertices - i - 1;
         }
 
@@ -3106,14 +3106,14 @@ GMSH_API void gmsh::model::mesh::getBasisFunctionsOrientationForElement(
       std::size_t max = 0;
       std::size_t maxPos = 0;
       for(std::size_t j = 0; j < numVertices; ++j) {
-        if(vertices[j] != 0) {
+        if(vertices[j] != nullptr) {
           if(max < vertices[j]->getNum()) {
             max = vertices[j]->getNum();
             maxPos = j;
           }
         }
       }
-      vertices[maxPos] = 0;
+      vertices[maxPos] = nullptr;
       verticesOrder[maxPos] = numVertices - i - 1;
     }
 
@@ -3206,7 +3206,7 @@ GMSH_API void gmsh::model::mesh::getLocalMultipliersForHcurl0(
   int dim = ElementType::getDimension(elementType);
   std::map<int, std::vector<GEntity *> > typeEnt;
   _getEntitiesForElementTypes(dim, tag, typeEnt);
-  HierarchicalBasis *basis(0);
+  HierarchicalBasis *basis(nullptr);
   const std::vector<GEntity *> &entities(typeEnt[elementType]);
   int familyType = ElementType::getParentType(elementType);
   switch(familyType) {
@@ -3282,7 +3282,7 @@ GMSH_API void gmsh::model::mesh::getKeysForElements(
   const std::vector<GEntity *> &entities(typeEnt[elementType]);
   int familyType = ElementType::getParentType(elementType);
 
-  HierarchicalBasis *basis(0);
+  HierarchicalBasis *basis(nullptr);
   if(fsName == "H1Legendre" || fsName == "GradH1Legendre") {
     switch(familyType) {
     case TYPE_HEX: {
@@ -3340,7 +3340,7 @@ GMSH_API void gmsh::model::mesh::getKeysForElements(
   }
   else if(fsName == "IsoParametric" || fsName == "Lagrange" ||
           fsName == "GradIsoParametric" || fsName == "GradLagrange") {
-    const nodalBasis *nodalB(0);
+    const nodalBasis *nodalB(nullptr);
     if(order == -1) { // isoparametric
       nodalB = BasisFactory::getNodalBasis(elementType);
     }
@@ -3532,7 +3532,7 @@ GMSH_API void gmsh::model::mesh::getKeysForElement(
   int elementType = e->getTypeForMSH();
   int familyType = ElementType::getParentType(elementType);
 
-  HierarchicalBasis *basis(0);
+  HierarchicalBasis *basis(nullptr);
   if(fsName == "H1Legendre" || fsName == "GradH1Legendre") {
     switch(familyType) {
     case TYPE_HEX: {
@@ -3742,7 +3742,7 @@ GMSH_API int gmsh::model::mesh::getNumberOfKeysForElements(
   }
   int familyType = ElementType::getParentType(elementType);
   if(fsName == "H1Legendre" || fsName == "GradH1Legendre") {
-    HierarchicalBasis *basis(0);
+    HierarchicalBasis *basis(nullptr);
     switch(familyType) {
     case TYPE_HEX: {
       basis = new HierarchicalBasisH1Brick(basisOrder);
@@ -3779,7 +3779,7 @@ GMSH_API int gmsh::model::mesh::getNumberOfKeysForElements(
     delete basis;
   }
   else if(fsName == "HcurlLegendre" || fsName == "CurlHcurlLegendre") {
-    HierarchicalBasis *basis(0);
+    HierarchicalBasis *basis(nullptr);
     switch(familyType) {
     case TYPE_QUA: {
       basis = new HierarchicalBasisHcurlQuad(basisOrder);
@@ -3814,7 +3814,7 @@ GMSH_API int gmsh::model::mesh::getNumberOfKeysForElements(
   }
   else if(fsName == "IsoParametric" || fsName == "Lagrange" ||
           fsName == "GradIsoParametric" || fsName == "GradLagrange") {
-    const nodalBasis *basis(0);
+    const nodalBasis *basis(nullptr);
     if(basisOrder == -1) { // isoparametric
       basis = BasisFactory::getNodalBasis(elementType);
     }
@@ -3846,7 +3846,7 @@ GMSH_API void gmsh::model::mesh::getInformationForElements(
     Msg::Error("Unknown function space type '%s'", functionSpaceType.c_str());
     return;
   }
-  HierarchicalBasis *basis(0);
+  HierarchicalBasis *basis(nullptr);
   int familyType = ElementType::getParentType(elementType);
   if(fsName == "H1Legendre" || fsName == "GradH1Legendre") {
     switch(familyType) {
@@ -3905,7 +3905,7 @@ GMSH_API void gmsh::model::mesh::getInformationForElements(
   }
   else if(fsName == "IsoParametric" || fsName == "Lagrange" ||
           fsName == "GradIsoParametric" || fsName == "GradLagrange") {
-    const nodalBasis *basis(0);
+    const nodalBasis *basis(nullptr);
     if(basisOrder == -1) { // isoparametric
       basis = BasisFactory::getNodalBasis(elementType);
     }
@@ -4799,14 +4799,14 @@ GMSH_API void gmsh::model::mesh::getPeriodicNodes(
   }
   if(ge->getMeshMaster() != ge) {
     tagMaster = ge->getMeshMaster()->tag();
-    for(std::map<MVertex *, MVertex *>::iterator it =
+    for(auto it =
           ge->correspondingVertices.begin();
         it != ge->correspondingVertices.end(); ++it) {
       nodeTags.push_back(it->first->getNum());
       nodeTagsMaster.push_back(it->second->getNum());
     }
     if(includeHighOrderNodes) {
-      for(std::map<MVertex *, MVertex *>::iterator it =
+      for(auto it =
             ge->correspondingHighOrderVertices.begin();
           it != ge->correspondingHighOrderVertices.end(); ++it) {
         nodeTags.push_back(it->first->getNum());
@@ -5004,13 +5004,13 @@ static FieldOption *_getFieldOption(const int tag, const std::string &option)
   Field *field = GModel::current()->getFields()->get(tag);
   if(!field) {
     Msg::Error("No field with id %i", tag);
-    return 0;
+    return nullptr;
   }
   FieldOption *o = field->options[option];
   if(!o) {
     Msg::Error("Unknown option '%s' in field %i of type '%s'", option.c_str(),
                tag, field->getName());
-    return 0;
+    return nullptr;
   }
   return o;
 }
@@ -5272,7 +5272,7 @@ static ExtrudeParams *_getExtrudeParams(const std::vector<int> &numElements,
                                         const std::vector<double> &heights,
                                         const bool recombine)
 {
-  ExtrudeParams *e = 0;
+  ExtrudeParams *e = nullptr;
   if(numElements.size()) {
     e = new ExtrudeParams();
     e->mesh.ExtrudeMesh = true;
@@ -6423,16 +6423,16 @@ static stepData<double> *_getModelData(const int tag, const int step,
                                        int &numComponents, int &numEnt,
                                        int &maxMult)
 {
-  if(!_checkInit()) return 0;
+  if(!_checkInit()) return nullptr;
   PView *view = PView::getViewByTag(tag);
   if(!view) {
     Msg::Error("Unknown view with tag %d", tag);
-    return 0;
+    return nullptr;
   }
   PViewDataGModel *d = dynamic_cast<PViewDataGModel *>(view->getData());
   if(!d) {
     Msg::Error("View with tag %d does not contain model data", tag);
-    return 0;
+    return nullptr;
   }
   if(d->getType() == PViewDataGModel::NodeData)
     dataType = "NodeData";
@@ -6450,7 +6450,7 @@ static stepData<double> *_getModelData(const int tag, const int step,
   if(!s) {
     Msg::Error("View with tag %d does not contain model data for step %d", tag,
                step);
-    return 0;
+    return nullptr;
   }
   time = s->getTime();
   numComponents = s->getNumComponents();
@@ -6983,7 +6983,7 @@ GMSH_API void gmsh::view::probe(const int tag, const double x, const double y,
   value.clear();
   std::vector<double> val(9 * data->getNumTimeSteps() * 3);
   int qn = 0;
-  double *qx = 0, *qy = 0, *qz = 0;
+  double *qx = nullptr, *qy = nullptr, *qz = nullptr;
   if(xElemCoord.size() && yElemCoord.size() && zElemCoord.size() &&
      xElemCoord.size() == yElemCoord.size() &&
      xElemCoord.size() == zElemCoord.size()) {
@@ -6997,33 +6997,33 @@ GMSH_API void gmsh::view::probe(const int tag, const double x, const double y,
   int numVal = 0;
   switch(numComp) {
   case 1:
-    if(data->searchScalarWithTol(x, y, z, &val[0], step, 0, tolerance, qn, qx,
+    if(data->searchScalarWithTol(x, y, z, &val[0], step, nullptr, tolerance, qn, qx,
                                  qy, qz, gradient, dim)) {
       numVal = numSteps * mult * 1;
     }
     break;
   case 3:
-    if(data->searchVectorWithTol(x, y, z, &val[0], step, 0, tolerance, qn, qx,
+    if(data->searchVectorWithTol(x, y, z, &val[0], step, nullptr, tolerance, qn, qx,
                                  qy, qz, gradient, dim)) {
       numVal = numSteps * mult * 3;
     }
     break;
   case 9:
-    if(data->searchTensorWithTol(x, y, z, &val[0], step, 0, tolerance, qn, qx,
+    if(data->searchTensorWithTol(x, y, z, &val[0], step, nullptr, tolerance, qn, qx,
                                  qy, qz, gradient, dim)) {
       numVal = numSteps * mult * 9;
     }
     break;
   default:
-    if(data->searchScalarWithTol(x, y, z, &val[0], step, 0, tolerance, qn, qx,
+    if(data->searchScalarWithTol(x, y, z, &val[0], step, nullptr, tolerance, qn, qx,
                                  qy, qz, gradient, dim)) {
       numVal = numSteps * mult * 1;
     }
-    else if(data->searchVectorWithTol(x, y, z, &val[0], step, 0, tolerance, qn,
+    else if(data->searchVectorWithTol(x, y, z, &val[0], step, nullptr, tolerance, qn,
                                       qx, qy, qz, gradient, dim)) {
       numVal = numSteps * mult * 3;
     }
-    else if(data->searchTensorWithTol(x, y, z, &val[0], step, 0, tolerance, qn,
+    else if(data->searchTensorWithTol(x, y, z, &val[0], step, nullptr, tolerance, qn,
                                       qx, qy, qz, gradient, dim)) {
       numVal = numSteps * mult * 9;
     }
@@ -7114,7 +7114,7 @@ GMSH_API void gmsh::plugin::run(const std::string &name)
   if(!_checkInit()) return;
 #if defined(HAVE_PLUGINS)
   try {
-    PluginManager::instance()->action(name, "Run", 0);
+    PluginManager::instance()->action(name, "Run", nullptr);
   } catch(...) {
     Msg::Error("Unknown plugin or plugin action");
   }
@@ -7568,7 +7568,7 @@ GMSH_API void gmsh::logger::stop()
   GmshMessage *msg = Msg::GetCallback();
   if(msg) {
     delete msg;
-    Msg::SetCallback(0);
+    Msg::SetCallback(nullptr);
   }
   else {
     Msg::Warning("Logger not started - ignoring");
diff --git a/Common/gmshLocalNetworkClient.cpp b/Common/gmshLocalNetworkClient.cpp
index ac94e4053d6849ee2a4dce9bca2d646128b14e63..254379f8eab1895c63810ce4b28118b363362ea3 100644
--- a/Common/gmshLocalNetworkClient.cpp
+++ b/Common/gmshLocalNetworkClient.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -88,7 +88,7 @@ public:
                 ps[0].setVisible(false);
                 ps[0].setValue("");
                 onelab::server::instance()->set(ps[0]);
-                if(FlGui::available()) onelab_cb(0, (void *)"refresh");
+                if(FlGui::available()) onelab_cb(nullptr, (void *)"refresh");
               }
               lastRefresh = start;
             }
@@ -380,14 +380,14 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master)
     else if(ptype == "number") {
       std::vector<onelab::number> numbers;
       get(numbers);
-      for(std::vector<onelab::number>::iterator it = numbers.begin();
+      for(auto it = numbers.begin();
           it != numbers.end(); it++)
         replies.push_back((*it).toChar());
     }
     else if(ptype == "string") {
       std::vector<onelab::string> strings;
       get(strings);
-      for(std::vector<onelab::string>::iterator it = strings.begin();
+      for(auto it = strings.begin();
           it != strings.end(); it++)
         replies.push_back((*it).toChar());
     }
@@ -553,7 +553,7 @@ new_connection:
     // loop over all the clients (usually only one, but can be more if we
     // spawned subclients) and check if data is available for one of them
     bool stop = false, haveData = false;
-    gmshLocalNetworkClient *c = 0;
+    gmshLocalNetworkClient *c = nullptr;
     std::vector<gmshLocalNetworkClient *> toDelete;
     for(int i = 0; i < getNumClients(); i++) {
       c = getClient(i);
@@ -566,8 +566,8 @@ new_connection:
           // this subclient is not active anymore: shut down and delete its
           // server and mark the client for deletion
           GmshServer *s = c->getGmshServer();
-          c->setGmshServer(0);
-          c->setFather(0);
+          c->setGmshServer(nullptr);
+          c->setFather(nullptr);
           if(s) {
             s->Shutdown();
             delete s;
@@ -620,8 +620,8 @@ new_connection:
   for(int i = 0; i < getNumClients(); i++) {
     gmshLocalNetworkClient *c = getClient(i);
     GmshServer *s = c->getGmshServer();
-    c->setGmshServer(0);
-    c->setFather(0);
+    c->setGmshServer(nullptr);
+    c->setFather(nullptr);
     if(s) {
       s->Shutdown();
       delete s;
diff --git a/Common/gmshLocalNetworkClient.h b/Common/gmshLocalNetworkClient.h
index ec1d3c8d84d121a1ac148f8a8b84c7d28548e51c..fee24a3cb2d34b4efdee1384978cbdd3e4c4b6a8 100644
--- a/Common/gmshLocalNetworkClient.h
+++ b/Common/gmshLocalNetworkClient.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -30,7 +30,7 @@ public:
                          bool treatExecutableAsFullCommandLine = false)
     : onelab::localNetworkClient(name, executable, remoteLogin,
                                  treatExecutableAsFullCommandLine),
-      _father(0)
+      _father(nullptr)
   {
     addClient(this);
   }
@@ -47,7 +47,7 @@ public:
   gmshLocalNetworkClient *getClient(int i)
   {
     if(i >= 0 && i < getNumClients()) return _clients[i];
-    return 0;
+    return nullptr;
   }
   int getNumConnectedClients()
   {
diff --git a/Common/gmshPopplerWrapper.cpp b/Common/gmshPopplerWrapper.cpp
index d3186d894d429a91462fb63d282b80846213b098..1fabda1464ea0445d62b0a194bbec6360a48579a 100644
--- a/Common/gmshPopplerWrapper.cpp
+++ b/Common/gmshPopplerWrapper.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/gmshPopplerWrapper.h b/Common/gmshPopplerWrapper.h
index 8dbc753e3f22e22c63357f05b0302c97abbb42d6..77c483323202255b194f7326dcb33e86ddf67269 100644
--- a/Common/gmshPopplerWrapper.h
+++ b/Common/gmshPopplerWrapper.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/onelab.h b/Common/onelab.h
index 1249688c9caad181096db39df9673476af84f301..756daf4fc1f17d64fda0cb33d984454b3a7a5522 100644
--- a/Common/onelab.h
+++ b/Common/onelab.h
@@ -1,4 +1,4 @@
-// ONELAB - Copyright (C) 2011-2020 Universite de Liege - Universite catholique
+// ONELAB - Copyright (C) 2011-2021 Universite de Liege - Universite catholique
 // de Louvain
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -92,11 +92,11 @@ namespace onelab {
     void setChanged(int changed, const std::string &client = "")
     {
       if(client.size()) {
-        std::map<std::string, int>::iterator it = _clients.find(client);
+        auto it = _clients.find(client);
         if(it != _clients.end()) it->second = changed;
       }
       else {
-        for(std::map<std::string, int>::iterator it = _clients.begin();
+        for(auto it = _clients.begin();
             it != _clients.end(); it++)
           it->second = changed;
       }
@@ -171,7 +171,7 @@ namespace onelab {
     int getChanged(const std::string &client = "") const
     {
       if(client.size()) {
-        std::map<std::string, int>::const_iterator it = _clients.find(client);
+        auto it = _clients.find(client);
         if(it != _clients.end())
           return it->second;
         else
@@ -179,7 +179,7 @@ namespace onelab {
       }
       else {
         int changed = 0;
-        for(std::map<std::string, int>::const_iterator it = _clients.begin();
+        for(auto it = _clients.begin();
             it != _clients.end(); it++) {
           changed = std::max(changed, it->second);
         }
@@ -192,7 +192,7 @@ namespace onelab {
     bool getReadOnly() const { return _readOnly; }
     std::string getAttribute(const std::string &key) const
     {
-      std::map<std::string, std::string>::const_iterator it =
+      auto it =
         _attributes.find(key);
       if(it != _attributes.end()) return it->second;
       return "";
@@ -261,13 +261,13 @@ namespace onelab {
               << getChangedValue() << charSep() << (getVisible() ? 1 : 0)
               << charSep() << (getReadOnly() ? 1 : 0) << charSep()
               << _attributes.size() << charSep();
-      for(std::map<std::string, std::string>::const_iterator it =
+      for(auto it =
             _attributes.begin();
           it != _attributes.end(); it++)
         sstream << sanitize(it->first) << charSep() << sanitize(it->second)
                 << charSep();
       sstream << getClients().size() << charSep();
-      for(std::map<std::string, int>::const_iterator it = getClients().begin();
+      for(auto it = getClients().begin();
           it != getClients().end(); it++)
         sstream << sanitize(it->first) << charSep() << (it->second ? 1 : 0)
                 << charSep();
@@ -353,7 +353,7 @@ namespace onelab {
               << ", \"readOnly\":" << (getReadOnly() ? "true" : "false");
       if(_attributes.size()) {
         sstream << ", \"attributes\":{ ";
-        for(std::map<std::string, std::string>::const_iterator it =
+        for(auto it =
               _attributes.begin();
             it != _attributes.end(); it++) {
           if(it != _attributes.begin()) sstream << ", ";
@@ -364,7 +364,7 @@ namespace onelab {
       }
       if(getClients().size()) {
         sstream << ", \"clients\":{ ";
-        for(std::map<std::string, int>::const_iterator it =
+        for(auto it =
               getClients().begin();
             it != getClients().end(); it++) {
           if(it != getClients().begin()) sstream << ", ";
@@ -377,7 +377,7 @@ namespace onelab {
 #if defined(HAVE_PICOJSON)
     virtual bool fromJSON(const picojson::value::object &par)
     {
-      for(picojson::value::object::const_iterator it = par.begin();
+      for(auto it = par.begin();
           it != par.end(); ++it) {
         if(it->first == "name") {
           if(!it->second.is<std::string>()) return false;
@@ -407,7 +407,7 @@ namespace onelab {
           if(!it->second.is<picojson::object>()) return false;
           const picojson::value::object &obj =
             it->second.get<picojson::object>();
-          for(picojson::value::object::const_iterator i = obj.begin();
+          for(auto i = obj.begin();
               i != obj.end(); ++i) {
             std::string key(i->first);
             if(!i->second.is<std::string>()) return false;
@@ -418,7 +418,7 @@ namespace onelab {
           if(!it->second.is<picojson::object>()) return false;
           const picojson::value::object &obj =
             it->second.get<picojson::object>();
-          for(picojson::value::object::const_iterator i = obj.begin();
+          for(auto i = obj.begin();
               i != obj.end(); ++i) {
             std::string client(i->first);
             if(!i->second.is<double>()) return false;
@@ -514,7 +514,7 @@ namespace onelab {
     }
     std::string getValueLabel(double value) const
     {
-      std::map<double, std::string>::const_iterator it =
+      auto it =
         _valueLabels.find(value);
       if(it != _valueLabels.end()) return it->second;
       return "";
@@ -558,7 +558,7 @@ namespace onelab {
       for(std::size_t i = 0; i < _choices.size(); i++)
         sstream << _choices[i] << charSep();
       sstream << _valueLabels.size() << charSep();
-      for(std::map<double, std::string>::const_iterator it =
+      for(auto it =
             _valueLabels.begin();
           it != _valueLabels.end(); it++) {
         sstream << it->first << charSep() << sanitize(it->second) << charSep();
@@ -608,7 +608,7 @@ namespace onelab {
       }
       if(_valueLabels.size()) {
         sstream << ", \"valueLabels\":{ ";
-        for(std::map<double, std::string>::const_iterator it =
+        for(auto it =
               _valueLabels.begin();
             it != _valueLabels.end(); it++) {
           if(it != _valueLabels.begin()) sstream << ", ";
@@ -627,7 +627,7 @@ namespace onelab {
       if(err.size()) return false;
       if(!v.is<picojson::object>()) return false;
       const picojson::value::object &par = v.get<picojson::object>();
-      picojson::value::object::const_iterator it = par.find("type");
+      auto it = par.find("type");
       if(it == par.end()) return false;
       if(it->second.to_str() == "number") {
         fromJSON(par);
@@ -640,7 +640,7 @@ namespace onelab {
     bool fromJSON(const picojson::value::object &par)
     {
       if(!parameter::fromJSON(par)) return false;
-      for(picojson::value::object::const_iterator it = par.begin();
+      for(auto it = par.begin();
           it != par.end(); ++it) {
         if(it->first == "values") {
           if(!it->second.is<picojson::array>()) return false;
@@ -680,7 +680,7 @@ namespace onelab {
           if(!it->second.is<picojson::object>()) return false;
           const picojson::value::object &obj =
             it->second.get<picojson::object>();
-          for(picojson::value::object::const_iterator i = obj.begin();
+          for(auto i = obj.begin();
               i != obj.end(); ++i) {
             if(!i->second.is<double>()) return false;
             _valueLabels[i->second.get<double>()] = i->first;
@@ -817,7 +817,7 @@ namespace onelab {
       if(err.size()) return false;
       if(!v.is<picojson::object>()) return false;
       const picojson::value::object &par = v.get<picojson::object>();
-      picojson::value::object::const_iterator it = par.find("type");
+      auto it = par.find("type");
       if(it == par.end()) return false;
       if(it->second.to_str() == "string") {
         fromJSON(par);
@@ -830,7 +830,7 @@ namespace onelab {
     bool fromJSON(const picojson::value::object &par)
     {
       if(!parameter::fromJSON(par)) return false;
-      for(picojson::value::object::const_iterator it = par.begin();
+      for(auto it = par.begin();
           it != par.end(); ++it) {
         if(it->first == "values") {
           if(!it->second.is<picojson::array>()) return false;
@@ -875,7 +875,7 @@ namespace onelab {
     {
       if(name.empty() && client.size()) {
         std::vector<T *> toDelete;
-        for(typename std::set<T *, parameterLessThan>::iterator it = ps.begin();
+        for(auto it = ps.begin();
             it != ps.end();) {
           T *p = *it;
           if(p->hasClient(client)) {
@@ -889,7 +889,7 @@ namespace onelab {
       }
       else {
         T tmp(name);
-        typename std::set<T *, parameterLessThan>::iterator it = ps.find(&tmp);
+        auto it = ps.find(&tmp);
         if(it != ps.end()) {
           T *p = *it;
           if(client.empty() || p->hasClient(client)) {
@@ -910,7 +910,7 @@ namespace onelab {
               std::set<T *, parameterLessThan> &ps)
     {
       _mutex.lock();
-      typename std::set<T *, parameterLessThan>::iterator it = ps.find((T *)&p);
+      auto it = ps.find((T *)&p);
       if(it != ps.end()) {
         (*it)->update(p);
         if(client.size())
@@ -935,13 +935,13 @@ namespace onelab {
     {
       p.clear();
       if(name.empty()) {
-        for(typename std::set<T *, parameterLessThan>::iterator it = ps.begin();
+        for(auto it = ps.begin();
             it != ps.end(); it++)
           p.push_back(**it);
       }
       else {
         T tmp(name);
-        typename std::set<T *, parameterLessThan>::iterator it = ps.find(&tmp);
+        auto it = ps.find(&tmp);
         if(it != ps.end()) {
           if(client.size()){
             _mutex.lock();
@@ -958,7 +958,7 @@ namespace onelab {
                std::set<T *, parameterLessThan> ps)
     {
       T tmp(name);
-      typename std::set<T *, parameterLessThan>::iterator it = ps.find(&tmp);
+      auto it = ps.find(&tmp);
       if(it != ps.end()) {
         if(client.size()){
           _mutex.lock();
@@ -967,7 +967,7 @@ namespace onelab {
         }
         return *it;
       }
-      return NULL;
+      return nullptr;
     }
 
   public:
@@ -978,7 +978,7 @@ namespace onelab {
       if(name.empty() && client.empty()) {
         std::set<parameter *, parameterLessThan> ps;
         getAllParameters(ps);
-        for(std::set<parameter *, parameterLessThan>::iterator it = ps.begin();
+        for(auto it = ps.begin();
             it != ps.end(); it++)
           delete *it;
         _numbers.clear();
@@ -1054,7 +1054,7 @@ namespace onelab {
     {
       std::set<parameter *, parameterLessThan> ps;
       getAllParameters(ps);
-      for(std::set<parameter *, parameterLessThan>::iterator it = ps.begin();
+      for(auto it = ps.begin();
           it != ps.end(); it++)
         if((*it)->hasClient(client)) return true;
       return false;
@@ -1066,7 +1066,7 @@ namespace onelab {
       std::set<parameter *, parameterLessThan> ps;
       getAllParameters(ps);
       int changed = 0;
-      for(std::set<parameter *, parameterLessThan>::iterator it = ps.begin();
+      for(auto it = ps.begin();
           it != ps.end(); it++) {
         changed = std::max(changed, (*it)->getChanged(client));
       }
@@ -1078,7 +1078,7 @@ namespace onelab {
     {
       std::set<parameter *, parameterLessThan> ps;
       getAllParameters(ps);
-      for(std::set<parameter *, parameterLessThan>::iterator it = ps.begin();
+      for(auto it = ps.begin();
           it != ps.end(); it++)
         (*it)->setChanged(changed, client);
     }
@@ -1086,7 +1086,7 @@ namespace onelab {
     {
       std::set<parameter *, parameterLessThan> ps;
       getAllParameters(ps);
-      for(std::set<parameter *, parameterLessThan>::iterator it = ps.begin();
+      for(auto it = ps.begin();
           it != ps.end(); it++) {
         int changed = (*it)->getChanged(client);
         if(changed > threshold) (*it)->setChanged(threshold, client);
@@ -1099,7 +1099,7 @@ namespace onelab {
       std::vector<std::string> s;
       std::set<parameter *, parameterLessThan> ps;
       getAllParameters(ps);
-      for(std::set<parameter *, parameterLessThan>::const_iterator it =
+      for(auto it =
             ps.begin();
           it != ps.end(); it++)
         if(client.empty() || (*it)->hasClient(client)) {
@@ -1146,7 +1146,7 @@ namespace onelab {
       json += "  \"parameters\":[\n";
       std::set<parameter *, parameterLessThan> ps;
       getAllParameters(ps);
-      for(std::set<parameter *, parameterLessThan>::const_iterator it =
+      for(auto it =
             ps.begin();
           it != ps.end(); it++) {
         if(it != ps.begin()) json += ",\n";
@@ -1167,11 +1167,11 @@ namespace onelab {
       if(err.size()) return false;
       if(v.is<picojson::object>()){ // onelab database or single parameter
         const picojson::value::object &obj = v.get<picojson::object>();
-        picojson::value::object::const_iterator it = obj.find("onelab");
+        auto it = obj.find("onelab");
         if(it != obj.end()){ // onelab database
           if(!it->second.is<picojson::object>()) return false;
           const picojson::value::object &db = it->second.get<picojson::object>();
-          for(picojson::value::object::const_iterator j = db.begin(); j != db.end(); ++j) {
+          for(auto j = db.begin(); j != db.end(); ++j) {
             if(j->first == "version") {
               if(!j->second.is<std::string>()) return false;
               if(j->second.get<std::string>() != parameter::version())
@@ -1212,7 +1212,7 @@ namespace onelab {
 #if defined(HAVE_PICOJSON)
     bool fromJSON(const picojson::value::object &par, const std::string &client = "")
     {
-      picojson::value::object::const_iterator it = par.find("type");
+      auto it = par.find("type");
       if(it == par.end()) return false;
       if(it->second.to_str() == "number") {
         number p;
@@ -1368,7 +1368,7 @@ namespace onelab {
     int getNumClients() { return (int)_clients.size(); };
     citer findClient(const std::string &name)
     {
-      for(citer it = _clients.begin(); it != _clients.end(); it++)
+      for(auto it = _clients.begin(); it != _clients.end(); it++)
         if((*it)->getName() == name) return it;
       return _clients.end();
     }
@@ -1531,7 +1531,7 @@ namespace onelab {
       : localClient(name), _executable(executable),
         _treatExecutableAsFullCommandLine(treatExecutableAsFullCommandLine),
         _remoteLogin(remoteLogin), _socketSwitch("-onelab"), _pid(-1),
-        _gmshServer(0)
+        _gmshServer(nullptr)
     {
     }
     virtual ~localNetworkClient() {}
@@ -1682,7 +1682,7 @@ namespace onelab {
       _gmshClient = new GmshClient();
       if(_gmshClient->Connect(_serverAddress.c_str()) < 0) {
         delete _gmshClient;
-        _gmshClient = 0;
+        _gmshClient = nullptr;
       }
       else {
         _gmshClient->Start();
@@ -1695,7 +1695,7 @@ namespace onelab {
         _gmshClient->Stop();
         _gmshClient->Disconnect();
         delete _gmshClient;
-        _gmshClient = 0;
+        _gmshClient = nullptr;
       }
     }
     GmshClient *getGmshClient() { return _gmshClient; }
diff --git a/Common/onelabUtils.cpp b/Common/onelabUtils.cpp
index 7d85ee1ffc2dc07f5882d5b78deed41202342066..f54b5414d8f2ded35907ec1f02acacceac2bcab8 100644
--- a/Common/onelabUtils.cpp
+++ b/Common/onelabUtils.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -61,7 +61,7 @@ namespace onelabUtils {
       sstream.precision(16);
       std::map<std::string, std::vector<double> > cln(
         Msg::GetCommandLineNumbers());
-      for(std::map<std::string, std::vector<double> >::iterator it =
+      for(auto it =
             cln.begin();
           it != cln.end(); it++) {
         if(it->second.size() == 1) {
@@ -74,7 +74,7 @@ namespace onelabUtils {
         }
       }
       std::map<std::string, std::string> cls(Msg::GetCommandLineStrings());
-      for(std::map<std::string, std::string>::iterator it = cls.begin();
+      for(auto it = cls.begin();
           it != cls.end(); it++)
         sstream << " -setstring " << it->first << " " << it->second;
       args.push_back(sstream.str());
@@ -271,7 +271,7 @@ namespace onelabUtils {
   {
     bool changed = false;
 #if defined(HAVE_POST)
-    PView *view = 0;
+    PView *view = nullptr;
 
     for(std::size_t i = 0; i < PView::list.size(); i++) {
       if(PView::list[i]->getData()->getFileName() == "ONELAB" + graphNum) {
@@ -338,7 +338,7 @@ namespace onelabUtils {
   {
     bool redraw = false;
 
-    onelab::server::citer it = onelab::server::instance()->findClient("Gmsh");
+    auto it = onelab::server::instance()->findClient("Gmsh");
     if(it == onelab::server::instance()->lastClient()) return redraw;
 
     // do nothing in case of a metamodel
@@ -472,7 +472,7 @@ namespace onelabUtils {
       onelab::server::instance()->set(n);
 
       // create client
-      onelab::localNetworkClient *c = 0;
+      onelab::localNetworkClient *c = nullptr;
       onelab::string o;
       if(name.size()) {
         c = new gmshLocalNetworkClient(name, exe, host);
@@ -601,7 +601,7 @@ namespace onelabUtils {
 
   bool haveSolverToRun()
   {
-    for(onelab::server::citer it = onelab::server::instance()->firstClient();
+    for(auto it = onelab::server::instance()->firstClient();
         it != onelab::server::instance()->lastClient(); it++) {
       onelab::client *c = *it;
       if(c->getName() != "Gmsh" && c->getName() != "Listen" &&
diff --git a/Common/onelabUtils.h b/Common/onelabUtils.h
index 8faeb5dba8b1a69d225bf272fb9361e877b5ced7..b8165efa719e1d1451dc7dc9bc08b87b439ad357 100644
--- a/Common/onelabUtils.h
+++ b/Common/onelabUtils.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Common/picojson.h b/Common/picojson.h
index 2b2e634062c6fe9bd9e24cd581b6573640c52670..966538ad60979e3552ac41884a7b64c3f3fd11d1 100644
--- a/Common/picojson.h
+++ b/Common/picojson.h
@@ -447,7 +447,7 @@ inline const value &value::get(const std::string &key) const {
 inline value &value::get(const std::string &key) {
   static value s_null;
   PICOJSON_ASSERT(is<object>());
-  object::iterator i = u_.object_->find(key);
+  auto i = u_.object_->find(key);
   return i != u_.object_->end() ? i->second : s_null;
 }
 
@@ -1063,7 +1063,7 @@ template <typename Iter> inline std::string parse(value &out, Iter &pos, const I
 
 template <typename Context, typename Iter> inline Iter _parse(Context &ctx, const Iter &first, const Iter &last, std::string *err) {
   input<Iter> in(first, last);
-  if (!_parse(ctx, in) && err != NULL) {
+  if (!_parse(ctx, in) && err != nullptr) {
     char buf[64];
     SNPRINTF(buf, sizeof(buf), "syntax error at line %d near: ", in.line());
     *err = buf;
diff --git a/Common/rtree.h b/Common/rtree.h
index b8c34d86feeda40e5e6418b18f99857b28a741a9..e1ba9c04b296e60540ccc2971c2ba6e2c79367e9 100644
--- a/Common/rtree.h
+++ b/Common/rtree.h
@@ -478,7 +478,7 @@ public:
 
   RTFileStream()
   {
-    m_file = NULL;
+    m_file = nullptr;
   }
 
   ~RTFileStream()
@@ -511,7 +511,7 @@ public:
     if(m_file)
     {
       fclose(m_file);
-      m_file = NULL;
+      m_file = nullptr;
     }
   }
 
diff --git a/Fltk/CMakeLists.txt b/Fltk/CMakeLists.txt
index 549a081f9a08acaf1c7ae0bb654289852ce41251..fedf798f6350cd3b130e53e3e051ffffd003aa4d 100644
--- a/Fltk/CMakeLists.txt
+++ b/Fltk/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp
index b9db8d21f6c7dee5b941f9e71cb2d8c2b8888cf2..e9deec9e979faa3cff538520fe20d80577058ae8 100644
--- a/Fltk/FlGui.cpp
+++ b/Fltk/FlGui.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -55,7 +55,7 @@
 #include "3M.h"
 #endif
 
-FlGui *FlGui::_instance = 0;
+FlGui *FlGui::_instance = nullptr;
 std::string FlGui::_openedThroughMacFinder = "";
 bool FlGui::_finishedProcessingCommandLine = false;
 std::atomic<int> FlGui::_locked(0);
@@ -118,7 +118,7 @@ static void awake_cb(void *data)
 void FlGui::awake(const std::string &action)
 {
   if(action.empty())
-    Fl::awake(awake_cb, 0);
+    Fl::awake(awake_cb, nullptr);
   else
     Fl::awake(awake_cb, (void*)"update");
 }
@@ -495,7 +495,7 @@ FlGui::FlGui(int argc, char **argv, bool quitShouldExit,
   applyColorScheme();
 
   // add gamepad handler
-  if(CTX::instance()->gamepad) Fl::add_timeout(5., gamepad_handler, (void *)0);
+  if(CTX::instance()->gamepad) Fl::add_timeout(5., gamepad_handler, (void *)nullptr);
 
   // add global shortcuts
   Fl::add_handler(globalShortcut);
@@ -544,7 +544,7 @@ FlGui::FlGui(int argc, char **argv, bool quitShouldExit,
   // add callback to respond to Mac Finder
 #if defined(__APPLE__)
   fl_open_callback(OpenProjectMacFinder);
-  fl_mac_set_about(help_about_cb, 0);
+  fl_mac_set_about(help_about_cb, nullptr);
 #endif
 
   // don't move input dialogs to follow mouse
@@ -643,7 +643,7 @@ FlGui::~FlGui()
   delete fullscreen;
 }
 
-bool FlGui::available() { return _instance != 0; }
+bool FlGui::available() { return _instance != nullptr; }
 
 FlGui *FlGui::instance(int argc, char **argv, bool quitShouldExit,
                        void (*error_handler)(const char *fmt, ...))
@@ -671,7 +671,7 @@ void FlGui::destroy()
 {
   if(!_instance) return;
   delete _instance;
-  _instance = 0;
+  _instance = nullptr;
 }
 
 int FlGui::run()
@@ -694,35 +694,35 @@ int FlGui::testGlobalShortcuts(int event)
   int status = 0;
 
   if(Fl::test_shortcut('0')) {
-    geometry_reload_cb(0, 0);
+    geometry_reload_cb(nullptr, nullptr);
     status = 1;
   }
   if(Fl::test_shortcut(FL_CTRL + '0') || Fl::test_shortcut(FL_META + '0') ||
      Fl::test_shortcut('9')) { // for Bruno
-    onelab_reload_cb(0, 0);
+    onelab_reload_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut('1') || Fl::test_shortcut(FL_F + 1)) {
-    mesh_1d_cb(0, 0);
+    mesh_1d_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut('2') || Fl::test_shortcut(FL_F + 2)) {
-    mesh_2d_cb(0, 0);
+    mesh_2d_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut('3') || Fl::test_shortcut(FL_F + 3)) {
-    mesh_3d_cb(0, 0);
+    mesh_3d_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_CTRL + 'q') ||
           Fl::test_shortcut(FL_META + 'q')) {
     // only necessary when using the system menu bar, but hey, it cannot hurt...
-    file_quit_cb(0, 0);
+    file_quit_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_CTRL + 't') ||
           Fl::test_shortcut(FL_META + 't')) {
-    show_hide_menu_cb(0, 0);
+    show_hide_menu_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut('g')) {
@@ -742,7 +742,7 @@ int FlGui::testGlobalShortcuts(int event)
     status = 1;
   }
   else if(Fl::test_shortcut('w')) {
-    file_watch_cb(0, 0);
+    file_watch_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut('e')) {
@@ -811,7 +811,7 @@ int FlGui::testGlobalShortcuts(int event)
           Fl::test_shortcut(FL_CTRL + FL_Escape) ||
           Fl::test_shortcut(FL_ALT + FL_Escape)) {
     if(fullscreen->shown()) {
-      window_cb(0, (void *)"fullscreen");
+      window_cb(nullptr, (void *)"fullscreen");
       status = 1;
     }
     else {
@@ -826,37 +826,37 @@ int FlGui::testGlobalShortcuts(int event)
         status = 2;
       }
       else {
-        status_options_cb(0, (void *)"S");
+        status_options_cb(nullptr, (void *)"S");
         status = 1;
       }
     }
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'a')) {
-    window_cb(0, (void *)"front");
+    window_cb(nullptr, (void *)"front");
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'o')) {
-    general_options_cb(0, 0);
+    general_options_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'g')) {
-    geometry_options_cb(0, 0);
+    geometry_options_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'm')) {
-    mesh_options_cb(0, 0);
+    mesh_options_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 's')) {
-    solver_options_cb(0, 0);
+    solver_options_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'p')) {
-    post_options_cb(0, 0);
+    post_options_cb(nullptr, nullptr);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'w')) {
-    view_options_cb(0, (void *)-1);
+    view_options_cb(nullptr, (void *)-1);
     status = 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'u')) {
@@ -909,28 +909,28 @@ int FlGui::testGlobalShortcuts(int event)
   }
   else if(Fl::test_shortcut(FL_ALT + 'x') ||
           Fl::test_shortcut(FL_ALT + FL_SHIFT + 'x')) {
-    status_xyz1p_cb(0, (void *)"x");
+    status_xyz1p_cb(nullptr, (void *)"x");
     status = 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'y') ||
           Fl::test_shortcut(FL_ALT + FL_SHIFT + 'y')) {
-    status_xyz1p_cb(0, (void *)"y");
+    status_xyz1p_cb(nullptr, (void *)"y");
     status = 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'z') ||
           Fl::test_shortcut(FL_ALT + FL_SHIFT + 'z')) {
-    status_xyz1p_cb(0, (void *)"z");
+    status_xyz1p_cb(nullptr, (void *)"z");
     status = 1;
   }
   else if(Fl::test_shortcut(FL_ALT + '1') ||
           Fl::test_shortcut(FL_ALT + FL_SHIFT + '1') ||
           Fl::test_shortcut(FL_ALT + FL_CTRL + '1') ||
           Fl::test_shortcut(FL_ALT + FL_META + '1')) {
-    status_xyz1p_cb(0, (void *)"1:1");
+    status_xyz1p_cb(nullptr, (void *)"1:1");
     status = 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'o')) {
-    status_options_cb(0, (void *)"p");
+    status_options_cb(nullptr, (void *)"p");
     status = 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'a')) {
@@ -1001,7 +1001,7 @@ int FlGui::testGlobalShortcuts(int event)
     status = 2;
   }
   else if(Fl::test_shortcut(FL_ALT + 'm')) {
-    quick_access_cb(0, (void *)"mesh_toggle");
+    quick_access_cb(nullptr, (void *)"mesh_toggle");
     status = 2;
   }
   else if(Fl::test_shortcut(FL_ALT + 't')) {
@@ -1137,8 +1137,8 @@ void FlGui::updateFields()
 
 void FlGui::resetVisibility()
 {
-  if(visibility->win->shown()) visibility_cb(NULL, NULL);
-  if(help->options->shown()) help_options_cb(NULL, NULL);
+  if(visibility->win->shown()) visibility_cb(nullptr, nullptr);
+  if(help->options->shown()) help_options_cb(nullptr, nullptr);
 }
 
 openglWindow *FlGui::getCurrentOpenglWindow()
diff --git a/Fltk/FlGui.h b/Fltk/FlGui.h
index ba6afd75cbf496c8896828bcbff74a69987b50af..39456745cd126ebe096a3190e878e2cdcb60471e 100644
--- a/Fltk/FlGui.h
+++ b/Fltk/FlGui.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -87,12 +87,12 @@ public:
 
 public:
   FlGui(int argc, char **argv, bool quitShouldExit,
-        void (*error_handler)(const char *fmt, ...) = 0);
+        void (*error_handler)(const char *fmt, ...) = nullptr);
   ~FlGui();
   // return the single static instance of the GUI
-  static FlGui *instance(int argc = 0, char **argv = 0,
+  static FlGui *instance(int argc = 0, char **argv = nullptr,
                          bool quitShouldExit = true,
-                         void (*error_handler)(const char *fmt, ...) = 0);
+                         void (*error_handler)(const char *fmt, ...) = nullptr);
   // destroy instance
   static void destroy();
   // check if the GUI is available
diff --git a/Fltk/Navigator.cpp b/Fltk/Navigator.cpp
index cf5485a0636e77154209fdc50525a02c785b0c35..536a9ad581d89cbf5c4748899dafd07fe70b37fb 100644
--- a/Fltk/Navigator.cpp
+++ b/Fltk/Navigator.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/Navigator.h b/Fltk/Navigator.h
index 174ce373b0ebbe05689718d94dd565f75f0365df..e35e1fcf585c83bd8371dde4e46f96207129aae4 100644
--- a/Fltk/Navigator.h
+++ b/Fltk/Navigator.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/XpmIcon.h b/Fltk/XpmIcon.h
index 640f3f5e999d816a3bcb8053ba8fde4522713cb1..f187eed5146210b09f0add6066e5094a4288fa02 100644
--- a/Fltk/XpmIcon.h
+++ b/Fltk/XpmIcon.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/classificationEditor.cpp b/Fltk/classificationEditor.cpp
index c350ef3cada8491409210cc5a7a50be9e7be6540..ca155f66ce44f339ab7c383be580a9fff091d54f 100644
--- a/Fltk/classificationEditor.cpp
+++ b/Fltk/classificationEditor.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -88,12 +88,12 @@ static void select_elements_cb(Fl_Widget *w, void *data)
   if(!e->selected) {
     e->selected =
       new discreteEdge(GModel::current(),
-                       GModel::current()->getMaxElementaryNumber(1) + 1, 0, 0);
+                       GModel::current()->getMaxElementaryNumber(1) + 1, nullptr, nullptr);
     GModel::current()->add(e->selected);
   }
 
   if(all) {
-    for(GModel::fiter it = GModel::current()->firstFace();
+    for(auto it = GModel::current()->firstFace();
         it != GModel::current()->lastFace(); ++it) {
       e->elements.insert(e->elements.end(), (*it)->triangles.begin(),
                          (*it)->triangles.end());
@@ -147,7 +147,7 @@ static void select_elements_cb(Fl_Widget *w, void *data)
   buildEdgeToElements(e->elements, adj);
   buildListOfEdgeAngle(adj, e->edges_detected, e->edges_lonly);
   ElementsSelectedMode(e);
-  update_edges_cb(0, data);
+  update_edges_cb(nullptr, data);
   Msg::StatusGl("");
 }
 
@@ -230,7 +230,7 @@ static void delete_edge_cb(Fl_Widget *w, void *data)
   std::vector<MLine *> temp = e->selected->lines;
   e->selected->lines.clear();
   for(std::size_t i = 0; i < temp.size(); i++) {
-    std::vector<MLine *>::iterator it =
+    auto it =
       std::find(ele.begin(), ele.end(), temp[i]);
     if(it != ele.end())
       delete temp[i];
@@ -267,7 +267,7 @@ static void classify_cb(Fl_Widget *w, void *data)
   if(!e->selected) {
     e->selected =
       new discreteEdge(GModel::current(),
-                       GModel::current()->getMaxElementaryNumber(1) + 1, 0, 0);
+                       GModel::current()->getMaxElementaryNumber(1) + 1, nullptr, nullptr);
     GModel::current()->add(e->selected);
   }
 
@@ -283,7 +283,7 @@ static void classify_cb(Fl_Widget *w, void *data)
     GModel::current()->remove(e->selected);
     e->selected->lines.clear();
     delete e->selected;
-    e->selected = 0;
+    e->selected = nullptr;
   }
 
   GModel::current()->pruneMeshVertexAssociations();
@@ -297,7 +297,7 @@ static void classify_cb(Fl_Widget *w, void *data)
   NoElementsSelectedMode(e);
 }
 
-classificationEditor::classificationEditor() : selected(0)
+classificationEditor::classificationEditor() : selected(nullptr)
 {
   opt_mesh_lines(0, GMSH_SET | GMSH_GUI, 1.);
 
@@ -423,7 +423,7 @@ classificationEditor::classificationEditor() : selected(0)
 void mesh_classify_cb(Fl_Widget *w, void *data)
 {
   // create the (static) editor
-  static classificationEditor *editor = 0;
+  static classificationEditor *editor = nullptr;
   if(!editor) editor = new classificationEditor();
   editor->show();
 }
diff --git a/Fltk/classificationEditor.h b/Fltk/classificationEditor.h
index 9159d0bdda66b9ab7e83975e3d0ac20f2790e7ec..424382933b5c7d11120223ff393d22338ff89cba 100644
--- a/Fltk/classificationEditor.h
+++ b/Fltk/classificationEditor.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/clippingWindow.cpp b/Fltk/clippingWindow.cpp
index 60501c14c4ef6ae776c9f6776e14487866818c75..e4d8ee5a7f3d2164838724b1eda1a53f6d924fb1 100644
--- a/Fltk/clippingWindow.cpp
+++ b/Fltk/clippingWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -138,7 +138,7 @@ static void clip_invert_cb(Fl_Widget *w, void *data)
   for(int i = 0; i < 4; i++)
     FlGui::instance()->clipping->plane[i]->value(
       -FlGui::instance()->clipping->plane[i]->value());
-  clip_update_cb(NULL, NULL);
+  clip_update_cb(nullptr, nullptr);
 }
 
 static void clip_reset_cb(Fl_Widget *w, void *data)
@@ -176,13 +176,13 @@ clippingWindow::clippingWindow(int deltaFontSize)
 {
   FL_NORMAL_SIZE -= deltaFontSize;
 
-  static Fl_Menu_Item plane_number[] = {{"Plane 0", 0, 0},
-                                        {"Plane 1", 0, 0},
-                                        {"Plane 2", 0, 0},
-                                        {"Plane 3", 0, 0},
-                                        {"Plane 4", 0, 0},
-                                        {"Plane 5", 0, 0},
-                                        {0}};
+  static Fl_Menu_Item plane_number[] = {{"Plane 0", 0, nullptr},
+                                        {"Plane 1", 0, nullptr},
+                                        {"Plane 2", 0, nullptr},
+                                        {"Plane 3", 0, nullptr},
+                                        {"Plane 4", 0, nullptr},
+                                        {"Plane 5", 0, nullptr},
+                                        {nullptr}};
 
   int width = 26 * FL_NORMAL_SIZE;
   int height = 10 * BH + 5 * WB;
diff --git a/Fltk/clippingWindow.h b/Fltk/clippingWindow.h
index 92fb62aa4869b80d0dd6b73386466fb5291e0d45..b5b9fe6d3f8f50711369986a557ccff1e55e74c8 100644
--- a/Fltk/clippingWindow.h
+++ b/Fltk/clippingWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/colorbarWindow.cpp b/Fltk/colorbarWindow.cpp
index 76103f7c5c82c58c6a291507e19e5791a1a97fa9..1226ac9275298a685b3e6202b17ea829a6ea71d1 100644
--- a/Fltk/colorbarWindow.cpp
+++ b/Fltk/colorbarWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -18,8 +18,8 @@
 colorbarWindow::colorbarWindow(int x, int y, int w, int h, const char *l)
   : Fl_Window(x, y, w, h, l)
 {
-  ct = NULL;
-  label = NULL;
+  ct = nullptr;
+  label = nullptr;
   help_flag = 1;
   font_height = FL_NORMAL_SIZE - 1; // use slightly smaller font
   marker_height = font_height;
diff --git a/Fltk/colorbarWindow.h b/Fltk/colorbarWindow.h
index 3d3891b9d383e27b9578097216388aadbfc48e76..536197de44d4934c882502f889cd130e689829ef 100644
--- a/Fltk/colorbarWindow.h
+++ b/Fltk/colorbarWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -37,7 +37,7 @@ private:
   void redraw_marker();
 
 public:
-  colorbarWindow(int x, int y, int w, int h, const char *l = 0);
+  colorbarWindow(int x, int y, int w, int h, const char *l = nullptr);
   void draw();
   int handle(int);
   void update(const char *name, double min, double max, GmshColorTable *ct,
diff --git a/Fltk/contextWindow.cpp b/Fltk/contextWindow.cpp
index 5694d6a6f40eee7df1dd7b69451ada7b5c77958d..ab1062b38015030893a8b82bac169664897e96c7 100644
--- a/Fltk/contextWindow.cpp
+++ b/Fltk/contextWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -34,7 +34,7 @@ static bool getval(const char *str, double &val)
   std::vector<double> valVar;
 
   // we should probably use the actual .geo parser instead...
-  for(std::map<std::string, gmsh_yysymbol>::iterator it =
+  for(auto it =
         gmsh_yysymbols.begin();
       it != gmsh_yysymbols.end(); it++) {
     if(it->second.value.size() == 1) {
@@ -379,7 +379,7 @@ static void elementary_add_sphere_cb(Fl_Widget *w, void *data)
                   FlGui::instance()->elementaryContext->input[38]->value());
   FlGui::instance()->resetVisibility();
   GModel::current()->setSelection(0);
-  drawContext::setDrawGeomTransientFunction(0);
+  drawContext::setDrawGeomTransientFunction(nullptr);
   SetBoundingBox();
   drawContext::global()->draw();
 }
@@ -1069,7 +1069,7 @@ void elementaryContextWindow::updatePoint(double pt[3], int which)
         for(int k = 0; k < 11; k++) {
           input[start[k] + i]->value(str);
           if(input[start[k] + i]->parent()->active()) {
-            input[start[k] + i]->do_callback(0, (void *)"no_redraw");
+            input[start[k] + i]->do_callback(nullptr, (void *)"no_redraw");
           }
         }
       }
@@ -1288,11 +1288,11 @@ void physicalContextWindow::show(const std::string &what, bool remove)
   {
     for(auto &p : physicalNames) {
       char *str = strdup(p.first.c_str());
-      Fl_Menu_Item item = {str, 0, 0, 0, 0};
+      Fl_Menu_Item item = {str, 0, nullptr, nullptr, 0};
       toFree.push_back(str);
       menuAdd.push_back(item);
     }
-    Fl_Menu_Item item = {0};
+    Fl_Menu_Item item = {nullptr};
     menuAdd.push_back(item);
     input[0]->menubutton()->copy(&menuAdd[0]);
   }
@@ -1301,11 +1301,11 @@ void physicalContextWindow::show(const std::string &what, bool remove)
       std::string label = std::to_string(p.first);
       if(p.second.size()) label += ": " + p.second;
       char *str = strdup(label.c_str());
-      Fl_Menu_Item item = {str, 0, 0, 0, 0};
+      Fl_Menu_Item item = {str, 0, nullptr, nullptr, 0};
       toFree.push_back(str);
       menuRemove.push_back(item);
     }
-    Fl_Menu_Item item = {0};
+    Fl_Menu_Item item = {nullptr};
     menuRemove.push_back(item);
     choice[0]->copy(&menuRemove[0]);
   }
@@ -1319,7 +1319,7 @@ void physicalContextWindow::show(const std::string &what, bool remove)
     mode = "Remove";
     group[1]->show();
     group[1]->activate();
-    physical_remove_cb(0, 0);
+    physical_remove_cb(nullptr, nullptr);
   }
   else {
     mode = "Add";
@@ -1329,15 +1329,15 @@ void physicalContextWindow::show(const std::string &what, bool remove)
       value[0]->deactivate();
     else
       value[0]->activate();
-    physical_add_cb(0, (void *)"Name");
+    physical_add_cb(nullptr, (void *)"Name");
   }
 
   if(!win->shown()) win->show();
 }
 
 static Fl_Menu_Item menu_selection_mode[] = {
-  {"All entities", 0, 0, 0}, {"Points", 0, 0, 0},  {"Curves", 0, 0, 0},
-  {"Surfaces", 0, 0, 0},     {"Volumes", 0, 0, 0}, {0}};
+  {"All entities", 0, nullptr, nullptr}, {"Points", 0, nullptr, nullptr},  {"Curves", 0, nullptr, nullptr},
+  {"Surfaces", 0, nullptr, nullptr},     {"Volumes", 0, nullptr, nullptr}, {nullptr}};
 
 static void selection_mode_cb(Fl_Widget *w, void *data)
 {
@@ -1569,7 +1569,7 @@ meshContextWindow::meshContextWindow(int deltaFontSize)
   FL_NORMAL_SIZE -= deltaFontSize;
 
   static Fl_Menu menu_transfinite_dir[] = {
-    {"Left", 0, 0, 0}, {"Right", 0, 0, 0}, {"Alternated", 0, 0, 0}, {0}};
+    {"Left", 0, nullptr, nullptr}, {"Right", 0, nullptr, nullptr}, {"Alternated", 0, nullptr, nullptr}, {nullptr}};
 
   int width = 29 * FL_NORMAL_SIZE;
   int height = 4 * WB + 4 * BH;
@@ -1599,7 +1599,7 @@ meshContextWindow::meshContextWindow(int deltaFontSize)
       input[2]->value("1");
       for(int i = 1; i < 3; i++) { input[i]->align(FL_ALIGN_RIGHT); }
       static Fl_Menu_Item menu_trsf_mesh[] = {
-        {"Progression", 0, 0, 0}, {"Bump", 0, 0, 0}, {"Beta", 0, 0, 0}, {0}};
+        {"Progression", 0, nullptr, nullptr}, {"Bump", 0, nullptr, nullptr}, {"Beta", 0, nullptr, nullptr}, {nullptr}};
       choice[0] = new Fl_Choice(2 * WB, 2 * WB + 2 * BH, IW, BH, "Type");
       choice[0]->menu(menu_trsf_mesh);
       choice[0]->align(FL_ALIGN_RIGHT);
diff --git a/Fltk/contextWindow.h b/Fltk/contextWindow.h
index 8f31d0162766e2b0eb8e565e8707d48f775b6e91..8488a76bb75341cc2ebdfccb4d9d01f982128d03 100644
--- a/Fltk/contextWindow.h
+++ b/Fltk/contextWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/drawContextFltk.h b/Fltk/drawContextFltk.h
index d34fc99db828116a71971426f430fd9a8b5f8b8a..d5ec20b25e5310b66f13334240f0774e35dccf6b 100644
--- a/Fltk/drawContextFltk.h
+++ b/Fltk/drawContextFltk.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/drawContextFltkCairo.cpp b/Fltk/drawContextFltkCairo.cpp
index 558d051ccff8faf0149199f436e0340bdca493cd..49b6fba680d83e44ec18e454b30ff58304f0f8e8 100644
--- a/Fltk/drawContextFltkCairo.cpp
+++ b/Fltk/drawContextFltkCairo.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -40,7 +40,7 @@ public:
 
   ~queueString()
   {
-    for(std::vector<element>::iterator it = _elements.begin();
+    for(auto it = _elements.begin();
         it != _elements.end(); ++it) {
       cairo_font_face_destroy(it->fontFace);
     }
@@ -73,7 +73,7 @@ public:
     cairo_font_options_destroy(fontOptions);
 
     cairo_set_source_rgba(cr, 1, 1, 1, 1);
-    for(std::vector<element>::iterator it = _elements.begin();
+    for(auto it = _elements.begin();
         it != _elements.end(); ++it) {
       cairo_move_to(cr, pos - it->xBearing, -it->yBearing);
       cairo_set_font_size(cr, it->fontSize);
@@ -115,7 +115,7 @@ public:
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 
     pos = 0;
-    for(std::vector<element>::iterator it = _elements.begin();
+    for(auto it = _elements.begin();
         it != _elements.end(); ++it) {
       glTranslatef(it->x, it->y, it->z);
       glColor4f(it->r, it->g, it->b, it->alpha);
diff --git a/Fltk/drawContextFltkCairo.h b/Fltk/drawContextFltkCairo.h
index 0f24f9369db09f74a178a22f016d68e3d8bfdd26..714b560cadbee0b122e002bf78da29417ba34b48 100644
--- a/Fltk/drawContextFltkCairo.h
+++ b/Fltk/drawContextFltkCairo.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/drawContextFltkStringTexture.cpp b/Fltk/drawContextFltkStringTexture.cpp
index c01efae5d1a0bbe9577dbafb944c5362e9a71d98..b9ee8a6e1aac0f0e7854f489a34cd4184c95e9e7 100644
--- a/Fltk/drawContextFltkStringTexture.cpp
+++ b/Fltk/drawContextFltkStringTexture.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -52,13 +52,13 @@ public:
     fl_rectf(0, 0, w, h);
     fl_color(255, 255, 255);
     int pos = 0;
-    for(std::vector<element>::iterator it = _elements.begin();
+    for(auto it = _elements.begin();
         it != _elements.end(); ++it) {
       fl_font(it->fontId, it->fontSize);
       fl_draw(it->text.c_str(), pos, it->height - fl_descent());
       pos += it->width;
     }
-    uchar *data = fl_read_image(NULL, 0, 0, w, h);
+    uchar *data = fl_read_image(nullptr, 0, 0, w, h);
     for(int i = 0; i < w * h; ++i) {
       data[i] = data[i * 3];
     }
@@ -100,7 +100,7 @@ public:
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 
     pos = 0;
-    for(std::vector<element>::iterator it = _elements.begin();
+    for(auto it = _elements.begin();
         it != _elements.end(); ++it) {
       glTranslatef(it->x, it->y, it->z);
       glColor4f(it->r, it->g, it->b, it->alpha);
diff --git a/Fltk/drawContextFltkStringTexture.h b/Fltk/drawContextFltkStringTexture.h
index d90da5134e13de2b27bdded7e102f2182a0a1e32..d7b2d637cdce54e163f4d08b53d63d8425b40215 100644
--- a/Fltk/drawContextFltkStringTexture.h
+++ b/Fltk/drawContextFltkStringTexture.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/extraDialogs.cpp b/Fltk/extraDialogs.cpp
index 7639aaa83ce0b2defa4756d2ddf13608c80abe7d..be1ff2b3d809dace44b28e168b905849fd3d1817 100644
--- a/Fltk/extraDialogs.cpp
+++ b/Fltk/extraDialogs.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -43,7 +43,7 @@ int arrowEditor(const char *title, double &a, double &b, double &c)
     Fl_Value_Slider *sa, *sb, *sc;
     Fl_Button *apply, *cancel;
   };
-  static _editor *editor = 0;
+  static _editor *editor = nullptr;
 
   if(!editor) {
     editor = new _editor;
@@ -120,7 +120,7 @@ class historyBrowser : public Fl_Hold_Browser {
   };
 
 public:
-  historyBrowser(int x, int y, int w, int h, const char *l = 0)
+  historyBrowser(int x, int y, int w, int h, const char *l = nullptr)
     : Fl_Hold_Browser(x, y, w, h, l)
   {
   }
@@ -237,7 +237,7 @@ public:
   }
 };
 
-static historyChooser *_connectionChooser = 0;
+static historyChooser *_connectionChooser = nullptr;
 static void connection_select_cb(Fl_Widget *w, void *data)
 {
   int i = _connectionChooser->browser->value();
@@ -255,7 +255,7 @@ std::string connectionChooser()
   return _connectionChooser->run();
 }
 
-static historyChooser *_patternChooser = 0;
+static historyChooser *_patternChooser = nullptr;
 static void pattern_select_cb(Fl_Widget *w, void *data)
 {
   int i = _patternChooser->browser->value();
@@ -354,7 +354,7 @@ public:
   }
 };
 
-static cgnsImportDialog *_cgnsImport = 0;
+static cgnsImportDialog *_cgnsImport = nullptr;
 /*static void pattern_select_cb(Fl_Widget* w, void *data)
 {
   _cgnsImport->input_choice->value("1");
diff --git a/Fltk/extraDialogs.h b/Fltk/extraDialogs.h
index 1cc46004654c45d92fede9821e1959254bb0d73a..996000f0bcec657a08abc612021005a0e3c3019a 100644
--- a/Fltk/extraDialogs.h
+++ b/Fltk/extraDialogs.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/fieldWindow.cpp b/Fltk/fieldWindow.cpp
index f8d5d889f9fe0e79e200c17f7aaaecfa7ca66eaf..389bfe8ef29bb9c5b67e340a790fb6da7e232c02 100644
--- a/Fltk/fieldWindow.cpp
+++ b/Fltk/fieldWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -33,14 +33,14 @@
 void field_cb(Fl_Widget *w, void *data)
 {
   FlGui::instance()->fields->win->show();
-  FlGui::instance()->fields->editField(NULL);
+  FlGui::instance()->fields->editField(nullptr);
 }
 
 static void field_delete_cb(Fl_Widget *w, void *data)
 {
   Field *f = (Field *)FlGui::instance()->fields->editor_group->user_data();
   scriptDeleteField(f->id, GModel::current()->getFileName());
-  FlGui::instance()->fields->editField(NULL);
+  FlGui::instance()->fields->editField(nullptr);
 }
 
 static void field_new_cb(Fl_Widget *w, void *data)
@@ -60,7 +60,7 @@ static void field_apply_cb(Fl_Widget *w, void *data)
 static void field_browser_cb(Fl_Widget *w, void *data)
 {
   int selected = FlGui::instance()->fields->browser->value();
-  if(!selected) { FlGui::instance()->fields->editField(NULL); }
+  if(!selected) { FlGui::instance()->fields->editField(nullptr); }
   Field *f = (Field *)FlGui::instance()->fields->browser->data(selected);
   FlGui::instance()->fields->editField(f);
 }
@@ -196,7 +196,7 @@ fieldWindow::fieldWindow(int deltaFontSize) : _deltaFontSize(deltaFontSize)
   FL_NORMAL_SIZE += deltaFontSize;
 
   loadFieldViewList();
-  editField(NULL);
+  editField(nullptr);
 }
 
 void fieldWindow::loadFieldViewList()
@@ -217,7 +217,7 @@ void fieldWindow::loadFieldList()
   Field *selected_field = (Field *)editor_group->user_data();
   browser->clear();
   int i_entry = 0;
-  for(FieldManager::iterator it = fields.begin(); it != fields.end(); it++) {
+  for(auto it = fields.begin(); it != fields.end(); it++) {
     i_entry++;
     Field *field = it->second;
     std::ostringstream sstream;
@@ -230,14 +230,14 @@ void fieldWindow::loadFieldList()
 
 void fieldWindow::saveFieldOptions()
 {
-  std::list<Fl_Widget *>::iterator input = options_widget.begin();
+  auto input = options_widget.begin();
   Field *f = (Field *)editor_group->user_data();
   std::ostringstream sstream;
   int i;
   char a;
   double d;
   sstream.precision(16);
-  for(std::map<std::string, FieldOption *>::iterator it = f->options.begin();
+  for(auto it = f->options.begin();
       it != f->options.end(); it++) {
     FieldOption *option = it->second;
     if(option->isDeprecated()) continue;
@@ -309,8 +309,8 @@ void fieldWindow::saveFieldOptions()
 void fieldWindow::loadFieldOptions()
 {
   Field *f = (Field *)editor_group->user_data();
-  std::list<Fl_Widget *>::iterator input = options_widget.begin();
-  for(std::map<std::string, FieldOption *>::iterator it = f->options.begin();
+  auto input = options_widget.begin();
+  for(auto it = f->options.begin();
       it != f->options.end(); it++) {
     FieldOption *option = it->second;
     if(option->isDeprecated()) continue;
@@ -374,7 +374,7 @@ void fieldWindow::editField(Field *f)
   editor_group->user_data(f);
   put_on_view_btn->deactivate();
   delete_btn->deactivate();
-  if(f == NULL) {
+  if(f == nullptr) {
     selected_id = -1;
     editor_group->hide();
     empty_message->show();
@@ -399,7 +399,7 @@ void fieldWindow::editField(Field *f)
   ConvertToHTML(help);
   if(!f->options.empty())
     help += std::string("<p><center><b>Options</b></center>");
-  for(std::map<std::string, FieldOption *>::iterator it = f->options.begin();
+  for(auto it = f->options.begin();
       it != f->options.end(); it++) {
     if(it->second->isDeprecated()) continue;
     Fl_Widget *input;
@@ -439,7 +439,7 @@ void fieldWindow::editField(Field *f)
   }
   if(!f->callbacks.empty())
     help += std::string("<p><center><b>Actions</b></center>");
-  for(std::map<std::string, FieldCallback *>::iterator it =
+  for(auto it =
         f->callbacks.begin();
       it != f->callbacks.end(); it++) {
     Fl_Widget *btn;
diff --git a/Fltk/fieldWindow.h b/Fltk/fieldWindow.h
index 877af507d56be204087b6a0992af58b0172e6b0d..9342d6f42a544f0b952ccbc32d02ff86cfc0e804 100644
--- a/Fltk/fieldWindow.h
+++ b/Fltk/fieldWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/fileDialogs.cpp b/Fltk/fileDialogs.cpp
index 4c98a110c201077757df27a2de7874b9d464ccf5..cf66c6a9be8c164fdd6df9f7cd1997cbf891a6e2 100644
--- a/Fltk/fileDialogs.cpp
+++ b/Fltk/fileDialogs.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -91,10 +91,10 @@ public:
   }
 };
 
-static flFileChooser *fc = 0;
+static flFileChooser *fc = nullptr;
 
 // native file chooser
-static Fl_Native_File_Chooser *nfc = 0;
+static Fl_Native_File_Chooser *nfc = nullptr;
 
 int fileChooser(FILE_CHOOSER_TYPE type, const char *message, const char *filter,
                 const char *fname)
@@ -261,7 +261,7 @@ int genericBitmapFileDialog(const char *name, const char *title, int format)
     Fl_Value_Input *v[2];
     Fl_Button *ok, *cancel;
   };
-  static _genericBitmapFileDialog *dialog = NULL;
+  static _genericBitmapFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _genericBitmapFileDialog;
@@ -379,7 +379,7 @@ int pgfBitmapFileDialog(const char *name, const char *title, int format)
     Fl_Value_Input *v[2];
     Fl_Button *ok, *cancel;
   };
-  static _pgfBitmapFileDialog *dialog = NULL;
+  static _pgfBitmapFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _pgfBitmapFileDialog;
@@ -469,7 +469,7 @@ int latexFileDialog(const char *name)
     Fl_Value_Input *v;
     Fl_Button *ok, *cancel;
   };
-  static _latexFileDialog *dialog = NULL;
+  static _latexFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _latexFileDialog;
@@ -545,7 +545,7 @@ int mpegFileDialog(const char *name)
     Fl_Group *buttons;
     Fl_Button *ok, *preview, *cancel;
   };
-  static _mpegFileDialog *dialog = NULL;
+  static _mpegFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _mpegFileDialog;
@@ -720,7 +720,7 @@ int gifFileDialog(const char *name)
     Fl_Check_Button *b[7];
     Fl_Button *ok, *cancel;
   };
-  static _gifFileDialog *dialog = NULL;
+  static _gifFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _gifFileDialog;
@@ -841,13 +841,13 @@ int gl2psFileDialog(const char *name, const char *title, int format)
     Fl_Choice *c;
     Fl_Button *ok, *cancel;
   };
-  static _gl2psFileDialog *dialog = NULL;
+  static _gl2psFileDialog *dialog = nullptr;
 
-  static Fl_Menu_Item sortmenu[] = {{"Raster image", 0, 0, 0},
-                                    {"Vector simple sort", 0, 0, 0},
-                                    {"Vector accurate sort", 0, 0, 0},
-                                    {"Vector unsorted", 0, 0, 0},
-                                    {0}};
+  static Fl_Menu_Item sortmenu[] = {{"Raster image", 0, nullptr, nullptr},
+                                    {"Vector simple sort", 0, nullptr, nullptr},
+                                    {"Vector accurate sort", 0, nullptr, nullptr},
+                                    {"Vector unsorted", 0, nullptr, nullptr},
+                                    {nullptr}};
 
   if(!dialog) {
     dialog = new _gl2psFileDialog;
@@ -944,7 +944,7 @@ int optionsFileDialog(const char *name)
     Fl_Check_Button *b[2];
     Fl_Button *ok, *cancel;
   };
-  static _optionsFileDialog *dialog = NULL;
+  static _optionsFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _optionsFileDialog;
@@ -1001,7 +1001,7 @@ int geoFileDialog(const char *name)
     Fl_Check_Button *b[2];
     Fl_Button *ok, *cancel;
   };
-  static _geoFileDialog *dialog = NULL;
+  static _geoFileDialog *dialog = nullptr;
 
   if(!dialog) {
     dialog = new _geoFileDialog;
@@ -1059,7 +1059,7 @@ int meshStatFileDialog(const char *name)
     Fl_Check_Button *b[8];
     Fl_Button *ok, *cancel;
   };
-  static _meshStatFileDialog *dialog = NULL;
+  static _meshStatFileDialog *dialog = nullptr;
 
   int BBB = BB + 9; // labels too long
 
@@ -1163,12 +1163,12 @@ struct _mshFileDialog {
 
 int mshFileDialog(const char *name)
 {
-  static _mshFileDialog *dialog = NULL;
+  static _mshFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item formatmenu[] = {
-    {"Version 1", 0, 0, 0},        {"Version 2 ASCII", 0, 0, 0},
-    {"Version 2 Binary", 0, 0, 0}, {"Version 4 ASCII", 0, 0, 0},
-    {"Version 4 Binary", 0, 0, 0}, {0}};
+    {"Version 1", 0, nullptr, nullptr},        {"Version 2 ASCII", 0, nullptr, nullptr},
+    {"Version 2 Binary", 0, nullptr, nullptr}, {"Version 4 ASCII", 0, nullptr, nullptr},
+    {"Version 4 Binary", 0, nullptr, nullptr}, {nullptr}};
 
   int BBB = BB + 9; // labels too long
 
@@ -1283,7 +1283,7 @@ int unvinpFileDialog(const char *name, const char *title, int format)
     Fl_Check_Button *b[2];
     Fl_Button *ok, *cancel;
   };
-  static _unvFileDialog *dialog = NULL;
+  static _unvFileDialog *dialog = nullptr;
 
   int BBB = BB + 9; // labels too long
 
@@ -1346,22 +1346,22 @@ int keyFileDialog(const char *name, const char *title, int format)
     Fl_Check_Button *b[2];
     Fl_Button *ok, *cancel;
   };
-  static _keyFileDialog *dialog = NULL;
+  static _keyFileDialog *dialog = nullptr;
 
-  static Fl_Menu_Item beammenu[] = {{"Physical groups", 0, 0, 0},
-                                    {"Save all", 0, 0, 0},
-                                    {"Ignore", 0, 0, 0},
-                                    {0}};
+  static Fl_Menu_Item beammenu[] = {{"Physical groups", 0, nullptr, nullptr},
+                                    {"Save all", 0, nullptr, nullptr},
+                                    {"Ignore", 0, nullptr, nullptr},
+                                    {nullptr}};
 
-  static Fl_Menu_Item shellmenu[] = {{"Physical groups", 0, 0, 0},
-                                     {"Save all", 0, 0, 0},
-                                     {"Ignore", 0, 0, 0},
-                                     {0}};
+  static Fl_Menu_Item shellmenu[] = {{"Physical groups", 0, nullptr, nullptr},
+                                     {"Save all", 0, nullptr, nullptr},
+                                     {"Ignore", 0, nullptr, nullptr},
+                                     {nullptr}};
 
-  static Fl_Menu_Item solidmenu[] = {{"Physical groups", 0, 0, 0},
-                                     {"Save all", 0, 0, 0},
-                                     {"Ignore", 0, 0, 0},
-                                     {0}};
+  static Fl_Menu_Item solidmenu[] = {{"Physical groups", 0, nullptr, nullptr},
+                                     {"Save all", 0, nullptr, nullptr},
+                                     {"Ignore", 0, nullptr, nullptr},
+                                     {nullptr}};
 
   int BBB = BB + 16; // labels too long
 
@@ -1445,17 +1445,17 @@ int bdfFileDialog(const char *name)
     Fl_Check_Button *b;
     Fl_Button *ok, *cancel;
   };
-  static _bdfFileDialog *dialog = NULL;
+  static _bdfFileDialog *dialog = nullptr;
 
-  static Fl_Menu_Item formatmenu[] = {{"Free field", 0, 0, 0},
-                                      {"Small field", 0, 0, 0},
-                                      {"Long field", 0, 0, 0},
-                                      {0}};
+  static Fl_Menu_Item formatmenu[] = {{"Free field", 0, nullptr, nullptr},
+                                      {"Small field", 0, nullptr, nullptr},
+                                      {"Long field", 0, nullptr, nullptr},
+                                      {nullptr}};
 
-  static Fl_Menu_Item tagmenu[] = {{"Elementary entity", 0, 0, 0},
-                                   {"Physical entity", 0, 0, 0},
-                                   {"Partition", 0, 0, 0},
-                                   {0}};
+  static Fl_Menu_Item tagmenu[] = {{"Elementary entity", 0, nullptr, nullptr},
+                                   {"Physical entity", 0, nullptr, nullptr},
+                                   {"Partition", 0, nullptr, nullptr},
+                                   {nullptr}};
 
   int BBB = BB + 16; // labels too long
 
@@ -1525,18 +1525,18 @@ int stlFileDialog(const char *name)
     Fl_Check_Button *b;
     Fl_Button *ok, *cancel;
   };
-  static _stlFileDialog *dialog = NULL;
+  static _stlFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item formatmenu[] = {
-    {"ASCII", 0, 0, 0},
-    {"Binary", 0, 0, 0},
-    {0}
+    {"ASCII", 0, nullptr, nullptr},
+    {"Binary", 0, nullptr, nullptr},
+    {nullptr}
   };
   static Fl_Menu_Item solidmenu[] = {
-    {"Single", 0, 0, 0},
-    {"Per surface", 0, 0, 0},
-    {"Per physical surface", 0, 0, 0},
-    {0}
+    {"Single", 0, nullptr, nullptr},
+    {"Per surface", 0, nullptr, nullptr},
+    {"Per physical surface", 0, nullptr, nullptr},
+    {nullptr}
   };
 
   int BBB = BB + 9; // labels too long
@@ -1620,15 +1620,15 @@ int genericMeshFileDialog(const char *name, const char *title, int format,
     Fl_Check_Button *b;
     Fl_Button *ok, *cancel;
   };
-  static _genericMeshFileDialog *dialog = NULL;
+  static _genericMeshFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item formatmenu[] = {
-    {"ASCII", 0, 0, 0}, {"Binary", 0, 0, 0}, {0}};
+    {"ASCII", 0, nullptr, nullptr}, {"Binary", 0, nullptr, nullptr}, {nullptr}};
 
-  static Fl_Menu_Item tagmenu[] = {{"Elementary entity", 0, 0, 0},
-                                   {"Physical entity", 0, 0, 0},
-                                   {"Partition", 0, 0, 0},
-                                   {0}};
+  static Fl_Menu_Item tagmenu[] = {{"Elementary entity", 0, nullptr, nullptr},
+                                   {"Physical entity", 0, nullptr, nullptr},
+                                   {"Partition", 0, nullptr, nullptr},
+                                   {nullptr}};
 
   int BBB = BB + 16; // labels too long
 
@@ -1752,15 +1752,15 @@ int posFileDialog(const char *name)
     Fl_Choice *c[2];
     Fl_Button *ok, *cancel;
   };
-  static _posFileDialog *dialog = NULL;
+  static _posFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item viewmenu[] = {
-    {"Current", 0, 0, 0}, {"Visible", 0, 0, 0}, {"All", 0, 0, 0}, {0}};
-  static Fl_Menu_Item formatmenu[] = {{"Parsed", 0, 0, 0},
-                                      {"Mesh-based", 0, 0, 0},
-                                      {"Legacy ASCII", 0, 0, 0},
-                                      {"Legacy Binary", 0, 0, 0},
-                                      {0}};
+    {"Current", 0, nullptr, nullptr}, {"Visible", 0, nullptr, nullptr}, {"All", 0, nullptr, nullptr}, {nullptr}};
+  static Fl_Menu_Item formatmenu[] = {{"Parsed", 0, nullptr, nullptr},
+                                      {"Mesh-based", 0, nullptr, nullptr},
+                                      {"Legacy ASCII", 0, nullptr, nullptr},
+                                      {"Legacy Binary", 0, nullptr, nullptr},
+                                      {nullptr}};
 
   int BBB = BB + 9; // labels too long
 
@@ -1877,12 +1877,12 @@ int pvtuAdaptFileDialog(const char *name)
     Fl_Value_Input *vi[3];
     Fl_Check_Button *defautName;
   };
-  static _pvtuAdaptFileDialog *dialog = NULL;
+  static _pvtuAdaptFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item viewmenu[] = {
-    {"Current", 0, 0, 0}, {"Visible", 0, 0, 0}, {"All", 0, 0, 0}, {0}};
+    {"Current", 0, nullptr, nullptr}, {"Visible", 0, nullptr, nullptr}, {"All", 0, nullptr, nullptr}, {nullptr}};
   static Fl_Menu_Item formatmenu[] = {
-    {"Binary", 0, 0, 0}, {"ASCII", 0, 0, 0}, {0}};
+    {"Binary", 0, nullptr, nullptr}, {"ASCII", 0, nullptr, nullptr}, {nullptr}};
 
   int BBB = BB + 9; // labels too long
 
@@ -1988,10 +1988,10 @@ int x3dViewFileDialog(const char *name, const char *title, int format)
     Fl_Check_Button *e[2];
     Fl_Button *ok, *cancel;
   };
-  static _viewFileDialog *dialog = NULL;
+  static _viewFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item viewmenu[] = {
-    {"Current", 0, 0, 0}, {"Visible", 0, 0, 0}, {"All", 0, 0, 0}, {0}};
+    {"Current", 0, nullptr, nullptr}, {"Visible", 0, nullptr, nullptr}, {"All", 0, nullptr, nullptr}, {nullptr}};
 
   int BBB = BB + 9; // labels too long
 
@@ -2077,10 +2077,10 @@ int genericViewFileDialog(const char *name, const char *title, int format)
     Fl_Choice *c[1];
     Fl_Button *ok, *cancel;
   };
-  static _viewFileDialog *dialog = NULL;
+  static _viewFileDialog *dialog = nullptr;
 
   static Fl_Menu_Item viewmenu[] = {
-    {"Current", 0, 0, 0}, {"Visible", 0, 0, 0}, {"All", 0, 0, 0}, {0}};
+    {"Current", 0, nullptr, nullptr}, {"Visible", 0, nullptr, nullptr}, {"All", 0, nullptr, nullptr}, {nullptr}};
 
   int BBB = BB + 9; // labels too long
 
diff --git a/Fltk/fileDialogs.h b/Fltk/fileDialogs.h
index 7b496e7b456c4b386779e7bbfb3fff62efc15d93..899d60563269e022e9888ba2ea322249ed310528 100644
--- a/Fltk/fileDialogs.h
+++ b/Fltk/fileDialogs.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/gamepadWindow.cpp b/Fltk/gamepadWindow.cpp
index 8ddf236c57bae1c048d87ab88943f991b56a652b..e503b94954d964eb563413feb81b81201bf43d41 100644
--- a/Fltk/gamepadWindow.cpp
+++ b/Fltk/gamepadWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/gamepadWindow.h b/Fltk/gamepadWindow.h
index fd2ba834543a004c6b675f1f1ecdd052b938fac4..c8dfb543391d033e8fcc0ec909f74195df320dc9 100644
--- a/Fltk/gamepadWindow.h
+++ b/Fltk/gamepadWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp
index f7bd767d44d61d878e20e73817ef231eb02855ed..6c5566d3112c631b9779834dfbdfb076d2f43bbf 100644
--- a/Fltk/graphicWindow.cpp
+++ b/Fltk/graphicWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -77,12 +77,12 @@ static void file_new_cb(Fl_Widget *w, void *data)
     if(split[2] != ".geo"){
       if(fl_choice("File '%s' does not have the '.geo' extension.\n\n"
                    "Do you want to continue as-is?",
-                   "Continue as-is", "Use '.geo' extension", 0, name.c_str()))
+                   "Continue as-is", "Use '.geo' extension", nullptr, name.c_str()))
         name = split[0] + split[1] + ".geo";
     }
     if(!StatFile(name)){
       if(fl_choice("File '%s' already exists.\n\nDo you want to delete it?",
-                   "Cancel", "Delete", 0, name.c_str()))
+                   "Cancel", "Delete", nullptr, name.c_str()))
         UnlinkFile(name);
       else
         goto test;
@@ -93,7 +93,7 @@ static void file_new_cb(Fl_Widget *w, void *data)
       return;
     }
     int factory = fl_choice("Which geometry kernel do you want to use?",
-                            "Built-in", "OpenCASCADE", 0);
+                            "Built-in", "OpenCASCADE", nullptr);
     time_t now;
     time(&now);
     fprintf(fp, "// Gmsh project created on %s", ctime(&now));
@@ -168,9 +168,9 @@ static void file_open_merge_cb(Fl_Widget *w, void *data)
     if(n != (int)PView::list.size())
       FlGui::instance()->openModule("Post-processing");
     if(CTX::instance()->launchSolverAtStartup >= 0)
-      solver_cb(0, (void*)(intptr_t)CTX::instance()->launchSolverAtStartup);
+      solver_cb(nullptr, (void*)(intptr_t)CTX::instance()->launchSolverAtStartup);
     else if(onelabUtils::haveSolverToRun())
-      onelab_cb(0, (void*)"check");
+      onelab_cb(nullptr, (void*)"check");
     drawContext::global()->draw();
   }
 }
@@ -185,9 +185,9 @@ static void file_open_recent_cb(Fl_Widget *w, void *data)
   if(n != (int)PView::list.size())
     FlGui::instance()->openModule("Post-processing");
   if(CTX::instance()->launchSolverAtStartup >= 0)
-    solver_cb(0, (void*)(intptr_t)CTX::instance()->launchSolverAtStartup);
+    solver_cb(nullptr, (void*)(intptr_t)CTX::instance()->launchSolverAtStartup);
   else if(onelabUtils::haveSolverToRun())
-    onelab_cb(0, (void*)"check");
+    onelab_cb(nullptr, (void*)"check");
 }
 
 static void file_clear_cb(Fl_Widget *w, void *data)
@@ -198,7 +198,7 @@ static void file_clear_cb(Fl_Widget *w, void *data)
   }
   ClearProject();
   if(onelabUtils::haveSolverToRun())
-    onelab_cb(0, (void*)"reset"); // this will call OpenProject
+    onelab_cb(nullptr, (void*)"reset"); // this will call OpenProject
   else
     OpenProject(GModel::current()->getFileName());
   drawContext::global()->draw();
@@ -207,7 +207,7 @@ static void file_clear_cb(Fl_Widget *w, void *data)
 static void file_remote_cb(Fl_Widget *w, void *data)
 {
   onelab::localNetworkClient *c;
-  onelab::server::citer it = onelab::server::instance()->findClient("GmshRemote");
+  auto it = onelab::server::instance()->findClient("GmshRemote");
   if(it == onelab::server::instance()->lastClient()){
     c = new gmshLocalNetworkClient("GmshRemote", "");
     c->setSocketSwitch("-socket");
@@ -483,7 +483,7 @@ static void file_export_cb(Fl_Widget *w, void *data)
 #endif
   };
   int nbformats = sizeof(formats) / sizeof(formats[0]);
-  static char *pat = 0;
+  static char *pat = nullptr;
   if(!pat) {
     pat = new char[nbformats * 256];
     strcpy(pat, formats[0].pat);
@@ -504,7 +504,7 @@ static void file_export_cb(Fl_Widget *w, void *data)
     if(confirmOverwrite) {
       if(!StatFile(name))
         if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?",
-                      "Cancel", "Replace", 0, name.c_str()))
+                      "Cancel", "Replace", nullptr, name.c_str()))
           goto test;
     }
     int i = fileChooserGetFilter();
@@ -545,7 +545,7 @@ static void file_rename_cb(Fl_Widget *w, void *data)
     if(confirmOverwrite) {
       if(!StatFile(name))
         if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?",
-                      "Cancel", "Replace", 0, name.c_str()))
+                      "Cancel", "Replace", nullptr, name.c_str()))
           goto test;
     }
     rename(GModel::current()->getFileName().c_str(), name.c_str());
@@ -553,7 +553,7 @@ static void file_rename_cb(Fl_Widget *w, void *data)
     GModel::current()->setName(SplitFileName(name)[1]);
     Msg::SetOnelabChanged(3);
     if(onelabUtils::haveSolverToRun())
-      onelab_cb(0, (void*)"check");
+      onelab_cb(nullptr, (void*)"check");
     drawContext::global()->draw();
   }
 }
@@ -561,10 +561,10 @@ static void file_rename_cb(Fl_Widget *w, void *data)
 static void file_delete_cb(Fl_Widget *w, void *data)
 {
   if(fl_choice("Do you really want to delete file '%s'?",
-               "Cancel", "Delete", 0, GModel::current()->getFileName().c_str())){
+               "Cancel", "Delete", nullptr, GModel::current()->getFileName().c_str())){
     UnlinkFile(GModel::current()->getFileName());
     Msg::Info("Deleted `%s'", GModel::current()->getFileName().c_str());
-    file_clear_cb(0, 0);
+    file_clear_cb(nullptr, nullptr);
   }
 }
 
@@ -601,7 +601,7 @@ void file_watch_cb(Fl_Widget *w, void *data)
   std::string directory = SplitFileName(pattern)[0];
   if(directory.empty()) directory = "./";
 
-  dirent **files = 0;
+  dirent **files = nullptr;
   int num = fl_filename_list(directory.c_str(), &files, fl_numericsort);
   if(num <= 0) return;
   std::vector<std::string> matches;
@@ -661,14 +661,14 @@ void onelab_reload_cb(Fl_Widget *w, void *data)
   std::string fileName = GModel::current()->getFileName();
   ClearProject();
   GModel::current()->setFileName(fileName);
-  onelab_cb(0, (void*)"reset"); // will call OpenProject
+  onelab_cb(nullptr, (void*)"reset"); // will call OpenProject
   drawContext::global()->draw();
 }
 
 void geometry_reload_cb(Fl_Widget *w, void *data)
 {
   if(onelabUtils::haveSolverToRun()){
-    onelab_cb(0, (void*)"check_always");
+    onelab_cb(nullptr, (void*)"check_always");
   }
   else
     OpenProject(GModel::current()->getFileName());
@@ -821,7 +821,7 @@ static void add_new_point_based_entity(const std::string &what, int pane)
   }
 
   FlGui::instance()->elementaryContext->hide();
-  drawContext::setDrawGeomTransientFunction(0);
+  drawContext::setDrawGeomTransientFunction(nullptr);
 
   // at the end, not during creation to avoid having things jumping around
   SetBoundingBox();
@@ -1526,7 +1526,7 @@ static void action_point_line_surface_volume(int action, const std::string &onwh
             if(!FlGui::available()) return;
 
             // ask clients to update using the new physical definition
-            onelab_cb(0, (void*)"check");
+            onelab_cb(nullptr, (void*)"check");
 
             // if onelab context parameters are defined for the physical group,
             // show the parameter definition window and abort the physical group
@@ -1898,7 +1898,7 @@ static void geometry_elementary_split_cb(Fl_Widget *w, void *data)
   drawContext::global()->draw();
   Msg::StatusGl("Select curve to split\n"
                 "[Press 'q' to abort]");
-  GEdge* edge_to_split = 0;
+  GEdge* edge_to_split = nullptr;
   while(1){
     if(!FlGui::available()) return;
 
@@ -1981,7 +1981,7 @@ void mesh_save_cb(Fl_Widget *w, void *data)
   if(CTX::instance()->confirmOverwrite) {
     if(!StatFile(name))
       if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?",
-                    "Cancel", "Replace", 0, name.c_str()))
+                    "Cancel", "Replace", nullptr, name.c_str()))
         return;
   }
   CreateOutputFile(name, CTX::instance()->mesh.fileFormat);
@@ -2601,51 +2601,51 @@ static void mesh_define_compound_entity_cb(Fl_Widget *w, void *data)
 // The static menus (we cannot use the 'g', 'm' 's' and 'p' mnemonics since they
 // are already defined as global shortcuts)
 static Fl_Menu_Item bar_table[] = {
-  {"&File", 0, 0, 0, FL_SUBMENU},
-    {"&New...",     FL_CTRL+'n', (Fl_Callback *)file_new_cb, 0},
+  {"&File", 0, nullptr, nullptr, FL_SUBMENU},
+    {"&New...",     FL_CTRL+'n', (Fl_Callback *)file_new_cb, nullptr},
     {"&Open...",    FL_CTRL+'o', (Fl_Callback *)file_open_merge_cb, (void*)"open"},
-    {"Open Recent", 0, 0, 0, FL_SUBMENU},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", FL_CTRL+FL_SHIFT+'r', (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {0},
+    {"Open Recent", 0, nullptr, nullptr, FL_SUBMENU},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", FL_CTRL+FL_SHIFT+'r', (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {nullptr},
     {"M&erge...",   FL_CTRL+FL_SHIFT+'o', (Fl_Callback *)file_open_merge_cb, (void*)"merge"},
-    {"Watch Pattern...",    0, (Fl_Callback *)file_watch_cb, 0, FL_MENU_DIVIDER},
-    {"&Clear",      0, (Fl_Callback *)file_clear_cb, 0},
-    {"&Rename...",  FL_CTRL+'r', (Fl_Callback *)file_rename_cb, 0},
-    {"Delete",      0, (Fl_Callback *)file_delete_cb, 0, FL_MENU_DIVIDER},
-    {"Remote", 0, 0, 0, FL_MENU_DIVIDER | FL_SUBMENU},
+    {"Watch Pattern...",    0, (Fl_Callback *)file_watch_cb, nullptr, FL_MENU_DIVIDER},
+    {"&Clear",      0, (Fl_Callback *)file_clear_cb, nullptr},
+    {"&Rename...",  FL_CTRL+'r', (Fl_Callback *)file_rename_cb, nullptr},
+    {"Delete",      0, (Fl_Callback *)file_delete_cb, nullptr, FL_MENU_DIVIDER},
+    {"Remote", 0, nullptr, nullptr, FL_MENU_DIVIDER | FL_SUBMENU},
       {"Start...",  0, (Fl_Callback *)file_remote_cb, (void*)"start"},
       {"Merge...",  0, (Fl_Callback *)file_remote_cb, (void*)"merge"},
       {"Clear",     0, (Fl_Callback *)file_remote_cb, (void*)"clear"},
       {"Stop",      0, (Fl_Callback *)file_remote_cb, (void*)"stop"},
-      {0},
-    {"Sa&ve Mesh",  FL_CTRL+FL_SHIFT+'s', (Fl_Callback *)mesh_save_cb, 0},
+      {nullptr},
+    {"Sa&ve Mesh",  FL_CTRL+FL_SHIFT+'s', (Fl_Callback *)mesh_save_cb, nullptr},
     {"Save Model Options", FL_CTRL+'j', (Fl_Callback *)file_options_save_cb, (void*)"file"},
     {"Save Options As Default", FL_CTRL+FL_SHIFT+'j', (Fl_Callback *)file_options_save_cb, (void*)"default", FL_MENU_DIVIDER},
-    {"&Export...",  FL_CTRL+'e', (Fl_Callback *)file_export_cb, 0, FL_MENU_DIVIDER},
-    {"&Quit",       FL_CTRL+'q', (Fl_Callback *)file_quit_cb, 0},
-    {0},
-  {"&Tools", 0, 0, 0, FL_SUBMENU},
-    {"&Options",         FL_CTRL+FL_SHIFT+'n', (Fl_Callback *)options_cb, 0},
+    {"&Export...",  FL_CTRL+'e', (Fl_Callback *)file_export_cb, nullptr, FL_MENU_DIVIDER},
+    {"&Quit",       FL_CTRL+'q', (Fl_Callback *)file_quit_cb, nullptr},
+    {nullptr},
+  {"&Tools", 0, nullptr, nullptr, FL_SUBMENU},
+    {"&Options",         FL_CTRL+FL_SHIFT+'n', (Fl_Callback *)options_cb, nullptr},
     {"Pl&ugins",         FL_CTRL+FL_SHIFT+'u', (Fl_Callback *)plugin_cb, (void*)(-1)},
-    {"&Visibility",      FL_CTRL+FL_SHIFT+'v', (Fl_Callback *)visibility_cb, 0},
-    {"&Clipping",        FL_CTRL+FL_SHIFT+'c', (Fl_Callback *)clip_cb, 0},
-    {"&Manipulator",     FL_CTRL+FL_SHIFT+'m', (Fl_Callback *)manip_cb, 0, FL_MENU_DIVIDER},
+    {"&Visibility",      FL_CTRL+FL_SHIFT+'v', (Fl_Callback *)visibility_cb, nullptr},
+    {"&Clipping",        FL_CTRL+FL_SHIFT+'c', (Fl_Callback *)clip_cb, nullptr},
+    {"&Manipulator",     FL_CTRL+FL_SHIFT+'m', (Fl_Callback *)manip_cb, nullptr, FL_MENU_DIVIDER},
 #if defined(HAVE_3M)
     {"&3M",              0, (Fl_Callback *)window3M_cb, 0, FL_MENU_DIVIDER},
 #endif
-    {"S&tatistics",      FL_CTRL+'i', (Fl_Callback *)statistics_cb, 0},
-    {"M&essage Console", FL_CTRL+'l', (Fl_Callback *)show_hide_message_cb, 0},
-    {0},
-  {"&Window", 0, 0, 0, FL_SUBMENU},
+    {"S&tatistics",      FL_CTRL+'i', (Fl_Callback *)statistics_cb, nullptr},
+    {"M&essage Console", FL_CTRL+'l', (Fl_Callback *)show_hide_message_cb, nullptr},
+    {nullptr},
+  {"&Window", 0, nullptr, nullptr, FL_SUBMENU},
     {"New Window", 0, (Fl_Callback *)file_window_cb, (void*)"new", FL_MENU_DIVIDER},
 #if defined(WIN32)
     {"Copy to Clipboard",  FL_CTRL+'c', (Fl_Callback *)file_window_cb, (void*)"copy", FL_MENU_DIVIDER},
@@ -2656,17 +2656,17 @@ static Fl_Menu_Item bar_table[] = {
     {"Minimize",           FL_CTRL+'m', (Fl_Callback *)window_cb, (void*)"minimize"},
     {"Zoom",               0, (Fl_Callback *)window_cb, (void*)"zoom"},
     {"Enter Full Screen",  FL_CTRL+'f', (Fl_Callback *)window_cb, (void*)"fullscreen", FL_MENU_DIVIDER},
-    {"Attach/Detach Menu", FL_CTRL+'d', (Fl_Callback *)attach_detach_menu_cb, 0, FL_MENU_DIVIDER},
+    {"Attach/Detach Menu", FL_CTRL+'d', (Fl_Callback *)attach_detach_menu_cb, nullptr, FL_MENU_DIVIDER},
     {"Bring All to Front", 0, (Fl_Callback *)window_cb, (void*)"front"},
-    {0},
-  {"&Help", 0, 0, 0, FL_SUBMENU},
-    {"On&line Documentation", 0, (Fl_Callback *)help_online_cb, 0, FL_MENU_DIVIDER},
-    {"&Keyboard and Mouse Usage",  FL_CTRL+'h', (Fl_Callback *)help_basic_cb, 0, FL_MENU_DIVIDER},
+    {nullptr},
+  {"&Help", 0, nullptr, nullptr, FL_SUBMENU},
+    {"On&line Documentation", 0, (Fl_Callback *)help_online_cb, nullptr, FL_MENU_DIVIDER},
+    {"&Keyboard and Mouse Usage",  FL_CTRL+'h', (Fl_Callback *)help_basic_cb, nullptr, FL_MENU_DIVIDER},
     {"&Current Options and Workspace", FL_CTRL+FL_SHIFT+'h', (Fl_Callback *)status_options_cb, (void*)"?", 0},
-    {"&Restore all Options to Default Settings", 0, (Fl_Callback *)options_restore_defaults_cb, 0, FL_MENU_DIVIDER},
-    {"&About Gmsh",           0, (Fl_Callback *)help_about_cb, 0},
-    {0},
-  {0}
+    {"&Restore all Options to Default Settings", 0, (Fl_Callback *)options_restore_defaults_cb, nullptr, FL_MENU_DIVIDER},
+    {"&About Gmsh",           0, (Fl_Callback *)help_about_cb, nullptr},
+    {nullptr},
+  {nullptr}
 };
 
 #if defined(__APPLE__)
@@ -2675,50 +2675,50 @@ static Fl_Menu_Item bar_table[] = {
 // would cause spurious menu items to appear on the menu window; removed
 // File->Quit)
 static Fl_Menu_Item sysbar_table[] = {
-  {"File", 0, 0, 0, FL_SUBMENU},
-    {"New...",     FL_META+'n', (Fl_Callback *)file_new_cb, 0},
+  {"File", 0, nullptr, nullptr, FL_SUBMENU},
+    {"New...",     FL_META+'n', (Fl_Callback *)file_new_cb, nullptr},
     {"Open...",    FL_META+'o', (Fl_Callback *)file_open_merge_cb, (void*)"open"},
-    {"Open Recent", 0, 0, 0, FL_SUBMENU},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", FL_META+FL_SHIFT+'r', (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {"", 0, (Fl_Callback *)file_open_recent_cb, 0},
-      {0},
+    {"Open Recent", 0, nullptr, nullptr, FL_SUBMENU},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", FL_META+FL_SHIFT+'r', (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {"", 0, (Fl_Callback *)file_open_recent_cb, nullptr},
+      {nullptr},
     {"Merge...",   FL_META+FL_SHIFT+'o', (Fl_Callback *)file_open_merge_cb, (void*)"merge"},
-    {"Watch Pattern...",   0, (Fl_Callback *)file_watch_cb, 0, FL_MENU_DIVIDER},
-    {"Clear",      0, (Fl_Callback *)file_clear_cb, 0},
-    {"Rename...",  FL_META+'r', (Fl_Callback *)file_rename_cb, 0},
-    {"Delete",     0, (Fl_Callback *)file_delete_cb, 0, FL_MENU_DIVIDER},
-    {"Remote", 0, 0, 0, FL_MENU_DIVIDER | FL_SUBMENU},
+    {"Watch Pattern...",   0, (Fl_Callback *)file_watch_cb, nullptr, FL_MENU_DIVIDER},
+    {"Clear",      0, (Fl_Callback *)file_clear_cb, nullptr},
+    {"Rename...",  FL_META+'r', (Fl_Callback *)file_rename_cb, nullptr},
+    {"Delete",     0, (Fl_Callback *)file_delete_cb, nullptr, FL_MENU_DIVIDER},
+    {"Remote", 0, nullptr, nullptr, FL_MENU_DIVIDER | FL_SUBMENU},
       {"Start...",  0, (Fl_Callback *)file_remote_cb, (void*)"start"},
       {"Merge...",  0, (Fl_Callback *)file_remote_cb, (void*)"merge"},
       {"Clear",     0, (Fl_Callback *)file_remote_cb, (void*)"clear"},
       {"Stop",      0, (Fl_Callback *)file_remote_cb, (void*)"stop"},
-      {0},
-    {"Save Mesh",  FL_META+'s', (Fl_Callback *)mesh_save_cb, 0},
+      {nullptr},
+    {"Save Mesh",  FL_META+'s', (Fl_Callback *)mesh_save_cb, nullptr},
     {"Save Model Options", FL_META+'j', (Fl_Callback *)file_options_save_cb, (void*)"file"},
     {"Save Options As Default", FL_META+FL_SHIFT+'j', (Fl_Callback *)file_options_save_cb, (void*)"default", FL_MENU_DIVIDER},
-    {"Export...",  FL_META+'e', (Fl_Callback *)file_export_cb, 0},
-    {0},
-  {"Tools", 0, 0, 0, FL_SUBMENU},
-    {"Options",         FL_META+FL_SHIFT+'n', (Fl_Callback *)options_cb, 0},
+    {"Export...",  FL_META+'e', (Fl_Callback *)file_export_cb, nullptr},
+    {nullptr},
+  {"Tools", 0, nullptr, nullptr, FL_SUBMENU},
+    {"Options",         FL_META+FL_SHIFT+'n', (Fl_Callback *)options_cb, nullptr},
     {"Plugins",         FL_META+FL_SHIFT+'u', (Fl_Callback *)plugin_cb, (void*)(-1)},
-    {"Visibility",      FL_META+FL_SHIFT+'v', (Fl_Callback *)visibility_cb, 0},
-    {"Clipping",        FL_META+FL_SHIFT+'c', (Fl_Callback *)clip_cb, 0},
-    {"Manipulator",     FL_META+FL_SHIFT+'m', (Fl_Callback *)manip_cb, 0, FL_MENU_DIVIDER},
+    {"Visibility",      FL_META+FL_SHIFT+'v', (Fl_Callback *)visibility_cb, nullptr},
+    {"Clipping",        FL_META+FL_SHIFT+'c', (Fl_Callback *)clip_cb, nullptr},
+    {"Manipulator",     FL_META+FL_SHIFT+'m', (Fl_Callback *)manip_cb, nullptr, FL_MENU_DIVIDER},
 #if defined(HAVE_3M)
     {"3M",              0, (Fl_Callback *)window3M_cb, 0, FL_MENU_DIVIDER},
 #endif
-    {"Statistics",      FL_META+'i', (Fl_Callback *)statistics_cb, 0},
-    {"Message Console", FL_META+'l', (Fl_Callback *)show_hide_message_cb, 0},
-    {0},
-  {"Window", 0, 0, 0, FL_SUBMENU},
+    {"Statistics",      FL_META+'i', (Fl_Callback *)statistics_cb, nullptr},
+    {"Message Console", FL_META+'l', (Fl_Callback *)show_hide_message_cb, nullptr},
+    {nullptr},
+  {"Window", 0, nullptr, nullptr, FL_SUBMENU},
     {"New Window", 0, (Fl_Callback *)file_window_cb, (void*)"new", FL_MENU_DIVIDER},
     {"Split Horizontally", 0, (Fl_Callback *)file_window_cb, (void*)"split_h"},
     {"Split Vertically",   0, (Fl_Callback *)file_window_cb, (void*)"split_v"},
@@ -2726,16 +2726,16 @@ static Fl_Menu_Item sysbar_table[] = {
     {"Minimize",           FL_META+'m', (Fl_Callback *)window_cb, (void*)"minimize"},
     {"Zoom",               0, (Fl_Callback *)window_cb, (void*)"zoom"},
     {"Enter Full Screen",  FL_META+'f', (Fl_Callback *)window_cb, (void*)"fullscreen", FL_MENU_DIVIDER},
-    {"Attach/Detach Menu", FL_META+'d', (Fl_Callback *)attach_detach_menu_cb, 0, FL_MENU_DIVIDER},
+    {"Attach/Detach Menu", FL_META+'d', (Fl_Callback *)attach_detach_menu_cb, nullptr, FL_MENU_DIVIDER},
     {"Bring All to Front", 0, (Fl_Callback *)window_cb, (void*)"front"},
-    {0},
-  {"Help", 0, 0, 0, FL_SUBMENU},
-    {"Online Documentation", 0, (Fl_Callback *)help_online_cb, 0, FL_MENU_DIVIDER},
-    {"Keyboard and Mouse Usage", 0, (Fl_Callback *)help_basic_cb, 0, FL_MENU_DIVIDER},
+    {nullptr},
+  {"Help", 0, nullptr, nullptr, FL_SUBMENU},
+    {"Online Documentation", 0, (Fl_Callback *)help_online_cb, nullptr, FL_MENU_DIVIDER},
+    {"Keyboard and Mouse Usage", 0, (Fl_Callback *)help_basic_cb, nullptr, FL_MENU_DIVIDER},
     {"Current Options and Workspace", FL_META+FL_SHIFT+'h', (Fl_Callback *)status_options_cb, (void*)"?"},
-    {"Restore all Options to Default Settings", 0, (Fl_Callback *)options_restore_defaults_cb, 0},
-    {0},
-  {0}
+    {"Restore all Options to Default Settings", 0, (Fl_Callback *)options_restore_defaults_cb, nullptr},
+    {nullptr},
+  {nullptr}
 };
 
 #endif
@@ -2871,41 +2871,41 @@ void quick_access_cb(Fl_Widget *w, void *data)
   if(!data) return;
   std::string what((const char*)data);
   if(what == "general")
-    general_options_cb(0, 0);
+    general_options_cb(nullptr, nullptr);
   else if(what == "geometry")
-    geometry_options_cb(0, 0);
+    geometry_options_cb(nullptr, nullptr);
   else if(what == "mesh")
-    mesh_options_cb(0, 0);
+    mesh_options_cb(nullptr, nullptr);
   else if(what == "view")
-    view_options_cb(0, (void *)-1);
+    view_options_cb(nullptr, (void *)-1);
   else if(what == "reset_viewport"){
-    status_xyz1p_cb(0, (void *)"1:1");
-    status_xyz1p_cb(0, (void *)"z");
+    status_xyz1p_cb(nullptr, (void *)"1:1");
+    status_xyz1p_cb(nullptr, (void *)"z");
   }
   else if(what == "select_center"){
     opt_general_rotation_center_cg(0, GMSH_SET | GMSH_GUI, 0);
-    general_options_ok_cb(0, (void *)"rotation_center");
-    general_options_rotation_center_select_cb(0, 0);
+    general_options_ok_cb(nullptr, (void *)"rotation_center");
+    general_options_rotation_center_select_cb(nullptr, nullptr);
   }
   else if(what == "hover_meshes"){
     opt_general_mouse_hover_meshes(0, GMSH_SET|GMSH_GUI,
                                    !opt_general_mouse_hover_meshes(0, GMSH_GET, 0));
   }
   else if(what == "split_hor"){
-    file_window_cb(0, (void*)"split_h");
+    file_window_cb(nullptr, (void*)"split_h");
   }
   else if(what == "split_ver"){
-    file_window_cb(0, (void*)"split_v");
+    file_window_cb(nullptr, (void*)"split_v");
   }
   else if(what == "unsplit"){
-    file_window_cb(0, (void*)"split_u");
+    file_window_cb(nullptr, (void*)"split_u");
   }
   else if(what == "axes"){
     int old = opt_general_axes(0, GMSH_GET, 0);
     opt_general_axes(0, GMSH_SET|GMSH_GUI, old ? 0 : 3);
     if(!old){
       opt_general_axes_auto_position(0, GMSH_SET|GMSH_GUI, 0);
-      general_options_axes_fit_cb(0, 0);
+      general_options_axes_fit_cb(nullptr, nullptr);
     }
   }
   else if(what == "orthographic")
@@ -3150,16 +3150,16 @@ void status_options_cb(Fl_Widget *w, void *data)
       menu.push_back(menuItem);
       tofree.push_back(str);
     }
-    Fl_Menu_Item it = {0};
+    Fl_Menu_Item it = {nullptr};
     menu.push_back(it);
     Fl_Menu_Item *m = (Fl_Menu_Item*)(&menu[0])->popup(Fl::event_x(), Fl::event_y(),
-                                                       0, &menu[selected], 0);
-    if(m) m->do_callback(0);
+                                                       nullptr, &menu[selected], nullptr);
+    if(m) m->do_callback(nullptr);
     for(std::size_t i = 0; i < tofree.size(); i++) free(tofree[i]);
     drawContext::global()->draw();
   }
   else if(what == "?"){ // display options
-    help_options_cb(0, 0);
+    help_options_cb(nullptr, nullptr);
     FlGui::instance()->help->options->show();
   }
   else if(what == "p"){ // toggle projection mode
@@ -3171,22 +3171,22 @@ void status_options_cb(Fl_Widget *w, void *data)
     static Fl_Menu_Item menu[] = {
       { "Reset viewport", 0, quick_access_cb, (void*)"reset_viewport" },
       { "Select rotation center", 0, quick_access_cb, (void*)"select_center" },
-      { "Split window", 0, 0, 0, FL_SUBMENU | FL_MENU_DIVIDER },
+      { "Split window", 0, nullptr, nullptr, FL_SUBMENU | FL_MENU_DIVIDER },
          { "Horizontally", 0, quick_access_cb, (void*)"split_hor"},
          { "Vertically", 0, quick_access_cb, (void*)"split_ver"},
          { "Unsplit", 0, quick_access_cb, (void*)"unsplit"},
-         { 0 },
+         { nullptr },
       { "Axes", FL_ALT + 'a', quick_access_cb, (void*)"axes",
         FL_MENU_TOGGLE },
       { "Mouse hover over meshes", 0, quick_access_cb, (void*)"hover_meshes",
         FL_MENU_TOGGLE },
-      { "Projection mode", 0, 0, 0, FL_SUBMENU },
+      { "Projection mode", 0, nullptr, nullptr, FL_SUBMENU },
          { "Orthographic", FL_ALT + 'o', quick_access_cb, (void*)"orthographic"},
          { "Perspective", 0, quick_access_cb, (void*)"perspective"},
-         { 0 },
+         { nullptr },
       { "All general options...", 0, quick_access_cb, (void*)"general",
         FL_MENU_DIVIDER, 0, FL_ITALIC },
-      { "Geometry visibility", 0, 0, 0, FL_SUBMENU },
+      { "Geometry visibility", 0, nullptr, nullptr, FL_SUBMENU },
          { "Points", FL_ALT + 'p', quick_access_cb, (void*)"geometry_points",
            FL_MENU_TOGGLE },
          { "Curves", FL_ALT + 'l', quick_access_cb, (void*)"geometry_curves",
@@ -3195,10 +3195,10 @@ void status_options_cb(Fl_Widget *w, void *data)
            FL_MENU_TOGGLE },
          { "Volumes", FL_ALT + 'v', quick_access_cb, (void*)"geometry_volumes",
            FL_MENU_TOGGLE },
-         { 0 },
+         { nullptr },
       { "All geometry options...", 0, quick_access_cb, (void*)"geometry",
         FL_MENU_DIVIDER, 0, FL_ITALIC },
-      { "Mesh visibility", 0, 0, 0, FL_SUBMENU },
+      { "Mesh visibility", 0, nullptr, nullptr, FL_SUBMENU },
          { "Nodes", FL_ALT + FL_SHIFT + 'p', quick_access_cb, (void*)"mesh_points",
            FL_MENU_TOGGLE },
          { "1D elements", FL_ALT + FL_SHIFT + 'l', quick_access_cb, (void*)"mesh_lines",
@@ -3211,7 +3211,7 @@ void status_options_cb(Fl_Widget *w, void *data)
            (void*)"mesh_volumes_edges", FL_MENU_TOGGLE },
          { "3D element faces", FL_ALT + FL_SHIFT + 'b', quick_access_cb,
            (void*)"mesh_volumes_faces", FL_MENU_TOGGLE },
-         { 0 },
+         { nullptr },
       { "Toggle mesh display", FL_ALT + 'm', quick_access_cb, (void*)"mesh_toggle" },
       { "Global mesh size factor", 0, quick_access_cb, (void*)"mesh_size" },
       { "All mesh options...", 0, quick_access_cb, (void*)"mesh",
@@ -3219,27 +3219,27 @@ void status_options_cb(Fl_Widget *w, void *data)
       { "View element outlines ", FL_ALT + 'e', quick_access_cb,
         (void*)"view_element_outlines", FL_MENU_TOGGLE },
       { "View normal raise", 0, quick_access_cb, (void*)"view_normal_raise" },
-      { "View intervals", 0, 0, 0, FL_SUBMENU },
+      { "View intervals", 0, nullptr, nullptr, FL_SUBMENU },
          { "Iso-values", FL_ALT + 't', quick_access_cb, (void*)"view_iso"},
          { "Continuous map", 0, quick_access_cb, (void*)"view_continous"},
          { "Filled iso-values", 0, quick_access_cb, (void*)"view_filled"},
          { "Numeric values", 0, quick_access_cb, (void*)"view_numeric"},
-         { 0 },
-      { "View range", 0, 0, 0, FL_SUBMENU },
+         { nullptr },
+      { "View range", 0, nullptr, nullptr, FL_SUBMENU },
          { "Default", 0, quick_access_cb, (void*)"view_range_default"},
          { "Per time step", 0, quick_access_cb, (void*)"view_range_per_step"},
-         { 0 },
-      { "View vector display", 0, 0, 0, FL_SUBMENU },
+         { nullptr },
+      { "View vector display", 0, nullptr, nullptr, FL_SUBMENU },
          { "Line", 0, quick_access_cb, (void*)"view_line"},
          { "3D arrow", 0, quick_access_cb, (void*)"view_3d_arrow"},
          { "Displacement", 0, quick_access_cb, (void*)"view_displacement"},
-         { 0 },
-      { "View glyph location", 0, 0, 0, FL_SUBMENU },
+         { nullptr },
+      { "View glyph location", 0, nullptr, nullptr, FL_SUBMENU },
          { "Barycenter", 0, quick_access_cb, (void*)"view_glyph_barycenter"},
          { "Node", 0, quick_access_cb, (void*)"view_glyph_node"},
-         { 0 },
+         { nullptr },
       { "All view options...", 0, quick_access_cb, (void*)"view", 0, 0, FL_ITALIC },
-      { 0 }
+      { nullptr }
     };
     const int gen = 7, geo = 14, msh = 21, pos = 32, end = 54;
     if(opt_general_axes(0, GMSH_GET, 0)) menu[gen + 0].set();
@@ -3290,10 +3290,10 @@ void status_options_cb(Fl_Widget *w, void *data)
     }
     // popup the menu
     static Fl_Menu_Item *picked = &menu[msh + 8]; // toggle mesh display - the default
-    picked = (Fl_Menu_Item*)menu->popup(Fl::event_x(), Fl::event_y(), 0,
+    picked = (Fl_Menu_Item*)menu->popup(Fl::event_x(), Fl::event_y(), nullptr,
                                         (picked && picked->visible()) ? picked :
-                                        &menu[msh + 8], 0);
-    if(picked && picked->callback()) picked->do_callback(0, picked->user_data());
+                                        &menu[msh + 8], nullptr);
+    if(picked && picked->callback()) picked->do_callback(nullptr, picked->user_data());
     drawContext::global()->draw();
   }
   else if(what == "S"){ // mouse selection
@@ -3322,7 +3322,7 @@ void status_play_manual(int time, int incr, bool redraw)
   busy = true;
 
   // if we watch some files this is a good time to check for new data
-  file_watch_cb(0, 0);
+  file_watch_cb(nullptr, nullptr);
 
   if(time) {
     for(std::size_t i = 0; i < PView::list.size(); i++){
@@ -3419,7 +3419,7 @@ static void status_stepforward_cb(Fl_Widget *w, void *data)
 static void remove_graphic_window_cb(Fl_Widget *w, void *data)
 {
   std::vector<graphicWindow*> graph2;
-  graphicWindow *deleteMe = 0;
+  graphicWindow *deleteMe = nullptr;
   for(std::size_t i = 0; i < FlGui::instance()->graph.size(); i++){
     if(FlGui::instance()->graph[i]->getWindow() == w)
       deleteMe = FlGui::instance()->graph[i];
@@ -3427,7 +3427,7 @@ static void remove_graphic_window_cb(Fl_Widget *w, void *data)
       graph2.push_back(FlGui::instance()->graph[i]);
   }
   if(deleteMe){
-    openglWindow::setLastHandled(0);
+    openglWindow::setLastHandled(nullptr);
     FlGui::instance()->graph = graph2;
     delete deleteMe;
   }
@@ -3505,14 +3505,14 @@ class dummyBox : public Fl_Box {
  private:
   int handle(int){ return 0; } // always!
  public:
-  dummyBox(int x, int y, int w, int h, const char *l=0) : Fl_Box(x, y, w, h, l) {}
+  dummyBox(int x, int y, int w, int h, const char *l=nullptr) : Fl_Box(x, y, w, h, l) {}
 };
 
 // The main graphic window has a special resize behaviour forcing the message
 // tile to always keep its height
 class mainWindowSpecialResize : public mainWindow {
  public:
-  mainWindowSpecialResize(int w, int h, bool nonModal, const char *l=0)
+  mainWindowSpecialResize(int w, int h, bool nonModal, const char *l=nullptr)
     : mainWindow(w, h, nonModal, l) {}
   virtual void resize(int X,int Y,int W,int H)
   {
@@ -3530,7 +3530,7 @@ class mainWindowSpecialResize : public mainWindow {
 
 class mainWindowProgress : public Fl_Progress{
 public:
-  mainWindowProgress(int x, int y, int w, int h, const char *l=0) :
+  mainWindowProgress(int x, int y, int w, int h, const char *l=nullptr) :
     Fl_Progress(x, y, w, h, l){}
   int handle(int event)
   {
@@ -3587,9 +3587,9 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu)
   }
 
 #if defined(__APPLE__)
-  _sysbar = 0;
+  _sysbar = nullptr;
 #endif
-  _bar = 0;
+  _bar = nullptr;
   if(main){
 #if defined(__APPLE__)
     if(CTX::instance()->systemMenuBar){
@@ -3671,7 +3671,7 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu)
     _browser->clear_callback(message_menu_clear_cb, this);
   }
   else{
-    _browser = 0;
+    _browser = nullptr;
   }
 
   if(main && !detachedMenu){
@@ -3679,7 +3679,7 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu)
     _onelab->enableTreeWidgetResize(false);
   }
   else{
-    _onelab = 0;
+    _onelab = nullptr;
   }
 
   _tile->callback(tile_cb);
@@ -3791,13 +3791,13 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu)
     _menuwin->end();
   }
   else{
-    _menuwin = 0;
+    _menuwin = nullptr;
   }
 }
 
 graphicWindow::~graphicWindow()
 {
-  openglWindow::setLastHandled(0);
+  openglWindow::setLastHandled(nullptr);
   _tile->clear();
   _win->clear();
   Fl::delete_widget(_win);
@@ -3854,7 +3854,7 @@ void graphicWindow::attachMenu()
   _menuwin->remove(_onelab);
   _menuwin->hide();
   delete _menuwin;
-  _menuwin = 0;
+  _menuwin = nullptr;
   if(_browser->h() == 0) setMessageHeight(1);
   int w = _onelab->w();
   if(_browser->w() - w < 0) w = _browser->w() / 2;
@@ -3939,7 +3939,7 @@ bool graphicWindow::split(openglWindow *g, char how, double ratio)
     // after many tries I cannot figure out how to do this cleanly, so let's be
     // brutal :-)
     int mode = g->mode();
-    openglWindow::setLastHandled(0);
+    openglWindow::setLastHandled(nullptr);
     for(std::size_t i = 0; i < gl.size(); i++){
       _tile->remove(gl[i]);
       delete gl[i];
@@ -3990,7 +3990,7 @@ bool graphicWindow::split(openglWindow *g, char how, double ratio)
 
 void graphicWindow::setStereo(bool st)
 {
-  openglWindow::setLastHandled(0);
+  openglWindow::setLastHandled(nullptr);
   for(std::size_t i = 0; i < gl.size(); i++){
     if (st) {
       gl[i]->mode(FL_RGB | FL_DEPTH | FL_DOUBLE | FL_STEREO);
diff --git a/Fltk/graphicWindow.h b/Fltk/graphicWindow.h
index fa80018150463354c174c342b695f5f2bef0ef3f..b27826adb40cba1fb814285971393d0ad16e2fa0 100644
--- a/Fltk/graphicWindow.h
+++ b/Fltk/graphicWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/helpWindow.cpp b/Fltk/helpWindow.cpp
index fb988e9643546163c3e8e49e70a19b2209f23127..840cea213ccafb9558c644a0cff4dbef2829b1a3 100644
--- a/Fltk/helpWindow.cpp
+++ b/Fltk/helpWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -42,7 +42,7 @@
 static const char *help_link(Fl_Widget *w, const char *uri)
 {
   fl_open_uri(uri);
-  return 0;
+  return nullptr;
 }
 
 struct opt_data {
@@ -81,8 +81,8 @@ double numberOrStringOptionChooser(const std::string &category, int index,
   Fl_Window *win = new paletteWindow(width, height, false, t.c_str());
   win->set_modal();
   win->hotspot(win);
-  inputValueFloat *number = 0;
-  Fl_Input *string = 0;
+  inputValueFloat *number = nullptr;
+  Fl_Input *string = nullptr;
   if(isNumber) {
     number = new inputValueFloat(WB, WB, width - 2 * WB, BH);
     number->value(valn);
@@ -106,7 +106,7 @@ double numberOrStringOptionChooser(const std::string &category, int index,
     new Fl_Return_Button(width - nn * BB - nn * WB, 2 * WB + BH, BB, BH, "OK");
   Fl_Button *def = new Fl_Button(width - (nn - 1) * BB - (nn - 1) * WB,
                                  2 * WB + BH, BB, BH, "Default");
-  Fl_Button *cancel = 0;
+  Fl_Button *cancel = nullptr;
   if(!isInteractive)
     cancel = new Fl_Button(width - BB - WB, 2 * WB + BH, BB, BH, "Cancel");
   win->end();
@@ -226,7 +226,7 @@ static void browser_cb(Fl_Widget *w, void *data)
           if(c1.size() && c2.size()) {
             editOption(type, c1, c2);
             int top = FlGui::instance()->help->browser->topline();
-            help_options_cb(0, 0);
+            help_options_cb(nullptr, nullptr);
             FlGui::instance()->help->browser->topline(top);
             FlGui::instance()->help->browser->select(i);
             drawContext::global()->draw();
@@ -262,7 +262,7 @@ void help_options_cb(Fl_Widget *w, void *data)
   std::string search = FlGui::instance()->help->search->value();
   std::transform(search.begin(), search.end(), search.begin(), ::tolower);
 
-  PrintOptions(0, GMSH_FULLRC, diff, help, 0, &s0);
+  PrintOptions(0, GMSH_FULLRC, diff, help, nullptr, &s0);
 #if defined(HAVE_PARSER)
   PrintParserSymbols(help, s0);
 #endif
@@ -271,7 +271,7 @@ void help_options_cb(Fl_Widget *w, void *data)
   FlGui::instance()->help->browser->clear();
   for(std::size_t i = 0; i < s0.size(); i++) {
     std::string::size_type sep = s0[i].rfind('\0');
-    void *d = 0;
+    void *d = nullptr;
     if(sep != std::string::npos) {
       std::string tmp = s0[i].substr(sep + 1);
       if(tmp == "number")
@@ -315,7 +315,7 @@ helpWindow::helpWindow()
     std::ostringstream sstream;
     sstream
       << "<center><h3>Gmsh</h3><br>version " << GetGmshVersion()
-      << "<p>Copyright (C) 1997-2020"
+      << "<p>Copyright (C) 1997-2021"
       << "<br>Christophe Geuzaine and Jean-Francois Remacle"
       << "<p><a href=\"https://gmsh.info/CREDITS.txt\">Credits</a> "
       << "and <a href=\"https://gmsh.info/LICENSE.txt\">licensing "
diff --git a/Fltk/helpWindow.h b/Fltk/helpWindow.h
index 2ea9bc8c47968510c88396c8cc08a439724a2003..2c744d07e1e66223918e488643f1a50ac724e8f5 100644
--- a/Fltk/helpWindow.h
+++ b/Fltk/helpWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/highOrderToolsWindow.cpp b/Fltk/highOrderToolsWindow.cpp
index fdbaeaad2e3bf09b8952c7aca8e7f8b8474606af..64c12f2230a5be9f488f9ffc61ade34d2fd51a63 100644
--- a/Fltk/highOrderToolsWindow.cpp
+++ b/Fltk/highOrderToolsWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -157,7 +157,7 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data)
   bool onlyVisible = (bool)o->butt[1]->value();
 
   int NE = 0;
-  for(GModel::riter it = GModel::current()->firstRegion();
+  for(auto it = GModel::current()->firstRegion();
       it != GModel::current()->lastRegion(); ++it) {
     NE += (*it)->getNumMeshElements();
   }
@@ -245,7 +245,7 @@ static void getMeshInfoForHighOrder(GModel *gm, int &meshOrder, bool &complete,
   // order = 2+, a prism or a pyramid if order = 3+ or a tet if order = 4+ and
   // so on...  But it is more likely that we want complete elements so always
   // setting true to 'complete' variable is acceptable.
-  for(GModel::riter itr = gm->firstRegion(); itr != gm->lastRegion(); ++itr) {
+  for(auto itr = gm->firstRegion(); itr != gm->lastRegion(); ++itr) {
     if((*itr)->getNumMeshElements()) {
       meshOrder = (*itr)->getMeshElement(0)->getPolynomialOrder();
       //complete = (meshOrder <= 2) ? true :
@@ -254,7 +254,7 @@ static void getMeshInfoForHighOrder(GModel *gm, int &meshOrder, bool &complete,
       break;
     }
   }
-  for(GModel::fiter itf = gm->firstFace(); itf != gm->lastFace(); ++itf) {
+  for(auto itf = gm->firstFace(); itf != gm->lastFace(); ++itf) {
     if((*itf)->getNumMeshElements()) {
       if(meshOrder == -1) {
         meshOrder = (*itf)->getMeshElement(0)->getPolynomialOrder();
@@ -362,11 +362,11 @@ highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
 
   y += BH;
   static Fl_Menu_Item menu_method[] = {
-    {"Optimization", 0, 0, 0},
-    {"Elastic Analogy", 0, 0, 0},
-    {"Fast Curving", 0, 0, 0},
-    {"Curve boundary layers (3D is experimental)", 0, 0, 0},
-    {0}};
+    {"Optimization", 0, nullptr, nullptr},
+    {"Elastic Analogy", 0, nullptr, nullptr},
+    {"Fast Curving", 0, nullptr, nullptr},
+    {"Curve boundary layers (3D is experimental)", 0, nullptr, nullptr},
+    {nullptr}};
   choice[2] = new Fl_Choice(x, y, IW, BH, "Algorithm");
   choice[2]->align(FL_ALIGN_RIGHT);
   choice[2]->menu(menu_method);
@@ -406,7 +406,7 @@ highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
 
   y += BH;
   static Fl_Menu_Item menu_objf[] = {
-    {"Fixed", 0, 0, 0}, {"Free", 0, 0, 0}, {0}};
+    {"Fixed", 0, nullptr, nullptr}, {"Free", 0, nullptr, nullptr}, {nullptr}};
   choice[0] = new Fl_Choice(x, y, IW, BH, "Boundary nodes");
   choice[0]->menu(menu_objf);
   choice[0]->align(FL_ALIGN_RIGHT);
@@ -432,10 +432,10 @@ highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
   value[4]->align(FL_ALIGN_RIGHT);
   value[4]->value(CTX::instance()->mesh.hoPassMax);
 
-  static Fl_Menu_Item menu_strategy[] = {{"Disjoint strong", 0, 0, 0},
-                                         {"Adaptive one-by-one", 0, 0, 0},
-                                         {"Disjoint weak", 0, 0, 0},
-                                         {0}};
+  static Fl_Menu_Item menu_strategy[] = {{"Disjoint strong", 0, nullptr, nullptr},
+                                         {"Adaptive one-by-one", 0, nullptr, nullptr},
+                                         {"Disjoint weak", 0, nullptr, nullptr},
+                                         {nullptr}};
 
   y += BH;
   choice[3] = new Fl_Choice(x, y, IW, BH, "Strategy");
diff --git a/Fltk/highOrderToolsWindow.h b/Fltk/highOrderToolsWindow.h
index acf2cf97b8cd358929412e911d7fb922f8708997..3ba0b6291040a609cb2511f4c0fe89c7030dc01e 100644
--- a/Fltk/highOrderToolsWindow.h
+++ b/Fltk/highOrderToolsWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/inputRange.h b/Fltk/inputRange.h
index 4e1e7c2b9d0cd7f62e0a0c22edc127b2d6d24770..a8adfd0f721c2031f9dc7458f6aa3083da636f17 100644
--- a/Fltk/inputRange.h
+++ b/Fltk/inputRange.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -247,7 +247,7 @@ private:
 
 public:
   inputRange(int x, int y, int w, int h, double max_number,
-             bool readOnlyRange = false, const char *l = 0)
+             bool readOnlyRange = false, const char *l = nullptr)
     : Fl_Group(x, y, w, h, l), _min(-max_number), _max(max_number), _step(0.),
       _max_number(max_number), _do_callback_on_values(true)
   {
diff --git a/Fltk/inputValue.cpp b/Fltk/inputValue.cpp
index ec281bf8a60d8a1408febc184a5d78167347e2cc..ae64a642d73eb40120f08001aaa7bf0a2f1b60b8 100644
--- a/Fltk/inputValue.cpp
+++ b/Fltk/inputValue.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -11,7 +11,7 @@
 void inputValueFloat::new_input_cb(Fl_Widget *, void *v)
 {
   inputValueFloat &t = *(inputValueFloat *)v;
-  double nv = strtod(t.input.value(), 0);
+  double nv = strtod(t.input.value(), nullptr);
   if(nv != t.value() || t.when() & FL_WHEN_NOT_CHANGED) {
     t.set_value(nv);
     t.set_changed();
diff --git a/Fltk/inputValue.h b/Fltk/inputValue.h
index 664d8f7703bcea45e40276c9b2c41382d49ea165..defddef86ede76d760bb84bd056fa6915fb71d62 100644
--- a/Fltk/inputValue.h
+++ b/Fltk/inputValue.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -16,7 +16,7 @@ class inputValue : public Fl_Value_Input {
 private:
   std::string _number_format;
 public:
-  inputValue(int x, int y, int w, int h, const char *l = 0)
+  inputValue(int x, int y, int w, int h, const char *l = nullptr)
     : Fl_Value_Input(x, y, w, h, l)
   {
   }
@@ -44,7 +44,7 @@ private:
   static void new_input_cb(Fl_Widget *, void *);
 
 public:
-  inputValueFloat(int x, int y, int w, int h, const char *l = 0);
+  inputValueFloat(int x, int y, int w, int h, const char *l = nullptr);
   int handle(int event);
 };
 
diff --git a/Fltk/mainWindow.h b/Fltk/mainWindow.h
index 5be4102cb2e001fb36137b3bc67da221ecbe459e..be553f941260cd5b2abff7d380a4e32f37864806 100644
--- a/Fltk/mainWindow.h
+++ b/Fltk/mainWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -13,7 +13,7 @@
 // Derive the main window from Fl_Window (it shows up faster that way)
 class mainWindow : public Fl_Window {
 public:
-  mainWindow(int w, int h, bool nonModal, const char *l = 0)
+  mainWindow(int w, int h, bool nonModal, const char *l = nullptr)
     : Fl_Window(w, h, l)
   {
     if(nonModal) set_non_modal();
@@ -30,7 +30,7 @@ public:
 #else
       if(Fl::test_shortcut(FL_CTRL + 'w')) {
 #endif
-        if(fl_choice("Do you really want to quit?", "Cancel", "Quit", 0))
+        if(fl_choice("Do you really want to quit?", "Cancel", "Quit", nullptr))
           do_callback();
         return 1;
       }
diff --git a/Fltk/manipWindow.cpp b/Fltk/manipWindow.cpp
index 19069a6fffedd6725ba8b9ae423946d8434cd283..e9db1748193f3fcbb37a2aabb3622a0d6de2e1fc 100644
--- a/Fltk/manipWindow.cpp
+++ b/Fltk/manipWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/manipWindow.h b/Fltk/manipWindow.h
index d2f285e40032d5d5a41dfdb112cb504d3c4803e5..79f5b92c199ab55367683797724629764b3a9a1b 100644
--- a/Fltk/manipWindow.h
+++ b/Fltk/manipWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/messageBrowser.h b/Fltk/messageBrowser.h
index 5c54d0cbd0c8a3334dd814b44a116b83d67054b8..17eb3e723b17afb471000b6376cb74b822cdb18c 100644
--- a/Fltk/messageBrowser.h
+++ b/Fltk/messageBrowser.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/onelabContextWindow.cpp b/Fltk/onelabContextWindow.cpp
index f31e446af1347fff0d0735c01fedcad5baeddfa4..4322b8972b522cae460d9395112adb0befabb0b0 100644
--- a/Fltk/onelabContextWindow.cpp
+++ b/Fltk/onelabContextWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -149,7 +149,7 @@ void onelabContextWindow::show(int dim, int tag)
       std::to_string(_tag);
     if(_name.size()) label += ": " + _name;
     char *str = strdup(label.c_str());
-    Fl_Menu_Item item = {str, 0, 0, 0, 0};
+    Fl_Menu_Item item = {str, 0, nullptr, nullptr, 0};
     toFree.push_back(str);
     menu.push_back(item);
   }
@@ -158,11 +158,11 @@ void onelabContextWindow::show(int dim, int tag)
       std::to_string(p.first);
     if(p.second.size()) label += ": " + p.second;
     char *str = strdup(label.c_str());
-    Fl_Menu_Item item = {str, 0, 0, 0, 0};
+    Fl_Menu_Item item = {str, 0, nullptr, nullptr, 0};
     toFree.push_back(str);
     menu.push_back(item);
   }
-  Fl_Menu_Item item = {0};
+  Fl_Menu_Item item = {nullptr};
   menu.push_back(item);
   _choice->copy(&menu[0]);
 
diff --git a/Fltk/onelabContextWindow.h b/Fltk/onelabContextWindow.h
index 55da763a78da40951122fc8b753306e75407e1eb..50aa2f58af1c66931cdd8e7454a39c30cbcac8e2 100644
--- a/Fltk/onelabContextWindow.h
+++ b/Fltk/onelabContextWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -20,7 +20,7 @@ class contextWindow : public paletteWindow {
 private:
   bool _redraw;
 public:
-  contextWindow(int w, int h, bool nonModal, const char *l = 0)
+  contextWindow(int w, int h, bool nonModal, const char *l = nullptr)
     : paletteWindow(w, h, nonModal, l), _redraw(false) { }
   virtual int handle(int event);
   void enableRedraw() { _redraw = true; }
diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp
index 6458de6e065411848f03b11ffa70a9cfa555b01b..e9a2ac1f8afbe47996952078cc6a09d7c959b2d3 100644
--- a/Fltk/onelabGroup.cpp
+++ b/Fltk/onelabGroup.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -80,13 +80,13 @@ void solver_cb(Fl_Widget *w, void *data)
     FlGui::instance()->onelab->show();
   else {
     if(CTX::instance()->launchSolverAtStartup >= 0) {
-      onelab_cb(0, (void *)"reset");
+      onelab_cb(nullptr, (void *)"reset");
       onelabUtils::setFirstComputationFlag(true);
     }
     else if(num >= 0)
-      onelab_cb(0, (void *)"check");
+      onelab_cb(nullptr, (void *)"check");
     else
-      onelab_cb(0, (void *)"refresh");
+      onelab_cb(nullptr, (void *)"refresh");
     FlGui::instance()->onelab->updateGearMenu();
   }
 
@@ -114,7 +114,7 @@ void onelab_cb(Fl_Widget *w, void *data)
   if(action == "stop") {
     FlGui::instance()->onelab->stop(true);
     FlGui::instance()->onelab->setButtonMode("", "kill");
-    for(onelab::server::citer it = onelab::server::instance()->firstClient();
+    for(auto it = onelab::server::instance()->firstClient();
         it != onelab::server::instance()->lastClient(); it++) {
       onelab::string o((*it)->getName() + "/Action", "stop");
       o.setVisible(false);
@@ -126,7 +126,7 @@ void onelab_cb(Fl_Widget *w, void *data)
 
   if(action == "kill") {
     FlGui::instance()->onelab->stop(true);
-    for(onelab::server::citer it = onelab::server::instance()->firstClient();
+    for(auto it = onelab::server::instance()->firstClient();
         it != onelab::server::instance()->lastClient(); it++)
       (*it)->kill();
     return;
@@ -211,7 +211,7 @@ void onelab_cb(Fl_Widget *w, void *data)
     if(FlGui::instance()->onelab->stop()) break;
 
     // iterate over all other clients (there should normally only be one)
-    for(onelab::server::citer it = onelab::server::instance()->firstClient();
+    for(auto it = onelab::server::instance()->firstClient();
         it != onelab::server::instance()->lastClient(); it++) {
       onelab::client *c = *it;
       if(c->getName() == "Gmsh" || // local Gmsh client
@@ -340,7 +340,7 @@ static void onelab_choose_executable_cb(Fl_Widget *w, void *data)
   }
 
   if(exe.empty()) {
-    const char *old = 0;
+    const char *old = nullptr;
     if(c->getExecutable().size()) old = c->getExecutable().c_str();
     std::string title = "Choose location of " + c->getName() + " executable";
     if(fileChooser(FILE_CHOOSER_SINGLE, title.c_str(), pattern.c_str(), old))
@@ -580,7 +580,7 @@ static void autoCheck(const T &pold, const T &pnew, bool force = false)
       pnew.getAttribute("AutoCheck") != "0") ||
      pnew.getAttribute("AutoCheck") == "1") {
     if(force || pold.getValue() != pnew.getValue())
-      onelab_cb(0, (void *)"check");
+      onelab_cb(nullptr, (void *)"check");
   }
 }
 
@@ -603,7 +603,7 @@ template <class T> void onelabGroup::_addParameter(T &p)
     (p, 1, 1, ww * _widgetLabelRatio, hh, _widgetLabelRatio,
      getPath(n), highlight, c, _tree->color(), _treeStrings);
   grp->end();
-  if(!_enableTreeWidgetResize) grp->resizable(0);
+  if(!_enableTreeWidgetResize) grp->resizable(nullptr);
   _treeWidgets.push_back(grp);
   widget->copy_label(p.getShortName().c_str());
   std::string help = p.getHelp();
@@ -633,7 +633,7 @@ void onelabGroup::_addMenu(const std::string &path, Fl_Callback *callback,
   but->color(_tree->color());
   but->selection_color(_tree->color());
   grp->end();
-  if(!_enableTreeWidgetResize) grp->resizable(0);
+  if(!_enableTreeWidgetResize) grp->resizable(nullptr);
   _treeWidgets.push_back(grp);
   std::string label = path;
   std::string::size_type last = path.find_last_of('/');
@@ -658,7 +658,7 @@ void onelabGroup::_addSolverMenu(int num)
   Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
   new solverButton(1, 1, ww, hh, num, _tree->color());
   grp->end();
-  if(!_enableTreeWidgetResize) grp->resizable(0);
+  if(!_enableTreeWidgetResize) grp->resizable(nullptr);
   _treeWidgets.push_back(grp);
   n->widget(grp);
   _tree->end();
@@ -679,7 +679,7 @@ void onelabGroup::_addViewMenu(int num)
   Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
   new viewButton(1, 1, ww, hh, num, _tree->color());
   grp->end();
-  if(!_enableTreeWidgetResize) grp->resizable(0);
+  if(!_enableTreeWidgetResize) grp->resizable(nullptr);
   _treeWidgets.push_back(grp);
   n->widget(grp);
   _tree->end();
@@ -689,13 +689,13 @@ void onelabGroup::_addViewMenu(int num)
 viewButton *onelabGroup::getViewButton(int num)
 {
   std::string path = getViewPathName(num);
-  if(path.empty()) return 0;
+  if(path.empty()) return nullptr;
   Fl_Tree_Item *n = _tree->find_item(path.c_str());
   if(n) {
     Fl_Group *grp = (Fl_Group *)n->widget();
     return (viewButton *)grp->child(0);
   }
-  return 0;
+  return nullptr;
 }
 
 void onelabGroup::openCloseViewButton(int num)
@@ -999,11 +999,11 @@ Fl_Widget *addParameterWidget(onelab::number &p,
     for(std::size_t i = 0; i < choices.size(); i++) {
       char *str = strdup(labels[choices[i]].c_str());
       stringsToFree.push_back(str);
-      Fl_Menu_Item menuItem = {str, 0, 0, 0, 0};
+      Fl_Menu_Item menuItem = {str, 0, nullptr, nullptr, 0};
       if(highlight) menuItem.labelcolor(c);
       menu.push_back(menuItem);
     }
-    Fl_Menu_Item it = {0};
+    Fl_Menu_Item it = {nullptr};
     menu.push_back(it);
     but->copy(&menu[0]);
     for(std::size_t i = 0; i < choices.size(); i++) {
@@ -1294,7 +1294,7 @@ Fl_Widget *addParameterWidget(onelab::string &p,
     int choice = multipleSelection.size() ? FL_MENU_TOGGLE : 0;
     if(multipleSelection.size() > j && multipleSelection[j] == '1')
       choice |= FL_MENU_VALUE;
-    Fl_Menu_Item it = {str, 0, 0, 0, choice | (divider ? FL_MENU_DIVIDER : 0)};
+    Fl_Menu_Item it = {str, 0, nullptr, nullptr, choice | (divider ? FL_MENU_DIVIDER : 0)};
     menu.push_back(it);
   }
   if(multipleSelection.size()) {
@@ -1318,7 +1318,7 @@ Fl_Widget *addParameterWidget(onelab::string &p,
       menu.push_back(it3);
     }
   }
-  Fl_Menu_Item it = {0};
+  Fl_Menu_Item it = {nullptr};
   menu.push_back(it);
   but->menubutton()->copy(&menu[0]);
   but->value(p.getValue().c_str());
@@ -1511,7 +1511,7 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
     }
   }
 
-  for(std::set<std::string>::iterator it = closed.begin(); it != closed.end();
+  for(auto it = closed.begin(); it != closed.end();
       it++) {
     if(it->size()) _tree->close(it->c_str(), 0);
   }
@@ -1724,7 +1724,7 @@ void onelabGroup::rebuildSolverList()
   }
   for(std::size_t i = 0; i < NUM_SOLVERS; i++) {
     if(i < names.size()) {
-      onelab::server::citer it =
+      auto it =
         onelab::server::instance()->findClient(names[i]);
       if(it != onelab::server::instance()->lastClient()) (*it)->setIndex(i);
       opt_solver_name(i, GMSH_SET, names[i]);
@@ -1758,16 +1758,16 @@ void onelabGroup::addSolver(const std::string &name,
                             const std::string &executable,
                             const std::string &remoteLogin, int index)
 {
-  onelab::server::citer it = onelab::server::instance()->findClient(name);
+  auto it = onelab::server::instance()->findClient(name);
   if(it != onelab::server::instance()->lastClient()) {
     if(needToChooseExe(executable))
-      onelab_choose_executable_cb(0, (void *)(*it));
+      onelab_choose_executable_cb(nullptr, (void *)(*it));
     return; // solver already exists
   }
 
   // delete the other non-local clients so we keep only the new one
   std::vector<onelab::client *> networkClients;
-  for(onelab::server::citer it = onelab::server::instance()->firstClient();
+  for(auto it = onelab::server::instance()->firstClient();
       it != onelab::server::instance()->lastClient(); it++)
     if((*it)->isNetworkClient()) networkClients.push_back(*it);
   for(std::size_t i = 0; i < networkClients.size(); i++) {
@@ -1780,7 +1780,7 @@ void onelabGroup::addSolver(const std::string &name,
   c->setIndex(index);
   opt_solver_name(index, GMSH_SET, name);
   if(needToChooseExe(executable))
-    onelab_choose_executable_cb(0, (void *)c);
+    onelab_choose_executable_cb(nullptr, (void *)c);
   else
     opt_solver_executable(index, GMSH_SET, executable);
   opt_solver_remote_login(index, GMSH_SET, remoteLogin);
@@ -1788,5 +1788,5 @@ void onelabGroup::addSolver(const std::string &name,
   FlGui::instance()->onelab->rebuildSolverList();
 
   // initialize the client
-  onelab_cb(0, (void *)"initialize");
+  onelab_cb(nullptr, (void *)"initialize");
 }
diff --git a/Fltk/onelabGroup.h b/Fltk/onelabGroup.h
index b19a9cfd1320b05b0b7f0c1623afb95353d6e862..d8944aa2a416289c3c164b551d0ceb39a518afb9 100644
--- a/Fltk/onelabGroup.h
+++ b/Fltk/onelabGroup.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -40,7 +40,7 @@ private:
   void _addGmshMenus();
 
 public:
-  onelabGroup(int x, int y, int w, int h, const char *l = 0);
+  onelabGroup(int x, int y, int w, int h, const char *l = nullptr);
   void updateGearMenu();
   void rebuildSolverList();
   void rebuildTree(bool deleteWidgets);
diff --git a/Fltk/openglWindow.cpp b/Fltk/openglWindow.cpp
index b28b09f185381600ea7d8588510997649f800901..dbf3b13011103629d875f17fa2913841aff4e55b 100644
--- a/Fltk/openglWindow.cpp
+++ b/Fltk/openglWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -32,7 +32,7 @@ static void navigator_handler(void *data)
 {
   openglWindow *gl_win = (openglWindow *)data;
   if(CTX::instance()->gamepad && CTX::instance()->gamepad->active) {
-    if(gl_win->Nautilus == 0) {
+    if(gl_win->Nautilus == nullptr) {
       gl_win->Nautilus = new Navigator(CTX::instance()->gamepad->frequency,
                                        gl_win->getDrawContext());
     }
@@ -43,7 +43,7 @@ static void navigator_handler(void *data)
   else {
     if(gl_win->Nautilus) {
       delete gl_win->Nautilus;
-      gl_win->Nautilus = 0;
+      gl_win->Nautilus = nullptr;
     }
     Fl::add_timeout(3., navigator_handler, data);
   }
@@ -71,7 +71,7 @@ static void lassoZoom(drawContext *ctx, mousePosition &click1,
 
 openglWindow::openglWindow(int x, int y, int w, int h)
   : Fl_Gl_Window(x, y, w, h, "gl"), _lock(false), _drawn(false),
-    _selection(ENT_NONE), _trySelection(0), Nautilus(0)
+    _selection(ENT_NONE), _trySelection(0), Nautilus(nullptr)
 {
   _ctx = new drawContext(this);
 
@@ -361,7 +361,7 @@ void openglWindow::draw()
   _lock = false;
 }
 
-openglWindow *openglWindow::_lastHandled = 0;
+openglWindow *openglWindow::_lastHandled = nullptr;
 
 void openglWindow::_setLastHandled(openglWindow *w)
 {
@@ -438,7 +438,7 @@ int openglWindow::handle(int event)
         ParseString(CTX::instance()->post.doubleClickedGraphPointCommand, true);
       }
       else { // popup quick access menu
-        status_options_cb(0, (void *)"quick_access");
+        status_options_cb(nullptr, (void *)"quick_access");
       }
       Fl::event_clicks(-1);
       return 1;
@@ -914,7 +914,7 @@ void openglWindow::drawTooltip(const std::string &text)
   static char str[1024];
   strncpy(str, text.c_str(), sizeof(str) - 1);
   str[sizeof(str) - 1] = '\0';
-  Fl_Tooltip::exit(0);
+  Fl_Tooltip::exit(nullptr);
   bool enabled = Fl_Tooltip::enabled();
   if(!enabled) Fl_Tooltip::enable();
   double d1 = Fl_Tooltip::delay();
@@ -932,7 +932,7 @@ void openglWindow::moveWithGamepad()
 {
   if(CTX::instance()->gamepad && CTX::instance()->gamepad->active && Nautilus) {
     if(!(_ctx->camera.on)) _ctx->camera.init();
-    if(_drawn && (_lastHandled == this || _lastHandled == 0)) {
+    if(_drawn && (_lastHandled == this || _lastHandled == nullptr)) {
       Nautilus->move();
       this->flush();
     }
diff --git a/Fltk/openglWindow.h b/Fltk/openglWindow.h
index 8806b6e25df5c7856fd68a8258cffb3ca9f6f68a..64736d9d9a790edc26452bc45576b199d12dfddd 100644
--- a/Fltk/openglWindow.h
+++ b/Fltk/openglWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp
index 418342b3045d1e85d7d11f8b70ab3e31a92337c5..1cac3f32bd3cae55a167809ddb8f91179a509328 100644
--- a/Fltk/optionWindow.cpp
+++ b/Fltk/optionWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -47,83 +47,83 @@ extern StringXColor MeshOptions_Color[];
 extern StringXColor ViewOptions_Color[];
 
 static Fl_Menu_Item menu_point_display[] = {
-  {"Color dot", 0, 0, 0},
-  {"3D sphere", 0, 0, 0},
-  {0}
+  {"Color dot", 0, nullptr, nullptr},
+  {"3D sphere", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 static Fl_Menu_Item menu_point_display_post[] = {
-  {"Color dot", 0, 0, 0},
-  {"3D sphere", 0, 0, 0},
-  {"Scaled dot", 0, 0, 0},
-  {"Scaled sphere", 0, 0, 0},
-  {0}
+  {"Color dot", 0, nullptr, nullptr},
+  {"3D sphere", 0, nullptr, nullptr},
+  {"Scaled dot", 0, nullptr, nullptr},
+  {"Scaled sphere", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 static Fl_Menu_Item menu_line_display[] = {
-  {"Color segment", 0, 0, 0},
-  {"3D cylinder", 0, 0, 0},
-  {0}
+  {"Color segment", 0, nullptr, nullptr},
+  {"3D cylinder", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 static Fl_Menu_Item menu_line_display_post[] = {
-  {"Color segment", 0, 0, 0},
-  {"3D cylinder", 0, 0, 0},
-  {"Tapered cylinder", 0, 0, 0},
-  {0}
+  {"Color segment", 0, nullptr, nullptr},
+  {"3D cylinder", 0, nullptr, nullptr},
+  {"Tapered cylinder", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 static Fl_Menu_Item menu_surface_display[] = {
-  {"Cross", 0, 0, 0},
-  {"Wireframe", 0, 0, 0},
-  {"Solid", 0, 0, 0},
-  {0}
+  {"Cross", 0, nullptr, nullptr},
+  {"Wireframe", 0, nullptr, nullptr},
+  {"Solid", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 static Fl_Menu_Item menu_axes_mode[] = {
-  {"None", 0, 0, 0},
-  {"Simple axes", 0, 0, 0},
-  {"Box", 0, 0, 0},
-  {"Full grid", 0, 0, 0},
-  {"Open grid", 0, 0, 0},
-  {"Ruler", 0, 0, 0},
-  {0}
+  {"None", 0, nullptr, nullptr},
+  {"Simple axes", 0, nullptr, nullptr},
+  {"Box", 0, nullptr, nullptr},
+  {"Full grid", 0, nullptr, nullptr},
+  {"Open grid", 0, nullptr, nullptr},
+  {"Ruler", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 static Fl_Menu_Item menu_position[] = {
-  {"Manual", 0, 0, 0},
-  {"Automatic", 0, 0, 0},
-  {"Top left", 0, 0, 0},
-  {"Top right", 0, 0, 0},
-  {"Bottom left", 0, 0, 0},
-  {"Bottom right", 0, 0, 0},
-  {"Top", 0, 0, 0},
-  {"Bottom", 0, 0, 0},
-  {"Left", 0, 0, 0},
-  {"Right", 0, 0, 0},
-  {"Full", 0, 0, 0},
-  {"Top third", 0, 0, 0},
-  {"In model coordinates", 0, 0, 0},
-  {0}
+  {"Manual", 0, nullptr, nullptr},
+  {"Automatic", 0, nullptr, nullptr},
+  {"Top left", 0, nullptr, nullptr},
+  {"Top right", 0, nullptr, nullptr},
+  {"Bottom left", 0, nullptr, nullptr},
+  {"Bottom right", 0, nullptr, nullptr},
+  {"Top", 0, nullptr, nullptr},
+  {"Bottom", 0, nullptr, nullptr},
+  {"Left", 0, nullptr, nullptr},
+  {"Right", 0, nullptr, nullptr},
+  {"Full", 0, nullptr, nullptr},
+  {"Top third", 0, nullptr, nullptr},
+  {"In model coordinates", 0, nullptr, nullptr},
+  {nullptr}
 };
 
 Fl_Menu_Item menu_font_names[] = {
-  {"Times-Roman", 0, 0, (void *)FL_TIMES},
-  {"Times-Bold", 0, 0, (void *)FL_TIMES_BOLD},
-  {"Times-Italic", 0, 0, (void *)FL_TIMES_ITALIC},
-  {"Times-BoldItalic", 0, 0, (void *)FL_TIMES_BOLD_ITALIC},
-  {"Helvetica", 0, 0, (void *)FL_HELVETICA},
-  {"Helvetica-Bold", 0, 0, (void *)FL_HELVETICA_BOLD},
-  {"Helvetica-Oblique", 0, 0, (void *)FL_HELVETICA_ITALIC},
-  {"Helvetica-BoldOblique", 0, 0, (void *)FL_HELVETICA_BOLD_ITALIC},
-  {"Courier", 0, 0, (void *)FL_COURIER},
-  {"Courier-Bold", 0, 0, (void *)FL_COURIER_BOLD},
-  {"Courier-Oblique", 0, 0, (void *)FL_COURIER_ITALIC},
-  {"Courier-BoldOblique", 0, 0, (void *)FL_COURIER_BOLD_ITALIC},
-  {"Symbol", 0, 0, (void *)FL_SYMBOL},
-  {"ZapfDingbats", 0, 0, (void *)FL_ZAPF_DINGBATS},
-  {"Screen", 0, 0, (void *)FL_SCREEN},
-  {0}
+  {"Times-Roman", 0, nullptr, (void *)FL_TIMES},
+  {"Times-Bold", 0, nullptr, (void *)FL_TIMES_BOLD},
+  {"Times-Italic", 0, nullptr, (void *)FL_TIMES_ITALIC},
+  {"Times-BoldItalic", 0, nullptr, (void *)FL_TIMES_BOLD_ITALIC},
+  {"Helvetica", 0, nullptr, (void *)FL_HELVETICA},
+  {"Helvetica-Bold", 0, nullptr, (void *)FL_HELVETICA_BOLD},
+  {"Helvetica-Oblique", 0, nullptr, (void *)FL_HELVETICA_ITALIC},
+  {"Helvetica-BoldOblique", 0, nullptr, (void *)FL_HELVETICA_BOLD_ITALIC},
+  {"Courier", 0, nullptr, (void *)FL_COURIER},
+  {"Courier-Bold", 0, nullptr, (void *)FL_COURIER_BOLD},
+  {"Courier-Oblique", 0, nullptr, (void *)FL_COURIER_ITALIC},
+  {"Courier-BoldOblique", 0, nullptr, (void *)FL_COURIER_BOLD_ITALIC},
+  {"Symbol", 0, nullptr, (void *)FL_SYMBOL},
+  {"ZapfDingbats", 0, nullptr, (void *)FL_ZAPF_DINGBATS},
+  {"Screen", 0, nullptr, (void *)FL_SCREEN},
+  {nullptr}
 };
 
 static void color_cb(Fl_Widget *w, void *data)
@@ -187,7 +187,7 @@ void options_restore_defaults_cb(Fl_Widget *w, void *data)
 {
   if(fl_choice(
        "Do you really want to reset all options to their default values?",
-       "Cancel", "Restore", 0)) {
+       "Cancel", "Restore", nullptr)) {
     UnlinkFile(CTX::instance()->homeDir + CTX::instance()->sessionFileName);
     UnlinkFile(CTX::instance()->homeDir + CTX::instance()->optionsFileName);
     ReInitOptions(0);
@@ -628,7 +628,7 @@ static void solver_options_ok_cb(Fl_Widget *w, void *data)
     (int)opt_solver_listen(0, GMSH_GET, o->solver.butt[0]->value());
   opt_solver_listen(0, GMSH_SET, o->solver.butt[0]->value());
   if(!old_listen && o->solver.butt[0]->value()) {
-    onelab::server::citer it = onelab::server::instance()->findClient("Listen");
+    auto it = onelab::server::instance()->findClient("Listen");
     if(it == onelab::server::instance()->lastClient()) {
       onelab::localNetworkClient *c = new gmshLocalNetworkClient("Listen", "");
       c->run();
@@ -1322,41 +1322,41 @@ static void view_options_max_recursion_cb(Fl_Widget *w, void *data)
     FlGui::instance()->options->view.value[33]->value(val - 1);
   else if(str == "+")
     FlGui::instance()->options->view.value[33]->value(val + 1);
-  view_options_ok_cb(0, 0);
+  view_options_ok_cb(nullptr, nullptr);
 }
 
 optionWindow::optionWindow(int deltaFontSize)
 {
-  general.butt.resize(50, 0);
-  general.push.resize(50, 0);
-  general.value.resize(50, 0);
-  general.color.resize(50, 0);
-  general.input.resize(50, 0);
-  general.choice.resize(50, 0);
-  geo.butt.resize(50, 0);
-  geo.value.resize(50, 0);
-  geo.color.resize(50, 0);
-  geo.choice.resize(50, 0);
-  mesh.butt.resize(50, 0);
-  mesh.retbutt.resize(50, 0);
-  mesh.input.resize(50, 0);
-  mesh.value.resize(50, 0);
-  mesh.color.resize(50, 0);
-  mesh.choice.resize(50, 0);
-  solver.butt.resize(50, 0);
-  solver.value.resize(50, 0);
-  solver.input.resize(50, 0);
-  post.butt.resize(50, 0);
-  post.value.resize(50, 0);
-  post.choice.resize(50, 0);
-  view.butt.resize(50, 0);
-  view.value.resize(100, 0);
-  view.input.resize(50, 0);
-  view.push.resize(50, 0);
-  view.choice.resize(50, 0);
-  view.color.resize(50, 0);
-  view.label.resize(50, 0);
-  view.menu.resize(50, 0);
+  general.butt.resize(50, nullptr);
+  general.push.resize(50, nullptr);
+  general.value.resize(50, nullptr);
+  general.color.resize(50, nullptr);
+  general.input.resize(50, nullptr);
+  general.choice.resize(50, nullptr);
+  geo.butt.resize(50, nullptr);
+  geo.value.resize(50, nullptr);
+  geo.color.resize(50, nullptr);
+  geo.choice.resize(50, nullptr);
+  mesh.butt.resize(50, nullptr);
+  mesh.retbutt.resize(50, nullptr);
+  mesh.input.resize(50, nullptr);
+  mesh.value.resize(50, nullptr);
+  mesh.color.resize(50, nullptr);
+  mesh.choice.resize(50, nullptr);
+  solver.butt.resize(50, nullptr);
+  solver.value.resize(50, nullptr);
+  solver.input.resize(50, nullptr);
+  post.butt.resize(50, nullptr);
+  post.value.resize(50, nullptr);
+  post.choice.resize(50, nullptr);
+  view.butt.resize(50, nullptr);
+  view.value.resize(100, nullptr);
+  view.input.resize(50, nullptr);
+  view.push.resize(50, nullptr);
+  view.choice.resize(50, nullptr);
+  view.color.resize(50, nullptr);
+  view.label.resize(50, nullptr);
+  view.menu.resize(50, nullptr);
 
   FL_NORMAL_SIZE -= deltaFontSize;
 
@@ -1720,9 +1720,9 @@ optionWindow::optionWindow(int deltaFontSize)
       o->hide();
 
       static Fl_Menu_Item menu_projection[] = {
-        {"Orthographic", 0, 0, 0},
-        {"Perspective", 0, 0, 0},
-        {0}
+        {"Orthographic", 0, nullptr, nullptr},
+        {"Perspective", 0, nullptr, nullptr},
+        {nullptr}
       };
       general.choice[2] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Projection mode");
@@ -1792,11 +1792,11 @@ optionWindow::optionWindow(int deltaFontSize)
       general.value[7]->callback(general_options_ok_cb);
 
       static Fl_Menu_Item menu_genvectype[] = {
-        {"Line", 0, 0, 0},
-        {"Arrow", 0, 0, 0},
-        {"Pyramid", 0, 0, 0},
-        {"3D arrow", 0, 0, 0},
-        {0}
+        {"Line", 0, nullptr, nullptr},
+        {"Arrow", 0, nullptr, nullptr},
+        {"Pyramid", 0, nullptr, nullptr},
+        {"3D arrow", 0, nullptr, nullptr},
+        {nullptr}
       };
       general.choice[0] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 8 * BH, IW, BH, "Vector display");
@@ -1810,14 +1810,14 @@ optionWindow::optionWindow(int deltaFontSize)
       b->callback(general_arrow_param_cb);
 
       static Fl_Menu_Item menu_font_engine[] = {
-        {"Native", 0, 0, 0},
-        {"Cairo", 0, 0, 0
+        {"Native", 0, nullptr, nullptr},
+        {"Cairo", 0, nullptr, nullptr
 #if !defined(HAVE_CAIRO)
          , FL_MENU_INACTIVE
 #endif
         },
-        {"StringTexture", 0, 0, 0},
-        {0}
+        {"StringTexture", 0, nullptr, nullptr},
+        {nullptr}
       };
       general.choice[7] = new Fl_Choice(L + 2 * WB, 2 * WB + 9 * BH, IW, BH,
                                         "Font rendering engine");
@@ -1918,11 +1918,11 @@ optionWindow::optionWindow(int deltaFontSize)
       general.value[0]->callback(general_options_ok_cb);
 
       static Fl_Menu_Item menu_color_scheme[] = {
-        {"Light", 0, 0, 0},
-        {"Default", 0, 0, 0},
-        {"Grayscale", 0, 0, 0},
-        {"Dark", 0, 0, 0},
-        {0}
+        {"Light", 0, nullptr, nullptr},
+        {"Default", 0, nullptr, nullptr},
+        {"Grayscale", 0, nullptr, nullptr},
+        {"Dark", 0, nullptr, nullptr},
+        {nullptr}
       };
 
       general.choice[3] = new Fl_Choice(L + 2 * WB, 2 * WB + 4 * BH, IW, BH,
@@ -1933,11 +1933,11 @@ optionWindow::optionWindow(int deltaFontSize)
       general.choice[3]->callback(general_options_color_scheme_cb);
 
       static Fl_Menu_Item menu_bg_grad[] = {
-        {"None", 0, 0, 0},
-        {"Vertical", 0, 0, 0},
-        {"Horizontal", 0, 0, 0},
-        {"Radial", 0, 0, 0},
-        {0}
+        {"None", 0, nullptr, nullptr},
+        {"Vertical", 0, nullptr, nullptr},
+        {"Horizontal", 0, nullptr, nullptr},
+        {"Radial", 0, nullptr, nullptr},
+        {nullptr}
       };
 
       general.choice[5] = new Fl_Choice(L + 2 * WB, 2 * WB + 5 * BH, IW, BH,
@@ -2189,10 +2189,10 @@ optionWindow::optionWindow(int deltaFontSize)
       geo.butt[7]->callback(geometry_options_ok_cb);
 
       static Fl_Menu_Item menu_label_type[] = {
-        {"Description", 0, 0, 0},
-        {"Elementary tag", 0, 0, 0},
-        {"Physical tag(s)", 0, 0, 0},
-        {0}
+        {"Description", 0, nullptr, nullptr},
+        {"Elementary tag", 0, nullptr, nullptr},
+        {"Physical tag(s)", 0, nullptr, nullptr},
+        {nullptr}
       };
       geo.choice[4] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 5 * BH, IW, BH, "Label type");
@@ -2229,9 +2229,9 @@ optionWindow::optionWindow(int deltaFontSize)
       o->hide();
 
       static Fl_Menu_Item menu_transform[] = {
-        {"None", 0, 0, 0},
-        {"Scaling", 0, 0, 0},
-        {0}
+        {"None", 0, nullptr, nullptr},
+        {"Scaling", 0, nullptr, nullptr},
+        {nullptr}
       };
       geo.choice[3] = new Fl_Choice(L + 2 * WB, 2 * WB + 1 * BH, IW, BH,
                                     "Main window transform");
@@ -2422,36 +2422,36 @@ optionWindow::optionWindow(int deltaFontSize)
       o->hide();
 
       static Fl_Menu_Item menu_2d_algo[] = {
-        {"Automatic", 0, 0, 0},
-        {"MeshAdapt", 0, 0, 0},
-        {"Delaunay", 0, 0, 0},
-        {"Frontal-Delaunay", 0, 0, 0},
-        {"BAMG (experimental)", 0, 0, 0},
-        {"Frontal-Delaunay for Quads (experimental)", 0, 0, 0},
-        {"Packing of Parallelograms (experimental, planar only)", 0, 0, 0},
-        {"Initial Mesh Only (no node insertion)", 0, 0, 0},
-        {0}
+        {"Automatic", 0, nullptr, nullptr},
+        {"MeshAdapt", 0, nullptr, nullptr},
+        {"Delaunay", 0, nullptr, nullptr},
+        {"Frontal-Delaunay", 0, nullptr, nullptr},
+        {"BAMG (experimental)", 0, nullptr, nullptr},
+        {"Frontal-Delaunay for Quads (experimental)", 0, nullptr, nullptr},
+        {"Packing of Parallelograms (experimental, planar only)", 0, nullptr, nullptr},
+        {"Initial Mesh Only (no node insertion)", 0, nullptr, nullptr},
+        {nullptr}
       };
       static Fl_Menu_Item menu_3d_algo[] = {
-        {"Delaunay", 0, 0, 0},
-        {"Frontal", 0, 0, 0},
-        {"HXT (experimental)", 0, 0, 0},
-        {"MMG3D (experimental, single volume only)", 0, 0, 0},
-        {"Initial Mesh Only (no node insertion)", 0, 0, 0},
-        {0}
+        {"Delaunay", 0, nullptr, nullptr},
+        {"Frontal", 0, nullptr, nullptr},
+        {"HXT (experimental)", 0, nullptr, nullptr},
+        {"MMG3D (experimental, single volume only)", 0, nullptr, nullptr},
+        {"Initial Mesh Only (no node insertion)", 0, nullptr, nullptr},
+        {nullptr}
       };
       static Fl_Menu_Item menu_recombination_algo[] = {
-        {"Simple", 0, 0, 0},
-        {"Blossom", 0, 0, 0},
-        {"Simple Full-Quad", 0, 0, 0},
-        {"Blossom Full-Quad", 0, 0, 0},
-        {0}
+        {"Simple", 0, nullptr, nullptr},
+        {"Blossom", 0, nullptr, nullptr},
+        {"Simple Full-Quad", 0, nullptr, nullptr},
+        {"Blossom Full-Quad", 0, nullptr, nullptr},
+        {nullptr}
       };
       static Fl_Menu_Item menu_subdivision_algo[] = {
-        {"None", 0, 0, 0},
-        {"All Quads", 0, 0, 0},
-        {"All Hexas", 0, 0, 0},
-        {0}
+        {"None", 0, nullptr, nullptr},
+        {"All Quads", 0, nullptr, nullptr},
+        {"All Hexas", 0, nullptr, nullptr},
+        {nullptr}
       };
 
       mesh.choice[2] =
@@ -2669,12 +2669,12 @@ optionWindow::optionWindow(int deltaFontSize)
       mesh.butt[15]->callback(mesh_options_ok_cb);
 
       static Fl_Menu_Item menu_label_type[] = {
-        {"Node/element tag", 0, 0, 0},
-        {"Elementary entity tag", 0, 0, 0},
-        {"Physical group tag(s)", 0, 0, 0},
-        {"Mesh partition", 0, 0, 0},
-        {"Coordinates", 0, 0, 0},
-        {0}
+        {"Node/element tag", 0, nullptr, nullptr},
+        {"Elementary entity tag", 0, nullptr, nullptr},
+        {"Physical group tag(s)", 0, nullptr, nullptr},
+        {"Mesh partition", 0, nullptr, nullptr},
+        {"Coordinates", 0, nullptr, nullptr},
+        {nullptr}
       };
       mesh.choice[7] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 7 * BH, IW, BH, "Label type");
@@ -2695,14 +2695,14 @@ optionWindow::optionWindow(int deltaFontSize)
       mesh.value[12]->callback(mesh_options_ok_cb);
 
       static Fl_Menu_Item menu_mesh_element_types[] = {
-        {"Triangles", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Quadrangles", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Tetrahedra", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Hexahedra", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Prisms", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Pyramids", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Trihedra", 0, 0, 0, FL_MENU_TOGGLE},
-        {0}
+        {"Triangles", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Quadrangles", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Tetrahedra", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Hexahedra", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Prisms", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Pyramids", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Trihedra", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {nullptr}
       };
 
       mesh.menu =
@@ -2733,11 +2733,11 @@ optionWindow::optionWindow(int deltaFontSize)
       mesh.value[5]->callback(mesh_options_ok_cb);
 
       static Fl_Menu_Item menu_quality_type[] = {
-        {"SICN", 0, 0, 0},
-        {"SIGE", 0, 0, 0},
-        {"Gamma", 0, 0, 0},
-        {"Disto", 0, 0, 0},
-        {0}
+        {"SICN", 0, nullptr, nullptr},
+        {"SIGE", 0, nullptr, nullptr},
+        {"Gamma", 0, nullptr, nullptr},
+        {"Disto", 0, nullptr, nullptr},
+        {nullptr}
       };
       mesh.choice[6] = new Fl_Choice(L + 2 * WB + IW / 2, 2 * WB + 9 * BH,
                                      IW / 2, BH, "Quality range");
@@ -2846,10 +2846,10 @@ optionWindow::optionWindow(int deltaFontSize)
       mesh.butt[17]->callback(mesh_options_ok_cb, (void *)"mesh_light");
 
       static Fl_Menu_Item menu_mesh_light_lines[] = {
-        {"No", 0, 0, 0},
-        {"Surface", 0, 0, 0},
-        {"Volume and surface", 0, 0, 0},
-        {0}
+        {"No", 0, nullptr, nullptr},
+        {"Surface", 0, nullptr, nullptr},
+        {"Volume and surface", 0, nullptr, nullptr},
+        {nullptr}
       };
       mesh.choice[10] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "Edge lighting");
@@ -2881,11 +2881,11 @@ optionWindow::optionWindow(int deltaFontSize)
       mesh.value[18]->callback(mesh_options_ok_cb);
 
       static Fl_Menu_Item menu_mesh_color[] = {
-        {"By element type", 0, 0, 0},
-        {"By elementary entity", 0, 0, 0},
-        {"By physical group", 0, 0, 0},
-        {"By mesh partition", 0, 0, 0},
-        {0}
+        {"By element type", 0, nullptr, nullptr},
+        {"By elementary entity", 0, nullptr, nullptr},
+        {"By physical group", 0, nullptr, nullptr},
+        {"By mesh partition", 0, nullptr, nullptr},
+        {nullptr}
       };
       mesh.choice[4] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 6 * BH, IW, BH, "Coloring mode");
@@ -2979,9 +2979,9 @@ optionWindow::optionWindow(int deltaFontSize)
                                  height - 2 * WB - BH, "General");
 
       static Fl_Menu_Item menu_links[] = {
-        {"Apply next changes to selected views", 0, 0, 0},
-        {"Force same options for selected views", 0, 0, 0},
-        {0}
+        {"Apply next changes to selected views", 0, nullptr, nullptr},
+        {"Force same options for selected views", 0, nullptr, nullptr},
+        {nullptr}
       };
 
       post.choice[0] =
@@ -3046,11 +3046,11 @@ optionWindow::optionWindow(int deltaFontSize)
                                  height - 2 * WB - BH, "General");
 
       static Fl_Menu_Item menu_plot_type[] = {
-        {"3D", 0, 0, 0},
-        {"2D space", 0, 0, 0},
-        {"2D time", 0, 0, 0},
-        {"2D", 0, 0, 0},
-        {0}
+        {"3D", 0, nullptr, nullptr},
+        {"2D space", 0, nullptr, nullptr},
+        {"2D time", 0, nullptr, nullptr},
+        {"2D", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[13] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Plot type");
@@ -3105,11 +3105,11 @@ optionWindow::optionWindow(int deltaFontSize)
       view.input[1]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_iso[] = {
-        {"Iso-values", 0, 0, 0},
-        {"Continuous map", 0, 0, 0},
-        {"Filled iso-values", 0, 0, 0},
-        {"Numeric values", 0, 0, 0},
-        {0}
+        {"Iso-values", 0, nullptr, nullptr},
+        {"Continuous map", 0, nullptr, nullptr},
+        {"Filled iso-values", 0, nullptr, nullptr},
+        {"Numeric values", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[0] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 5 * BH, IW, BH, "Intervals type");
@@ -3119,10 +3119,10 @@ optionWindow::optionWindow(int deltaFontSize)
       view.choice[0]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_scale[] = {
-        {"Linear", 0, 0, 0},
-        {"Logarithmic", 0, 0, 0},
-        {"Double logarithmic", 0, 0, 0},
-        {0}
+        {"Linear", 0, nullptr, nullptr},
+        {"Logarithmic", 0, nullptr, nullptr},
+        {"Double logarithmic", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[1] = new Fl_Choice(L + width - (int)(0.85 * IW) - 2 * WB,
                                      2 * WB + 5 * BH, (int)(0.85 * IW), BH);
@@ -3132,10 +3132,10 @@ optionWindow::optionWindow(int deltaFontSize)
       view.choice[1]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_range[] = {
-        {"Default", 0, 0, 0},
-        {"Custom", 0, 0, 0},
-        {"Per step", 0, 0, 0},
-        {0}
+        {"Default", 0, nullptr, nullptr},
+        {"Custom", 0, nullptr, nullptr},
+        {"Per step", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[7] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 6 * BH, IW, BH, "Range mode");
@@ -3367,15 +3367,15 @@ optionWindow::optionWindow(int deltaFontSize)
       view.butt[4]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item time_display[] = {
-        {"None", 0, 0, 0},
-        {"Time series", 0, 0, 0},
-        {"Harmonic data", 0, 0, 0},
-        {"Automatic", 0, 0, 0},
-        {"Step data", 0, 0, 0},
-        {"Multi-step data", 0, 0, 0},
-        {"Real eigenvalues", 0, 0, 0},
-        {"Complex eigenvalues", 0, 0, 0},
-        {0}
+        {"None", 0, nullptr, nullptr},
+        {"Time series", 0, nullptr, nullptr},
+        {"Harmonic data", 0, nullptr, nullptr},
+        {"Automatic", 0, nullptr, nullptr},
+        {"Step data", 0, nullptr, nullptr},
+        {"Multi-step data", 0, nullptr, nullptr},
+        {"Real eigenvalues", 0, nullptr, nullptr},
+        {"Complex eigenvalues", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[12] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "Time display");
@@ -3403,15 +3403,15 @@ optionWindow::optionWindow(int deltaFontSize)
       view.butt[2]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_view_element_types[] = {
-        {"Points", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Lines", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Triangles", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Quadrangles", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Tetrahedra", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Hexahedra", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Prisms", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Pyramids", 0, 0, 0, FL_MENU_TOGGLE},
-        {0}
+        {"Points", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Lines", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Triangles", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Quadrangles", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Tetrahedra", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Hexahedra", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Prisms", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Pyramids", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {nullptr}
       };
 
       view.menu[1] =
@@ -3433,11 +3433,11 @@ optionWindow::optionWindow(int deltaFontSize)
       view.value[6]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_boundary[] = {
-        {"None", 0, 0, 0},
-        {"Dimension - 1", 0, 0, 0},
-        {"Dimension - 2", 0, 0, 0},
-        {"Dimension - 3", 0, 0, 0},
-        {0}
+        {"None", 0, nullptr, nullptr},
+        {"Dimension - 1", 0, nullptr, nullptr},
+        {"Dimension - 2", 0, nullptr, nullptr},
+        {"Dimension - 3", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[9] = new Fl_Choice(L + 2 * WB, 2 * WB + 7 * BH, IW, BH,
                                      "Element boundary mode");
@@ -3467,10 +3467,10 @@ optionWindow::optionWindow(int deltaFontSize)
       view.value[1]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_view_field_types[] = {
-        {"Scalar", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Vector", 0, 0, 0, FL_MENU_TOGGLE},
-        {"Tensor", 0, 0, 0, FL_MENU_TOGGLE},
-        {0}
+        {"Scalar", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Vector", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {"Tensor", 0, nullptr, nullptr, FL_MENU_TOGGLE},
+        {nullptr}
       };
       view.menu[0] =
         new Fl_Menu_Button(L + 2 * WB, 2 * WB + 9 * BH, IW, BH, "Fields");
@@ -3479,11 +3479,11 @@ optionWindow::optionWindow(int deltaFontSize)
       view.menu[0]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_force_field_type[] = {
-        {"Original Field", 0, 0, 0},
-        {"Force Scalar", 0, 0, 0},
-        {"Force Vector", 0, 0, 0},
-        {"Force Tensor", 0, 0, 0},
-        {0}
+        {"Original Field", 0, nullptr, nullptr},
+        {"Force Scalar", 0, nullptr, nullptr},
+        {"Force Vector", 0, nullptr, nullptr},
+        {"Force Tensor", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[14] = new Fl_Choice(L + 2 * WB, 2 * WB + 10 * BH, IW, BH);
       view.choice[14]->tooltip("View.ForceNumComponents");
@@ -3680,13 +3680,13 @@ optionWindow::optionWindow(int deltaFontSize)
 
       {
         static Fl_Menu_Item menu_vectype[] = {
-          {"Line", 0, 0, 0},
-          {"Arrow", 0, 0, 0},
-          {"Pyramid", 0, 0, 0},
-          {"3D arrow", 0, 0, 0},
-          {"Displacement", 0, 0, 0},
-          {"Comet", 0, 0, 0},
-          {0}
+          {"Line", 0, nullptr, nullptr},
+          {"Arrow", 0, nullptr, nullptr},
+          {"Pyramid", 0, nullptr, nullptr},
+          {"3D arrow", 0, nullptr, nullptr},
+          {"Displacement", 0, nullptr, nullptr},
+          {"Comet", 0, nullptr, nullptr},
+          {nullptr}
         };
         view.choice[2] =
           new Fl_Choice(L + 2 * WB, 2 * WB + 6 * BH, IW, BH, "Vector display");
@@ -3731,9 +3731,9 @@ optionWindow::optionWindow(int deltaFontSize)
       }
 
       static Fl_Menu_Item menu_glyph_loc[] = {
-        {"Barycenter", 0, 0, 0},
-        {"Node", 0, 0, 0},
-        {0}
+        {"Barycenter", 0, nullptr, nullptr},
+        {"Node", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[3] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 10 * BH, IW, BH, "Glyph location");
@@ -3743,10 +3743,10 @@ optionWindow::optionWindow(int deltaFontSize)
       view.choice[3]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_glyph_center[] = {
-        {"Left-aligned", 0, 0, 0},
-        {"Centered", 0, 0, 0},
-        {"Right-aligned", 0, 0, 0},
-        {0}
+        {"Left-aligned", 0, nullptr, nullptr},
+        {"Centered", 0, nullptr, nullptr},
+        {"Right-aligned", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[15] = new Fl_Choice(L + width - (int)(0.85 * IW) - 2 * WB,
                                       2 * WB + 10 * BH, (int)(0.85 * IW), BH);
@@ -3755,14 +3755,14 @@ optionWindow::optionWindow(int deltaFontSize)
       view.choice[15]->callback(view_options_ok_cb);
 
       static Fl_Menu_Item menu_tensor[] = {
-        {"Von-Mises", 0, 0, 0},
-        {"Maximum eigenvalue", 0, 0, 0},
-        {"Minimum eigenvalue", 0, 0, 0},
-        {"Eigenvectors", 0, 0, 0},
-        {"Ellipse", 0, 0, 0},
-        {"Ellipsoid", 0, 0, 0},
-        {"Frame", 0, 0, 0},
-        {0}
+        {"Von-Mises", 0, nullptr, nullptr},
+        {"Maximum eigenvalue", 0, nullptr, nullptr},
+        {"Minimum eigenvalue", 0, nullptr, nullptr},
+        {"Eigenvectors", 0, nullptr, nullptr},
+        {"Ellipse", 0, nullptr, nullptr},
+        {"Ellipsoid", 0, nullptr, nullptr},
+        {"Frame", 0, nullptr, nullptr},
+        {nullptr}
       };
       view.choice[4] =
         new Fl_Choice(L + 2 * WB, 2 * WB + 11 * BH, IW, BH, "Tensor display");
@@ -3942,8 +3942,8 @@ void optionWindow::resetExternalViewList()
   view.choice[11]->add("Self");
   for(std::size_t i = 0; i < PView::list.size(); i++) {
     sprintf(str, "View [%lu]", i);
-    view.choice[10]->add(str, 0, NULL);
-    view.choice[11]->add(str, 0, NULL);
+    view.choice[10]->add(str, 0, nullptr);
+    view.choice[11]->add(str, 0, nullptr);
   }
   if(view.index >= 0 && view.index < (int)PView::list.size()) {
     opt_view_external_view(view.index, GMSH_GUI, 0);
diff --git a/Fltk/optionWindow.h b/Fltk/optionWindow.h
index fe08a93254ee63a87a004170059c224acff5f122..affda3697c3a3a2ae4d9adf3310d2e732ee16e87 100644
--- a/Fltk/optionWindow.h
+++ b/Fltk/optionWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/outputRange.h b/Fltk/outputRange.h
index 59eead4f0077bf3ea1b1466e7bb5f96aa61e1c37..895bbf3587afba736422bf28426fd6b46ad4dbdc 100644
--- a/Fltk/outputRange.h
+++ b/Fltk/outputRange.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -74,7 +74,7 @@ private:
   }
 
 public:
-  outputRange(int x, int y, int w, int h, const char *l = 0)
+  outputRange(int x, int y, int w, int h, const char *l = nullptr)
     : Fl_Group(x, y, w, h, l)
   {
     _graph_val.resize(36, '0');
diff --git a/Fltk/paletteWindow.h b/Fltk/paletteWindow.h
index 2febd60773c478844a5c091e1763345d028a564a..2e3ba35769231622555aea3378a0401227f18f49 100644
--- a/Fltk/paletteWindow.h
+++ b/Fltk/paletteWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -13,7 +13,7 @@
 // the OS-specific shorcuts (Esc & Cmd-w on Mac, Alt+F4 on Windows)
 class paletteWindow : public Fl_Double_Window {
 public:
-  paletteWindow(int w, int h, bool nonModal, const char *l = 0)
+  paletteWindow(int w, int h, bool nonModal, const char *l = nullptr)
     : Fl_Double_Window(w, h, l)
   {
     if(nonModal) set_non_modal();
diff --git a/Fltk/partitionDialog.cpp b/Fltk/partitionDialog.cpp
index 2b70707790abba3d1daaebcb491f6ea387d51ac0..15b4a31556513b0c5c6c001fe8a8244a2cec26ab 100644
--- a/Fltk/partitionDialog.cpp
+++ b/Fltk/partitionDialog.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -210,19 +210,19 @@ void partition_dialog()
 {
   static PartitionDialog dlg;
 
-  static Fl_Menu_Item partitionTypeMenu[] = {{"Metis", 0, 0, 0}, {0}};
+  static Fl_Menu_Item partitionTypeMenu[] = {{"Metis", 0, nullptr, nullptr}, {nullptr}};
 
   static Fl_Menu_Item metisAlgMenu[] = {
-    {"Recursive", 0, 0, 0}, {"K-way", 0, 0, 0}, {0}};
+    {"Recursive", 0, nullptr, nullptr}, {"K-way", 0, nullptr, nullptr}, {nullptr}};
 
   static Fl_Menu_Item metisEdgeMatchingMenu[] = {
-    {"Random", 0, 0, 0}, {"Sorted heavy-edge", 0, 0, 0}, {0}};
+    {"Random", 0, nullptr, nullptr}, {"Sorted heavy-edge", 0, nullptr, nullptr}, {nullptr}};
 
-  static Fl_Menu_Item metisRefineAlgMenu[] = {{"FM-based cut", 0, 0, 0},
-                                              {"Greedy", 0, 0, 0},
-                                              {"Two-sided node FM", 0, 0, 0},
-                                              {"One-sided node FM", 0, 0, 0},
-                                              {0}};
+  static Fl_Menu_Item metisRefineAlgMenu[] = {{"FM-based cut", 0, nullptr, nullptr},
+                                              {"Greedy", 0, nullptr, nullptr},
+                                              {"Two-sided node FM", 0, nullptr, nullptr},
+                                              {"One-sided node FM", 0, nullptr, nullptr},
+                                              {nullptr}};
 
   // This will be resized based on groups that are displayed
   const int h = 8 * WB + 5 * BH + 4;
diff --git a/Fltk/partitionDialog.h b/Fltk/partitionDialog.h
index 6a1cd13f7f5db6aad80f03f9f4331ad8f9b36272..4ed05a07ead99c1ee9ee1674a7f2f76590c29c0b 100644
--- a/Fltk/partitionDialog.h
+++ b/Fltk/partitionDialog.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/pluginWindow.cpp b/Fltk/pluginWindow.cpp
index 3ae15cfa361d5bd497ba3e9c0af5cafb4ef22124..b79ef2b35431769db9980310afaebbf56943ba99 100644
--- a/Fltk/pluginWindow.cpp
+++ b/Fltk/pluginWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -64,7 +64,7 @@ static void plugin_input_cb(Fl_Widget *w, void *data)
 static void plugin_browser_cb(Fl_Widget *w, void *data)
 {
   // get selected plugin
-  GMSH_Plugin *p = 0;
+  GMSH_Plugin *p = nullptr;
   for(int i = 1; i <= FlGui::instance()->plugins->browser->size(); i++) {
     if(FlGui::instance()->plugins->browser->selected(i)) {
       p = (GMSH_Plugin *)FlGui::instance()->plugins->browser->data(i);
@@ -191,8 +191,8 @@ static void plugin_run_cb(Fl_Widget *w, void *data)
             }
           }
           else {
-            pp->execute(0);
-            add_scripting(pp, 0);
+            pp->execute(nullptr);
+            add_scripting(pp, nullptr);
           }
         } catch(GMSH_Plugin *err) {
           char tmp[256];
@@ -202,8 +202,8 @@ static void plugin_run_cb(Fl_Widget *w, void *data)
       }
     }
     if(no_view_selected) {
-      pp->execute(0);
-      add_scripting(pp, 0);
+      pp->execute(nullptr);
+      add_scripting(pp, nullptr);
     }
   }
   else {
@@ -211,7 +211,7 @@ static void plugin_run_cb(Fl_Widget *w, void *data)
   }
 
   FlGui::instance()->updateViews(true, true);
-  GMSH_Plugin::draw = 0;
+  GMSH_Plugin::draw = nullptr;
   drawContext::global()->draw();
 }
 
@@ -327,7 +327,7 @@ pluginWindow::pluginWindow(int deltaFontSize)
   view_browser->callback(plugin_browser_cb);
   view_browser->box(GMSH_SIMPLE_RIGHT_BOX);
 
-  for(std::map<std::string, GMSH_Plugin *>::iterator it =
+  for(auto it =
         PluginManager::instance()->begin();
       it != PluginManager::instance()->end(); ++it) {
     GMSH_Plugin *p = it->second;
@@ -366,7 +366,7 @@ void pluginWindow::show(int viewIndex)
   if(viewIndex >= 0 && viewIndex < (int)PView::list.size()) {
     view_browser->deselect();
     view_browser->select(viewIndex + 1);
-    plugin_browser_cb(NULL, NULL);
+    plugin_browser_cb(nullptr, nullptr);
   }
   win->show();
 }
@@ -400,5 +400,5 @@ void pluginWindow::resetViewBrowser()
     view_browser->deactivate();
   }
 
-  plugin_browser_cb(NULL, NULL);
+  plugin_browser_cb(nullptr, nullptr);
 }
diff --git a/Fltk/pluginWindow.h b/Fltk/pluginWindow.h
index d24c80c42f5526cf1f8a9d338a3b600a26046689..83e9125f1a87b20a78fcc086099be6917a3cff17 100644
--- a/Fltk/pluginWindow.h
+++ b/Fltk/pluginWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/solverButton.cpp b/Fltk/solverButton.cpp
index 9d1f7f10cdb393ee5dde86746366635629d1994d..fea328a8ef34c34c0e2803aa7c7a2078a5374ddc 100644
--- a/Fltk/solverButton.cpp
+++ b/Fltk/solverButton.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -32,7 +32,7 @@ static void solver_rename_cb(Fl_Widget *w, void *data)
     std::string host = opt_solver_remote_login(num, GMSH_GET, "");
     // this will remove the old client if the new name is different
     FlGui::instance()->onelab->addSolver(n, exe, host, num);
-    onelab_cb(0, (void *)"reset");
+    onelab_cb(nullptr, (void *)"reset");
   }
 }
 
@@ -46,7 +46,7 @@ static void solver_change_exe_cb(Fl_Widget *w, void *data)
   int num = (intptr_t)data;
   std::string name = opt_solver_name(num, GMSH_GET, "");
   std::string exe = opt_solver_executable(num, GMSH_GET, "");
-  const char *old = exe.size() ? exe.c_str() : 0;
+  const char *old = exe.size() ? exe.c_str() : nullptr;
   std::string title = "Choose location of " + name + " executable";
   std::string pattern = "*";
 #if defined(WIN32)
@@ -56,11 +56,11 @@ static void solver_change_exe_cb(Fl_Widget *w, void *data)
     exe = fileChooserGetName(1);
     if(exe.size()) {
       // remove old client if it's already loaded
-      onelab::server::citer it = onelab::server::instance()->findClient(name);
+      auto it = onelab::server::instance()->findClient(name);
       if(it != onelab::server::instance()->lastClient()) delete *it;
       std::string host = opt_solver_remote_login(num, GMSH_GET, "");
       FlGui::instance()->onelab->addSolver(name, exe, host, num);
-      onelab_cb(0, (void *)"reset");
+      onelab_cb(nullptr, (void *)"reset");
     }
   }
 }
@@ -79,7 +79,7 @@ static void solver_remove_cb(Fl_Widget *w, void *data)
   opt_solver_executable(num, GMSH_SET, "");
   opt_solver_remote_login(num, GMSH_SET, "");
 
-  onelab::server::citer it = onelab::server::instance()->findClient(name);
+  auto it = onelab::server::instance()->findClient(name);
   if(it != onelab::server::instance()->lastClient()) {
     delete *it;
   }
diff --git a/Fltk/solverButton.h b/Fltk/solverButton.h
index 448edb7aa05703ccf69e29a31bd052062137261b..58565ba83ca7753b35600da6f73a63d3215ac76a 100644
--- a/Fltk/solverButton.h
+++ b/Fltk/solverButton.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/spherePositionWidget.h b/Fltk/spherePositionWidget.h
index 24a1f28c5f63fe94b3a857750966491528791732..2cb84cf17b424e1c645dd034579b464cfb80867d 100644
--- a/Fltk/spherePositionWidget.h
+++ b/Fltk/spherePositionWidget.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -62,7 +62,7 @@ private:
   }
 
 public:
-  spherePositionWidget(int x, int y, int w, const char *l = 0)
+  spherePositionWidget(int x, int y, int w, const char *l = nullptr)
     : Fl_Widget(x, y, w, w, l), _x(0.), _y(0.), _z(0.)
   {
     box(FL_FLAT_BOX);
diff --git a/Fltk/statisticsWindow.cpp b/Fltk/statisticsWindow.cpp
index baa2fcae7096a4bfb95a9c337f6f717d6307552d..16586b6f213a94e3dff0e8ea6f3b87a6b3d809ee 100644
--- a/Fltk/statisticsWindow.cpp
+++ b/Fltk/statisticsWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -205,7 +205,7 @@ statisticsWindow::statisticsWindow(int deltaFontSize)
 
   for(int i = 0; i < num; i++) {
     value[i]->align(FL_ALIGN_RIGHT);
-    value[i]->value(0);
+    value[i]->value(nullptr);
   }
 
   {
@@ -234,7 +234,7 @@ void statisticsWindow::compute(bool elementQuality)
   if(elementQuality)
     GetStatistics(s, quality, visibleOnly);
   else
-    GetStatistics(s, 0, visibleOnly);
+    GetStatistics(s, nullptr, visibleOnly);
 
   // geom
   sprintf(label[num], "%g", s[0]);
diff --git a/Fltk/statisticsWindow.h b/Fltk/statisticsWindow.h
index fbf685b78c7f2a9bca5748a1a3b292b62c31ab3a..fd8fc11bc9b58702a8aea0e4d4d2fd0b50e28de2 100644
--- a/Fltk/statisticsWindow.h
+++ b/Fltk/statisticsWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/touchBar.h b/Fltk/touchBar.h
index 8bbc2e4c9173f4b7a5cdadb98f1e46a727651406..577996e70f48e5014c4dd96c5ad43248ff9985de 100644
--- a/Fltk/touchBar.h
+++ b/Fltk/touchBar.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/touchBar.mm b/Fltk/touchBar.mm
index 18e9c042c7b52aca26f702a46f64f736a3609f06..b8f47504548436715408d5723502c7ca103003cf 100644
--- a/Fltk/touchBar.mm
+++ b/Fltk/touchBar.mm
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/treeIcons.h b/Fltk/treeIcons.h
index 8a85af4f6a55a8a80c66ea699721822560708d95..7cc2ba9ba926c552e5669085d31a4dd4981bebf1 100644
--- a/Fltk/treeIcons.h
+++ b/Fltk/treeIcons.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/viewButton.cpp b/Fltk/viewButton.cpp
index bedb94d7ba6b1dcefc4d50fb881c8c325af7e6ed..e78e2b1400b1b919d8225036fbbf504f197999e7 100644
--- a/Fltk/viewButton.cpp
+++ b/Fltk/viewButton.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -66,7 +66,7 @@ static void view_reload(int index)
       // delete old data and replace with new
       delete p->getData();
       p->setData(PView::list.back()->getData());
-      PView::list.back()->setData(0);
+      PView::list.back()->setData(nullptr);
       // delete new view
       delete PView::list.back();
       // in case the reloaded view has a different number of time steps
@@ -170,7 +170,7 @@ static void view_save_cb(Fl_Widget *w, void *data)
     if(confirmOverwrite) {
       if(!StatFile(name))
         if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?",
-                      "Cancel", "Replace", 0, name.c_str()))
+                      "Cancel", "Replace", nullptr, name.c_str()))
           goto test;
     }
     int format = 0;
@@ -323,7 +323,7 @@ viewButton::viewButton(int x, int y, int w, int h, int num, Fl_Color col)
   _popup->add("Remove Views/With Same Name", 0,
               (Fl_Callback *)view_remove_all_cb, (void *)(intptr_t)num, 0);
 
-  _popup->add("Sort By Name", 0, (Fl_Callback *)view_sort_cb, (void *)0, 0);
+  _popup->add("Sort By Name", 0, (Fl_Callback *)view_sort_cb, (void *)nullptr, 0);
   _popup->add("Set Visibility/All On", 0, (Fl_Callback *)view_all_visible_cb,
               (void *)-1, 0);
   _popup->add("Set Visibility/All Off", 0, (Fl_Callback *)view_all_visible_cb,
diff --git a/Fltk/viewButton.h b/Fltk/viewButton.h
index 9d167de94d61e4df01f0468aee60e62c66fce869..0aa1e9fb417cdcf2b19590826d4d9a3c0a8e8303 100644
--- a/Fltk/viewButton.h
+++ b/Fltk/viewButton.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp
index 677325458dee012441c7b61d937051f3efe58e6e..5957a433027442c15bbea44c8b76bf659556f3e8 100644
--- a/Fltk/visibilityWindow.cpp
+++ b/Fltk/visibilityWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -108,7 +108,7 @@ static void setVisibilityOnOtherModels(GEntity *ge, char val, bool recursive)
   for(std::size_t i = 0; i < GModel::list.size(); i++) {
     GModel *m2 = GModel::list[i];
     if(m2 != ge->model()) {
-      GEntity *ge2 = 0;
+      GEntity *ge2 = nullptr;
       switch(ge->dim()) {
       case 0: ge2 = m2->getVertexByTag(ge->tag()); break;
       case 1: ge2 = m2->getEdgeByTag(ge->tag()); break;
@@ -261,7 +261,7 @@ public:
   {
     std::map<int, std::string> oldLabels;
 #if defined(HAVE_PARSER)
-    for(std::map<std::string, gmsh_yysymbol>::iterator it =
+    for(auto it =
           gmsh_yysymbols.begin();
         it != gmsh_yysymbols.end(); ++it)
       if(it->first.size())
@@ -372,7 +372,7 @@ public:
   int getSortMode() { return _sortMode; }
 };
 
-VisibilityList *VisibilityList::_instance = 0;
+VisibilityList *VisibilityList::_instance = nullptr;
 
 static void _rebuild_list_browser()
 {
@@ -469,7 +469,7 @@ static void visibility_sort_cb(Fl_Widget *w, void *data)
   }
   else { // set new sorting mode
     VisibilityList::instance()->setSortMode(val);
-    visibility_cb(NULL, (void *)"list_only");
+    visibility_cb(nullptr, (void *)"list_only");
   }
 }
 
@@ -486,14 +486,14 @@ class listBrowser : public Fl_Browser {
         return 1;
       }
       else if(Fl::test_shortcut(FL_Enter) || Fl::test_shortcut(FL_KP_Enter)) {
-        visibility_browser_apply_cb(NULL, NULL);
+        visibility_browser_apply_cb(nullptr, nullptr);
         if(l) Fl_Browser_::select(l);
         return 1;
       }
       else if(Fl::test_shortcut(FL_Up)) {
         if(l && (l = item_prev(l))) {
           select_only(l, 1);
-          visibility_browser_apply_cb(NULL, NULL);
+          visibility_browser_apply_cb(nullptr, nullptr);
           Fl_Browser_::select(l);
           return 1;
         }
@@ -501,7 +501,7 @@ class listBrowser : public Fl_Browser {
       else if(Fl::test_shortcut(FL_Down)) {
         if(l && (l = item_next(l))) {
           select_only(l, 1);
-          visibility_browser_apply_cb(NULL, NULL);
+          visibility_browser_apply_cb(nullptr, nullptr);
           Fl_Browser_::select(l);
           return 1;
         }
@@ -511,7 +511,7 @@ class listBrowser : public Fl_Browser {
   }
 
 public:
-  listBrowser(int x, int y, int w, int h, const char *c = 0)
+  listBrowser(int x, int y, int w, int h, const char *c = nullptr)
     : Fl_Browser(x, y, w, h, c)
   {
   }
@@ -560,7 +560,7 @@ static void _add_face(GFace *gf, Fl_Tree *tree, const std::string &path)
   n->user_data((void *)gf);
   n->close();
   std::vector<GEdge *> const &edges = gf->edges();
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); it++)
     _add_edge(*it, tree, face.str());
 }
@@ -578,7 +578,7 @@ static void _add_region(GRegion *gr, Fl_Tree *tree, const std::string &path)
   n->user_data((void *)gr);
   n->close();
   std::vector<GFace *> faces = gr->faces();
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++)
     _add_face(*it, tree, region.str());
 }
@@ -666,13 +666,13 @@ static void _rebuild_tree_browser(bool force)
     std::string elementary = model.str() + "Elementary entities/";
     n = FlGui::instance()->visibility->tree->add(elementary.c_str());
     if(n) n->close();
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++)
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++)
       _add_region(*it, FlGui::instance()->visibility->tree, elementary);
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
+    for(auto it = m->firstFace(); it != m->lastFace(); it++)
       _add_face(*it, FlGui::instance()->visibility->tree, elementary);
-    for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
+    for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
       _add_edge(*it, FlGui::instance()->visibility->tree, elementary);
-    for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); it++)
+    for(auto it = m->firstVertex(); it != m->lastVertex(); it++)
       _add_vertex(*it, FlGui::instance()->visibility->tree, elementary);
 
     std::string physical = model.str() + "Physical groups/";
@@ -683,7 +683,7 @@ static void _rebuild_tree_browser(bool force)
     m->getPhysicalGroups(groups);
     std::map<int, std::string> oldLabels;
 #if defined(HAVE_PARSER)
-    for(std::map<std::string, gmsh_yysymbol>::iterator it =
+    for(auto it =
           gmsh_yysymbols.begin();
         it != gmsh_yysymbols.end(); ++it)
       if(it->first.size())
@@ -692,7 +692,7 @@ static void _rebuild_tree_browser(bool force)
             std::string("(") + it->first + ")";
 #endif
     for(int i = 3; i >= 0; i--)
-      for(std::map<int, std::vector<GEntity *> >::iterator it =
+      for(auto it =
             groups[i].begin();
           it != groups[i].end(); it++)
         _add_physical_group(i, it->first, it->second, oldLabels,
@@ -789,7 +789,7 @@ class treeBrowser : public Fl_Tree {
     case FL_SHORTCUT:
     case FL_KEYBOARD:
       if(Fl::test_shortcut(FL_Enter) || Fl::test_shortcut(FL_KP_Enter)) {
-        visibility_tree_apply_cb(NULL, NULL);
+        visibility_tree_apply_cb(nullptr, nullptr);
         return 1;
       }
     }
@@ -797,7 +797,7 @@ class treeBrowser : public Fl_Tree {
   }
 
 public:
-  treeBrowser(int x, int y, int w, int h, const char *c = 0)
+  treeBrowser(int x, int y, int w, int h, const char *c = nullptr)
     : Fl_Tree(x, y, w, h, c)
   {
   }
@@ -827,16 +827,16 @@ static void visibility_save_cb(Fl_Widget *w, void *data)
   // get the whole visibility information in geo format
   std::vector<int> state[4][2];
   GModel *m = GModel::current();
-  for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); it++)
+  for(auto it = m->firstVertex(); it != m->lastVertex(); it++)
     (*it)->getVisibility() ? state[0][1].push_back((*it)->tag()) :
                              state[0][0].push_back((*it)->tag());
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
+  for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
     (*it)->getVisibility() ? state[1][1].push_back((*it)->tag()) :
                              state[1][0].push_back((*it)->tag());
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
+  for(auto it = m->firstFace(); it != m->lastFace(); it++)
     (*it)->getVisibility() ? state[2][1].push_back((*it)->tag()) :
                              state[2][0].push_back((*it)->tag());
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); it++)
     (*it)->getVisibility() ? state[3][1].push_back((*it)->tag()) :
                              state[3][0].push_back((*it)->tag());
   std::vector<std::pair<int, int> > entities;
@@ -895,41 +895,41 @@ static void _set_visibility_by_number(int what, int num, char val,
         }
         break;
       case 2: // point
-        for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); it++)
+        for(auto it = m->firstVertex(); it != m->lastVertex(); it++)
           if(all || (*it)->tag() == num) (*it)->setVisibility(val, recursive);
         break;
       case 3: // line
-        for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
+        for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
           if(all || (*it)->tag() == num) (*it)->setVisibility(val, recursive);
         break;
       case 4: // surface
-        for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
+        for(auto it = m->firstFace(); it != m->lastFace(); it++)
           if(all || (*it)->tag() == num) (*it)->setVisibility(val, recursive);
         break;
       case 5: // volume
-        for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++)
+        for(auto it = m->firstRegion(); it != m->lastRegion(); it++)
           if(all || (*it)->tag() == num) (*it)->setVisibility(val, recursive);
         break;
       case 6: // physical point
-        for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); it++)
+        for(auto it = m->firstVertex(); it != m->lastVertex(); it++)
           for(std::size_t i = 0; i < (*it)->physicals.size(); i++)
             if(all || std::abs((*it)->physicals[i]) == num)
               (*it)->setVisibility(val, recursive);
         break;
       case 7: // physical line
-        for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
+        for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
           for(std::size_t i = 0; i < (*it)->physicals.size(); i++)
             if(all || std::abs((*it)->physicals[i]) == num)
               (*it)->setVisibility(val, recursive);
         break;
       case 8: // physical surface
-        for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
+        for(auto it = m->firstFace(); it != m->lastFace(); it++)
           for(std::size_t i = 0; i < (*it)->physicals.size(); i++)
             if(all || std::abs((*it)->physicals[i]) == num)
               (*it)->setVisibility(val, recursive);
         break;
       case 9: // physical volume
-        for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++)
+        for(auto it = m->firstRegion(); it != m->lastRegion(); it++)
           for(std::size_t i = 0; i < (*it)->physicals.size(); i++)
             if(all || std::abs((*it)->physicals[i]) == num)
               (*it)->setVisibility(val, recursive);
@@ -1000,7 +1000,7 @@ static void _apply_visibility(char mode, bool physical,
     }
   }
   int pos = FlGui::instance()->visibility->browser->position();
-  visibility_cb(NULL, (void *)"redraw_only");
+  visibility_cb(nullptr, (void *)"redraw_only");
   FlGui::instance()->visibility->browser->position(pos);
 }
 
@@ -1032,7 +1032,7 @@ static void visibility_number_cb(Fl_Widget *w, void *data)
   _set_visibility_by_number(what, num, val, recursive, allmodels);
 
   int pos = FlGui::instance()->visibility->browser->position();
-  visibility_cb(NULL, (void *)"redraw_only");
+  visibility_cb(nullptr, (void *)"redraw_only");
   FlGui::instance()->visibility->browser->position(pos);
   drawContext::global()->draw();
 }
@@ -1217,7 +1217,7 @@ static void tree_cb(Fl_Widget *w, void *data)
   if(tree->callback_reason() == FL_TREE_REASON_RESELECTED && Fl::event_clicks()) {
     // double click
     Fl_Tree_Item *item = (Fl_Tree_Item *)tree->callback_item();
-    GEntity *ge = 0;
+    GEntity *ge = nullptr;
     if(item) {
       if(item->user_data()) {
         ge = (GEntity*)item->user_data();
@@ -1322,7 +1322,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize)
        (void *)"list_only"},
       {"Physical groups", 0, (Fl_Callback *)visibility_cb, (void *)"list_only"},
       {"Mesh partitions", 0, (Fl_Callback *)visibility_cb, (void *)"list_only"},
-      {0}};
+      {nullptr}};
 
     double w1 = 1.7 * CC;
     double w3 = CC;
@@ -1381,7 +1381,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize)
   {
     Fl_Group *g = new Fl_Group(WB, WB + BH, width - 2 * WB,
                                height - 3 * WB - 2 * BH, "Numeric");
-    g->resizable(NULL);
+    g->resizable(nullptr);
 
     int yy = 2 * WB + BH;
     for(int i = 0; i < 10; i++) {
@@ -1451,7 +1451,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize)
   {
     Fl_Group *g = new Fl_Group(WB, WB + BH, width - 2 * WB,
                                height - 3 * WB - 2 * BH, "Interactive");
-    g->resizable(NULL);
+    g->resizable(nullptr);
 
     Fl_Button *bb[20];
     int ll = width / 2 - BH - WB - IW;
@@ -1555,7 +1555,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize)
     int aw = (int)(3.5 * FL_NORMAL_SIZE);
 
     Fl_Group *g = new Fl_Group(WB, height - BH - WB, width - 2 * WB - CC, BH);
-    g->resizable(NULL);
+    g->resizable(nullptr);
 
     Fl_Box *b = new Fl_Box(WB, height - BH - WB, aw, BH, "Apply");
     b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
@@ -1600,7 +1600,7 @@ void visibilityWindow::show(bool redrawOnly)
 
 void visibilityWindow::updatePerWindow(bool force)
 {
-  static openglWindow *gl = 0;
+  static openglWindow *gl = nullptr;
   if(!force && gl == FlGui::instance()->getCurrentOpenglWindow()) return;
 
   gl = FlGui::instance()->getCurrentOpenglWindow();
diff --git a/Fltk/visibilityWindow.h b/Fltk/visibilityWindow.h
index 082ed1bfd2c26d3f51677692262a1f354a495d37..74cb4dd3fcea82357c058ce86ceffc5ae1be9a98 100644
--- a/Fltk/visibilityWindow.h
+++ b/Fltk/visibilityWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSCommon.cpp b/Geo/CGNSCommon.cpp
index 98b6fb80a06b90723f6f94cbc633212ca14ac2f2..b6b780bd2c88bb9188138b1a927829540dfd4130 100644
--- a/Geo/CGNSCommon.cpp
+++ b/Geo/CGNSCommon.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSCommon.h b/Geo/CGNSCommon.h
index e038971bb0cf240fa99557bf3fcc2f7512de334f..578bf79ac145cdb1fabab60a73babee5733284e1 100644
--- a/Geo/CGNSCommon.h
+++ b/Geo/CGNSCommon.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSConventions.cpp b/Geo/CGNSConventions.cpp
index 8005633acda2f1da0aa0b1da1e2e68828093d3f2..03dfaa6290da5fe8b3f1cee58b087ef709d6aeba 100644
--- a/Geo/CGNSConventions.cpp
+++ b/Geo/CGNSConventions.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSConventions.h b/Geo/CGNSConventions.h
index 9d1b23da60b8f1b2c0bbe18547fd55367776f808..eefb2fe8de0ca849a07f59b15b10eb1f00bef1d8 100644
--- a/Geo/CGNSConventions.h
+++ b/Geo/CGNSConventions.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSRead.cpp b/Geo/CGNSRead.cpp
index 12e3034d1a29b904f275735b4bb0722920ec7b66..d80b40d5b37597860b04c19927f0b86d211883d6 100644
--- a/Geo/CGNSRead.cpp
+++ b/Geo/CGNSRead.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSRead.h b/Geo/CGNSRead.h
index abcfc496a31fea61a72ba03981b8b5ab03f245fc..b2496b478ee1ff3254711fe98534e48b46f139f0 100644
--- a/Geo/CGNSRead.h
+++ b/Geo/CGNSRead.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSWrite.cpp b/Geo/CGNSWrite.cpp
index 54abc18666edbd32fea188ef8e5b5d0c958f1719..df90ee489ddb0f3fc59fa66e57d56e9604d0acd8 100644
--- a/Geo/CGNSWrite.cpp
+++ b/Geo/CGNSWrite.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSWrite.h b/Geo/CGNSWrite.h
index 4d55c39c965855403f4fd4f46fd91406b69921ab..dbe69938f9e6ecc87eedc70b52c9296a16948543 100644
--- a/Geo/CGNSWrite.h
+++ b/Geo/CGNSWrite.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues
diff --git a/Geo/CGNSWriteStruct.cpp b/Geo/CGNSWriteStruct.cpp
index 211da5af0eea4465c1b8b22c0a320cbf10f3e0a9..a18ad91436f9e90bbc519f6a60e36e1ce13a3485 100644
--- a/Geo/CGNSWriteStruct.cpp
+++ b/Geo/CGNSWriteStruct.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSWriteStruct.h b/Geo/CGNSWriteStruct.h
index b5ed4214b01e10712c77c31eb85b5424f3d244e8..65b5d7dc6d2338caaf3b343634da776c6fcbf191 100644
--- a/Geo/CGNSWriteStruct.h
+++ b/Geo/CGNSWriteStruct.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues
diff --git a/Geo/CGNSZone.cpp b/Geo/CGNSZone.cpp
index 5e9784cc5a2b6af9e1389996d382a2aebf08cc7d..8ab881a409c68c81bda2843b709ad5b31cfc0697 100644
--- a/Geo/CGNSZone.cpp
+++ b/Geo/CGNSZone.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSZone.h b/Geo/CGNSZone.h
index fa3e9ca760825d8686bdad3f97de466e9ff2f17c..8436ac0bdc8eb02fe826a24efa271462f3032fe3 100644
--- a/Geo/CGNSZone.h
+++ b/Geo/CGNSZone.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSZoneStruct.cpp b/Geo/CGNSZoneStruct.cpp
index a1bbeb544b9aee25e6068a2c9ab61f242bf859f9..73132decf0cf45679570a75557f48c8d05849920 100644
--- a/Geo/CGNSZoneStruct.cpp
+++ b/Geo/CGNSZoneStruct.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSZoneStruct.h b/Geo/CGNSZoneStruct.h
index 61c1e44c7b6f4dbd5c966cbf57a210a2c244485b..2efb778f9086d6e1fbb213cdac9179dc0a880709 100644
--- a/Geo/CGNSZoneStruct.h
+++ b/Geo/CGNSZoneStruct.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSZoneUnstruct.cpp b/Geo/CGNSZoneUnstruct.cpp
index a677ac4a98160cd8b0b59be312dffeadccd446fd..e34328f1e621930be9b355b150868e38ed274bd5 100644
--- a/Geo/CGNSZoneUnstruct.cpp
+++ b/Geo/CGNSZoneUnstruct.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CGNSZoneUnstruct.h b/Geo/CGNSZoneUnstruct.h
index b49c6c70ddf056b84f8a69040dbb1b1dc4f67568..62c12b6416c96aee52b1ec1269c29a96529d3f97 100644
--- a/Geo/CGNSZoneUnstruct.h
+++ b/Geo/CGNSZoneUnstruct.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CMakeLists.txt b/Geo/CMakeLists.txt
index 396001468c4707d3f824a9fc9bd48671cf1c7652..820b2ac124449e351f850dc147d642e6308648b9 100644
--- a/Geo/CMakeLists.txt
+++ b/Geo/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Cell.cpp b/Geo/Cell.cpp
index 83fde015649e923cd72e97e81775758d4d1b4fa8..afeb5808684836f649328b63a79feda2a325346a 100644
--- a/Geo/Cell.cpp
+++ b/Geo/Cell.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Cell.h b/Geo/Cell.h
index e00bf0caa52864ba47b6ecaddc9da5fc92869599..ce70e2b19589b9d42153ea9af31aaa1f425c246d 100644
--- a/Geo/Cell.h
+++ b/Geo/Cell.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CellComplex.cpp b/Geo/CellComplex.cpp
index d2ce3c3b98f0c742a2556380567dcc00ba0094ec..d17b324035fd4a3824b706ab1b6644ea02428665 100644
--- a/Geo/CellComplex.cpp
+++ b/Geo/CellComplex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/CellComplex.h b/Geo/CellComplex.h
index ac42da3716a7cf6f4fe002737d7d611f3b48e36a..5750d587263e4539127390a5a3b1c87d10494a62 100644
--- a/Geo/CellComplex.h
+++ b/Geo/CellComplex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Chain.cpp b/Geo/Chain.cpp
index 36715bdbcd0a24f5502806636e789555e3ade066..9f0932846f767b4f299be9b9524580aea47e6f17 100644
--- a/Geo/Chain.cpp
+++ b/Geo/Chain.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Chain.h b/Geo/Chain.h
index 3d7af201150a3f7bae22d6173f1fc0c32f0bf027..5d80054fff72822158fc2447b1d7cffd20a34f9e 100644
--- a/Geo/Chain.h
+++ b/Geo/Chain.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ChainComplex.cpp b/Geo/ChainComplex.cpp
index d0a3d1900dbb2f7c71510a553c60f329508b4527..34069852d8081041ac11a7cc36b8fb16adf8a4b6 100644
--- a/Geo/ChainComplex.cpp
+++ b/Geo/ChainComplex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ChainComplex.h b/Geo/ChainComplex.h
index 5137bc5557b8bbcbffcff0eeee34eb8c5b255972..4cd25c3972a57e0ceddde3a426ad49fba32417bb 100644
--- a/Geo/ChainComplex.h
+++ b/Geo/ChainComplex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ExtrudeParams.cpp b/Geo/ExtrudeParams.cpp
index 84572dfa7399c775933cf8101b02f310ef7f38ed..5e989fd0105550a3a84f1b3e2a1905763b4504a5 100644
--- a/Geo/ExtrudeParams.cpp
+++ b/Geo/ExtrudeParams.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ExtrudeParams.h b/Geo/ExtrudeParams.h
index 9475482e830f3a4e44ef7a049509eb8aa437997b..3f5ce6aeb14fa0e654e83c4ab94e787d53b2fca1 100644
--- a/Geo/ExtrudeParams.h
+++ b/Geo/ExtrudeParams.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp
index 911e125af5e25cd7b734ff43686a479b58556514..2b7db06efb9edf76e4f11700c728ae2286828957 100644
--- a/Geo/GEdge.cpp
+++ b/Geo/GEdge.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GEdge.h b/Geo/GEdge.h
index 4b4ee8e141bc7842bd2266398a403fcfc8dbc1a0..7c3097ef7346b9cea18411cec29edcfab1c34583 100644
--- a/Geo/GEdge.h
+++ b/Geo/GEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GEdgeLoop.cpp b/Geo/GEdgeLoop.cpp
index c6a1b451fc6e3f70bdada670e70c14227e9c3acc..75c5a575b4da922b0df3569524fc7755afacf183 100644
--- a/Geo/GEdgeLoop.cpp
+++ b/Geo/GEdgeLoop.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GEdgeLoop.h b/Geo/GEdgeLoop.h
index 2e95ee3ff981842b9bdb9bf66a1553a8d929f5d8..0b3df4a33fc54011281f49784f714e4996cd957d 100644
--- a/Geo/GEdgeLoop.h
+++ b/Geo/GEdgeLoop.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GEntity.cpp b/Geo/GEntity.cpp
index 77a13498d31932b0bc856061dc2ad60ce89c11f9..6a732d9f9d9dd3c85019941885694ba9f1949030 100644
--- a/Geo/GEntity.cpp
+++ b/Geo/GEntity.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GEntity.h b/Geo/GEntity.h
index 053e01bf7b0abbf8c04ab34cad00e9c12fc2e0c2..b59178392f63b6beb4785a3accf5790ce5018388 100644
--- a/Geo/GEntity.h
+++ b/Geo/GEntity.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp
index afaf675514145bdd62e03899be3a3f7daca3c67d..d5bfe85ee0c98cc9e50fc3bc7acf00cde9a39ab6 100644
--- a/Geo/GFace.cpp
+++ b/Geo/GFace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GFace.h b/Geo/GFace.h
index 70390e6d3abad3e007b93380afe3b400b8484766..dab4b377575a1cf8e2ae73a6e33e559fd4489fdd 100644
--- a/Geo/GFace.h
+++ b/Geo/GFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 3ef69115e3ed3784513145d8f1bc46360f59a434..332cd8690b6c55d403c216ba24b55a086f605fba 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModel.h b/Geo/GModel.h
index a7c5629c7974b09feb38138533761c7c6bc03bdb..1ec7bc18a6194015e380a4e82f02f5c87be9ae68 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelCreateTopologyFromMesh.cpp b/Geo/GModelCreateTopologyFromMesh.cpp
index c7d6217abd73efdc67fa93125b7764846274cecb..2e2ecd9c6bc267b2540d406be7744f79351d5a44 100644
--- a/Geo/GModelCreateTopologyFromMesh.cpp
+++ b/Geo/GModelCreateTopologyFromMesh.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelCreateTopologyFromMesh.h b/Geo/GModelCreateTopologyFromMesh.h
index a865ce9da0a83abaa4eb871021f92d06f7a9fc76..d157cc46831569883335c5d15cb761f4fd9211d3 100644
--- a/Geo/GModelCreateTopologyFromMesh.h
+++ b/Geo/GModelCreateTopologyFromMesh.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_ACTRAN.cpp b/Geo/GModelIO_ACTRAN.cpp
index e18b4e74caaefb8fe69661b051794ca18bf15c98..d644f0a68b2851486770246f829a64225f01a62c 100644
--- a/Geo/GModelIO_ACTRAN.cpp
+++ b/Geo/GModelIO_ACTRAN.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_BDF.cpp b/Geo/GModelIO_BDF.cpp
index 5b8bc6c0a57de58920b4b02ec330c5463f3f342e..e56fa822a63edb08992907bc0ce98902c46648c8 100644
--- a/Geo/GModelIO_BDF.cpp
+++ b/Geo/GModelIO_BDF.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_CGNS.cpp b/Geo/GModelIO_CGNS.cpp
index 342fb44a20af99ecbd560159f86d60b0ebfc98eb..3ba99356877a0ef39fc8f96f14f2265cca514b25 100644
--- a/Geo/GModelIO_CGNS.cpp
+++ b/Geo/GModelIO_CGNS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_DIFF.cpp b/Geo/GModelIO_DIFF.cpp
index eaa525892c71edfed63d2920523dc560f4c23040..f28fc0683fb6c16e075ccffc44cfc490656530ea 100644
--- a/Geo/GModelIO_DIFF.cpp
+++ b/Geo/GModelIO_DIFF.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_GEO.cpp b/Geo/GModelIO_GEO.cpp
index 298f63d8a886853501b3a1310341ffcceeb52292..50a5665224902d2ccaa5b052fd48b9c211486435 100644
--- a/Geo/GModelIO_GEO.cpp
+++ b/Geo/GModelIO_GEO.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_GEO.h b/Geo/GModelIO_GEO.h
index 8f3c9b270939a0ce99c399adacde1ce2f9f53669..8198e42a3982de2a35ec67d16db16fcaf3610762 100644
--- a/Geo/GModelIO_GEO.h
+++ b/Geo/GModelIO_GEO.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_GEOM.cpp b/Geo/GModelIO_GEOM.cpp
index 3005d2eb3f22c6dc0fe3ca8b778b9edc696ac6ca..932783130b1bf603116f119d66da4a48387e9fc3 100644
--- a/Geo/GModelIO_GEOM.cpp
+++ b/Geo/GModelIO_GEOM.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_INP.cpp b/Geo/GModelIO_INP.cpp
index 828075c183c9bcdb052b1857106cb3581b516577..7ae0c16c9d0e90261476bbb991032a8e36c23b59 100644
--- a/Geo/GModelIO_INP.cpp
+++ b/Geo/GModelIO_INP.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_IR3.cpp b/Geo/GModelIO_IR3.cpp
index b95a3578cbe1c136817549d5f7802a4a7ce54971..c7a7b33c6f7c7b8944ffae20c64f1c632ee7a0ae 100644
--- a/Geo/GModelIO_IR3.cpp
+++ b/Geo/GModelIO_IR3.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_KEY.cpp b/Geo/GModelIO_KEY.cpp
index 676b15456f7266b7e90d47be6eeda835042f1782..20ec42e49eac7ee6a6672de3d265c86028ea292e 100644
--- a/Geo/GModelIO_KEY.cpp
+++ b/Geo/GModelIO_KEY.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MAIL.cpp b/Geo/GModelIO_MAIL.cpp
index f0d0e5d68cd22397c60f81650720e2971d6627e0..547115e34270162fa763a5907bdde74113f02645 100644
--- a/Geo/GModelIO_MAIL.cpp
+++ b/Geo/GModelIO_MAIL.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MATLAB.cpp b/Geo/GModelIO_MATLAB.cpp
index bfc855ab3cf74648cb341e30ed6cc360a0fb0b95..ccc0eb475263f0ce040740e07fc10de7d174afdb 100644
--- a/Geo/GModelIO_MATLAB.cpp
+++ b/Geo/GModelIO_MATLAB.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MED.cpp b/Geo/GModelIO_MED.cpp
index 00e538276fff0be0052944106d2cb0f175753e8f..cab954ca7db0e5538aaa6186bafeae849539a3dc 100644
--- a/Geo/GModelIO_MED.cpp
+++ b/Geo/GModelIO_MED.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MESH.cpp b/Geo/GModelIO_MESH.cpp
index 31d6734862c6cec8986d2c1df195058c8d3c4bfa..7a22e54dd2d21559224a4ccb53ce533844c64ab0 100644
--- a/Geo/GModelIO_MESH.cpp
+++ b/Geo/GModelIO_MESH.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MSH.cpp b/Geo/GModelIO_MSH.cpp
index 686e621110befad7f4cbd78128958738c2fb50e5..700c7fb2c7a7f276cae8c2b197ef59dcf52d1ac8 100644
--- a/Geo/GModelIO_MSH.cpp
+++ b/Geo/GModelIO_MSH.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MSH2.cpp b/Geo/GModelIO_MSH2.cpp
index 39ffd0f126fe6831ee10aa2972c743f96335be0b..5f558f1e539a17d822af222703048c8c0abb67a5 100644
--- a/Geo/GModelIO_MSH2.cpp
+++ b/Geo/GModelIO_MSH2.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MSH3.cpp b/Geo/GModelIO_MSH3.cpp
index 75ff216140228ca61d2ca96f4598bb249613f27c..09c412df961fe59760022f9c4b56fb90f8842469 100644
--- a/Geo/GModelIO_MSH3.cpp
+++ b/Geo/GModelIO_MSH3.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_MSH4.cpp b/Geo/GModelIO_MSH4.cpp
index 441c0d123a4a5cab5a16ae05668b33f68066b26c..adebb682106a068d83ec5f53287cc777873f0be4 100644
--- a/Geo/GModelIO_MSH4.cpp
+++ b/Geo/GModelIO_MSH4.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_NEU.cpp b/Geo/GModelIO_NEU.cpp
index 5311fb17a4e3c35764ea6e35dc884c98ff7246aa..64757e0733183028413d33851a45b7956ce39295 100644
--- a/Geo/GModelIO_NEU.cpp
+++ b/Geo/GModelIO_NEU.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp
index 783e61efbd9923e6b3076d2eed80a02266f23522..31b358866ee9e3bcaaf783cb12ce80524c9a9b22 100644
--- a/Geo/GModelIO_OCC.cpp
+++ b/Geo/GModelIO_OCC.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_OCC.h b/Geo/GModelIO_OCC.h
index 33e2bf25ea098e4766fecbd7fe3e4a5c376f724c..55b094d27a736ff2187cf4043c6e5aa4cf77ce8f 100644
--- a/Geo/GModelIO_OCC.h
+++ b/Geo/GModelIO_OCC.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_P3D.cpp b/Geo/GModelIO_P3D.cpp
index bfc93d1aa5d18d9b25b3cc3f2f96446e5f200644..7b6af8bad997c487e332a41c49639e8021637236 100644
--- a/Geo/GModelIO_P3D.cpp
+++ b/Geo/GModelIO_P3D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_PLY.cpp b/Geo/GModelIO_PLY.cpp
index 3f43709a5bfac171acd4e90171a7e82fc84faf23..0a113a674b6044534a3d42c8fb94321ea13f993f 100644
--- a/Geo/GModelIO_PLY.cpp
+++ b/Geo/GModelIO_PLY.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_POS.cpp b/Geo/GModelIO_POS.cpp
index ae3f7d66a411fbc451e2c0c7e82367e6c735ee9d..86da7e3ddcf83e9115eeba347afed02fc1370abd 100644
--- a/Geo/GModelIO_POS.cpp
+++ b/Geo/GModelIO_POS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_SAMCEF.cpp b/Geo/GModelIO_SAMCEF.cpp
index 138d92f5a7673d0de68370ceb0d60ea9f39c6477..40c614693e98929e22dc9fe35cc845285403f183 100644
--- a/Geo/GModelIO_SAMCEF.cpp
+++ b/Geo/GModelIO_SAMCEF.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_STL.cpp b/Geo/GModelIO_STL.cpp
index d271d506486cb920cd2b12cfdf1f32c6df5eec62..1891c76bcc35c2747eca08765a626871a600308e 100644
--- a/Geo/GModelIO_STL.cpp
+++ b/Geo/GModelIO_STL.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_SU2.cpp b/Geo/GModelIO_SU2.cpp
index a6e324e1e288afde2a9c67eb43bb7918c26c5ddb..18340c04941c5c684003375693339699e9822800 100644
--- a/Geo/GModelIO_SU2.cpp
+++ b/Geo/GModelIO_SU2.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_UNV.cpp b/Geo/GModelIO_UNV.cpp
index 2cb6c9ccda7ea33349d2aae59d92f9afed5050c3..f7cba2529d7f421cd0a9daff54ebb8319e35b062 100644
--- a/Geo/GModelIO_UNV.cpp
+++ b/Geo/GModelIO_UNV.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_VRML.cpp b/Geo/GModelIO_VRML.cpp
index 988b92979341a6e59a3c3d74c0b015927693f7b3..8559c643202b397d1d9c934deaa82d301611b8a5 100644
--- a/Geo/GModelIO_VRML.cpp
+++ b/Geo/GModelIO_VRML.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_VTK.cpp b/Geo/GModelIO_VTK.cpp
index 3ccaed8dd1ed582cb33b464d5a4c654a152b221f..013850f1f65a848b9ca606bbd1f8a4d214a606a1 100644
--- a/Geo/GModelIO_VTK.cpp
+++ b/Geo/GModelIO_VTK.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelIO_X3D.cpp b/Geo/GModelIO_X3D.cpp
index 1e2c405ea41b7f1a00027bba4338d1e8c3fc7011..15f4b9eb280a9f5b93aa4f6899310bec91f4720a 100644
--- a/Geo/GModelIO_X3D.cpp
+++ b/Geo/GModelIO_X3D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle and Jeremy Theler
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle and Jeremy Theler
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelParametrize.cpp b/Geo/GModelParametrize.cpp
index d52e28b3876c6e56423f8d46e46a834c1f158159..8f336254ca34482fa6f02e1fe0bd2ba615c82799 100644
--- a/Geo/GModelParametrize.cpp
+++ b/Geo/GModelParametrize.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelParametrize.h b/Geo/GModelParametrize.h
index d58a9ec6e5a6d392c28f4e2656ddf76b989ebb28..1e217818a05e684a0ef58b109140e5f3645fe3c5 100644
--- a/Geo/GModelParametrize.h
+++ b/Geo/GModelParametrize.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GModelVertexArrays.cpp b/Geo/GModelVertexArrays.cpp
index acda27e710a7ae9810ba1d3a1431fab0d78413b1..da0058268cf241fa962b57f971536973b27f1b81 100644
--- a/Geo/GModelVertexArrays.cpp
+++ b/Geo/GModelVertexArrays.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GPoint.h b/Geo/GPoint.h
index 54c48dc9efb16d9652b202cc2f43305e27f2adc2..9fdc5c343a5624dc1a9f27e777b48f9ffb12cf05 100644
--- a/Geo/GPoint.h
+++ b/Geo/GPoint.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GRegion.cpp b/Geo/GRegion.cpp
index 1be089c78bd8961a21738d7ff610340d9bd61b42..db87f71f283d00c4f79e6411d76222088e018b0e 100644
--- a/Geo/GRegion.cpp
+++ b/Geo/GRegion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GRegion.h b/Geo/GRegion.h
index 027857db11883b23538f62c0cac2e405c5d2a643..03f3026205b0c17777481b38f63b0019d2553214 100644
--- a/Geo/GRegion.h
+++ b/Geo/GRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GVertex.cpp b/Geo/GVertex.cpp
index c9e3a7e27fd99f3cbcfef196bdc8a72bfb115e5d..4a8175446a540afbfddb97d4ef3c1835e5d0416f 100644
--- a/Geo/GVertex.cpp
+++ b/Geo/GVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GVertex.h b/Geo/GVertex.h
index 9c875ce82c302d41008c7525066e22c5f4499b6d..4152bdbee54cf27967880a63a2ad32a33705537d 100644
--- a/Geo/GVertex.h
+++ b/Geo/GVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp
index 45ab6eb000e9b4c1aa855e32e7205ea446d1a52a..591d66a6d293e4c7780693e87656dffc88eec4c4 100644
--- a/Geo/Geo.cpp
+++ b/Geo/Geo.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Geo.h b/Geo/Geo.h
index c08ed704fb93b3aa9400072f6808f724d7e438a6..6e5ce601bfece7e6c1c1a74804ef7ac40b8f0941 100644
--- a/Geo/Geo.h
+++ b/Geo/Geo.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GeoDefines.h b/Geo/GeoDefines.h
index a51b8e931408da4ba6f479cc87fefa05de87a2b2..4500c4c9a58ea5288c27485a188c76b2eb89dd51 100644
--- a/Geo/GeoDefines.h
+++ b/Geo/GeoDefines.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GeoInterpolation.cpp b/Geo/GeoInterpolation.cpp
index 9acd51fa83f8f52a30c30942d614423cf7cb8ebb..2c76df50a4a651640f7cf8e8a8a5b3c4e70bd788 100644
--- a/Geo/GeoInterpolation.cpp
+++ b/Geo/GeoInterpolation.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GeoInterpolation.h b/Geo/GeoInterpolation.h
index bb720b044a42a00b2fc013ced597094b6dc2df96..d35db851e280ed7b74b0b971360cff2c8c034307 100644
--- a/Geo/GeoInterpolation.h
+++ b/Geo/GeoInterpolation.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GeomMeshMatcher.cpp b/Geo/GeomMeshMatcher.cpp
index 0060c688b9f9ab7f439c9e669210aa223ed415e8..5d6382e83540e761b8944074aa5eecf075d56d00 100644
--- a/Geo/GeomMeshMatcher.cpp
+++ b/Geo/GeomMeshMatcher.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/GeomMeshMatcher.h b/Geo/GeomMeshMatcher.h
index 0a54606b774f258f20c08acda82c89bc4571e978..eff25e71dfd2102734aafc7a8475348aa9f47526 100644
--- a/Geo/GeomMeshMatcher.h
+++ b/Geo/GeomMeshMatcher.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Homology.cpp b/Geo/Homology.cpp
index f191cfe65c5dd2cd359a735f05d9ccfc31d42924..f7a934344daa5825fed1fa74df8b624f1a7ba7ef 100644
--- a/Geo/Homology.cpp
+++ b/Geo/Homology.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Homology.h b/Geo/Homology.h
index d9d7cf6a3fda3eeb58e56d0d835e8c06a1d41df1..79e33f88cbb33170fdb967cc8458c1862d1ee7b4 100644
--- a/Geo/Homology.h
+++ b/Geo/Homology.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MEdge.cpp b/Geo/MEdge.cpp
index 7a1d743388dbad0b704578a80b993040b898c80c..f03cde46d5fc8d45d6fe3b54933ead86ab383bc7 100644
--- a/Geo/MEdge.cpp
+++ b/Geo/MEdge.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MEdge.h b/Geo/MEdge.h
index 05d2cd5ef0876589d2e03fb333d4227e36458caa..03da71463a5660fa3928ec33bdfda889b4d86274 100644
--- a/Geo/MEdge.h
+++ b/Geo/MEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MEdgeHash.h b/Geo/MEdgeHash.h
index 373e3436f3212dc7dd26510a8f4074d6b61682ee..dcb8aee2ea88ee533a0e3eb0ffd6acb1057534fe 100644
--- a/Geo/MEdgeHash.h
+++ b/Geo/MEdgeHash.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp
index 6cfda67c8dac20e3b0a93c2e024d35e5fc39e5a3..936968d8a03bb90728e6cba30dd1bcb8df17313a 100644
--- a/Geo/MElement.cpp
+++ b/Geo/MElement.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MElement.h b/Geo/MElement.h
index 1130700b3414fc10b359fecf63503aceaef27821..eb1874ad417fabe133527ced68552db10ed15bed 100644
--- a/Geo/MElement.h
+++ b/Geo/MElement.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MElementCut.cpp b/Geo/MElementCut.cpp
index c28fd9ff6d6b062a7695094ac1ea389c85aea5c1..0023395d74510763121a2041abfdd7877c1ca951 100644
--- a/Geo/MElementCut.cpp
+++ b/Geo/MElementCut.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MElementCut.h b/Geo/MElementCut.h
index 0b3befc5181dc8f825f87eb23fa6d82263023aeb..9fb43f8288a0a41b27d5af94c73609a35ce42500 100644
--- a/Geo/MElementCut.h
+++ b/Geo/MElementCut.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MElementOctree.cpp b/Geo/MElementOctree.cpp
index 36dd85f23d77efb3931b3efd08036c7d90a59be3..dc27113ba9ff74a6690626a1b27b5addeb131aeb 100644
--- a/Geo/MElementOctree.cpp
+++ b/Geo/MElementOctree.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MElementOctree.h b/Geo/MElementOctree.h
index 7fff20a2b7dba993d9f507f4b6ca780cd291ebe9..8cf070230952f08ade6fe0fd9e881cd51923fd9f 100644
--- a/Geo/MElementOctree.h
+++ b/Geo/MElementOctree.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MFace.cpp b/Geo/MFace.cpp
index d789e6563fb2200063d76a36634287ecb166c2d9..f44d92a87bb66d5d4774b73e0ce2687f8bf909c1 100644
--- a/Geo/MFace.cpp
+++ b/Geo/MFace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MFace.h b/Geo/MFace.h
index 26fc3e1877c6dabbd2faff460a99408e598de7da..96610449b1e543ebf4d121e8127f592ce497cd22 100644
--- a/Geo/MFace.h
+++ b/Geo/MFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MFaceHash.h b/Geo/MFaceHash.h
index 0035b697d5d5b10d7f019c77fdb0a1c16c5c7d15..901bca16f225edc097a74e09b43e8ba7bcae4e5e 100644
--- a/Geo/MFaceHash.h
+++ b/Geo/MFaceHash.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MHexahedron.cpp b/Geo/MHexahedron.cpp
index 7ef00df6bdb19e2822355cc48efe823c5c2b097d..4828a1fba37cf7fbcac4789296b7bd3b60008108 100644
--- a/Geo/MHexahedron.cpp
+++ b/Geo/MHexahedron.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MHexahedron.h b/Geo/MHexahedron.h
index 6a73a8e5403eb1d8cb14efda633a476ca7a7ddb4..9ad88c5bdaf66b7bb17d7cdd933829a9d514feb9 100644
--- a/Geo/MHexahedron.h
+++ b/Geo/MHexahedron.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MLine.cpp b/Geo/MLine.cpp
index d4c851ff622f8a79e2dcfd4ad3093d075b3a45e1..7753d8cc979789ff655b5cc7c4a8c9df14f1356c 100644
--- a/Geo/MLine.cpp
+++ b/Geo/MLine.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MLine.h b/Geo/MLine.h
index dddfd5ae23ce6a4b2beb8beac957c46d94c9ea3a..54c7f8f72bf4d2d6bc91fccf5be75c097dbc5c2a 100644
--- a/Geo/MLine.h
+++ b/Geo/MLine.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MPoint.h b/Geo/MPoint.h
index a75f6550860aab6e281418840e52b1f008af7615..fdd7c85a919d705f599fa6532d959f9ca1bcb980 100644
--- a/Geo/MPoint.h
+++ b/Geo/MPoint.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MPrism.cpp b/Geo/MPrism.cpp
index ff8513564e2ee73e72ac2ce827f6e89eed403de7..2d72f2f6ebba5c80fd6c4150203113a80644b3cf 100644
--- a/Geo/MPrism.cpp
+++ b/Geo/MPrism.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MPrism.h b/Geo/MPrism.h
index 9458611c11e6697ef6aaa7d17b8ec8f9067913b8..6aabc53b4a9432d08455c6be3e585aae3c58e776 100644
--- a/Geo/MPrism.h
+++ b/Geo/MPrism.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MPyramid.cpp b/Geo/MPyramid.cpp
index 32170a141739c0d5e2fedf3e70202c4c584b28f4..f706c854ebfd74461286c28ee4b4843a875f4bbf 100644
--- a/Geo/MPyramid.cpp
+++ b/Geo/MPyramid.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MPyramid.h b/Geo/MPyramid.h
index 6f9a4f5e1c9c3a9fe69ede7537dc05f04edc6559..986719d63fbdc441c804b4f1a2f579d1a5913e34 100644
--- a/Geo/MPyramid.h
+++ b/Geo/MPyramid.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MQuadrangle.cpp b/Geo/MQuadrangle.cpp
index 85487fe5032c4b5adfac063f73b3c17317d74f21..6c228e6f9402bfabd4466bfdd8c0b177a9258d8c 100644
--- a/Geo/MQuadrangle.cpp
+++ b/Geo/MQuadrangle.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MQuadrangle.h b/Geo/MQuadrangle.h
index d25795096631360c87d27b78ca1bf20029459508..949cbedc4a1be69dda524841f161efa321649c6b 100644
--- a/Geo/MQuadrangle.h
+++ b/Geo/MQuadrangle.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MSubElement.cpp b/Geo/MSubElement.cpp
index 8b11536053b2446ca26ebdb02f11b348b13adc76..905bf87f7d3b17103a927f6f1e08535e51fc5009 100644
--- a/Geo/MSubElement.cpp
+++ b/Geo/MSubElement.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MSubElement.h b/Geo/MSubElement.h
index 79b2c0e934980304e80362ce6af2507f6532646f..667118cc07273227f026991e5881d40c99fec82f 100644
--- a/Geo/MSubElement.h
+++ b/Geo/MSubElement.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MTetrahedron.cpp b/Geo/MTetrahedron.cpp
index 9b137296f56264175a26fa8f8357bfa2748f9e67..3499761690c973551a8dab53a4d053cab87c0ea8 100644
--- a/Geo/MTetrahedron.cpp
+++ b/Geo/MTetrahedron.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MTetrahedron.h b/Geo/MTetrahedron.h
index 18c83f0fec0588a34f1b69a72b29338253c1844a..43d4cd4a9b9622df471da00327a7263065441914 100644
--- a/Geo/MTetrahedron.h
+++ b/Geo/MTetrahedron.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MTriangle.cpp b/Geo/MTriangle.cpp
index c4b936699192afe71a4438a88066ea6884dd1024..1e9aa919883dde144849156574bbe51f0c0f9f2f 100644
--- a/Geo/MTriangle.cpp
+++ b/Geo/MTriangle.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MTriangle.h b/Geo/MTriangle.h
index 65fdd22271a38ae8cf92854b3e404a9859ae96bf..8cb91f2c280b20a474fef7c12057c9d9d4cd1d03 100644
--- a/Geo/MTriangle.h
+++ b/Geo/MTriangle.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MTrihedron.cpp b/Geo/MTrihedron.cpp
index 9bc83d771b6eb4093288f9d35d979d083220fdec..4846a760930b2d73c0c93b9d206ca8b1f7273210 100644
--- a/Geo/MTrihedron.cpp
+++ b/Geo/MTrihedron.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MTrihedron.h b/Geo/MTrihedron.h
index 1ed297f277722b1e18cecbd3fc424b39caa1da49..e06055908038feba4543d3b5f5b81f546d8011de 100644
--- a/Geo/MTrihedron.h
+++ b/Geo/MTrihedron.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MVertex.cpp b/Geo/MVertex.cpp
index cbda9732acdfbbf65799d1cff02f99629c1d22c2..a7d33009946645e6b6bee8ab143f05e89ca9e1fe 100644
--- a/Geo/MVertex.cpp
+++ b/Geo/MVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MVertex.h b/Geo/MVertex.h
index 661e48fb3fa4db5d4ddcf59443cebef64c53f0c4..234b044820e128f131170761d702ef508980e36d 100644
--- a/Geo/MVertex.h
+++ b/Geo/MVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MVertexBoundaryLayerData.cpp b/Geo/MVertexBoundaryLayerData.cpp
index 262cab084f757af450296ddd32153bfc600a0673..61ade2e4b3451501685b21fc45bc65f8cb1b4624 100644
--- a/Geo/MVertexBoundaryLayerData.cpp
+++ b/Geo/MVertexBoundaryLayerData.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MVertexBoundaryLayerData.h b/Geo/MVertexBoundaryLayerData.h
index 01111e8bb5a7eefa48368e47fdf31df032d16dd3..ed5753c14cebd3720c77e92e5afa29727bd9bf5d 100644
--- a/Geo/MVertexBoundaryLayerData.h
+++ b/Geo/MVertexBoundaryLayerData.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/MVertexRTree.h b/Geo/MVertexRTree.h
index 730d7259ef8bc8424a9f7562bd0a8f5ea0abdaaf..0beaeea09b0938df0848a8b26633ea1f319fa19b 100644
--- a/Geo/MVertexRTree.h
+++ b/Geo/MVertexRTree.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCAttributes.h b/Geo/OCCAttributes.h
index cceaf0c1800e0794b4716c76b2299f3449fc8ffe..ea22f2bff61d318027cdd9c11002ba8c7e8d5c85 100644
--- a/Geo/OCCAttributes.h
+++ b/Geo/OCCAttributes.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCEdge.cpp b/Geo/OCCEdge.cpp
index b16da5cc4c182b55a8481a4e1dbe8266be99c924..4d0f0eb6b7ee50b97666600e6bbedae2d707b0d8 100644
--- a/Geo/OCCEdge.cpp
+++ b/Geo/OCCEdge.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCEdge.h b/Geo/OCCEdge.h
index 136400e952b2b9184608b8ff7bfacb0b68d9ee2f..cf6e35bd70f1f4c31a40e1db2e2bc85ae9b8e3d5 100644
--- a/Geo/OCCEdge.h
+++ b/Geo/OCCEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCFace.cpp b/Geo/OCCFace.cpp
index 1511603aed98b890f9159bd3be6779ec65e9bdee..cdc4b132511f47536f69c125ce21a64e7cfeef05 100644
--- a/Geo/OCCFace.cpp
+++ b/Geo/OCCFace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCFace.h b/Geo/OCCFace.h
index 4485a0e8701ee1185908d31a4f17193715c40bd1..2f870bbd5f8c572c6bfe1b1f72db9511768ce904 100644
--- a/Geo/OCCFace.h
+++ b/Geo/OCCFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCRegion.cpp b/Geo/OCCRegion.cpp
index 5a31b6708a5a8e20e64fc28287afc01a5701c481..64c3ead874844448b151b406c5b04d007f4a1209 100644
--- a/Geo/OCCRegion.cpp
+++ b/Geo/OCCRegion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCRegion.h b/Geo/OCCRegion.h
index a594967aaca2b7e77bd0d6fb1179d56e7888ed5e..c515f148a598ae5abe2b66df41aec5db16c2cd78 100644
--- a/Geo/OCCRegion.h
+++ b/Geo/OCCRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCVertex.cpp b/Geo/OCCVertex.cpp
index 8a0b21bac5980ec74ab2cc323f7a7069ed18bed7..2b67e16dc745bf9e9b639a4d73d7c0532291aedf 100644
--- a/Geo/OCCVertex.cpp
+++ b/Geo/OCCVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/OCCVertex.h b/Geo/OCCVertex.h
index 5a514486190d78a74d68f7d2c52a6ef33e75ed07..3befc400bbaf2259f5b9e9a87dc69e4f1129895e 100644
--- a/Geo/OCCVertex.h
+++ b/Geo/OCCVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Pair.h b/Geo/Pair.h
index 569f97ff4ab535afe8597c857e7801d6e2a44fed..cbaa317381e36205fa3ce45e9551565ee2297127 100644
--- a/Geo/Pair.h
+++ b/Geo/Pair.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/Range.h b/Geo/Range.h
index f438d4dbfb3aea45a2d4dce17dc5b4e2489dc451..f001e2bfe4924fbb82eb7343a1e264fa3ab96030 100644
--- a/Geo/Range.h
+++ b/Geo/Range.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/SBoundingBox3d.h b/Geo/SBoundingBox3d.h
index 76e46c425b3dc9171c4f3227b1171f230c0e8b46..8bfd091aa582119ca2ea0806cfb5da1cc4eb4f1d 100644
--- a/Geo/SBoundingBox3d.h
+++ b/Geo/SBoundingBox3d.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/SOrientedBoundingBox.cpp b/Geo/SOrientedBoundingBox.cpp
index f7db28a88e25127868161f5474c02a19514fd8e0..48442dd833149b0a6abf99ee0400c14662e0e171 100644
--- a/Geo/SOrientedBoundingBox.cpp
+++ b/Geo/SOrientedBoundingBox.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/SOrientedBoundingBox.h b/Geo/SOrientedBoundingBox.h
index 08afd8c284b3217cd7f55263650f005d1dc3d732..f9e0fbf7c4d2df620693389366ecbb04b5beff4f 100644
--- a/Geo/SOrientedBoundingBox.h
+++ b/Geo/SOrientedBoundingBox.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/SPoint2.h b/Geo/SPoint2.h
index 15925b65222f5fbba479be20b0d0c721543ee497..3c06e087eb648ff45c9f0e01138399090f8088cd 100644
--- a/Geo/SPoint2.h
+++ b/Geo/SPoint2.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/SPoint3.h b/Geo/SPoint3.h
index fc34f5d8f9a709a4726d2034fc7d79aff99cda53..ddc14abc9788eb84f8a6f967fa9ae8abc0d46eac 100644
--- a/Geo/SPoint3.h
+++ b/Geo/SPoint3.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/STensor3.cpp b/Geo/STensor3.cpp
index 4c68d578497e6c0512ee4a14d6ab401546066ea2..f8d725777de268f532baf3ecf05ea1f615b99094 100644
--- a/Geo/STensor3.cpp
+++ b/Geo/STensor3.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/STensor3.h b/Geo/STensor3.h
index 988d8253ca90ccb1abaad0facb061c53568be6b2..ec7c869d8df5c3294eee8518ca676e09ee4b884d 100644
--- a/Geo/STensor3.h
+++ b/Geo/STensor3.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/SVector3.h b/Geo/SVector3.h
index a76c29a8bdd9c74114d9101e8a1450db7aa179ec..43f9caed733e51d3c5cfd10603e5e1f630830913 100644
--- a/Geo/SVector3.h
+++ b/Geo/SVector3.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/affineTransformation.cpp b/Geo/affineTransformation.cpp
index 17261ad278e1cb474e3c92d5c2ebdc456a3f85b2..1c3ff4b4251bc6ee41dec88d623c9533a01eeee4 100644
--- a/Geo/affineTransformation.cpp
+++ b/Geo/affineTransformation.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/affineTransformation.h b/Geo/affineTransformation.h
index 1adcc5552fd0aab8bda33adb280994d5593bd3d2..e1b7e14a636280b0d024f5b2c9076fcc44cd8261 100644
--- a/Geo/affineTransformation.h
+++ b/Geo/affineTransformation.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/boundaryLayersData.cpp b/Geo/boundaryLayersData.cpp
index 252dee36d0f08643355676624cfd00147b7a9cab..b7ca2d90b658ea438958f4f364d062cceef4d1c0 100644
--- a/Geo/boundaryLayersData.cpp
+++ b/Geo/boundaryLayersData.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/boundaryLayersData.h b/Geo/boundaryLayersData.h
index ab7380eb39a80be112eac8b6d69718d3f2a48803..a30e3b2b466ada014c09f885d75db28bbb72c246 100644
--- a/Geo/boundaryLayersData.h
+++ b/Geo/boundaryLayersData.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/closestPoint.cpp b/Geo/closestPoint.cpp
index 7edd479d59c1e9097cca4c7aef785386b8c085d3..d4203296fadf9aae6b96bd2243f9d21370865e3a 100644
--- a/Geo/closestPoint.cpp
+++ b/Geo/closestPoint.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/closestPoint.h b/Geo/closestPoint.h
index 40f262f0b385e55b1c2f1fe64071e5e9464b4a86..22e71534d1b862b6a35473b85e7b220b212fb83c 100644
--- a/Geo/closestPoint.h
+++ b/Geo/closestPoint.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/closestVertex.cpp b/Geo/closestVertex.cpp
index 69d1f8cf8d12d1d2c07605c1e2ddc8a888e08bfd..202056b766fa252b0a029cfc79131f7af3df31cc 100644
--- a/Geo/closestVertex.cpp
+++ b/Geo/closestVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/closestVertex.h b/Geo/closestVertex.h
index 6efe4824995bd8fd3fc79aa1824cc4f932578a56..fff96bd087c083ebd850bdd3a53348b7081d7233 100644
--- a/Geo/closestVertex.h
+++ b/Geo/closestVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteEdge.cpp b/Geo/discreteEdge.cpp
index 7859f868a89810e87ac9a4057536eea1639d77e2..9154d8566de2390df16c8f0a34ff8431012b0aaa 100644
--- a/Geo/discreteEdge.cpp
+++ b/Geo/discreteEdge.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteEdge.h b/Geo/discreteEdge.h
index bf1b1035ac07a4b223354958fbeee9b55d8c509d..67d127619c952f8a7275031df1a5cbf05e24c740 100644
--- a/Geo/discreteEdge.h
+++ b/Geo/discreteEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteFace.cpp b/Geo/discreteFace.cpp
index d3b2ecfb6b5b815456e8790f5e6177f0b4918faf..870c8b2c5071335db0010942bd8c76a09ffd8800 100644
--- a/Geo/discreteFace.cpp
+++ b/Geo/discreteFace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteFace.h b/Geo/discreteFace.h
index 240ab11aa7ca8419390a98cc341bdba24c4d9973..26853964630287ed76b980cecf8a7ad7cba23671 100644
--- a/Geo/discreteFace.h
+++ b/Geo/discreteFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteRegion.cpp b/Geo/discreteRegion.cpp
index b87be48c515503adaba1ee9470819bdb9b0af269..fbc6241ed354e53ed45886524fb6d2feb70ac9f2 100644
--- a/Geo/discreteRegion.cpp
+++ b/Geo/discreteRegion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteRegion.h b/Geo/discreteRegion.h
index 3c1626beb2748afc08d30f917c43219d19566cba..e34bc4213d3ac1a0c85b85692e219d3d9e73c4b2 100644
--- a/Geo/discreteRegion.h
+++ b/Geo/discreteRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteVertex.cpp b/Geo/discreteVertex.cpp
index 1dba2365e5f589e11c1d668adaef8da3b03a57a0..9cd71d110badde4277ffcbbff11c9109a8e66639 100644
--- a/Geo/discreteVertex.cpp
+++ b/Geo/discreteVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/discreteVertex.h b/Geo/discreteVertex.h
index e7ccee6b751923deec2b6d84c08e872081ec2996..3011b7a4a747b950d5b209b84035cb7048c30388 100644
--- a/Geo/discreteVertex.h
+++ b/Geo/discreteVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/findLinks.cpp b/Geo/findLinks.cpp
index 1dacc52b2cf0968b1c7ceab51aa5cf3348557801..732e8fbb43a937a5da1b0b5cbd5b90eefa341516 100644
--- a/Geo/findLinks.cpp
+++ b/Geo/findLinks.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/findLinks.h b/Geo/findLinks.h
index 311892ba685244a5fdc6861d2d1c98bdceeea7cb..af6836dc9215ee23c222e25f9487dd2e6b063596 100644
--- a/Geo/findLinks.h
+++ b/Geo/findLinks.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ghostEdge.h b/Geo/ghostEdge.h
index 1e142bb5e8162db7e46bce6d15ce56a2416e8484..962709b02603804c8685f86fd4e9953e0712b893 100644
--- a/Geo/ghostEdge.h
+++ b/Geo/ghostEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ghostFace.h b/Geo/ghostFace.h
index 0c8eadf20f3e8f07bd05f437d30620909beb4ccc..4d1fbc5172611d12ac20f1f11d4eaa68c420503f 100644
--- a/Geo/ghostFace.h
+++ b/Geo/ghostFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/ghostRegion.h b/Geo/ghostRegion.h
index 8e2062ca0270a04a975a8d19fe13686a6bb29174..591f605f6f4583b51d1eb976c82381592bf18de1 100644
--- a/Geo/ghostRegion.h
+++ b/Geo/ghostRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshEdge.cpp b/Geo/gmshEdge.cpp
index d13bcd12a972feb99d499c40e08d7d8080c2e8b3..5a1b31cd41c1e57e4add4d8a1d3d945efaf625e4 100644
--- a/Geo/gmshEdge.cpp
+++ b/Geo/gmshEdge.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshEdge.h b/Geo/gmshEdge.h
index b593209411350529265df2b8917f998c4b460943..42ab72ed212e0f8347416b14bde26771fa877378 100644
--- a/Geo/gmshEdge.h
+++ b/Geo/gmshEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshEdgeDiscretize.cpp b/Geo/gmshEdgeDiscretize.cpp
index 63f4a504e70d9e61beac12f9736761903f445cc3..7b5652d41712552f9d76c09a343c617435c2edc3 100644
--- a/Geo/gmshEdgeDiscretize.cpp
+++ b/Geo/gmshEdgeDiscretize.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshFace.cpp b/Geo/gmshFace.cpp
index ced2ab653152a405a5e60710e74f544c02dd4c8b..c4d0dd483bf670a0082729dfa14b888baaa98550 100644
--- a/Geo/gmshFace.cpp
+++ b/Geo/gmshFace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshFace.h b/Geo/gmshFace.h
index e91495e63a32839a7533993fab10d987cd8981e1..e616af4c88ce0a7d5129e370632f7afde97edba0 100644
--- a/Geo/gmshFace.h
+++ b/Geo/gmshFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshLevelset.cpp b/Geo/gmshLevelset.cpp
index 2a3f2ff708df81f5d2782a3d9b9495a813d0ce81..f0c949ab2b862a724298eb4118d3c5cb69b8efc9 100644
--- a/Geo/gmshLevelset.cpp
+++ b/Geo/gmshLevelset.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshLevelset.h b/Geo/gmshLevelset.h
index e52776569b9cb50786a4e8221a100a5c78071374..2ca25f5762954f019f08cd2851025a0ae8bc0716 100644
--- a/Geo/gmshLevelset.h
+++ b/Geo/gmshLevelset.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshRegion.cpp b/Geo/gmshRegion.cpp
index 37af42c8bc4f43d28cd75a5a39222fd71095453b..dbeb50b436d3dbc7d61af6d74a0bdcc629253e1f 100644
--- a/Geo/gmshRegion.cpp
+++ b/Geo/gmshRegion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshRegion.h b/Geo/gmshRegion.h
index d7b80c5107b4df31c2ae1321cf563fe827e55d55..cb4885a6d280a23251a2e7e628965fff2b311441 100644
--- a/Geo/gmshRegion.h
+++ b/Geo/gmshRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshSurface.cpp b/Geo/gmshSurface.cpp
index c731aa05ef3e102df18d8296523d0aae989af784..67bdaea3035625fe1a56967e7faa78a139c31c08 100644
--- a/Geo/gmshSurface.cpp
+++ b/Geo/gmshSurface.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshSurface.h b/Geo/gmshSurface.h
index e8eb59fefe61029c9fd2811d0ba71f42eab24097..fc01e3c329a81cb1b834dc775507e5efb3a4f0d1 100644
--- a/Geo/gmshSurface.h
+++ b/Geo/gmshSurface.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshVertex.cpp b/Geo/gmshVertex.cpp
index 64f06a64fd1fbfd19aa78a8cfc41075d31695190..e6c59c405cabcb4cf2faf2c58fdb94b07a1e62b3 100644
--- a/Geo/gmshVertex.cpp
+++ b/Geo/gmshVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/gmshVertex.h b/Geo/gmshVertex.h
index fedbfb22756bdb1d7850f0b6d3b619199f68b5b6..aa975ccc01da687e502c9787a871e809f670ae27 100644
--- a/Geo/gmshVertex.h
+++ b/Geo/gmshVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/intersectCurveSurface.cpp b/Geo/intersectCurveSurface.cpp
index 67c5579bd4a762feb5a50149ff4da5d775af795d..474927ab3d2563e64434bc3f1f00029122fde5b1 100644
--- a/Geo/intersectCurveSurface.cpp
+++ b/Geo/intersectCurveSurface.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/intersectCurveSurface.h b/Geo/intersectCurveSurface.h
index 90063b73f6d9b984b79599130d7ebfd540235d92..437ae8e3656d5548789e77da12bf0c49cda26232 100644
--- a/Geo/intersectCurveSurface.h
+++ b/Geo/intersectCurveSurface.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/partitionEdge.h b/Geo/partitionEdge.h
index 45e67e5c494cd5f83dd374de6f09ab61e415ebbc..95b152a33ac4134891d67294e79f0f16e6298425 100644
--- a/Geo/partitionEdge.h
+++ b/Geo/partitionEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/partitionFace.h b/Geo/partitionFace.h
index aadf3b7c4be749f405a988064e283f9ea6b3cf08..5963039283baada36674127617c72df3c3ce8338 100644
--- a/Geo/partitionFace.h
+++ b/Geo/partitionFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/partitionRegion.h b/Geo/partitionRegion.h
index 4effacb3f61aa52be71419e0641141b0069ff633..b23d1c531cc1768218def398309d407db158a956 100644
--- a/Geo/partitionRegion.h
+++ b/Geo/partitionRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/partitionVertex.h b/Geo/partitionVertex.h
index 11b562955390b5b19ad71cd7bc764366a7c3f849..46fdea261a604163a8218d9b48b234ec09b7bc46 100644
--- a/Geo/partitionVertex.h
+++ b/Geo/partitionVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/scriptStringInterface.cpp b/Geo/scriptStringInterface.cpp
index 1a142562bca472b9588c0a61f6f681a79d514bb7..4e531471c298f6a11cf2d18c392881f2e6492f10 100644
--- a/Geo/scriptStringInterface.cpp
+++ b/Geo/scriptStringInterface.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/scriptStringInterface.h b/Geo/scriptStringInterface.h
index fce1f2cd65b8401f1e41c6280a6726171091e1e1..3dee516b9cba142b88642718a74da71a22ed8675 100644
--- a/Geo/scriptStringInterface.h
+++ b/Geo/scriptStringInterface.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/xyEdge.h b/Geo/xyEdge.h
index fb5bb53435a1e2ae3a4bf7d470bfa389567f4cbe..994b7fbd1e571977eaeb7184d56abb2f1d130739 100644
--- a/Geo/xyEdge.h
+++ b/Geo/xyEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Geo/xyFace.h b/Geo/xyFace.h
index 7a3bf9e75e95b380d409e2f7a5ce704ee19bcc35..bae894b8c8692f3029d8e3bc5d083bd6d9fdd725 100644
--- a/Geo/xyFace.h
+++ b/Geo/xyFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/CMakeLists.txt b/Graphics/CMakeLists.txt
index 0a5a90a6d22ae010c51e7c5dfb703680ac80f827..e6806f5a8868cfd75eb3f406a39e254a71267e4c 100644
--- a/Graphics/CMakeLists.txt
+++ b/Graphics/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/Camera.cpp b/Graphics/Camera.cpp
index c37aa359bd6e4256537114b78f4a803b8bafeda1..822de3fb4b40626252b65344ef48c2486b4e66db 100644
--- a/Graphics/Camera.cpp
+++ b/Graphics/Camera.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/Camera.h b/Graphics/Camera.h
index 2b4dbff96977b79a4f8e60c04fe1fbe90b7ea742..0a71ab4593ed6a66761720a701f2735dda432e6f 100644
--- a/Graphics/Camera.h
+++ b/Graphics/Camera.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/PixelBuffer.h b/Graphics/PixelBuffer.h
index dd2a6477ba3ec303033f72231f8405bc3b6c8794..aae2b92f00637fb37df1d951dca7d04f53a8a557 100644
--- a/Graphics/PixelBuffer.h
+++ b/Graphics/PixelBuffer.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/ReadImg.cpp b/Graphics/ReadImg.cpp
index 5ce78b857219222066807ca7f723a2f539edd707..0caa9dd7534812dc30cabddf2e8db864359f6453 100644
--- a/Graphics/ReadImg.cpp
+++ b/Graphics/ReadImg.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -38,7 +38,7 @@ static PViewDataList *Img2Data(Fl_RGB_Image &img_init, int quads = 1,
 
   if(dim != 1 && dim != 2) {
     Msg::Error("Unable to obtain one-channel image");
-    return 0;
+    return nullptr;
   }
 
   PViewDataList *d = new PViewDataList();
diff --git a/Graphics/ReadImg.h b/Graphics/ReadImg.h
index e9473e65937f840514441a9a299ea662fdbd812f..55d5a28f24f1d6458daef1fd74a3e6b9aef80f34 100644
--- a/Graphics/ReadImg.h
+++ b/Graphics/ReadImg.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/drawAxes.cpp b/Graphics/drawAxes.cpp
index e2c69761f47e8cdbcfd2b00025232d4a4810f1d8..02258bf967759dae71d0f6e7cf2b1358bad2537a 100644
--- a/Graphics/drawAxes.cpp
+++ b/Graphics/drawAxes.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/drawContext.cpp b/Graphics/drawContext.cpp
index 9449727c96d99db99a53917e3b68a2b0863220af..123e472084dbe207b2f53c1a6e586c76cb864f52 100644
--- a/Graphics/drawContext.cpp
+++ b/Graphics/drawContext.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -32,8 +32,8 @@
 #include "gmshPopplerWrapper.h"
 #endif
 
-drawContextGlobal *drawContext::_global = 0;
-void (*drawContext::drawGeomTransient)(void *) = 0;
+drawContextGlobal *drawContext::_global = nullptr;
+void (*drawContext::drawGeomTransient)(void *) = nullptr;
 
 void drawContext::setDrawGeomTransientFunction(void (*fct)(void *))
 {
@@ -64,7 +64,7 @@ drawContext::drawContext(openglWindow *window, drawTransform *transform)
 
   _bgImageTexture = _bgImageW = _bgImageH = 0;
 
-  _quadric = 0; // cannot create it here: needs valid opengl context
+  _quadric = nullptr; // cannot create it here: needs valid opengl context
   _displayLists = 0;
 }
 
@@ -92,7 +92,7 @@ void drawContext::invalidateQuadricsAndDisplayLists()
 {
   if(_quadric) {
     gluDeleteQuadric(_quadric);
-    _quadric = 0;
+    _quadric = nullptr;
   }
   if(_displayLists) {
     glDeleteLists(_displayLists, 3);
@@ -429,7 +429,7 @@ bool drawContext::generateTextureForImage(const std::string &name, int page,
   else {
 #if defined(HAVE_FLTK)
     if(!imageTexture) {
-      Fl_RGB_Image *img = 0;
+      Fl_RGB_Image *img = nullptr;
       if(ext == ".jpg" || ext == ".JPG" || ext == ".jpeg" || ext == ".JPEG")
         img = new Fl_JPEG_Image(name.c_str());
       else if(ext == ".png" || ext == ".PNG")
@@ -911,7 +911,7 @@ static MElement *getElement(GEntity *e, int va_type, int index)
       return *e->va_triangles->getElementPointerArray(index);
     break;
   }
-  return 0;
+  return nullptr;
 }
 
 bool drawContext::select(int type, bool multiple, bool mesh, bool post, int x,
diff --git a/Graphics/drawContext.h b/Graphics/drawContext.h
index fbe04815b4e2c818788ebf177f57b0899df54388..103ee3eef0a7e040682690e86f0031e11458fa0b 100644
--- a/Graphics/drawContext.h
+++ b/Graphics/drawContext.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -59,11 +59,11 @@ private:
   double _tra[3];
 
 public:
-  drawTransformScaled(double mat[3][3], double tra[3] = 0) : drawTransform()
+  drawTransformScaled(double mat[3][3], double tra[3] = nullptr) : drawTransform()
   {
     drawTransformScaled::setMatrix(mat, tra);
   }
-  virtual void setMatrix(double mat[3][3], double tra[3] = 0)
+  virtual void setMatrix(double mat[3][3], double tra[3] = nullptr)
   {
     for(int i = 0; i < 3; i++) {
       for(int j = 0; j < 3; j++) _mat[i][j] = mat[i][j];
@@ -145,7 +145,7 @@ public:
   enum RenderMode { GMSH_RENDER = 1, GMSH_SELECT = 2, GMSH_FEEDBACK = 3 };
   int render_mode; // current rendering mode
 public:
-  drawContext(openglWindow *window = 0, drawTransform *transform = 0);
+  drawContext(openglWindow *window = nullptr, drawTransform *transform = nullptr);
   ~drawContext();
   // factor between the (true) size in pixels and the size reported by OSes
   // (e.g. 2 on an Apple "retina" display)
@@ -186,12 +186,12 @@ public:
   void hide(PView *v) { _hiddenViews.insert(v); }
   void show(GModel *m)
   {
-    std::set<GModel *>::iterator it = _hiddenModels.find(m);
+    auto it = _hiddenModels.find(m);
     if(it != _hiddenModels.end()) _hiddenModels.erase(it);
   }
   void show(PView *v)
   {
-    std::set<PView *>::iterator it = _hiddenViews.find(v);
+    auto it = _hiddenViews.find(v);
     if(it != _hiddenViews.end()) _hiddenViews.erase(it);
   }
   void showAll()
diff --git a/Graphics/drawGeom.cpp b/Graphics/drawGeom.cpp
index f7afe98709775ebedbe43913293b173cba14c798..ae8d287ccc9cb4f231a1a0d971425e354833df7c 100644
--- a/Graphics/drawGeom.cpp
+++ b/Graphics/drawGeom.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/drawGlyph.cpp b/Graphics/drawGlyph.cpp
index 5658594c7b086aef5af985a13def107c1a1c0bde..9911d553fbbc15ec840a83d6252d79f2d9365524 100644
--- a/Graphics/drawGlyph.cpp
+++ b/Graphics/drawGlyph.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp
index e46a24b55448e46b2b8d7132a75b080ec67edf07..8cf9f95417e79f8e482da72297f399b0aad470cf 100644
--- a/Graphics/drawGraph2d.cpp
+++ b/Graphics/drawGraph2d.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -402,7 +402,7 @@ static std::map<unsigned int, SPoint2> tags_rev;
 
 static unsigned int getTagForGraph2dDataPoint(const SPoint2 &p)
 {
-  std::map<SPoint2, unsigned int>::iterator it = tags.find(p);
+  auto it = tags.find(p);
   if(it != tags.end()) return it->second;
   int t = tags.size();
   tags[p] = t;
diff --git a/Graphics/drawMesh.cpp b/Graphics/drawMesh.cpp
index fa2baab9e94066550bd507608970e1dd6a48b7cd..30a046ef0958919fcd12b18cdf65c96b8dfbfa12 100644
--- a/Graphics/drawMesh.cpp
+++ b/Graphics/drawMesh.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/drawPost.cpp b/Graphics/drawPost.cpp
index 84d1b267a9733fb2257a2076c48777d5f8102dd2..3f06a5747e619e50ab9beff77ed92da9a2c6b7b0 100644
--- a/Graphics/drawPost.cpp
+++ b/Graphics/drawPost.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/drawScales.cpp b/Graphics/drawScales.cpp
index 0896f61ded2c6996a6f2d8556b0172e151b8ee04..95e7a23f5f0048429aaa0e4b08e936568f07d12a 100644
--- a/Graphics/drawScales.cpp
+++ b/Graphics/drawScales.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2gif.cpp b/Graphics/gl2gif.cpp
index 502f10ce52486ad14625424a64a63afc60db0739..3f6625564c87ad02c9f8f178636bf541d1b3521b 100644
--- a/Graphics/gl2gif.cpp
+++ b/Graphics/gl2gif.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -87,7 +87,7 @@ static colorhash_table ppm_alloccolorhash()
 
   cht = (colorhash_table)Malloc(HASH_SIZE * sizeof(colorhist_list));
 
-  for(i = 0; i < HASH_SIZE; ++i) cht[i] = (colorhist_list)0;
+  for(i = 0; i < HASH_SIZE; ++i) cht[i] = (colorhist_list)nullptr;
 
   return cht;
 }
@@ -98,7 +98,7 @@ static void ppm_freecolorhash(colorhash_table cht)
   colorhist_list chl, chlnext;
 
   for(i = 0; i < HASH_SIZE; ++i)
-    for(chl = cht[i]; chl != (colorhist_list)0; chl = chlnext) {
+    for(chl = cht[i]; chl != (colorhist_list)nullptr; chl = chlnext) {
       chlnext = chl->next;
       Free((char *)chl);
     }
@@ -122,14 +122,14 @@ static colorhash_table ppm_computecolorhash(pixel **const pixels,
   for(row = 0; row < rows; ++row)
     for(col = 0, pP = pixels[row]; col < cols; ++col, ++pP) {
       hash = ppm_hashpixel(*pP);
-      for(chl = cht[hash]; chl != (colorhist_list)0; chl = chl->next)
+      for(chl = cht[hash]; chl != (colorhist_list)nullptr; chl = chl->next)
         if(PPM_EQUAL(chl->ch.color, *pP)) break;
-      if(chl != (colorhist_list)0)
+      if(chl != (colorhist_list)nullptr)
         ++(chl->ch.value);
       else {
         if(++(*colorsP) > maxcolors) {
           ppm_freecolorhash(cht);
-          return (colorhash_table)0;
+          return (colorhash_table)nullptr;
         }
         chl = (colorhist_list)Malloc(sizeof(struct colorhist_list_item));
         chl->ch.color = *pP;
@@ -169,7 +169,7 @@ static colorhist_vector ppm_colorhashtocolorhist(const colorhash_table cht,
   /* Loop through the hash table. */
   j = 0;
   for(i = 0; i < HASH_SIZE; ++i)
-    for(chl = cht[i]; chl != (colorhist_list)0; chl = chl->next) {
+    for(chl = cht[i]; chl != (colorhist_list)nullptr; chl = chl->next) {
       /* Add the new entry. */
       chv[j] = chl->ch;
       ++j;
@@ -192,7 +192,7 @@ static colorhash_table ppm_colorhisttocolorhash(const colorhist_vector chv,
   for(i = 0; i < colors; ++i) {
     color = chv[i].color;
     hash = ppm_hashpixel(color);
-    for(chl = cht[hash]; chl != (colorhist_list)0; chl = chl->next)
+    for(chl = cht[hash]; chl != (colorhist_list)nullptr; chl = chl->next)
       if(PPM_EQUAL(chl->ch.color, color))
         Msg::Error("GIF: same color found twice - %d %d %d", PPM_GETR(color),
                    PPM_GETG(color), PPM_GETB(color));
@@ -215,7 +215,7 @@ static colorhist_vector ppm_computecolorhist(pixel **const pixels,
   colorhist_vector chv;
 
   cht = ppm_computecolorhash(pixels, cols, rows, maxcolors, colorsP);
-  if(cht == (colorhash_table)0) return (colorhist_vector)0;
+  if(cht == (colorhash_table)nullptr) return (colorhist_vector)nullptr;
   chv = ppm_colorhashtocolorhist(cht, maxcolors);
   ppm_freecolorhash(cht);
   return chv;
@@ -227,7 +227,7 @@ static int ppm_lookupcolor(const colorhash_table cht, const pixel *const colorP)
   colorhist_list chl;
 
   hash = ppm_hashpixel(*colorP);
-  for(chl = cht[hash]; chl != (colorhist_list)0; chl = chl->next)
+  for(chl = cht[hash]; chl != (colorhist_list)nullptr; chl = chl->next)
     if(PPM_EQUAL(chl->ch.color, *colorP)) return chl->ch.value;
 
   return -1;
@@ -354,7 +354,7 @@ static colorhist_vector mediancut(colorhist_vector chv, int colors, int sum,
   bv = (box_vector)malloc(sizeof(struct box) * newcolors);
   colormap =
     (colorhist_vector)malloc(sizeof(struct colorhist_item) * newcolors);
-  if(bv == (box_vector)0 || colormap == (colorhist_vector)0)
+  if(bv == (box_vector)nullptr || colormap == (colorhist_vector)nullptr)
     Msg::Error("GIF: out of memory");
   for(i = 0; i < newcolors; ++i) PPM_ASSIGN(colormap[i].color, 0, 0, 0);
 
@@ -1119,8 +1119,8 @@ void create_gif(FILE *outfile, PixelBuffer *buffer, int dither, int sort,
   pixel *pP;
   int col, row, limitcol, ind;
   int newcolors = 256;
-  long *thisrerr = NULL, *nextrerr = NULL, *thisgerr = NULL, *nextgerr = NULL;
-  long *thisberr = NULL, *nextberr = NULL, *temperr = NULL;
+  long *thisrerr = nullptr, *nextrerr = nullptr, *thisgerr = nullptr, *nextgerr = nullptr;
+  long *thisberr = nullptr, *nextberr = nullptr, *temperr = nullptr;
   long sr = 0, sg = 0, sb = 0, err = 0;
   int fs_direction = 0;
 
@@ -1151,7 +1151,7 @@ void create_gif(FILE *outfile, PixelBuffer *buffer, int dither, int sort,
 
   /* Fuck, there are more than 256 colors in the picture: we need to quantize */
 
-  if(chv == (colorhist_vector)0) {
+  if(chv == (colorhist_vector)nullptr) {
     Msg::Debug("GIF: too many colors in image");
 
     rows = height;
@@ -1161,7 +1161,7 @@ void create_gif(FILE *outfile, PixelBuffer *buffer, int dither, int sort,
       Msg::Debug("GIF: making histogram...");
       chv = ppm_computecolorhist(static_pixels, width, height, MAXCOL2,
                                  &static_nbcolors);
-      if(chv != (colorhist_vector)0) break;
+      if(chv != (colorhist_vector)nullptr) break;
       Msg::Debug("GIF: still too many colors!");
       newmaxval = maxval / 2;
       Msg::Debug("GIF: scaling colors from maxval=%d to maxval=%d to improve "
diff --git a/Graphics/gl2gif.h b/Graphics/gl2gif.h
index 1e538c4531945e79e2ad843c449b53441d417143..fe9209c0797f6c2da384302537b625af3c193d24 100644
--- a/Graphics/gl2gif.h
+++ b/Graphics/gl2gif.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2jpeg.cpp b/Graphics/gl2jpeg.cpp
index 0cacc5adda7c4ebcbaf5738658b2bb1d61302847..9d8aeaed6779eb98a47e8c4f14024caa0a1622a7 100644
--- a/Graphics/gl2jpeg.cpp
+++ b/Graphics/gl2jpeg.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2jpeg.h b/Graphics/gl2jpeg.h
index 9e79946b6b99ec2dd262b7e032491f57f1a65087..93491aaaa080d6be579d0c0d94fc93fca63e859d 100644
--- a/Graphics/gl2jpeg.h
+++ b/Graphics/gl2jpeg.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2pgf.cpp b/Graphics/gl2pgf.cpp
index c6bce5d1507f327ae983875eb514d7768beaaed4..8ea1a6e433cf4b6966a5211e5674c81860566202 100644
--- a/Graphics/gl2pgf.cpp
+++ b/Graphics/gl2pgf.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -540,7 +540,7 @@ static int assemble3d(const int num, const int exportAxis, std::string &axisstr,
   plotstr.append("\t    points={%%\n");
 
   unsigned int j = 0;
-  for(std::vector<int>::iterator it = acceptableAnchors.begin();
+  for(auto it = acceptableAnchors.begin();
       it != acceptableAnchors.end(); ++it, j++) {
     sprintf(tmp, "\t    (%f,%f,%f)", factor * axPts[*it][0],
             factor * axPts[*it][1], factor * axPts[*it][2]);
@@ -553,7 +553,7 @@ static int assemble3d(const int num, const int exportAxis, std::string &axisstr,
             ypix - (int)(axViewPt[*it][1] + 0.5));
     plotstr.append(tmp);
   }
-  for(std::vector<int>::iterator it = masked.begin(); it != masked.end();
+  for(auto it = masked.begin(); it != masked.end();
       ++it) {
     sprintf(tmp, "\t    (%f,%f,%f)", factor * axPts[*it][0],
             factor * axPts[*it][1], factor * axPts[*it][2]);
@@ -648,7 +648,7 @@ int print_pgf(const std::string &name, const int num, const int cnt,
   if(twoDim) {
     // try to trim the png...
     char tmp[2048];
-    if(system(NULL)) {
+    if(system(nullptr)) {
       std::string pngname = name;
       pngname.replace(pngname.end() - 3, pngname.end(), "png");
       sprintf(tmp, "convert -trim %s %s", pngname.c_str(), pngname.c_str());
@@ -683,7 +683,7 @@ int print_pgf(const std::string &name, const int num, const int cnt,
   // matrix is wrong!!!!
   if(!twoDim) {
     char tmp[2048];
-    if(system(NULL)) {
+    if(system(nullptr)) {
       std::string pngname = name;
       pngname.replace(pngname.end() - 3, pngname.end(), "png");
       sprintf(tmp, "convert -transparent white %s %s", pngname.c_str(),
diff --git a/Graphics/gl2pgf.h b/Graphics/gl2pgf.h
index 36a9f16532eae6b057472c193b961176a1f5d833..bb002b46c299408380b287b706981fcc09012271 100644
--- a/Graphics/gl2pgf.h
+++ b/Graphics/gl2pgf.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2png.cpp b/Graphics/gl2png.cpp
index 6a862193909ac20d83ba01f37f550a67abfa282d..4678e8470cde48a1c20f847efcd802992f005ecf 100644
--- a/Graphics/gl2png.cpp
+++ b/Graphics/gl2png.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -30,17 +30,17 @@ void create_png(FILE *file, PixelBuffer *buffer, int quality)
   }
 
   png_structp png_ptr =
-    png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+    png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
 
-  if(png_ptr == NULL) {
+  if(png_ptr == nullptr) {
     Msg::Error("Could not create PNG write struct");
     return;
   }
 
   png_infop info_ptr = png_create_info_struct(png_ptr);
 
-  if(info_ptr == NULL) {
-    png_destroy_write_struct(&png_ptr, NULL);
+  if(info_ptr == nullptr) {
+    png_destroy_write_struct(&png_ptr, nullptr);
     Msg::Error("Could not create PNG info struct");
     return;
   }
diff --git a/Graphics/gl2png.h b/Graphics/gl2png.h
index c6bd6cad26676f7792cce356d228bedb712c3850..757598477e70bc1fcb6243e328c461672ff7209d 100644
--- a/Graphics/gl2png.h
+++ b/Graphics/gl2png.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2ppm.cpp b/Graphics/gl2ppm.cpp
index 99b95b14addace70fd1ea3515d12c7a570c18d97..92762e20b9e9ecd88f65a5681ef93cf299cdc5a3 100644
--- a/Graphics/gl2ppm.cpp
+++ b/Graphics/gl2ppm.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2ppm.h b/Graphics/gl2ppm.h
index fdf624556b93945d7b767cced578bc9e00f903ee..b8571c86f8e3e109571cb80f201a4384bc5ca9e8 100644
--- a/Graphics/gl2ppm.h
+++ b/Graphics/gl2ppm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp
index e4893fc504724071b1b3ce41348ffed27a633048..6ae3f1dfb9d3429b31c5d6420a63ddbed90fb5fc 100644
--- a/Graphics/gl2ps.cpp
+++ b/Graphics/gl2ps.cpp
@@ -246,7 +246,7 @@ typedef struct {
 /* The gl2ps context. gl2ps is not thread safe (we should create a
    local GL2PScontext during gl2psBeginPage) */
 
-static GL2PScontext *gl2ps = NULL;
+static GL2PScontext *gl2ps = nullptr;
 
 /* Need to forward-declare this one */
 
@@ -280,11 +280,11 @@ static void *gl2psMalloc(size_t size)
 {
   void *ptr;
 
-  if(!size) return NULL;
+  if(!size) return nullptr;
   ptr = malloc(size);
   if(!ptr){
     gl2psMsg(GL2PS_ERROR, "Couldn't allocate requested memory");
-    return NULL;
+    return nullptr;
   }
   return ptr;
 }
@@ -292,12 +292,12 @@ static void *gl2psMalloc(size_t size)
 static void *gl2psRealloc(void *ptr, size_t size)
 {
   void *orig = ptr;
-  if(!size) return NULL;
+  if(!size) return nullptr;
   ptr = realloc(orig, size);
   if(!ptr){
     gl2psMsg(GL2PS_ERROR, "Couldn't reallocate requested memory");
     free(orig);
-    return NULL;
+    return nullptr;
   }
   return ptr;
 }
@@ -325,9 +325,9 @@ static int gl2psWriteBigEndian(unsigned long data, int bytes)
 static void gl2psSetupCompress(void)
 {
   gl2ps->compress = (GL2PScompress*)gl2psMalloc(sizeof(GL2PScompress));
-  gl2ps->compress->src = NULL;
-  gl2ps->compress->start = NULL;
-  gl2ps->compress->dest = NULL;
+  gl2ps->compress->src = nullptr;
+  gl2ps->compress->start = nullptr;
+  gl2ps->compress->dest = nullptr;
   gl2ps->compress->srcLen = 0;
   gl2ps->compress->destLen = 0;
 }
@@ -338,9 +338,9 @@ static void gl2psFreeCompress(void)
     return;
   gl2psFree(gl2ps->compress->start);
   gl2psFree(gl2ps->compress->dest);
-  gl2ps->compress->src = NULL;
-  gl2ps->compress->start = NULL;
-  gl2ps->compress->dest = NULL;
+  gl2ps->compress->src = nullptr;
+  gl2ps->compress->start = nullptr;
+  gl2ps->compress->dest = nullptr;
   gl2ps->compress->srcLen = 0;
   gl2ps->compress->destLen = 0;
 }
@@ -364,7 +364,7 @@ static int gl2psAllocCompress(unsigned int srcsize)
 static void *gl2psReallocCompress(unsigned int srcsize)
 {
   if(!gl2ps->compress || !srcsize)
-    return NULL;
+    return nullptr;
 
   if(srcsize < gl2ps->compress->srcLen)
     return gl2ps->compress->start;
@@ -506,7 +506,7 @@ static void gl2psPrintGzipFooter(void)
     }
     gl2psFreeCompress();
     gl2psFree(gl2ps->compress);
-    gl2ps->compress = NULL;
+    gl2ps->compress = nullptr;
   }
 #endif
 }
@@ -544,7 +544,7 @@ static GL2PSlist *gl2psListCreate(GLint n, GLint incr, GLint size)
   list->incr = incr;
   list->size = size;
   list->n = 0;
-  list->array = NULL;
+  list->array = nullptr;
   gl2psListRealloc(list, n);
   return list;
 }
@@ -584,11 +584,11 @@ static void *gl2psListPointer(GL2PSlist *list, GLint idx)
 {
   if(!list){
     gl2psMsg(GL2PS_ERROR, "Cannot point into unallocated list");
-    return NULL;
+    return nullptr;
   }
   if((idx < 0) || (idx >= list->n)){
     gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListPointer");
-    return NULL;
+    return nullptr;
   }
   return &list->array[idx * list->size];
 }
@@ -821,11 +821,11 @@ static void gl2psConvertPixmapToPNG(GL2PSimage *pixmap, GL2PSlist *png)
   GLfloat dr, dg, db;
   int row, col;
 
-  if(!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)))
+  if(!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr)))
     return;
 
   if(!(info_ptr = png_create_info_struct(png_ptr))){
-    png_destroy_write_struct(&png_ptr, NULL);
+    png_destroy_write_struct(&png_ptr, nullptr);
     return;
   }
 
@@ -1072,7 +1072,7 @@ static GL2PSprimitive *gl2psCopyPrimitive(GL2PSprimitive *p)
 
   if(!p){
     gl2psMsg(GL2PS_ERROR, "Trying to copy an empty primitive");
-    return NULL;
+    return nullptr;
   }
 
   prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive));
@@ -1530,7 +1530,7 @@ static GLint gl2psFindRoot(GL2PSlist *primitives, GL2PSprimitive **root)
 static void gl2psFreeImagemap(GL2PSimagemap *list)
 {
   GL2PSimagemap *next;
-  while(list != NULL){
+  while(list != nullptr){
     next = list->next;
     gl2psFree(list->image->pixels);
     gl2psFree(list->image);
@@ -1580,7 +1580,7 @@ static void gl2psFreeBspTree(GL2PSbsptree **tree)
     }
     if((*tree)->front) gl2psFreeBspTree(&(*tree)->front);
     gl2psFree(*tree);
-    *tree = NULL;
+    *tree = nullptr;
   }
 }
 
@@ -1598,12 +1598,12 @@ static GLboolean gl2psLess(GLfloat f1, GLfloat f2)
 
 static void gl2psBuildBspTree(GL2PSbsptree *tree, GL2PSlist *primitives)
 {
-  GL2PSprimitive *prim, *frontprim = NULL, *backprim = NULL;
+  GL2PSprimitive *prim, *frontprim = nullptr, *backprim = nullptr;
   GL2PSlist *frontlist, *backlist;
   GLint i, idx;
 
-  tree->front = NULL;
-  tree->back = NULL;
+  tree->front = nullptr;
+  tree->back = nullptr;
   tree->primitives = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*));
   idx = gl2psFindRoot(primitives, &prim);
   gl2psGetPlane(prim, tree->plane);
@@ -1810,7 +1810,7 @@ static void gl2psFreeBspImageTree(GL2PSbsptree2d **tree)
     if((*tree)->back)  gl2psFreeBspImageTree(&(*tree)->back);
     if((*tree)->front) gl2psFreeBspImageTree(&(*tree)->front);
     gl2psFree(*tree);
-    *tree = NULL;
+    *tree = nullptr;
   }
 }
 
@@ -1830,9 +1830,9 @@ static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim,
   GLint ret = 0;
   GLint i;
   GLint offset = 0;
-  GL2PSbsptree2d *head = NULL, *cur = NULL;
+  GL2PSbsptree2d *head = nullptr, *cur = nullptr;
 
-  if((*tree == NULL) && (prim->numverts > 2)){
+  if((*tree == nullptr) && (prim->numverts > 2)){
     /* don't cull if transparent
     for(i = 0; i < prim->numverts - 1; i++)
       if(prim->verts[i].rgba[3] < 1.0F) return;
@@ -1854,8 +1854,8 @@ static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim,
         break;
       }
     }
-    head->back = NULL;
-    head->front = NULL;
+    head->back = nullptr;
+    head->front = nullptr;
     for(i = 2+offset; i < prim->numverts; i++){
       ret = gl2psCheckPoint(prim->verts[i].xyz, head->plane);
       if(ret != GL2PS_POINT_COINCIDENT) break;
@@ -1864,29 +1864,29 @@ static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim,
     case GL2PS_POINT_INFRONT :
       cur = head;
       for(i = 1+offset; i < prim->numverts-1; i++){
-        if(cur->front == NULL){
+        if(cur->front == nullptr){
           cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d));
         }
         if(gl2psGetPlaneFromPoints(prim->verts[i].xyz,
                                    prim->verts[i+1].xyz,
                                    cur->front->plane)){
           cur = cur->front;
-          cur->front = NULL;
-          cur->back = NULL;
+          cur->front = nullptr;
+          cur->back = nullptr;
         }
       }
-      if(cur->front == NULL){
+      if(cur->front == nullptr){
         cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d));
       }
       if(gl2psGetPlaneFromPoints(prim->verts[i].xyz,
                                  prim->verts[offset].xyz,
                                  cur->front->plane)){
-        cur->front->front = NULL;
-        cur->front->back = NULL;
+        cur->front->front = nullptr;
+        cur->front->back = nullptr;
       }
       else{
         gl2psFree(cur->front);
-        cur->front = NULL;
+        cur->front = nullptr;
       }
       break;
     case GL2PS_POINT_BACK :
@@ -1895,29 +1895,29 @@ static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim,
       }
       cur = head;
       for(i = 1+offset; i < prim->numverts-1; i++){
-        if(cur->front == NULL){
+        if(cur->front == nullptr){
           cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d));
         }
         if(gl2psGetPlaneFromPoints(prim->verts[i+1].xyz,
                                    prim->verts[i].xyz,
                                    cur->front->plane)){
           cur = cur->front;
-          cur->front = NULL;
-          cur->back = NULL;
+          cur->front = nullptr;
+          cur->back = nullptr;
         }
       }
-      if(cur->front == NULL){
+      if(cur->front == nullptr){
         cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d));
       }
       if(gl2psGetPlaneFromPoints(prim->verts[offset].xyz,
                                  prim->verts[i].xyz,
                                  cur->front->plane)){
-        cur->front->front = NULL;
-        cur->front->back = NULL;
+        cur->front->front = nullptr;
+        cur->front->back = nullptr;
       }
       else{
         gl2psFree(cur->front);
-        cur->front = NULL;
+        cur->front = nullptr;
       }
       break;
     default:
@@ -1994,7 +1994,7 @@ static void gl2psSplitPrimitive2D(GL2PSprimitive *prim,
   GLint cur = -1, prev = -1, i, v1 = 0, v2 = 0, flag = 1, prev0 = -1;
 
   /* list of vertices that will go in front and back primitive */
-  GL2PSvertex *front_list = NULL, *back_list = NULL;
+  GL2PSvertex *front_list = nullptr, *back_list = nullptr;
 
   /* number of vertices in front and back list */
   GLshort front_count = 0, back_count = 0;
@@ -2066,7 +2066,7 @@ static void gl2psSplitPrimitive2D(GL2PSprimitive *prim,
 static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree)
 {
   GLint ret = 0;
-  GL2PSprimitive *frontprim = NULL, *backprim = NULL;
+  GL2PSprimitive *frontprim = nullptr, *backprim = nullptr;
 
   /* FIXME: until we consider the actual extent of text strings and
      pixmaps, never cull them. Otherwise the whole string/pixmap gets
@@ -2077,7 +2077,7 @@ static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree)
     return 1;
   }
 
-  if(*tree == NULL){
+  if(*tree == nullptr){
     if((prim->type != GL2PS_IMAGEMAP) && (GL_FALSE == gl2ps->zerosurfacearea)){
       gl2psAddPlanesInBspTreeImage(gl2ps->primitivetoadd, tree);
     }
@@ -2087,12 +2087,12 @@ static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree)
     switch(gl2psCheckPrimitive(prim, (*tree)->plane)){
     case GL2PS_IN_BACK_OF: return gl2psAddInBspImageTree(prim, &(*tree)->back);
     case GL2PS_IN_FRONT_OF:
-      if((*tree)->front != NULL) return gl2psAddInBspImageTree(prim, &(*tree)->front);
+      if((*tree)->front != nullptr) return gl2psAddInBspImageTree(prim, &(*tree)->front);
       else                       return 0;
     case GL2PS_SPANNING:
       gl2psSplitPrimitive2D(prim, (*tree)->plane, &frontprim, &backprim);
       ret = gl2psAddInBspImageTree(backprim, &(*tree)->back);
-      if((*tree)->front != NULL){
+      if((*tree)->front != nullptr){
         if(gl2psAddInBspImageTree(frontprim, &(*tree)->front)){
           ret = 1;
         }
@@ -2103,13 +2103,13 @@ static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree)
       gl2psFree(backprim);
       return ret;
     case GL2PS_COINCIDENT:
-      if((*tree)->back != NULL){
+      if((*tree)->back != nullptr){
         gl2ps->zerosurfacearea = GL_TRUE;
         ret = gl2psAddInBspImageTree(prim, &(*tree)->back);
         gl2ps->zerosurfacearea = GL_FALSE;
         if(ret) return ret;
       }
-      if((*tree)->front != NULL){
+      if((*tree)->front != nullptr){
         gl2ps->zerosurfacearea = GL_TRUE;
         ret = gl2psAddInBspImageTree(prim, &(*tree)->front);
         gl2ps->zerosurfacearea = GL_FALSE;
@@ -2448,9 +2448,9 @@ static void gl2psParseFeedbackBuffer(GLint used)
         node->image->format = 0;
         node->image->zoom_x = 1.0F;
         node->image->zoom_y = 1.0F;
-        node->next = NULL;
+        node->next = nullptr;
 
-        if(gl2ps->imagemap_head == NULL)
+        if(gl2ps->imagemap_head == nullptr)
           gl2ps->imagemap_head = node;
         else
           gl2ps->imagemap_tail->next = node;
@@ -3652,7 +3652,7 @@ static void gl2psPDFgroupObjectInit(GL2PSpdfgroup *gro)
   if(!gro)
     return;
 
-  gro->ptrlist = NULL;
+  gro->ptrlist = nullptr;
   gro->fontno = gro->gsno = gro->imno = gro->maskshno = gro->shno
     = gro->trgroupno = gro->fontobjno = gro->imobjno = gro->shobjno
     = gro->maskshobjno = gro->gsobjno = gro->trgroupobjno = -1;
@@ -3663,7 +3663,7 @@ static void gl2psPDFgroupObjectInit(GL2PSpdfgroup *gro)
 static void gl2psPDFgroupListInit(void)
 {
   int i;
-  GL2PSprimitive *p = NULL;
+  GL2PSprimitive *p = nullptr;
   GL2PSpdfgroup gro;
   int lasttype = GL2PS_NO_TYPE;
   GL2PSrgba lastrgba = {-1.0F, -1.0F, -1.0F, -1.0F};
@@ -3770,7 +3770,7 @@ static void gl2psPDFgroupListInit(void)
 static void gl2psSortOutTrianglePDFgroup(GL2PSpdfgroup *gro)
 {
   GL2PStriangle t;
-  GL2PSprimitive *prim = NULL;
+  GL2PSprimitive *prim = nullptr;
 
   if(!gro)
     return;
@@ -3824,7 +3824,7 @@ static void gl2psSortOutTrianglePDFgroup(GL2PSpdfgroup *gro)
 static void gl2psPDFgroupListWriteMainStream(void)
 {
   int i, j, lastel, count;
-  GL2PSprimitive *prim = NULL, *prev = NULL;
+  GL2PSprimitive *prim = nullptr, *prev = nullptr;
   GL2PSpdfgroup *gro;
   GL2PStriangle t;
 
@@ -4075,7 +4075,7 @@ static int gl2psPDFgroupListWriteShaderResources(void)
 static int gl2psPDFgroupListWriteXObjectResources(void)
 {
   int i;
-  GL2PSprimitive *p = NULL;
+  GL2PSprimitive *p = nullptr;
   GL2PSpdfgroup *gro;
   int offs = 0;
 
@@ -4131,7 +4131,7 @@ static int gl2psPDFgroupListWriteFontResources(void)
 static void gl2psPDFgroupListDelete(void)
 {
   int i;
-  GL2PSpdfgroup *gro = NULL;
+  GL2PSpdfgroup *gro = nullptr;
 
   if(!gl2ps->pdfgrouplist)
     return;
@@ -4142,7 +4142,7 @@ static void gl2psPDFgroupListDelete(void)
   }
 
   gl2psListDelete(gl2ps->pdfgrouplist);
-  gl2ps->pdfgrouplist = NULL;
+  gl2ps->pdfgrouplist = nullptr;
 }
 
 /* Print 1st PDF object - file info */
@@ -4870,7 +4870,7 @@ static int gl2psPrintPDFText(int obj, GL2PSstring *s, int fontnumber)
 static int gl2psPDFgroupListWriteObjects(int entryoffs)
 {
   int i,j;
-  GL2PSprimitive *p = NULL;
+  GL2PSprimitive *p = nullptr;
   GL2PSpdfgroup *gro;
   int offs = entryoffs;
   GL2PStriangle *triangles;
@@ -5001,7 +5001,7 @@ static void gl2psPrintPDFFooter(void)
   if(gl2ps->options & GL2PS_COMPRESS){
     gl2psFreeCompress();
     gl2psFree(gl2ps->compress);
-    gl2ps->compress = NULL;
+    gl2ps->compress = nullptr;
   }
 #endif
 }
@@ -6011,7 +6011,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   /* Validate options */
   if (gl2psCheckOptions(options, colormode) == GL_FALSE) {
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     return GL2PS_ERROR;
   }
 
@@ -6021,7 +6021,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   else {
     gl2psMsg(GL2PS_ERROR, "Unknown output format: %d", format);
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     return GL2PS_ERROR;
   }
 
@@ -6034,7 +6034,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   default :
     gl2psMsg(GL2PS_ERROR, "Unknown sorting algorithm: %d", sort);
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     return GL2PS_ERROR;
   }
 
@@ -6044,7 +6044,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   else{
     gl2psMsg(GL2PS_ERROR, "Bad file pointer");
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     return GL2PS_ERROR;
   }
 
@@ -6052,9 +6052,9 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   gl2ps->forcerasterpos = GL_FALSE;
   gl2ps->maxbestroot = 10;
   gl2ps->options = options;
-  gl2ps->compress = NULL;
-  gl2ps->imagemap_head = NULL;
-  gl2ps->imagemap_tail = NULL;
+  gl2ps->compress = nullptr;
+  gl2ps->imagemap_head = nullptr;
+  gl2ps->imagemap_tail = nullptr;
 
   if(gl2ps->options & GL2PS_USE_CURRENT_VIEWPORT){
     glGetIntegerv(GL_VIEWPORT, gl2ps->viewport);
@@ -6070,7 +6070,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
              gl2ps->viewport[0], gl2ps->viewport[1],
              gl2ps->viewport[2], gl2ps->viewport[3]);
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     return GL2PS_ERROR;
   }
 
@@ -6091,12 +6091,12 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   gl2ps->lastlinejoin = 0;
   gl2ps->lastpattern = 0;
   gl2ps->lastfactor = 0;
-  gl2ps->imagetree = NULL;
-  gl2ps->primitivetoadd = NULL;
+  gl2ps->imagetree = nullptr;
+  gl2ps->primitivetoadd = nullptr;
   gl2ps->zerosurfacearea = GL_FALSE;
-  gl2ps->pdfprimlist = NULL;
-  gl2ps->pdfgrouplist = NULL;
-  gl2ps->xreflist = NULL;
+  gl2ps->pdfprimlist = nullptr;
+  gl2ps->pdfgrouplist = nullptr;
+  gl2ps->xreflist = nullptr;
 
   /* get default blending mode from current OpenGL state (enabled by
      default for SVG) */
@@ -6112,7 +6112,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
 
   if(gl2ps->colormode == GL_RGBA){
     gl2ps->colorsize = 0;
-    gl2ps->colormap = NULL;
+    gl2ps->colormap = nullptr;
     if ((gl2ps->options & GL2PS_NO_OPENGL_CONTEXT) == GL2PS_NONE) {
       glGetFloatv(GL_COLOR_CLEAR_VALUE, gl2ps->bgcolor);
     }
@@ -6121,7 +6121,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
     if(!colorsize || !colormap){
       gl2psMsg(GL2PS_ERROR, "Missing colormap for GL_COLOR_INDEX rendering");
       gl2psFree(gl2ps);
-      gl2ps = NULL;
+      gl2ps = nullptr;
       return GL2PS_ERROR;
     }
     gl2ps->colorsize = colorsize;
@@ -6136,7 +6136,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
   else{
     gl2psMsg(GL2PS_ERROR, "Unknown color mode in gl2psBeginPage");
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     return GL2PS_ERROR;
   }
 
@@ -6176,7 +6176,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
     glRenderMode(GL_FEEDBACK);
   }
   else {
-    gl2ps->feedback = NULL;
+    gl2ps->feedback = nullptr;
     gl2ps->buffersize = 0;
   }
 
@@ -6207,7 +6207,7 @@ GL2PSDLL_API GLint gl2psEndPage(void)
   gl2psFree(gl2ps->filename);
   gl2psFree(gl2ps->feedback);
   gl2psFree(gl2ps);
-  gl2ps = NULL;
+  gl2ps = nullptr;
 
   return res;
 }
@@ -6251,7 +6251,7 @@ GL2PSDLL_API GLint gl2psSorting(GLint mode)
   default :
     gl2psMsg(GL2PS_ERROR, "Unknown sorting algorithm: %d", mode);
     gl2psFree(gl2ps);
-    gl2ps = NULL;
+    gl2ps = nullptr;
     res = GL2PS_ERROR;
   }
 
@@ -6282,18 +6282,18 @@ GL2PSDLL_API GLint gl2psTextOptColorBL(const char *str, const char *fontname,
 GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname,
                                 GLshort fontsize, GLint alignment, GLfloat angle)
 {
-  return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, alignment, angle, NULL, GL_FALSE, 0, 0);
+  return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, alignment, angle, nullptr, GL_FALSE, 0, 0);
 }
 
 GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize)
 {
   return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, GL2PS_TEXT_BL, 0.0F,
-                      NULL, GL_FALSE, 0, 0);
+                      nullptr, GL_FALSE, 0, 0);
 }
 
 GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str)
 {
-  return gl2psAddText(GL2PS_SPECIAL, str, "", 0, format, 0.0F, NULL, GL_FALSE, 0, 0);
+  return gl2psAddText(GL2PS_SPECIAL, str, "", 0, format, 0.0F, nullptr, GL_FALSE, 0, 0);
 }
 
 GL2PSDLL_API GLint gl2psSpecialColor(GLint format, const char *str, GL2PSrgba rgba)
diff --git a/Graphics/gl2yuv.cpp b/Graphics/gl2yuv.cpp
index dfc50b7c5f6dfa76c790e7a6d3487d8fddc84227..dd1957b8953f9e35aff32ee4a02d3993bfd05d89 100644
--- a/Graphics/gl2yuv.cpp
+++ b/Graphics/gl2yuv.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Graphics/gl2yuv.h b/Graphics/gl2yuv.h
index e9cf43e7dce552baf70e57aca9e7e9054729c98f..5b2c2c825808f431fcf21604baa90374cd6fd478 100644
--- a/Graphics/gl2yuv.h
+++ b/Graphics/gl2yuv.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/BDS.cpp b/Mesh/BDS.cpp
index 51b5c75e78e859714c618b4a91cbc2d418d00356..1f1ecc5686e563481a922ad4b29c6a70231f7c6e 100644
--- a/Mesh/BDS.cpp
+++ b/Mesh/BDS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -54,8 +54,8 @@ void outputScalarField(std::vector<BDS_Face *> &t, const char *iii, int param,
       return;
     }
     fprintf(view_c, "View \"paramC\"{\n");
-    std::vector<BDS_Face *>::iterator tit = t.begin();
-    std::vector<BDS_Face *>::iterator tite = t.end();
+    auto tit = t.begin();
+    auto tite = t.end();
     while(tit != tite) {
       BDS_Point *pts[4];
       if(!(*tit)->deleted && (*tit)->getNodes(pts)) {
@@ -94,8 +94,8 @@ void outputScalarField(std::vector<BDS_Face *> &t, const char *iii, int param,
     return;
   }
   fprintf(f, "View \"scalar\" {\n");
-  std::vector<BDS_Face *>::iterator tit = t.begin();
-  std::vector<BDS_Face *>::iterator tite = t.end();
+  auto tit = t.begin();
+  auto tite = t.end();
   while(tit != tite) {
     BDS_Point *pts[4];
     if(!(*tit)->deleted && (*tit)->getNodes(pts)) {
@@ -239,7 +239,7 @@ std::vector<BDS_Face *> BDS_Point::getTriangles() const
   std::vector<BDS_Face *> t;
   t.reserve(edges.size());
 
-  std::vector<BDS_Edge *>::const_iterator it = edges.begin();
+  auto it = edges.begin();
   while(it != edges.end()) {
     std::size_t const number_of_faces = (*it)->numfaces();
 
@@ -277,20 +277,20 @@ BDS_Point *BDS_Mesh::add_point(int num, double u, double v, GFace *gf)
 BDS_Point *BDS_Mesh::find_point(int p)
 {
   BDS_Point P(p);
-  std::set<BDS_Point *, PointLessThan>::iterator it = points.find(&P);
+  auto it = points.find(&P);
 
-  return it != points.end() ? static_cast<BDS_Point *>(*it) : NULL;
+  return it != points.end() ? static_cast<BDS_Point *>(*it) : nullptr;
 }
 
 BDS_Edge *BDS_Mesh::find_edge(BDS_Point *p, int num2)
 {
-  std::vector<BDS_Edge *>::iterator eit = p->edges.begin();
+  auto eit = p->edges.begin();
   while(eit != p->edges.end()) {
     if((*eit)->p1 == p && (*eit)->p2->iD == num2) return (*eit);
     if((*eit)->p2 == p && (*eit)->p1->iD == num2) return (*eit);
     ++eit;
   }
-  return 0;
+  return nullptr;
 }
 
 BDS_Edge *BDS_Mesh::find_edge(BDS_Point *p1, BDS_Point *p2)
@@ -341,7 +341,7 @@ BDS_Edge *BDS_Mesh::recover_edge_fast(BDS_Point *p1, BDS_Point *p2)
     }
     ++it;
   }
-  return 0;
+  return nullptr;
 }
 
 BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
@@ -358,7 +358,7 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
 
   if(!p1 || !p2) {
     Msg::Error("Could not find points %d or %d in BDS mesh", num1, num2);
-    return 0;
+    return nullptr;
   }
 
   Msg::Debug("Edge %d %d has to be recovered", num1, num2);
@@ -379,11 +379,11 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
                               p1->v, p2->u, p2->v, x)) {
           // intersect
           if(e2r &&
-             e2r->find(EdgeToRecover(e->p1->iD, e->p2->iD, 0)) != e2r->end()) {
-            std::set<EdgeToRecover>::iterator itr1 =
-              e2r->find(EdgeToRecover(e->p1->iD, e->p2->iD, 0));
-            std::set<EdgeToRecover>::iterator itr2 =
-              e2r->find(EdgeToRecover(num1, num2, 0));
+             e2r->find(EdgeToRecover(e->p1->iD, e->p2->iD, nullptr)) != e2r->end()) {
+            auto itr1 =
+              e2r->find(EdgeToRecover(e->p1->iD, e->p2->iD, nullptr));
+            auto itr2 =
+              e2r->find(EdgeToRecover(num1, num2, nullptr));
             Msg::Debug("edge %d %d on model edge %d cannot be recovered because"
                        " it intersects %d %d on model edge %d",
                        num1, num2, itr2->ge->tag(), e->p1->iD, e->p2->iD,
@@ -394,13 +394,13 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
               EdgeToRecover(e->p1->iD, e->p2->iD, itr1->ge));
             selfIntersection = true;
           }
-          if(e->numfaces() != e->numTriangles()) return 0;
+          if(e->numfaces() != e->numTriangles()) return nullptr;
           intersected.push_back(e);
         }
       ++it;
     }
 
-    if(selfIntersection) return 0;
+    if(selfIntersection) return nullptr;
 
     if(!intersected.size() || ix > 300) {
       BDS_Edge *eee = find_edge(num1, num2);
@@ -417,7 +417,7 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
           Msg::Debug("edge %d %d cannot be recovered at all", num1, num2);
         }
         _fatal = true;
-        return 0;
+        return nullptr;
       }
       return eee;
     }
@@ -431,12 +431,12 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
     if(!success) {
       Msg::Debug("edge %d %d cannot be recovered at all\n", num1, num2);
       _fatal = true;
-      return 0;
+      return nullptr;
     }
 
     ix++;
   }
-  return 0;
+  return nullptr;
 }
 
 BDS_Edge *BDS_Mesh::find_edge(BDS_Point *p1, BDS_Point *p2, BDS_Face *t) const
@@ -447,7 +447,7 @@ BDS_Edge *BDS_Mesh::find_edge(BDS_Point *p1, BDS_Point *p2, BDS_Face *t) const
   if(t->e1->p1->iD == E.p1->iD && t->e1->p2->iD == E.p2->iD) return t->e1;
   if(t->e2->p1->iD == E.p1->iD && t->e2->p2->iD == E.p2->iD) return t->e2;
   if(t->e3->p1->iD == E.p1->iD && t->e3->p2->iD == E.p2->iD) return t->e3;
-  return 0;
+  return nullptr;
 }
 
 static bool is_equivalent(BDS_Edge *e1, BDS_Edge *e2, BDS_Edge *e3,
@@ -475,7 +475,7 @@ BDS_Face *BDS_Mesh::find_triangle(BDS_Edge *e1, BDS_Edge *e2, BDS_Edge *e3)
     BDS_Face *t = e3->faces(i);
     if(is_equivalent(e1, e2, e3, t->e1, t->e2, t->e3)) { return t; }
   }
-  return 0;
+  return nullptr;
 }
 
 BDS_Edge *BDS_Mesh::add_edge(int const p1, int const p2)
@@ -488,7 +488,7 @@ BDS_Edge *BDS_Mesh::add_edge(int const p1, int const p2)
 
   if(!pp1 || !pp2) {
     Msg::Error("Could not find points %d or %d", p1, p2);
-    return 0;
+    return nullptr;
   }
   edges.push_back(new BDS_Edge(pp1, pp2));
 
@@ -501,7 +501,7 @@ BDS_Face *BDS_Mesh::add_triangle(int p1, int p2, int p3)
   BDS_Edge *e2 = add_edge(p2, p3);
   BDS_Edge *e3 = add_edge(p3, p1);
   if(e1 && e2 && e3) return add_triangle(e1, e2, e3);
-  return 0;
+  return nullptr;
 }
 
 BDS_Face *BDS_Mesh::add_triangle(BDS_Edge *e1, BDS_Edge *e2, BDS_Edge *e3)
@@ -511,7 +511,7 @@ BDS_Face *BDS_Mesh::add_triangle(BDS_Edge *e1, BDS_Edge *e2, BDS_Edge *e3)
     triangles.push_back(t);
     return t;
   }
-  return 0;
+  return nullptr;
 }
 
 void BDS_Mesh::del_face(BDS_Face *t)
@@ -549,9 +549,9 @@ void BDS_Mesh::add_geom(int p1, int p2)
 void BDS_Edge::computeNeighborhood(BDS_Point *pts1[4], BDS_Point *pts2[4],
                                    BDS_Point *oface[2]) const
 {
-  oface[0] = oface[1] = 0;
-  pts1[0] = pts1[1] = pts1[2] = pts1[3] = 0;
-  pts2[0] = pts2[1] = pts2[2] = pts2[3] = 0;
+  oface[0] = oface[1] = nullptr;
+  pts1[0] = pts1[1] = pts1[2] = pts1[3] = nullptr;
+  pts2[0] = pts2[1] = pts2[2] = pts2[3] = nullptr;
   if(faces(0)) {
     if(!faces(0)->getNodes(pts1)) return;
     if(pts1[0] != p1 && pts1[0] != p2)
@@ -574,7 +574,7 @@ void BDS_Edge::computeNeighborhood(BDS_Point *pts1[4], BDS_Point *pts2[4],
 
 void BDS_Edge::oppositeof(BDS_Point *oface[2]) const
 {
-  oface[0] = oface[1] = 0;
+  oface[0] = oface[1] = nullptr;
   if(faces(0)) {
     BDS_Point *pts[4];
     if(!faces(0)->getNodes(pts)) return;
@@ -600,8 +600,8 @@ void BDS_Edge::oppositeof(BDS_Point *oface[2]) const
 BDS_GeomEntity *BDS_Mesh::get_geom(int p1, int p2)
 {
   BDS_GeomEntity ge(p1, p2);
-  std::set<BDS_GeomEntity *, GeomLessThan>::iterator it = geom.find(&ge);
-  if(it == geom.end()) return 0;
+  auto it = geom.find(&ge);
+  if(it == geom.end()) return nullptr;
   return (BDS_GeomEntity *)(*it);
 }
 
@@ -645,9 +645,9 @@ struct is_not_deleted {
 void BDS_Mesh::cleanup()
 {
   {
-    std::vector<BDS_Face *>::iterator last =
+    auto last =
       std::partition(triangles.begin(), triangles.end(), is_not_deleted());
-    std::vector<BDS_Face *>::iterator it = last;
+    auto it = last;
     while(it != triangles.end()) {
       delete *it;
       ++it;
@@ -655,9 +655,9 @@ void BDS_Mesh::cleanup()
     triangles.erase(last, triangles.end());
   }
   {
-    std::vector<BDS_Edge *>::iterator last =
+    auto last =
       std::partition(edges.begin(), edges.end(), is_not_deleted());
-    std::vector<BDS_Edge *>::iterator it = last;
+    auto it = last;
     while(it != edges.end()) {
       delete *it;
       ++it;
@@ -729,7 +729,7 @@ bool BDS_Mesh::split_edge(BDS_Edge *e, BDS_Point *mid, bool check_area_param)
     }
   }
 
-  BDS_GeomEntity *g1 = 0, *g2 = 0, *ge = e->g;
+  BDS_GeomEntity *g1 = nullptr, *g2 = nullptr, *ge = e->g;
 
   BDS_Edge *p1_op1 = find_edge(p1, op[0], e->faces(0));
   BDS_Edge *op1_p2 = find_edge(op[0], p2, e->faces(0));
@@ -858,7 +858,7 @@ bool BDS_SwapEdgeTestQuality::operator()(BDS_Point *_p1, BDS_Point *_p2,
                                          BDS_Point *_oq2, BDS_Point *_oq3) const
 {
   // Check if new edge is not on a seam or degenerated
-  BDS_Point *p1 = 0, *p2 = 0;
+  BDS_Point *p1 = nullptr, *p2 = nullptr;
   if(_op1 != _oq1 && _op1 != _oq2 && _op1 != _oq3) {
     p1 = _op2;
     p2 = _op3;
@@ -976,7 +976,7 @@ bool BDS_Mesh::swap_edge(BDS_Edge *e, const BDS_SwapEdgeTest &theTest,
 
   if(p1->iD == CHECK1 && p2->iD == CHECK2) printf("topology OK \n");
 
-  BDS_GeomEntity *g1 = 0, *g2 = 0, *ge = e->g;
+  BDS_GeomEntity *g1 = nullptr, *g2 = nullptr, *ge = e->g;
 
   // compute the orientation of the face
   // with respect to the edge
@@ -1144,7 +1144,7 @@ bool BDS_Mesh::collapse_edge_parametric(BDS_Edge *e, BDS_Point *p, bool force)
   double area_old = 0.0;
   double area_new = 0.0;
   {
-    std::vector<BDS_Face *>::iterator it = t.begin();
+    auto it = t.begin();
     while(it != t.end()) {
       BDS_Face *t = *it;
       BDS_Point *pts[4];
@@ -1179,7 +1179,7 @@ bool BDS_Mesh::collapse_edge_parametric(BDS_Edge *e, BDS_Point *p, bool force)
     return false;
   }
   {
-    std::vector<BDS_Face *>::iterator it = t.begin();
+    auto it = t.begin();
     while(it != t.end()) {
       del_face(*it);
       ++it;
@@ -1189,7 +1189,7 @@ bool BDS_Mesh::collapse_edge_parametric(BDS_Edge *e, BDS_Point *p, bool force)
   int kk = 0;
   {
     std::vector<BDS_Edge *> edges(p->edges);
-    std::vector<BDS_Edge *>::iterator eit = edges.begin();
+    auto eit = edges.begin();
     while(eit != edges.end()) {
       (*eit)->p1->config_modified = (*eit)->p2->config_modified = true;
       ept[0][kk] = ((*eit)->p1 == p) ? (o ? o->iD : -1) : (*eit)->p1->iD;
@@ -1396,7 +1396,7 @@ static inline void computeSomeKindOfKernel(const BDS_Point *p,
                                            std::vector<SPoint2> &kernel,
                                            std::vector<double> &lc, int check)
 {
-  FILE *f = NULL;
+  FILE *f = nullptr;
   if(p->iD == check) f = fopen("kernel.pos", "w");
 
   SPoint2 pp(p->u, p->v);
diff --git a/Mesh/BDS.h b/Mesh/BDS.h
index c80243694f1bd4385b3bdb521e40da621ae37da1..78df29c80607cc90e4caad4e40fdeea16cce98a7 100644
--- a/Mesh/BDS.h
+++ b/Mesh/BDS.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -76,8 +76,8 @@ public:
   std::vector<BDS_Face *> getTriangles() const;
   BDS_Point(int id, double x = 0, double y = 0, double z = 0)
     : _lcBGM(1.e22), _lcPTS(1.e22), X(x), Y(y), Z(z), u(0), v(0),
-      config_modified(true), degenerated(0), _periodicCounterpart(NULL),
-      iD(id), g(0)
+      config_modified(true), degenerated(0), _periodicCounterpart(nullptr),
+      iD(id), g(nullptr)
   {
   }
 };
@@ -86,7 +86,7 @@ class BDS_Edge {
   std::vector<BDS_Face *> _faces;
 
 public:
-  BDS_Edge(BDS_Point *A, BDS_Point *B) : deleted(false), g(0)
+  BDS_Edge(BDS_Point *A, BDS_Point *B) : deleted(false), g(nullptr)
   {
     if(*A < *B) {
       p1 = A;
@@ -115,14 +115,14 @@ public:
     if(p2 == other->p1 || p2 == other->p2) return p2;
     Msg::Error("Edge %d %d has no common node with edge %d %d",
                p1->iD, p2->iD, other->p1->iD, other->p2->iD);
-    return 0;
+    return nullptr;
   }
   BDS_Point *othervertex(const BDS_Point *p) const
   {
     if(p1 == p) return p2;
     if(p2 == p) return p1;
     Msg::Error("Edge %d %d does not contain node %d", p1->iD, p2->iD, p->iD);
-    return 0;
+    return nullptr;
   }
   void addface(BDS_Face *f) { _faces.push_back(f); }
   bool operator < (const BDS_Edge &other) const
@@ -137,12 +137,12 @@ public:
     if(numfaces() != 2) {
       Msg::Error("%d face(s) attached to edge %d %d", numfaces(),
                  p1->iD, p2->iD);
-      return 0;
+      return nullptr;
     }
     if(f == _faces[0]) return _faces[1];
     if(f == _faces[1]) return _faces[0];
     Msg::Error("Edge %d %d does not belong to the face", p1->iD, p2->iD);
-    return 0;
+    return nullptr;
   }
   void del(BDS_Face *t)
   {
@@ -162,8 +162,8 @@ public:
 
 class BDS_Face {
 public:
-  BDS_Face(BDS_Edge *A, BDS_Edge *B, BDS_Edge *C, BDS_Edge *D = 0)
-    : deleted(false), e1(A), e2(B), e3(C), e4(D), g(0)
+  BDS_Face(BDS_Edge *A, BDS_Edge *B, BDS_Edge *C, BDS_Edge *D = nullptr)
+    : deleted(false), e1(A), e2(B), e3(C), e4(D), g(nullptr)
   {
     e1->addface(this);
     e2->addface(this);
@@ -175,27 +175,27 @@ public:
   {
     if(e4) {
       Msg::Error("Opposite edge to point %d cannot be found for quad", p->iD);
-      return 0;
+      return nullptr;
     }
     if(e1->p1 != p && e1->p2 != p) return e1;
     if(e2->p1 != p && e2->p2 != p) return e2;
     if(e3->p1 != p && e3->p2 != p) return e3;
     Msg::Error("Point %d does not belong to this triangle", p->iD);
-    return 0;
+    return nullptr;
   }
   BDS_Point *oppositeVertex(BDS_Edge *e)
   {
     if(e4) {
       Msg::Error("Opposite point to edge %d %d cannot be found for quad",
                  e->p1->iD, e->p2->iD);
-      return 0;
+      return nullptr;
     }
     if(e == e1) return e2->commonvertex(e3);
     if(e == e2) return e1->commonvertex(e3);
     if(e == e3) return e1->commonvertex(e2);
     Msg::Error("Edge %d %d does not belong to this triangle", e->p1->iD,
                e->p2->iD);
-    return 0;
+    return nullptr;
   }
   inline bool getNodes(BDS_Point *_n[4]) const
   {
@@ -203,7 +203,7 @@ public:
       _n[0] = e1->commonvertex(e3);
       _n[1] = e1->commonvertex(e2);
       _n[2] = e2->commonvertex(e3);
-      _n[3] = 0;
+      _n[3] = nullptr;
       if(_n[0] && _n[1] && _n[2]) return true;
     }
     else {
@@ -368,8 +368,8 @@ public:
   BDS_GeomEntity *get_geom(int p1, int p2);
   // 2D operators
   BDS_Edge *recover_edge(int p1, int p2, bool &_fatal,
-                         std::set<EdgeToRecover> *e2r = 0,
-                         std::set<EdgeToRecover> *not_recovered = 0);
+                         std::set<EdgeToRecover> *e2r = nullptr,
+                         std::set<EdgeToRecover> *not_recovered = nullptr);
   BDS_Edge *recover_edge_fast(BDS_Point *p1, BDS_Point *p2);
 
   /// Can invalidate the iterators for \p edge
@@ -385,7 +385,7 @@ public:
 
 void normal_triangle(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3, double c[3]);
 void outputScalarField(std::vector<BDS_Face *> &t, const char *fn, int param,
-                       GFace *gf = 0);
+                       GFace *gf = nullptr);
 void recur_tag(BDS_Face *t, BDS_GeomEntity *g);
 int Intersect_Edges_2d(double x1, double y1, double x2, double y2, double x3,
                        double y3, double x4, double y4, double x[2]);
diff --git a/Mesh/BackgroundMesh.cpp b/Mesh/BackgroundMesh.cpp
index 222ae69c54af0a22ece3cf77fd567adffe87c7e5..fd709a4b45f0db77a5d6cedf10a165e0838128e6 100644
--- a/Mesh/BackgroundMesh.cpp
+++ b/Mesh/BackgroundMesh.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -35,7 +35,7 @@ static const int NBANN = 2;
 static const int MAX_THREADS = 256;
 
 std::vector<backgroundMesh *> backgroundMesh::_current =
-  std::vector<backgroundMesh *>(MAX_THREADS, (backgroundMesh *)0);
+  std::vector<backgroundMesh *>(MAX_THREADS, (backgroundMesh *)nullptr);
 
 void backgroundMesh::set(GFace *gf)
 {
@@ -62,19 +62,19 @@ void backgroundMesh::unset()
   int t = Msg::GetThreadNum();
   if(t >= MAX_THREADS) return;
   if(_current[t]) delete _current[t];
-  _current[t] = 0;
+  _current[t] = nullptr;
 }
 
 backgroundMesh *backgroundMesh::current()
 {
   int t = Msg::GetThreadNum();
-  if(t >= MAX_THREADS) return 0;
+  if(t >= MAX_THREADS) return nullptr;
   return _current[t];
 }
 
 backgroundMesh::backgroundMesh(GFace *_gf, bool cfd)
 #if defined(HAVE_ANN)
-  : _octree(0), uv_kdtree(0), nodes(0), angle_nodes(0), angle_kdtree(0)
+  : _octree(nullptr), uv_kdtree(nullptr), nodes(nullptr), angle_nodes(nullptr), angle_kdtree(nullptr)
 #endif
 {
   if(cfd) {
@@ -93,8 +93,8 @@ backgroundMesh::backgroundMesh(GFace *_gf, bool cfd)
     MVertex *news[3];
     for(int j = 0; j < 3; j++) {
       MVertex *v = e->getVertex(j);
-      std::map<MVertex *, MVertex *>::iterator it = _3Dto2D.find(v);
-      MVertex *newv = 0;
+      auto it = _3Dto2D.find(v);
+      MVertex *newv = nullptr;
       if(it == _3Dto2D.end()) {
         SPoint2 p;
         reparamMeshVertexOnFace(v, _gf, p);
@@ -116,7 +116,7 @@ backgroundMesh::backgroundMesh(GFace *_gf, bool cfd)
   index = new ANNidx[2];
   dist = new ANNdist[2];
   nodes = annAllocPts(myBCNodes.size(), 3);
-  std::set<SPoint2>::iterator itp = myBCNodes.begin();
+  auto itp = myBCNodes.begin();
   int ind = 0;
   while(itp != myBCNodes.end()) {
     SPoint2 pt = *itp;
@@ -137,7 +137,7 @@ backgroundMesh::backgroundMesh(GFace *_gf, bool cfd)
     propagate1dMesh(_gf);
   }
   else {
-    std::map<MVertex *, MVertex *>::iterator itv2 = _2Dto3D.begin();
+    auto itv2 = _2Dto3D.begin();
     for(; itv2 != _2Dto3D.end(); ++itv2) {
       _sizes[itv2->first] = CTX::instance()->mesh.lcMax;
     }
@@ -184,7 +184,7 @@ static void propagateValuesOnFace(GFace *_gf,
   dofManager<double> myAssembler(_lsys);
 
   // fix boundary conditions
-  std::map<MVertex *, double>::iterator itv = dirichlet.begin();
+  auto itv = dirichlet.begin();
   for(; itv != dirichlet.end(); ++itv) {
     myAssembler.fixVertex(itv->first, 0, 1, itv->second);
   }
@@ -198,7 +198,7 @@ static void propagateValuesOnFace(GFace *_gf,
 
   std::map<MVertex *, SPoint3> theMap;
   if(in_parametric_plane) {
-    for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it) {
+    for(auto it = vs.begin(); it != vs.end(); ++it) {
       SPoint2 p;
       reparamMeshVertexOnFace(*it, _gf, p);
       theMap[*it] = SPoint3((*it)->x(), (*it)->y(), (*it)->z());
@@ -206,11 +206,11 @@ static void propagateValuesOnFace(GFace *_gf,
     }
   }
 
-  for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it)
+  for(auto it = vs.begin(); it != vs.end(); ++it)
     myAssembler.numberVertex(*it, 0, 1);
 
   // Assemble
-  laplaceTerm l(0, 1, ONE);
+  laplaceTerm l(nullptr, 1, ONE);
   for(std::size_t k = 0; k < _gf->triangles.size(); k++) {
     MTriangle *t = _gf->triangles[k];
     SElement se(t);
@@ -223,12 +223,12 @@ static void propagateValuesOnFace(GFace *_gf,
   }
 
   // save solution
-  for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it) {
+  for(auto it = vs.begin(); it != vs.end(); ++it) {
     myAssembler.getDofValue(*it, 0, 1, dirichlet[*it]);
   }
 
   if(in_parametric_plane) {
-    for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it) {
+    for(auto it = vs.begin(); it != vs.end(); ++it) {
       SPoint3 p = theMap[(*it)];
       (*it)->setXYZ(p.x(), p.y(), p.z());
     }
@@ -240,7 +240,7 @@ static void propagateValuesOnFace(GFace *_gf,
 void backgroundMesh::propagate1dMesh(GFace *_gf)
 {
   std::vector<GEdge *> const &e = _gf->edges();
-  std::vector<GEdge *>::const_iterator it = e.begin();
+  auto it = e.begin();
   std::map<MVertex *, double> sizes;
 
   for(; it != e.end(); ++it) {
@@ -254,7 +254,7 @@ void backgroundMesh::propagate1dMesh(GFace *_gf)
                           (v1->z() - v2->z()) * (v1->z() - v2->z()));
           for(int k = 0; k < 2; k++) {
             MVertex *v = (*it)->lines[i]->getVertex(k);
-            std::map<MVertex *, double>::iterator itv = sizes.find(v);
+            auto itv = sizes.find(v);
             if(itv == sizes.end())
               sizes[v] = log(d);
             else
@@ -268,7 +268,7 @@ void backgroundMesh::propagate1dMesh(GFace *_gf)
   simpleFunction<double> ONE(1.0);
   propagateValuesOnFace(_gf, sizes, &ONE);
 
-  std::map<MVertex *, MVertex *>::iterator itv2 = _2Dto3D.begin();
+  auto itv2 = _2Dto3D.begin();
   for(; itv2 != _2Dto3D.end(); ++itv2) {
     MVertex *v_2D = itv2->first;
     MVertex *v_3D = itv2->second;
@@ -294,7 +294,7 @@ crossField2d::crossField2d(MVertex *v, GEdge *ge)
 void backgroundMesh::propagateCrossFieldByDistance(GFace *_gf)
 {
   std::vector<GEdge *> const &e = _gf->edges();
-  std::vector<GEdge *>::const_iterator it = e.begin();
+  auto it = e.begin();
   std::map<MVertex *, double> _cosines4, _sines4;
   std::map<MVertex *, SPoint2> _param;
 
@@ -317,8 +317,8 @@ void backgroundMesh::propagateCrossFieldByDistance(GFace *_gf)
         //        double angle = atan2 ( p1.y()-p2.y() , p1.x()-p2.x() );
         crossField2d::normalizeAngle(_angle);
         for(int i = 0; i < 2; i++) {
-          std::map<MVertex *, double>::iterator itc = _cosines4.find(v[i]);
-          std::map<MVertex *, double>::iterator its = _sines4.find(v[i]);
+          auto itc = _cosines4.find(v[i]);
+          auto its = _sines4.find(v[i]);
           if(itc != _cosines4.end()) {
             itc->second = 0.5 * (itc->second + cos(4 * _angle));
             its->second = 0.5 * (its->second + sin(4 * _angle));
@@ -337,7 +337,7 @@ void backgroundMesh::propagateCrossFieldByDistance(GFace *_gf)
   index = new ANNidx[NBANN];
   dist = new ANNdist[NBANN];
   angle_nodes = annAllocPts(_cosines4.size(), 3);
-  std::map<MVertex *, double>::iterator itp = _cosines4.begin();
+  auto itp = _cosines4.begin();
   int ind = 0;
   _sin.clear();
   _cos.clear();
@@ -453,7 +453,7 @@ void backgroundMesh::propagateCrossField(GFace *_gf,
 {
   std::map<MVertex *, double> _cosines4, _sines4;
   std::vector<GEdge *> const &e = _gf->edges();
-  std::vector<GEdge *>::const_iterator it = e.begin();
+  auto it = e.begin();
   for(; it != e.end(); ++it) {
     if(!(*it)->isSeam(_gf)) {
       for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
@@ -474,8 +474,8 @@ void backgroundMesh::propagateCrossField(GFace *_gf,
         double _angle = myAngle(t1, d1, n);
         crossField2d::normalizeAngle(_angle);
         for(int i = 0; i < 2; i++) {
-          std::map<MVertex *, double>::iterator itc = _cosines4.find(v[i]);
-          std::map<MVertex *, double>::iterator its = _sines4.find(v[i]);
+          auto itc = _cosines4.find(v[i]);
+          auto its = _sines4.find(v[i]);
           if(itc != _cosines4.end()) {
             itc->second = 0.5 * (itc->second + cos(4 * _angle));
             its->second = 0.5 * (its->second + sin(4 * _angle));
@@ -495,7 +495,7 @@ void backgroundMesh::propagateCrossField(GFace *_gf,
   //    print("cos4.pos",0,_cosines4,0);
   //    print("sin4.pos",0,_sines4,0);
 
-  std::map<MVertex *, MVertex *>::iterator itv2 = _2Dto3D.begin();
+  auto itv2 = _2Dto3D.begin();
   for(; itv2 != _2Dto3D.end(); ++itv2) {
     MVertex *v_2D = itv2->first;
     MVertex *v_3D = itv2->second;
@@ -507,7 +507,7 @@ void backgroundMesh::propagateCrossField(GFace *_gf,
 
 void backgroundMesh::updateSizes(GFace *_gf)
 {
-  std::map<MVertex *, double>::iterator itv = _sizes.begin();
+  auto itv = _sizes.begin();
   for(; itv != _sizes.end(); ++itv) {
     SPoint2 p;
     MVertex *v = _2Dto3D[itv->first];
@@ -539,14 +539,14 @@ void backgroundMesh::updateSizes(GFace *_gf)
   }
   const double _beta = 1.3;
   for(int i = 0; i < 3; i++) {
-    std::set<MEdge, MEdgeLessThan>::iterator it = edges.begin();
+    auto it = edges.begin();
     for(; it != edges.end(); ++it) {
       MVertex *v0 = it->getVertex(0);
       MVertex *v1 = it->getVertex(1);
       MVertex *V0 = _2Dto3D[v0];
       MVertex *V1 = _2Dto3D[v1];
-      std::map<MVertex *, double>::iterator s0 = _sizes.find(V0);
-      std::map<MVertex *, double>::iterator s1 = _sizes.find(V1);
+      auto s0 = _sizes.find(V0);
+      auto s1 = _sizes.find(V1);
       if(s0->second < s1->second)
         s1->second = std::min(s1->second, _beta * s0->second);
       else
@@ -558,7 +558,7 @@ void backgroundMesh::updateSizes(GFace *_gf)
 bool backgroundMesh::inDomain(double u, double v, double w) const
 {
   if(!_octree) return false;
-  return _octree->find(u, v, w, 2, true) != 0;
+  return _octree->find(u, v, w, 2, true) != nullptr;
 }
 
 double backgroundMesh::operator()(double u, double v, double w) const
@@ -591,11 +591,11 @@ double backgroundMesh::operator()(double u, double v, double w) const
     }
   }
   e->xyz2uvw(uv, uv2);
-  std::map<MVertex *, double>::const_iterator itv1 =
+  auto itv1 =
     _sizes.find(e->getVertex(0));
-  std::map<MVertex *, double>::const_iterator itv2 =
+  auto itv2 =
     _sizes.find(e->getVertex(1));
-  std::map<MVertex *, double>::const_iterator itv3 =
+  auto itv3 =
     _sizes.find(e->getVertex(2));
   return itv1->second * (1 - uv2[0] - uv2[1]) + itv2->second * uv2[0] +
          itv3->second * uv2[1];
@@ -660,11 +660,11 @@ double backgroundMesh::getAngle(double u, double v, double w) const
     }
   }
   e->xyz2uvw(uv, uv2);
-  std::map<MVertex *, double>::const_iterator itv1 =
+  auto itv1 =
     _angles.find(e->getVertex(0));
-  std::map<MVertex *, double>::const_iterator itv2 =
+  auto itv2 =
     _angles.find(e->getVertex(1));
-  std::map<MVertex *, double>::const_iterator itv3 =
+  auto itv3 =
     _angles.find(e->getVertex(2));
 
   double cos4 = cos(4 * itv1->second) * (1 - uv2[0] - uv2[1]) +
@@ -703,9 +703,9 @@ void backgroundMesh::print(const std::string &filename, GFace *gf,
       MVertex *v1 = _triangles[i]->getVertex(0);
       MVertex *v2 = _triangles[i]->getVertex(1);
       MVertex *v3 = _triangles[i]->getVertex(2);
-      std::map<MVertex *, double>::const_iterator itv1 = _whatToPrint.find(v1);
-      std::map<MVertex *, double>::const_iterator itv2 = _whatToPrint.find(v2);
-      std::map<MVertex *, double>::const_iterator itv3 = _whatToPrint.find(v3);
+      auto itv1 = _whatToPrint.find(v1);
+      auto itv2 = _whatToPrint.find(v2);
+      auto itv3 = _whatToPrint.find(v3);
       if(!gf) {
         fprintf(f, "ST(%g,%g,%g,%g,%g,%g,%g,%g,%g) {%g,%g,%g};\n", v1->x(),
                 v1->y(), v1->z(), v2->x(), v2->y(), v2->z(), v3->x(), v3->y(),
diff --git a/Mesh/BackgroundMesh.h b/Mesh/BackgroundMesh.h
index b840c51f250a58d7e84a9f0d6259f40ccb17c878..4ae50cabe4dc820c16f7f9757af31488e377d28f 100644
--- a/Mesh/BackgroundMesh.h
+++ b/Mesh/BackgroundMesh.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/BackgroundMeshTools.cpp b/Mesh/BackgroundMeshTools.cpp
index e40ed26cf7bed1a0671a670c5733cfc70f78fd01..7a146286e00507cbb7fd7fe2489da16ccc7d0734 100644
--- a/Mesh/BackgroundMeshTools.cpp
+++ b/Mesh/BackgroundMeshTools.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -16,7 +16,7 @@ static double max_surf_curvature(const GEdge *ge, double u)
 {
   double val = 0;
   std::vector<GFace *> faces = ge->faces();
-  std::vector<GFace *>::iterator it = faces.begin();
+  auto it = faces.begin();
   while(it != faces.end()) {
     SPoint2 par = ge->reparamOnFace((*it), u, 1);
     double cc = (*it)->curvatureMax(par);
@@ -30,7 +30,7 @@ static double max_edge_curvature(const GVertex *gv)
 {
   double val = 0;
   std::vector<GEdge *> const &l_edges = gv->edges();
-  for(std::vector<GEdge *>::const_iterator ite = l_edges.begin();
+  for(auto ite = l_edges.begin();
       ite != l_edges.end(); ++ite) {
     GEdge *_myGEdge = *ite;
     Range<double> range = _myGEdge->parBounds(0);
@@ -87,7 +87,7 @@ static SMetric3 metric_based_on_surface_curvature(const GEdge *ge, double u,
 {
   SMetric3 mesh_size(1.e-12);
   std::vector<GFace *> faces = ge->faces();
-  std::vector<GFace *>::iterator it = faces.begin();
+  auto it = faces.begin();
   // we choose the metric eigenvectors to be the ones
   // related to the edge ...
   SMetric3 curvMetric = max_edge_curvature_metric(ge, u);
@@ -348,7 +348,7 @@ SMetric3 max_edge_curvature_metric(const GVertex *gv)
 {
   SMetric3 val(1.e-12);
   std::vector<GEdge *> const &l_edges = gv->edges();
-  for(std::vector<GEdge *>::const_iterator ite = l_edges.begin();
+  for(auto ite = l_edges.begin();
       ite != l_edges.end(); ++ite) {
     GEdge *_myGEdge = *ite;
     Range<double> range = _myGEdge->parBounds(0);
diff --git a/Mesh/BackgroundMeshTools.h b/Mesh/BackgroundMeshTools.h
index 79838a92f543140e7d07fda035259807f2318fc0..9e4bd557b8c706f288228a7ebd7a03e58d892f53 100644
--- a/Mesh/BackgroundMeshTools.h
+++ b/Mesh/BackgroundMeshTools.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/BoundaryLayers.cpp b/Mesh/BoundaryLayers.cpp
index 14c54e26a71b389a3c94a3722f48b827f1ff59f3..c343f60d8184c0b49d18c77bbedb1fe2b18e3eed 100644
--- a/Mesh/BoundaryLayers.cpp
+++ b/Mesh/BoundaryLayers.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -72,7 +72,7 @@ static void addExtrudeNormals(std::vector<T *> &elements, int invert,
         }
       }
     }
-    for(std::set<MVertex *>::iterator it = verts.begin(); it != verts.end();
+    for(auto it = verts.begin(); it != verts.end();
         it++) {
       MVertex *v = *it;
       double nn[3] = {0., 0., 0.};
@@ -135,16 +135,16 @@ static void addExtrudeNormals(std::set<T *> &entities,
   bool normalize = true, special3dbox = false, extrudeField = false;
   std::vector<OctreePost *> octrees;
 
-  for(typename std::set<T *>::iterator it = entities.begin();
+  for(auto it = entities.begin();
       it != entities.end(); it++) {
     T *ge = *it;
     infoset info = infos[ge->tag()];
-    for(infoset::iterator it2 = info.begin(); it2 != info.end(); it2++) {
+    for(auto it2 = info.begin(); it2 != info.end(); it2++) {
       bool invert = it2->first;
       int index = it2->second.first;
       int view = it2->second.second;
       bool gouraud = true;
-      OctreePost *octree = 0;
+      OctreePost *octree = nullptr;
 #if defined(HAVE_POST)
       if(view != -1) {
         if(view >= 0 && view < (int)PView::list.size()) {
@@ -166,7 +166,7 @@ static void addExtrudeNormals(std::set<T *> &entities,
       }
 #endif
       bool skipScaleCalc = true;
-      std::map<int, bool>::iterator itskip = skipScaleCalcMap.find(ge->tag());
+      auto itskip = skipScaleCalcMap.find(ge->tag());
       if(itskip != skipScaleCalcMap.end())
         skipScaleCalc = skipScaleCalcMap[ge->tag()];
       if(ge->dim() == 1)
@@ -198,7 +198,7 @@ static void addExtrudeNormals(std::set<T *> &entities,
     for(int i = 0; i < 2; i++) {
       ExtrudeParams::normals[i]->normalize();
       if(special3dbox) { // force normals for 3d "box" along x,y,z
-        for(smooth_data::iter it = ExtrudeParams::normals[i]->begin();
+        for(auto it = ExtrudeParams::normals[i]->begin();
             it != ExtrudeParams::normals[i]->end(); it++) {
           for(int j = 0; j < 3; j++) {
             if(it->vals[j] < -0.1)
@@ -211,7 +211,7 @@ static void addExtrudeNormals(std::set<T *> &entities,
         }
       }
       if(extrudeField) { // force normals according to field
-        for(smooth_data::iter it = ExtrudeParams::normals[i]->begin();
+        for(auto it = ExtrudeParams::normals[i]->begin();
             it != ExtrudeParams::normals[i]->end(); it++) {
           GEntity *ge = (GEntity *)(*entities.begin());
           FieldManager *fields = ge->model()->getFields();
@@ -224,7 +224,7 @@ static void addExtrudeNormals(std::set<T *> &entities,
       }
 #if defined(HAVE_POST)
       if(octrees.size()) { // scale normals by scalar views
-        for(smooth_data::iter it = ExtrudeParams::normals[i]->begin();
+        for(auto it = ExtrudeParams::normals[i]->begin();
             it != ExtrudeParams::normals[i]->end(); it++) {
           for(std::size_t j = 0; j < octrees.size(); j++) {
             double d;
@@ -286,7 +286,7 @@ FixErasedExtrScaleFlags(GModel *m, std::map<int, bool> &faceSkipScaleCalc,
   // a region, then it would not have been replaced except by a pointless
   // degenerate extrusion right on it...which makes no sense anyway.  So... just
   // loop through faces.
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
     ExtrudeParams *f_ep = (*it)->meshAttributes.extrude;
     if(!f_ep || !f_ep->mesh.ExtrudeMesh || !f_ep->mesh.ScaleLast) continue;
     std::vector<GEdge *> f_edges = (*it)->edges();
@@ -316,7 +316,7 @@ int Mesh2DWithBoundaryLayers(GModel *m)
   ExtrudeParams::calcLayerScaleFactor[1] = 0; // Trevor Strickler
 
   // 2D boundary layers
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
     GEdge *ge = *it;
     if(ge->getNativeType() == GEntity::GmshModel &&
        ge->geomType() == GEntity::BoundaryLayerCurve) {
@@ -351,7 +351,7 @@ int Mesh2DWithBoundaryLayers(GModel *m)
   }
 
   // 3D boundary layers
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
     GFace *gf = *it;
     if(gf->getNativeType() == GEntity::GmshModel &&
        gf->geomType() == GEntity::BoundaryLayerSurface) {
@@ -383,7 +383,7 @@ int Mesh2DWithBoundaryLayers(GModel *m)
         }
         std::vector<GEdge *> const &e = from->edges();
         sourceEdges.insert(e.begin(), e.end());
-        for(std::vector<GEdge *>::const_iterator ite = e.begin();
+        for(auto ite = e.begin();
             ite != e.end(); ite++) {
           if(edgeSkipScaleCalc.find((*ite)->tag()) == edgeSkipScaleCalc.end())
             edgeSkipScaleCalc[(*ite)->tag()] = true; // a default
@@ -412,21 +412,21 @@ int Mesh2DWithBoundaryLayers(GModel *m)
   // compute mesh dependencies in source faces (so we can e.g. create a boundary
   // layer on an extruded mesh)
   std::set<GFace *> sourceFacesDependencies;
-  for(std::set<GFace *>::iterator it = sourceFaces.begin();
+  for(auto it = sourceFaces.begin();
       it != sourceFaces.end(); it++)
     checkDepends(m, *it, sourceFacesDependencies);
   Msg::Info("%d dependencies in mesh of source faces",
             sourceFacesDependencies.size());
-  for(std::set<GFace *>::iterator it = sourceFacesDependencies.begin();
+  for(auto it = sourceFacesDependencies.begin();
       it != sourceFacesDependencies.end(); it++) {
     std::vector<GEdge *> const &e = (*it)->edges();
     sourceEdges.insert(e.begin(), e.end());
   }
 
   // compute set of non-source edges and faces
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
+  for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
     if(sourceEdges.find(*it) == sourceEdges.end()) otherEdges.insert(*it);
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
+  for(auto it = m->firstFace(); it != m->lastFace(); it++)
     if(sourceFaces.find(*it) == sourceFaces.end() &&
        sourceFacesDependencies.find(*it) == sourceFacesDependencies.end())
       otherFaces.insert(*it);
@@ -435,7 +435,7 @@ int Mesh2DWithBoundaryLayers(GModel *m)
   int nIter = 0;
   while(1) {
     int nPending = 0;
-    for(std::set<GFace *>::iterator it = sourceFacesDependencies.begin();
+    for(auto it = sourceFacesDependencies.begin();
         it != sourceFacesDependencies.end(); it++) {
       if((*it)->meshStatistics.status == GFace::PENDING) {
         (*it)->mesh(true);
@@ -445,7 +445,7 @@ int Mesh2DWithBoundaryLayers(GModel *m)
     if(!nPending) break;
     if(nIter++ > CTX::instance()->mesh.maxRetries) break;
   }
-  for(std::set<GFace *>::iterator it = sourceFaces.begin();
+  for(auto it = sourceFaces.begin();
       it != sourceFaces.end(); it++)
     (*it)->mesh(true);
 
@@ -465,7 +465,7 @@ int Mesh2DWithBoundaryLayers(GModel *m)
     addExtrudeNormals(sourceFaces, sourceFaceInfo, faceSkipScaleCalc);
 
   // set the position of boundary layer points using the smooth normal field
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
     GEdge *ge = *it;
     if(ge->geomType() == GEntity::BoundaryLayerCurve) {
       ExtrudeParams *ep = ge->meshAttributes.extrude;
@@ -494,13 +494,13 @@ int Mesh2DWithBoundaryLayers(GModel *m)
   // remesh non-source edges (since they might have been modified by the change
   // in boundary layer points)
   std::for_each(otherFaces.begin(), otherFaces.end(), deMeshGFace());
-  for(std::set<GEdge *>::iterator it = otherEdges.begin();
+  for(auto it = otherEdges.begin();
       it != otherEdges.end(); it++)
     (*it)->mesh(true);
 
   // mesh the curves bounding the boundary layers by extrusion using the smooth
   // normal field
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
     GEdge *ge = *it;
     if(ge->geomType() == GEntity::BoundaryLayerCurve) {
       Msg::Info("Meshing curve %d", ge->tag());
@@ -511,20 +511,20 @@ int Mesh2DWithBoundaryLayers(GModel *m)
   }
 
   // recompute mean plane for plane surfaces just in case
-  for(std::set<GFace *>::iterator it = otherFaces.begin();
+  for(auto it = otherFaces.begin();
       it != otherFaces.end(); it++) {
     GFace *gf = *it;
     if(gf->geomType() == GEntity::Plane) gf->computeMeanPlane();
   }
 
   // mesh non-source surfaces
-  for(std::set<GFace *>::iterator it = otherFaces.begin();
+  for(auto it = otherFaces.begin();
       it != otherFaces.end(); it++)
     (*it)->mesh(true);
 
   // mesh the surfaces bounding the boundary layers by extrusion using the
   // smooth normal field
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
     GFace *gf = *it;
     if(gf->geomType() == GEntity::BoundaryLayerSurface) {
       Msg::Info("Meshing surface %d (%s)", gf->tag(),
diff --git a/Mesh/BoundaryLayers.h b/Mesh/BoundaryLayers.h
index e9ac7a53ffc546b5eb97beea52a3b50cc4c7e329..af59578dadac0459fa9a9fd13a0e77bf912c7e40 100644
--- a/Mesh/BoundaryLayers.h
+++ b/Mesh/BoundaryLayers.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/CMakeLists.txt b/Mesh/CMakeLists.txt
index 48d424e138ce65ef4c2e31fd1f3b654559bcd367..53241f650eccdf89367c00a2817c3adf28765b06 100644
--- a/Mesh/CMakeLists.txt
+++ b/Mesh/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/DivideAndConquer.cpp b/Mesh/DivideAndConquer.cpp
index 8994786a6a6e6a41e801ee61bba97ef90841ffe4..93273dc85245c0e24a487939685c8302d1225483 100644
--- a/Mesh/DivideAndConquer.cpp
+++ b/Mesh/DivideAndConquer.cpp
@@ -34,7 +34,7 @@ PointNumero DocRecord::Predecessor(PointNumero a, PointNumero b)
   DListPeek p = points[a].adjacent;
 
   do {
-    if(p == NULL) return -1;
+    if(p == nullptr) return -1;
     if(p->point_num == b) return Pred(p)->point_num;
     p = Pred(p);
   } while(p != points[a].adjacent);
@@ -47,7 +47,7 @@ PointNumero DocRecord::Successor(PointNumero a, PointNumero b)
   DListPeek p = points[a].adjacent;
 
   do {
-    if(p == NULL) return -1;
+    if(p == nullptr) return -1;
     if(p->point_num == b) return Succ(p)->point_num;
     p = Succ(p);
   } while(p != points[a].adjacent);
@@ -58,7 +58,7 @@ PointNumero DocRecord::Successor(PointNumero a, PointNumero b)
 int DocRecord::FixFirst(PointNumero x, PointNumero f)
 {
   DListPeek p = points[x].adjacent;
-  if(p == NULL) return 0;
+  if(p == nullptr) return 0;
 
   int out = 0;
   DListPeek copy = p;
@@ -325,7 +325,7 @@ int DocRecord::DListInsert(PointNumero centerPoint, PointNumero newPoint)
   newp->point_num = newPoint;
 
   DListRecord **dlist = &points[centerPoint].adjacent;
-  if(*dlist == NULL) {
+  if(*dlist == nullptr) {
     *dlist = newp;
     Pred(*dlist) = newp;
     Succ(*dlist) = newp;
@@ -413,11 +413,11 @@ int DocRecord::DListDelete(DListPeek *dlist, PointNumero oldPoint)
 {
   DListPeek p;
 
-  if(*dlist == NULL) return 0;
+  if(*dlist == nullptr) return 0;
   if(Succ(*dlist) == *dlist) {
     if((*dlist)->point_num == oldPoint) {
       delete *dlist;
-      *dlist = NULL;
+      *dlist = nullptr;
       return 1;
     }
     else
@@ -455,7 +455,7 @@ int DocRecord::CountPointsOnHull()
   PointNumero p, p2, temp;
   int i, n = numPoints;
 
-  if(points[0].adjacent == NULL) return 0;
+  if(points[0].adjacent == nullptr) return 0;
   i = 1;
   p = 0;
   p2 = First(0);
@@ -473,7 +473,7 @@ void DocRecord::ConvexHull()
 {
   PointNumero p, p2, temp;
 
-  if(points[0].adjacent == NULL) return;
+  if(points[0].adjacent == nullptr) return;
   int count = 0;
   p = 0;
   _hull[count++] = p;
@@ -498,7 +498,7 @@ PointNumero *DocRecord::ConvertDlistToArray(DListPeek *dlist, int *n)
     p = Pred(p);
   } while(p != *dlist);
   ptr = new PointNumero[max + 1];
-  if(ptr == NULL) return NULL;
+  if(ptr == nullptr) return nullptr;
   p = *dlist;
   for(i = 0; i < max; i++) {
     ptr[i] = p->point_num;
@@ -507,7 +507,7 @@ PointNumero *DocRecord::ConvertDlistToArray(DListPeek *dlist, int *n)
     delete temp;
   }
   ptr[max] = ptr[0];
-  *dlist = NULL;
+  *dlist = nullptr;
   *n = max;
   return ptr;
 }
@@ -818,20 +818,20 @@ void DocRecord::RemoveAllDList()
   DListPeek p, temp;
 
   for(i = 0; i < numPoints; i++)
-    if(points[i].adjacent != NULL) {
+    if(points[i].adjacent != nullptr) {
       p = points[i].adjacent;
       do {
         temp = p;
         p = Pred(p);
         delete temp;
       } while(p != points[i].adjacent);
-      points[i].adjacent = NULL;
+      points[i].adjacent = nullptr;
     }
 }
 
 DocRecord::DocRecord(int n)
-  : _hullSize(0), _hull(NULL), _adjacencies(NULL), numPoints(n), points(NULL),
-    numTriangles(0), triangles(NULL)
+  : _hullSize(0), _hull(nullptr), _adjacencies(nullptr), numPoints(n), points(nullptr),
+    numTriangles(0), triangles(nullptr)
 {
   if(numPoints) points = new PointRecord[numPoints + 3000];
 }
@@ -850,7 +850,7 @@ DocRecord::~DocRecord()
 bool DocRecord::AdjacentNullptrExists()
 {
   for(int i = 0; i < numPoints; i++) {
-    if(points[i].adjacent == NULL) return false;
+    if(points[i].adjacent == nullptr) return false;
   }
   return true;
 }
@@ -883,7 +883,7 @@ void DocRecord::setPoints(fullMatrix<double> *p)
   for(int i = 0; i < p->size1(); i++) {
     x(i) = (*p)(i, 0);
     y(i) = (*p)(i, 1);
-    data(i) = (*p)(i, 2) < 0 ? (void *)1 : NULL;
+    data(i) = (*p)(i, 2) < 0 ? (void *)1 : nullptr;
   }
 }
 
@@ -940,7 +940,7 @@ std::set<int> DocRecord::tagInterior(double x, double y)
       std::pair<void *, void *> ab =
         std::make_pair(std::min(p[j]->data, p[(j + 1) % 3]->data),
                        std::max(p[j]->data, p[(j + 1) % 3]->data));
-      std::map<std::pair<void *, void *>, std::pair<int, int> >::iterator it =
+      auto it =
         edgesToTriangles.find(ab);
       if(it == edgesToTriangles.end()) {
         edgesToTriangles[ab] = std::make_pair(i, -1);
@@ -1101,7 +1101,7 @@ bool DocRecord::delaunay_conformity(GFace *gf)
 {
   std::vector<GEdge *> const &list = gf->edges();
 
-  for(std::vector<GEdge *>::const_iterator it = list.begin(); it != list.end();
+  for(auto it = list.begin(); it != list.end();
       it++) {
     GEdge *edge = *it;
     for(std::size_t i = 0; i < edge->getNumMeshElements(); i++) {
diff --git a/Mesh/DivideAndConquer.h b/Mesh/DivideAndConquer.h
index 409430bd6ae7eb9df11067c311d29f8a73c63e4d..ecf02dd9f79e4b26bc0c17d7c38919b3b178e90e 100644
--- a/Mesh/DivideAndConquer.h
+++ b/Mesh/DivideAndConquer.h
@@ -31,7 +31,7 @@ struct PointRecord {
   int flag; // 0:to be kept, 1:to be removed
   int identificator;
   std::vector<void *> vicinity;
-  PointRecord() : adjacent(0), data(0), flag(0), identificator(0)
+  PointRecord() : adjacent(nullptr), data(nullptr), flag(0), identificator(0)
   {
     where.v = where.h = 0.;
   }
@@ -108,9 +108,9 @@ public:
   {
     return std::binary_search(_hull, _hull + _hullSize, i);
   }
-  void makePosView(const std::string &, GFace *gf = NULL);
-  void printMedialAxis(Octree *_octree, const std::string &, GFace *gf = NULL,
-                       GEdge *ge = NULL);
+  void makePosView(const std::string &, GFace *gf = nullptr);
+  void printMedialAxis(Octree *_octree, const std::string &, GFace *gf = nullptr,
+                       GEdge *ge = nullptr);
   void voronoiCell(PointNumero pt, std::vector<SPoint2> &pts) const;
 
   std::set<std::pair<void *, void *> > boundaryEdges;
@@ -125,7 +125,7 @@ public:
   {
     void *a = (p1 < p2) ? p1 : p2;
     void *b = (p1 > p2) ? p1 : p2;
-    std::set<std::pair<void *, void *> >::iterator it =
+    auto it =
       boundaryEdges.find(std::make_pair(a, b));
     return it != boundaryEdges.end();
   }
@@ -155,7 +155,7 @@ public:
   {
     void *a = (p1 < p2) ? p1 : p2;
     void *b = (p1 > p2) ? p1 : p2;
-    std::set<std::pair<void *, void *> >::iterator it =
+    auto it =
       mesh_edges.find(std::make_pair(a, b));
     return it != mesh_edges.end();
   }
@@ -172,6 +172,6 @@ void centroidOfOrientedBox(std::vector<SPoint2> &pts, const double &angle,
                            double &area);
 void centroidOfPolygon(SPoint2 &pc, std::vector<SPoint2> &pts, double &xc,
                        double &yc, double &inertia, double &areaCell,
-                       simpleFunction<double> *bgm = 0);
+                       simpleFunction<double> *bgm = nullptr);
 
 #endif
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index c276bf292bef2d89518dc7e4fade80ee0bbb91f7..dc232798fc6d7ccdc0ce81ce980c682cabf0670a 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -51,27 +51,27 @@
 
 Field::~Field()
 {
-  for(std::map<std::string, FieldOption *>::iterator it = options.begin();
+  for(auto it = options.begin();
       it != options.end(); ++it)
     delete it->second;
-  for(std::map<std::string, FieldCallback *>::iterator it = callbacks.begin();
+  for(auto it = callbacks.begin();
       it != callbacks.end(); ++it)
     delete it->second;
 }
 
 FieldOption *Field::getOption(const std::string &optionName)
 {
-  std::map<std::string, FieldOption *>::iterator it = options.find(optionName);
+  auto it = options.find(optionName);
   if(it == options.end()) {
     Msg::Error("Field option '%s' does not exist", optionName.c_str());
-    return NULL;
+    return nullptr;
   }
   return it->second;
 }
 
 void FieldManager::reset()
 {
-  for(std::map<int, Field *>::iterator it = begin(); it != end(); it++) {
+  for(auto it = begin(); it != end(); it++) {
     delete it->second;
   }
   clear();
@@ -79,8 +79,8 @@ void FieldManager::reset()
 
 Field *FieldManager::get(int id)
 {
-  iterator it = find(id);
-  if(it == end()) return NULL;
+  auto it = find(id);
+  if(it == end()) return nullptr;
   return it->second;
 }
 
@@ -88,14 +88,14 @@ Field *FieldManager::newField(int id, const std::string &type_name)
 {
   if(find(id) != end()) {
     Msg::Error("Field id %i is already defined", id);
-    return 0;
+    return nullptr;
   }
   if(mapTypeName.find(type_name) == mapTypeName.end()) {
     Msg::Error("Unknown field type \"%s\"", type_name.c_str());
-    return 0;
+    return nullptr;
   }
   Field *f = (*mapTypeName[type_name])();
-  if(!f) return 0;
+  if(!f) return nullptr;
   f->id = id;
   (*this)[id] = f;
   return f;
@@ -104,7 +104,7 @@ Field *FieldManager::newField(int id, const std::string &type_name)
 int FieldManager::newId()
 {
   int i = 0;
-  iterator it = begin();
+  auto it = begin();
   while(1) {
     i++;
     while(it != end() && it->first < i) it++;
@@ -123,7 +123,7 @@ int FieldManager::maxId()
 
 void FieldManager::deleteField(int id)
 {
-  iterator it = find(id);
+  auto it = find(id);
   if(it == end()) {
     Msg::Error("Cannot delete field id %i, it does not exist", id);
     return;
@@ -146,7 +146,7 @@ private:
 public:
   StructuredField()
   {
-    _data = 0;
+    _data = nullptr;
 
     options["FileName"] =
       new FieldOptionPath(_fileName, "Name of the input file", &updateNeeded);
@@ -187,7 +187,7 @@ public:
     if(_data) delete[] _data;
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     if(updateNeeded) {
       _errorStatus = false;
@@ -281,11 +281,11 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Tag of the field to evaluate", 0, true);
+      new FieldOptionInt(_inField, "Tag of the field to evaluate", nullptr, true);
   }
   const char *getName() { return "LonLat"; }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -375,7 +375,7 @@ public:
            std::pow((psbox[2] - zp), 2));
     return dist;
   }
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     // inside
     if(x >= _xMin && x <= _xMax && y >= _yMin && y <= _yMax && z >= _zMin &&
@@ -432,7 +432,7 @@ public:
   }
   const char *getName() { return "Cylinder"; }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double dx = x - _xc;
     double dy = y - _yc;
@@ -486,7 +486,7 @@ public:
   }
   const char *getName() { return "Ball"; }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double dx = x - _xc;
     double dy = y - _yc;
@@ -561,25 +561,25 @@ public:
 
     // deprecated names
     options["R1_inner"] = new FieldOptionDouble(
-      _r1i, "Inner radius of Frustum at endpoint 1", 0, true);
+      _r1i, "Inner radius of Frustum at endpoint 1", nullptr, true);
     options["R1_outer"] = new FieldOptionDouble(
-      _r1o, "Outer radius of Frustum at endpoint 1", 0, true);
+      _r1o, "Outer radius of Frustum at endpoint 1", nullptr, true);
     options["R2_inner"] = new FieldOptionDouble(
-      _r2i, "Inner radius of Frustum at endpoint 2", 0, true);
+      _r2i, "Inner radius of Frustum at endpoint 2", nullptr, true);
     options["R2_outer"] = new FieldOptionDouble(
-      _r2o, "Outer radius of Frustum at endpoint 2", 0, true);
+      _r2o, "Outer radius of Frustum at endpoint 2", nullptr, true);
     options["V1_inner"] = new FieldOptionDouble(
-      _v1i, "Element size at point 1, inner radius", 0, true);
+      _v1i, "Element size at point 1, inner radius", nullptr, true);
     options["V1_outer"] = new FieldOptionDouble(
-      _v1o, "Element size at point 1, outer radius", 0, true);
+      _v1o, "Element size at point 1, outer radius", nullptr, true);
     options["V2_inner"] = new FieldOptionDouble(
-      _v2i, "Element size at point 2, inner radius", 0, true);
+      _v2i, "Element size at point 2, inner radius", nullptr, true);
     options["V2_outer"] = new FieldOptionDouble(
-      _v2o, "Element size at point 2, outer radius", 0, true);
+      _v2o, "Element size at point 2, outer radius", nullptr, true);
   }
   const char *getName() { return "Frustum"; }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double dx = x - _x1;
     double dy = y - _y1;
@@ -651,14 +651,14 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Tag of the field to evaluate", 0, true);
+      new FieldOptionInt(_inField, "Tag of the field to evaluate", nullptr, true);
     options["LcMin"] =
-      new FieldOptionDouble(_lcMin, "Element size inside DistMin", 0, true);
+      new FieldOptionDouble(_lcMin, "Element size inside DistMin", nullptr, true);
     options["LcMax"] =
-      new FieldOptionDouble(_lcMax, "Element size outside DistMax", 0, true);
+      new FieldOptionDouble(_lcMax, "Element size outside DistMax", nullptr, true);
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -705,10 +705,10 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -761,7 +761,7 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
   }
   void grad_norm(Field &f, double x, double y, double z, double *g)
   {
@@ -774,7 +774,7 @@ public:
     g[2] /= n;
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -816,10 +816,10 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -870,10 +870,10 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -909,10 +909,10 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *field = GModel::current()->getFields()->get(_inField);
     if(!field || _inField == id) return MAX_LC;
@@ -930,7 +930,7 @@ private:
   std::set<int> _fields;
 
 public:
-  MathEvalExpression() : _f(0) {}
+  MathEvalExpression() : _f(nullptr) {}
   ~MathEvalExpression()
   {
     if(_f) delete _f;
@@ -959,7 +959,7 @@ public:
     variables[1] = "y";
     variables[2] = "z";
     i = 3;
-    for(std::set<int>::iterator it = _fields.begin(); it != _fields.end();
+    for(auto it = _fields.begin(); it != _fields.end();
         it++) {
       std::ostringstream sstream;
       sstream << "F" << *it;
@@ -969,7 +969,7 @@ public:
     _f = new mathEvaluator(expressions, variables);
     if(expressions.empty()) {
       delete _f;
-      _f = 0;
+      _f = nullptr;
       return false;
     }
     return true;
@@ -982,7 +982,7 @@ public:
     values[1] = y;
     values[2] = z;
     int i = 3;
-    for(std::set<int>::iterator it = _fields.begin(); it != _fields.end();
+    for(auto it = _fields.begin(); it != _fields.end();
         it++) {
       Field *field = GModel::current()->getFields()->get(*it);
       values[i++] = field ? (*field)(x, y, z) : MAX_LC;
@@ -1002,7 +1002,7 @@ private:
 public:
   MathEvalExpressionAniso()
   {
-    for(int i = 0; i < 6; i++) _f[i] = 0;
+    for(int i = 0; i < 6; i++) _f[i] = nullptr;
   }
   ~MathEvalExpressionAniso()
   {
@@ -1034,7 +1034,7 @@ public:
     variables[1] = "y";
     variables[2] = "z";
     i = 3;
-    for(std::set<int>::iterator it = _fields[iFunction].begin();
+    for(auto it = _fields[iFunction].begin();
         it != _fields[iFunction].end(); it++) {
       std::ostringstream sstream;
       sstream << "F" << *it;
@@ -1044,7 +1044,7 @@ public:
     _f[iFunction] = new mathEvaluator(expressions, variables);
     if(expressions.empty()) {
       delete _f[iFunction];
-      _f[iFunction] = 0;
+      _f[iFunction] = nullptr;
       return false;
     }
     return true;
@@ -1061,7 +1061,7 @@ public:
         values[1] = y;
         values[2] = z;
         int i = 3;
-        for(std::set<int>::iterator it = _fields[iFunction].begin();
+        for(auto it = _fields[iFunction].begin();
             it != _fields[iFunction].end(); it++) {
           Field *field = GModel::current()->getFields()->get(*it);
           values[i++] = field ? (*field)(x, y, z) : MAX_LC;
@@ -1088,7 +1088,7 @@ public:
       _f, "Mathematical function to evaluate.", &updateNeeded);
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double ret = 0;
 #if defined(_OPENMP)
@@ -1157,7 +1157,7 @@ public:
     options["m23"] = new FieldOptionString(
       _f[5], "Element 23 of the metric tensor", &updateNeeded, true);
   }
-  void operator()(double x, double y, double z, SMetric3 &metr, GEntity *ge = 0)
+  void operator()(double x, double y, double z, SMetric3 &metr, GEntity *ge = nullptr)
   {
 #if defined(_OPENMP)
 #pragma omp critical
@@ -1174,7 +1174,7 @@ public:
       _expr.evaluate(x, y, z, metr);
     }
   }
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     SMetric3 metr;
 #if defined(_OPENMP)
@@ -1353,7 +1353,7 @@ public:
   }
   ~ExternalProcessField() { closePipes(); }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double xyz[3] = {x, y, z};
     double f;
@@ -1460,7 +1460,7 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
   }
   std::string getDescription()
   {
@@ -1470,7 +1470,7 @@ public:
            "and FZ expressions.";
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     if(updateNeeded) {
       for(int i = 0; i < 3; i++) {
@@ -1499,7 +1499,7 @@ private:
 public:
   PostViewField()
   {
-    _octree = 0;
+    _octree = nullptr;
     _viewIndex = 0;
     _viewTag = -1;
     _cropNegativeValues = true;
@@ -1524,12 +1524,12 @@ public:
   }
   PView *getView() const
   {
-    PView *v = 0;
+    PView *v = nullptr;
     if(_viewTag >= 0) v = PView::getViewByTag(_viewTag);
     if(!v) {
       if(_viewIndex < 0 || _viewIndex >= (int)PView::list.size()) {
         Msg::Error("View[%d] does not exist", _viewIndex);
-        return 0;
+        return nullptr;
       }
       v = PView::list[_viewIndex];
     }
@@ -1537,7 +1537,7 @@ public:
       Msg::Error(
         "Cannot use view based on current mesh for background mesh: you might"
         " want to use a list-based view (.pos file) instead");
-      return 0;
+      return nullptr;
     }
     return v;
   }
@@ -1547,7 +1547,7 @@ public:
     if(v && v->getData()->getNumTensors()) return false;
     return true;
   }
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     PView *v = getView();
     if(!v) return MAX_LC;
@@ -1559,12 +1559,12 @@ public:
     double l = 0.;
     // use large tolerance (in element reference coordinates) to maximize chance
     // of finding an element
-    if(!_octree->searchScalarWithTol(x, y, z, &l, 0, 0, 0.05))
+    if(!_octree->searchScalarWithTol(x, y, z, &l, 0, nullptr, 0.05))
       Msg::Info("No scalar element found containing point (%g,%g,%g)", x, y, z);
     if(l <= 0 && _cropNegativeValues) return MAX_LC;
     return l;
   }
-  void operator()(double x, double y, double z, SMetric3 &metr, GEntity *ge = 0)
+  void operator()(double x, double y, double z, SMetric3 &metr, GEntity *ge = nullptr)
   {
     PView *v = getView();
     if(!v) return;
@@ -1576,7 +1576,7 @@ public:
     double l[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.};
     // use large tolerance (in element reference coordinates) to maximize chance
     // of finding an element
-    if(!_octree->searchTensorWithTol(x, y, z, l, 0, 0, 0.05))
+    if(!_octree->searchTensorWithTol(x, y, z, l, 0, nullptr, 0.05))
       Msg::Info("No tensor element found containing point (%g,%g,%g)", x, y, z);
     if(0 && _cropNegativeValues) {
       if(l[0] <= 0 && l[1] <= 0 && l[2] <= 0 && l[3] <= 0 && l[4] <= 0 &&
@@ -1624,10 +1624,10 @@ public:
     return "Take the intersection of a list of possibly anisotropic fields.";
   }
   virtual void operator()(double x, double y, double z, SMetric3 &metr,
-                          GEntity *ge = 0)
+                          GEntity *ge = nullptr)
   {
     SMetric3 v(1. / MAX_LC);
-    for(std::list<int>::iterator it = _fieldIds.begin(); it != _fieldIds.end();
+    for(auto it = _fieldIds.begin(); it != _fieldIds.end();
         it++) {
       Field *f = (GModel::current()->getFields()->get(*it));
       SMetric3 ff;
@@ -1644,11 +1644,11 @@ public:
     }
     metr = v;
   }
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     SMetric3 metr(1. / MAX_LC);
     double v = MAX_LC;
-    for(std::list<int>::iterator it = _fieldIds.begin(); it != _fieldIds.end();
+    for(auto it = _fieldIds.begin(); it != _fieldIds.end();
         it++) {
       Field *f = (GModel::current()->getFields()->get(*it));
       SMetric3 m;
@@ -1687,11 +1687,11 @@ public:
            "Alauzet.";
   }
   virtual void operator()(double x, double y, double z, SMetric3 &metr,
-                          GEntity *ge = 0)
+                          GEntity *ge = nullptr)
   {
     // check if _fieldIds contains 2 elements other error message
     SMetric3 v;
-    for(std::list<int>::iterator it = _fieldIds.begin(); it != _fieldIds.end();
+    for(auto it = _fieldIds.begin(); it != _fieldIds.end();
         it++) {
       Field *f = (GModel::current()->getFields()->get(*it));
       SMetric3 ff;
@@ -1711,11 +1711,11 @@ public:
     }
     metr = v;
   }
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     // check if _fieldIds contains 2 elements other error message
     SMetric3 metr;
-    for(std::list<int>::iterator it = _fieldIds.begin(); it != _fieldIds.end();
+    for(auto it = _fieldIds.begin(); it != _fieldIds.end();
         it++) {
       Field *f = (GModel::current()->getFields()->get(*it));
       SMetric3 m;
@@ -1754,10 +1754,10 @@ public:
     return "Take the minimum value of a list of fields.";
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double v = MAX_LC;
-    for(std::list<int>::iterator it = _fieldIds.begin(); it != _fieldIds.end();
+    for(auto it = _fieldIds.begin(); it != _fieldIds.end();
         it++) {
       Field *f = (GModel::current()->getFields()->get(*it));
       if(f && *it != id) {
@@ -1793,10 +1793,10 @@ public:
     return "Take the maximum value of a list of fields.";
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     double v = -MAX_LC;
-    for(std::list<int>::iterator it = _fieldIds.begin(); it != _fieldIds.end();
+    for(auto it = _fieldIds.begin(); it != _fieldIds.end();
         it++) {
       Field *f = (GModel::current()->getFields()->get(*it));
       if(f && *it != id) {
@@ -1835,15 +1835,15 @@ public:
 
     // deprecated names
     options["IField"] =
-      new FieldOptionInt(_inField, "Input field tag", 0, true);
+      new FieldOptionInt(_inField, "Input field tag", nullptr, true);
     options["VerticesList"] =
-      new FieldOptionList(_pointTags, "Point tags", 0, true);
+      new FieldOptionList(_pointTags, "Point tags", nullptr, true);
     options["EdgesList"] =
-      new FieldOptionList(_curveTags, "Curve tags", 0, true);
+      new FieldOptionList(_curveTags, "Curve tags", nullptr, true);
     options["FacesList"] =
-      new FieldOptionList(_surfaceTags, "Surface tags", 0, true);
+      new FieldOptionList(_surfaceTags, "Surface tags", nullptr, true);
     options["RegionsList"] =
-      new FieldOptionList(_volumeTags, "Volume tags", 0, true);
+      new FieldOptionList(_volumeTags, "Volume tags", nullptr, true);
   }
   std::string getDescription()
   {
@@ -1851,7 +1851,7 @@ public:
            "points, curves, surfaces or volumes.";
   }
   using Field::operator();
-  double operator()(double x, double y, double z, GEntity *ge = 0)
+  double operator()(double x, double y, double z, GEntity *ge = nullptr)
   {
     Field *f = (GModel::current()->getFields()->get(_inField));
     if(!f || _inField == id) return MAX_LC;
@@ -1893,7 +1893,7 @@ private:
   std::vector<SVector3> _tg;
 
 public:
-  AttractorAnisoCurveField() : _kdTree(0), _zeroNodes(0)
+  AttractorAnisoCurveField() : _kdTree(nullptr), _zeroNodes(nullptr)
   {
     _index = new ANNidx[1];
     _dist = new ANNdist[1];
@@ -1940,32 +1940,32 @@ public:
       _dMin,
       "Minimum distance, below this distance from the curves, "
       "prescribe the minimum mesh sizes",
-      0, true);
+      nullptr, true);
     options["dMax"] = new FieldOptionDouble(
       _dMax,
       "Maxmium distance, above this distance from the curves, prescribe "
       "the maximum mesh sizes",
-      0, true);
+      nullptr, true);
     options["lMinTangent"] = new FieldOptionDouble(
       _lMinTangent,
       "Minimum mesh size in the direction tangeant to the "
       "closest curve",
-      0, true);
+      nullptr, true);
     options["lMaxTangent"] = new FieldOptionDouble(
       _lMaxTangent,
       "Maximum mesh size in the direction tangeant to the "
       "closest curve",
-      0, true);
+      nullptr, true);
     options["lMinNormal"] =
       new FieldOptionDouble(_lMinNormal,
                             "Minimum mesh size in the direction normal to the "
                             "closest curve",
-                            0, true);
+                            nullptr, true);
     options["lMaxNormal"] =
       new FieldOptionDouble(_lMaxNormal,
                             "Maximum mesh size in the direction normal to the "
                             "closest curve",
-                            0, true);
+                            nullptr, true);
 
     // make sure all internal GEO CAD data has been synced with GModel
     GModel::current()->getGEOInternals()->synchronize(GModel::current());
@@ -1998,7 +1998,7 @@ public:
     if(totpoints) { _zeroNodes = annAllocPts(totpoints, 3); }
     _tg.resize(totpoints);
     int k = 0;
-    for(std::list<int>::iterator it = _curveTags.begin();
+    for(auto it = _curveTags.begin();
         it != _curveTags.end(); ++it) {
       GEdge *e = GModel::current()->getEdgeByTag(*it);
       if(e) {
@@ -2020,7 +2020,7 @@ public:
     _kdTree = new ANNkd_tree(_zeroNodes, totpoints, 3);
     updateNeeded = false;
   }
-  void operator()(double x, double y, double z, SMetric3 &metr, GEntity *ge = 0)
+  void operator()(double x, double y, double z, SMetric3 &metr, GEntity *ge = nullptr)
   {
     if(updateNeeded) update();
     double xyz[3] = {x, y, z};
@@ -2044,7 +2044,7 @@ public:
     SVector3 n1 = crossprod(t, n0);
     metr = SMetric3(1 / lTg / lTg, 1 / lN / lN, 1 / lN / lN, t, n0, n1);
   }
-  virtual double operator()(double X, double Y, double Z, GEntity *ge = 0)
+  virtual double operator()(double X, double Y, double Z, GEntity *ge = nullptr)
   {
     if(updateNeeded) update();
     double xyz[3] = {X, Y, Z};
@@ -2072,7 +2072,7 @@ private:
 
 public:
   AttractorField(int dim, int tag, int nbe)
-    : _kdTree(0), _zeroNodes(0), _numPointsPerCurve(nbe)
+    : _kdTree(nullptr), _zeroNodes(nullptr), _numPointsPerCurve(nbe)
   {
     _index = new ANNidx[1];
     _dist = new ANNdist[1];
@@ -2082,11 +2082,11 @@ public:
       _curveTags.push_back(tag);
     else if(dim == 2)
       _surfaceTags.push_back(tag);
-    _xField = _yField = _zField = NULL;
+    _xField = _yField = _zField = nullptr;
     _xFieldId = _yFieldId = _zFieldId = -1;
     updateNeeded = true;
   }
-  AttractorField() : _kdTree(0), _zeroNodes(0)
+  AttractorField() : _kdTree(nullptr), _zeroNodes(nullptr)
   {
     _index = new ANNidx[1];
     _dist = new ANNdist[1];
@@ -2143,7 +2143,7 @@ public:
            "The Attractor field is deprecated: use the Distance field instead.";
   }
   void getCoord(double x, double y, double z, double &cx, double &cy,
-                double &cz, GEntity *ge = NULL)
+                double &cz, GEntity *ge = nullptr)
   {
     cx = _xField ? (*_xField)(x, y, z, ge) : x;
     cy = _yField ? (*_yField)(x, y, z, ge) : y;
@@ -2160,13 +2160,13 @@ public:
     if(updateNeeded) {
       _xField = _xFieldId >= 0 ?
                   (GModel::current()->getFields()->get(_xFieldId)) :
-                  NULL;
+                  nullptr;
       _yField = _yFieldId >= 0 ?
                   (GModel::current()->getFields()->get(_yFieldId)) :
-                  NULL;
+                  nullptr;
       _zField = _zFieldId >= 0 ?
                   (GModel::current()->getFields()->get(_zFieldId)) :
-                  NULL;
+                  nullptr;
       if(_zeroNodes) {
         annDeallocPts(_zeroNodes);
         delete _kdTree;
@@ -2175,7 +2175,7 @@ public:
       std::vector<SPoint2> uvpoints;
       std::vector<int> offset;
       offset.push_back(0);
-      for(std::list<int>::iterator it = _surfaceTags.begin();
+      for(auto it = _surfaceTags.begin();
           it != _surfaceTags.end(); ++it) {
         GFace *f = GModel::current()->getFaceByTag(*it);
         if(f) {
@@ -2202,7 +2202,7 @@ public:
       double x, y, z;
       std::vector<double> px, py, pz;
 
-      for(std::list<int>::iterator it = _pointTags.begin();
+      for(auto it = _pointTags.begin();
           it != _pointTags.end(); ++it) {
         GVertex *gv = GModel::current()->getVertexByTag(*it);
         if(gv) {
@@ -2214,7 +2214,7 @@ public:
         }
       }
 
-      for(std::list<int>::iterator it = _curveTags.begin();
+      for(auto it = _curveTags.begin();
           it != _curveTags.end(); ++it) {
         GEdge *e = GModel::current()->getEdgeByTag(*it);
         if(e) {
@@ -2247,7 +2247,7 @@ public:
       // This can lead to weird results as we generate attractors over the whole
       // parametric plane (we should really use a mesh, e.g. a refined STL.)
       int count = 0;
-      for(std::list<int>::iterator it = _surfaceTags.begin();
+      for(auto it = _surfaceTags.begin();
           it != _surfaceTags.end(); ++it) {
         GFace *f = GModel::current()->getFaceByTag(*it);
         if(f) {
@@ -2305,7 +2305,7 @@ public:
   }
 
   using Field::operator();
-  virtual double operator()(double X, double Y, double Z, GEntity *ge = 0)
+  virtual double operator()(double X, double Y, double Z, GEntity *ge = nullptr)
   {
 #if defined(_OPENMP)
 #pragma omp critical
@@ -2438,7 +2438,7 @@ double _l0;
 public:
 OctreeField()
 {
-  _root = NULL;
+  _root = nullptr;
 
   options["InField"] = new FieldOptionInt(
     _inFieldId, "Id of the field to represent on the octree", &updateNeeded);
@@ -2458,13 +2458,13 @@ void update()
     updateNeeded = false;
     if(_root) {
       delete _root;
-      _root = NULL;
+      _root = nullptr;
     }
   }
   if(!_root) {
     _inField = _inFieldId >= 0 ?
                  (GModel::current()->getFields()->get(_inFieldId)) :
-                 NULL;
+                 nullptr;
     if(!_inField) return;
     GModel::current()->getFields()->get(_inFieldId)->update();
     bounds = GModel::current()->bounds();
@@ -2476,7 +2476,7 @@ void update()
   }
 }
 using Field::operator();
-virtual double operator()(double X, double Y, double Z, GEntity *ge = 0)
+virtual double operator()(double X, double Y, double Z, GEntity *ge = nullptr)
 {
   SPoint3 xmin = bounds.min();
   SVector3 d = bounds.max() - xmin;
@@ -2557,7 +2557,7 @@ class DistanceField : public Field {
   double _outDistSqr;
 
 public:
-  DistanceField() : _index(NULL), _pc2kd(_P), _outIndex(0), _outDistSqr(0)
+  DistanceField() : _index(nullptr), _pc2kd(_P), _outIndex(0), _outDistSqr(0)
   {
     _numPointsPerCurve = 20;
     _xFieldId = _yFieldId = _zFieldId = -1;
@@ -2595,7 +2595,7 @@ public:
       true);
   }
   DistanceField(int dim, int tag, int nbe)
-    : _numPointsPerCurve(nbe), _index(NULL), _pc2kd(_P), _outIndex(0),
+    : _numPointsPerCurve(nbe), _index(nullptr), _pc2kd(_P), _outIndex(0),
       _outDistSqr(0)
   {
     if(dim == 0)
@@ -2604,7 +2604,7 @@ public:
       _curveTags.push_back(tag);
     else if(dim == 3)
       _surfaceTags.push_back(tag);
-    _xField = _yField = _zField = NULL;
+    _xField = _yField = _zField = nullptr;
     _xFieldId = _yFieldId = _zFieldId = -1;
     updateNeeded = true;
   }
@@ -2632,18 +2632,18 @@ public:
     if(updateNeeded) {
       _xField = _xFieldId >= 0 ?
                   (GModel::current()->getFields()->get(_xFieldId)) :
-                  NULL;
+                  nullptr;
       _yField = _yFieldId >= 0 ?
                   (GModel::current()->getFields()->get(_yFieldId)) :
-                  NULL;
+                  nullptr;
       _zField = _zFieldId >= 0 ?
                   (GModel::current()->getFields()->get(_zFieldId)) :
-                  NULL;
+                  nullptr;
 
       _infos.clear();
       std::vector<SPoint3> &points = _P.pts;
       points.clear();
-      for(std::list<int>::iterator it = _surfaceTags.begin();
+      for(auto it = _surfaceTags.begin();
           it != _surfaceTags.end(); ++it) {
         GFace *f = GModel::current()->getFaceByTag(*it);
         if(f) {
@@ -2670,7 +2670,7 @@ public:
         }
       }
 
-      for(std::list<int>::iterator it = _pointTags.begin();
+      for(auto it = _pointTags.begin();
           it != _pointTags.end(); ++it) {
         GVertex *gv = GModel::current()->getVertexByTag(*it);
         if(gv) {
@@ -2679,7 +2679,7 @@ public:
         }
       }
 
-      for(std::list<int>::iterator it = _curveTags.begin();
+      for(auto it = _curveTags.begin();
           it != _curveTags.end(); ++it) {
         GEdge *e = GModel::current()->getEdgeByTag(*it);
         if(e) {
@@ -2713,7 +2713,7 @@ public:
     }
   }
   using Field::operator();
-  virtual double operator()(double X, double Y, double Z, GEntity *ge = 0)
+  virtual double operator()(double X, double Y, double Z, GEntity *ge = nullptr)
   {
     if(!_index) return MAX_LC;
     double query_pt[3] = {X, Y, Z};
@@ -2815,18 +2815,18 @@ BoundaryLayerField::BoundaryLayerField()
     hWallN,
     "Mesh size normal to the curvem per point (overwrites "
     "Size when defined)",
-    0, true);
+    nullptr, true);
   options["hwall_n_nodes"] = new FieldOptionListDouble(
     _hWallNNodes,
     "Mesh size normal to the curve, per point (overwrites "
     "Size when defined)",
-    0, true);
+    nullptr, true);
   options["ratio"] = new FieldOptionDouble(
-    ratio, "Size ratio between two successive layers", 0, true);
+    ratio, "Size ratio between two successive layers", nullptr, true);
   options["hfar"] =
-    new FieldOptionDouble(hFar, "Element size far from the wall", 0, true);
+    new FieldOptionDouble(hFar, "Element size far from the wall", nullptr, true);
   options["thickness"] = new FieldOptionDouble(
-    thickness, "Maximal thickness of the boundary layer", 0, true);
+    thickness, "Maximal thickness of the boundary layer", nullptr, true);
   options["ExcludedFaceList"] =
     new FieldOptionList(_excludedSurfaceTags,
                         "Tags of surfaces in the geometric model where the "
@@ -2836,7 +2836,7 @@ BoundaryLayerField::BoundaryLayerField()
 
 void BoundaryLayerField::removeAttractors()
 {
-  for(std::list<DistanceField *>::iterator it = _attFields.begin();
+  for(auto it = _attFields.begin();
       it != _attFields.end(); ++it)
     delete *it;
   _attFields.clear();
@@ -2899,7 +2899,7 @@ bool BoundaryLayerField::setupFor2d(int iF)
   std::vector<GEdge *> const &embedded_edges = gf->embeddedEdges();
   ed.insert(ed.begin(), embedded_edges.begin(), embedded_edges.end());
 
-  for(std::vector<GEdge *>::iterator it = ed.begin(); it != ed.end(); ++it) {
+  for(auto it = ed.begin(); it != ed.end(); ++it) {
     bool isIn = false;
     int iE = (*it)->tag();
     bool found = std::find(_curveTagsSaved.begin(), _curveTagsSaved.end(),
@@ -2908,7 +2908,7 @@ bool BoundaryLayerField::setupFor2d(int iF)
     if(found) {
       std::vector<GFace *> fc = (*it)->faces();
       int numf = 0;
-      for(std::vector<GFace *>::iterator it = fc.begin(); it != fc.end();
+      for(auto it = fc.begin(); it != fc.end();
           it++) {
         if((*it)->meshAttributes.extrude &&
            (*it)->meshAttributes.extrude->geo.Mode == EXTRUDED_ENTITY) {
@@ -2948,11 +2948,11 @@ bool BoundaryLayerField::setupFor2d(int iF)
 double BoundaryLayerField::operator()(double x, double y, double z, GEntity *ge)
 {
   if(updateNeeded) {
-    for(std::list<int>::iterator it = _pointTags.begin();
+    for(auto it = _pointTags.begin();
         it != _pointTags.end(); ++it) {
       _attFields.push_back(new DistanceField(0, *it, 100000));
     }
-    for(std::list<int>::iterator it = _curveTags.begin();
+    for(auto it = _curveTags.begin();
         it != _curveTags.end(); ++it) {
       _attFields.push_back(new DistanceField(1, *it, 300000));
     }
@@ -2961,7 +2961,7 @@ double BoundaryLayerField::operator()(double x, double y, double z, GEntity *ge)
 
   double dist = 1.e22;
   if(_attFields.empty()) return dist;
-  for(std::list<DistanceField *>::iterator it = _attFields.begin();
+  for(auto it = _attFields.begin();
       it != _attFields.end(); ++it) {
     double cdist = (*(*it))(x, y, z);
     if(cdist < dist) { dist = cdist; }
@@ -2983,7 +2983,7 @@ void BoundaryLayerField::computeFor1dMesh(double x, double y, double z,
 {
   double xpk = 0., ypk = 0., zpk = 0.;
   double distk = 1.e22;
-  for(std::list<int>::iterator it = _pointTags.begin(); it != _pointTags.end();
+  for(auto it = _pointTags.begin(); it != _pointTags.end();
       ++it) {
     GVertex *v = GModel::current()->getVertexByTag(*it);
     double xp = v->x();
@@ -3102,11 +3102,11 @@ void BoundaryLayerField::operator()(double x, double y, double z,
                                     SMetric3 &metr, GEntity *ge)
 {
   if(updateNeeded) {
-    for(std::list<int>::iterator it = _pointTags.begin();
+    for(auto it = _pointTags.begin();
         it != _pointTags.end(); ++it) {
       _attFields.push_back(new DistanceField(0, *it, 100000));
     }
-    for(std::list<int>::iterator it = _curveTags.begin();
+    for(auto it = _curveTags.begin();
         it != _curveTags.end(); ++it) {
       _attFields.push_back(new DistanceField(1, *it, 10000));
     }
@@ -3114,11 +3114,11 @@ void BoundaryLayerField::operator()(double x, double y, double z,
   }
 
   currentDistance = 1.e22;
-  currentClosest = 0;
+  currentClosest = nullptr;
   std::vector<SMetric3> hop;
   SMetric3 v(1. / (CTX::instance()->mesh.lcMax * CTX::instance()->mesh.lcMax));
   hop.push_back(v);
-  for(std::list<DistanceField *>::iterator it = _attFields.begin();
+  for(auto it = _attFields.begin();
       it != _attFields.end(); ++it) {
     double cdist = (*(*it))(x, y, z);
     SPoint3 CLOSEST = (*it)->getAttractorInfo().second;
@@ -3182,16 +3182,16 @@ FieldManager::FieldManager()
 
 void FieldManager::initialize()
 {
-  std::map<int, Field *>::iterator it = begin();
+  auto it = begin();
   for(; it != end(); ++it) it->second->update();
 }
 
 FieldManager::~FieldManager()
 {
-  for(std::map<std::string, FieldFactory *>::iterator it = mapTypeName.begin();
+  for(auto it = mapTypeName.begin();
       it != mapTypeName.end(); it++)
     delete it->second;
-  for(FieldManager::iterator it = begin(); it != end(); it++) delete it->second;
+  for(auto it = begin(); it != end(); it++) delete it->second;
 }
 
 void FieldManager::setBackgroundField(Field *BGF)
@@ -3267,10 +3267,10 @@ double GenericField::operator()(double x, double y, double z, GEntity *ge)
 {
   std::vector<double> sizes(cbs_with_data.size() +
                             cbs_extended_with_data.size());
-  std::vector<double>::iterator it = sizes.begin();
+  auto it = sizes.begin();
 
   // Go over all callback functions
-  for(std::vector<std::pair<ptrfunction, void *> >::iterator itcbs =
+  for(auto itcbs =
         cbs_with_data.begin();
       itcbs != cbs_with_data.end(); itcbs++, it++) {
     bool ok = (itcbs->first)(x, y, z, itcbs->second, (*it));
@@ -3278,7 +3278,7 @@ double GenericField::operator()(double x, double y, double z, GEntity *ge)
   }
 
   // Go over all extended callback functions
-  for(std::vector<std::pair<ptrfunctionextended, void *> >::iterator itcbs =
+  for(auto itcbs =
         cbs_extended_with_data.begin();
       itcbs != cbs_extended_with_data.end(); itcbs++, it++) {
     bool ok = (itcbs->first)(x, y, z, ge, itcbs->second, (*it));
diff --git a/Mesh/Field.h b/Mesh/Field.h
index 8b1a46379919d8afb8387fa620ad85a417dbd0a7..b800a9384ada8ef052be816afe484c9f39a01f4e 100644
--- a/Mesh/Field.h
+++ b/Mesh/Field.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -110,10 +110,10 @@ public:
   std::map<std::string, FieldCallback *> callbacks;
   virtual bool isotropic() const { return true; }
   // isotropic
-  virtual double operator()(double x, double y, double z, GEntity *ge = 0) = 0;
+  virtual double operator()(double x, double y, double z, GEntity *ge = nullptr) = 0;
   // anisotropic
   virtual void operator()(double x, double y, double z, SMetric3 &,
-                          GEntity *ge = 0)
+                          GEntity *ge = nullptr)
   {
   }
   bool updateNeeded;
@@ -200,9 +200,9 @@ public:
   virtual std::string getDescription();
   BoundaryLayerField();
   ~BoundaryLayerField() { removeAttractors(); }
-  virtual double operator()(double x, double y, double z, GEntity *ge = 0);
+  virtual double operator()(double x, double y, double z, GEntity *ge = nullptr);
   virtual void operator()(double x, double y, double z, SMetric3 &metr,
-                          GEntity *ge = 0);
+                          GEntity *ge = nullptr);
   bool isEdgeBL(int iE) const
   {
     return std::find(_curveTags.begin(), _curveTags.end(), iE) !=
@@ -222,8 +222,8 @@ public:
   {
     if(_fanPointTags.size() != _fanSizes.size())
       return CTX::instance()->mesh.boundaryLayerFanPoints;
-    std::list<int>::iterator it1 = _fanPointTags.begin();
-    std::list<int>::iterator it2 = _fanSizes.begin();
+    auto it1 = _fanPointTags.begin();
+    auto it2 = _fanSizes.begin();
     for(; it1 != _fanPointTags.end(); ++it1, ++it2) {
       if(*it1 == iV) return *it2;
     }
@@ -237,7 +237,7 @@ public:
   }
   double hWall(int iV)
   {
-    for(std::list<double>::iterator it = _hWallNNodes.begin();
+    for(auto it = _hWallNNodes.begin();
         it != _hWallNNodes.end(); ++it) {
       int i = (int)*it;
       ++it;
@@ -257,7 +257,7 @@ public:
   std::string &val;
   virtual FieldOptionType getType() { return FIELD_OPTION_STRING; }
   FieldOptionString(std::string &_val, const std::string &help,
-                    bool *status = 0, bool deprecated = false)
+                    bool *status = nullptr, bool deprecated = false)
     : FieldOption(help, status, deprecated), val(_val)
   {
   }
@@ -279,7 +279,7 @@ class FieldOptionDouble : public FieldOption {
 public:
   double &val;
   FieldOptionType getType() { return FIELD_OPTION_DOUBLE; }
-  FieldOptionDouble(double &_val, const std::string &help, bool *status = 0,
+  FieldOptionDouble(double &_val, const std::string &help, bool *status = nullptr,
                     bool deprecated = false)
     : FieldOption(help, status, deprecated), val(_val)
   {
@@ -303,7 +303,7 @@ class FieldOptionInt : public FieldOption {
 public:
   int &val;
   FieldOptionType getType() { return FIELD_OPTION_INT; }
-  FieldOptionInt(int &_val, const std::string &help, bool *status = 0,
+  FieldOptionInt(int &_val, const std::string &help, bool *status = nullptr,
                  bool deprecated = false)
     : FieldOption(help, status, deprecated), val(_val)
   {
@@ -327,7 +327,7 @@ public:
   std::list<int> &val;
   FieldOptionType getType() { return FIELD_OPTION_LIST; }
   FieldOptionList(std::list<int> &_val, const std::string &help,
-                  bool *status = 0, bool deprecated = false)
+                  bool *status = nullptr, bool deprecated = false)
     : FieldOption(help, status, deprecated), val(_val)
   {
   }
@@ -341,7 +341,7 @@ public:
   {
     std::ostringstream sstream;
     sstream << "{";
-    for(std::list<int>::iterator it = val.begin(); it != val.end(); it++) {
+    for(auto it = val.begin(); it != val.end(); it++) {
       if(it != val.begin()) sstream << ", ";
       sstream << *it;
     }
@@ -355,7 +355,7 @@ public:
   std::list<double> &val;
   FieldOptionType getType() { return FIELD_OPTION_LIST_DOUBLE; }
   FieldOptionListDouble(std::list<double> &_val, const std::string &help,
-                        bool *status = 0, bool deprecated = false)
+                        bool *status = nullptr, bool deprecated = false)
     : FieldOption(help, status, deprecated), val(_val)
   {
   }
@@ -370,7 +370,7 @@ public:
     std::ostringstream sstream;
     sstream.precision(16);
     sstream << "{";
-    for(std::list<double>::iterator it = val.begin(); it != val.end(); it++) {
+    for(auto it = val.begin(); it != val.end(); it++) {
       if(it != val.begin()) sstream << ", ";
       sstream << *it;
     }
@@ -382,7 +382,7 @@ public:
 class FieldOptionPath : public FieldOptionString {
 public:
   virtual FieldOptionType getType() { return FIELD_OPTION_PATH; }
-  FieldOptionPath(std::string &val, const std::string &help, bool *status = 0,
+  FieldOptionPath(std::string &val, const std::string &help, bool *status = nullptr,
                   bool deprecated = false)
     : FieldOptionString(val, help, status, deprecated)
   {
@@ -393,7 +393,7 @@ class FieldOptionBool : public FieldOption {
 public:
   bool &val;
   FieldOptionType getType() { return FIELD_OPTION_BOOL; }
-  FieldOptionBool(bool &_val, const std::string &help, bool *status = 0,
+  FieldOptionBool(bool &_val, const std::string &help, bool *status = nullptr,
                   bool deprecated = false)
     : FieldOption(help, status, deprecated), val(_val)
   {
@@ -447,7 +447,7 @@ public:
   GenericField();
   ~GenericField();
   using Field::operator();
-  virtual double operator()(double x, double y, double z, GEntity *ge = 0);
+  virtual double operator()(double x, double y, double z, GEntity *ge = nullptr);
   virtual const char *getName() { return "GenericField"; };
 
   // sets the callbacks
diff --git a/Mesh/FieldPython.h b/Mesh/FieldPython.h
index fb6382721c179764bb80575ddacfd541a15839bc..7d1609fb30152c3ccd1e5a21b446490b99af1507 100644
--- a/Mesh/FieldPython.h
+++ b/Mesh/FieldPython.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index a67174a713460a49113f8c8decd3b0659f29b1fb..ed2f0cb135f9593135f558d27dd32c564580340d 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -65,8 +65,8 @@ public:
     if(e.empty() && f.empty()) return;
     std::map<MEdge, GEdge *, MEdgeLessThan> edges;
     std::map<MFace, GFace *, MFaceLessThan> faces;
-    std::vector<GEdge *>::const_iterator it = e.begin();
-    std::vector<GFace *>::const_iterator itf = f.begin();
+    auto it = e.begin();
+    auto itf = f.begin();
     for(; it != e.end(); ++it) {
       for(std::size_t i = 0; i < (*it)->lines.size(); ++i) {
         if(distance((*it)->lines[i]->getVertex(0),
@@ -107,7 +107,7 @@ public:
       Msg::Info("Saving the missing edges in file %s", name);
       FILE *f = fopen(name, "w");
       fprintf(f, "View \" \" {\n");
-      for(std::map<MEdge, GEdge *, MEdgeLessThan>::iterator it = edges.begin();
+      for(auto it = edges.begin();
           it != edges.end(); ++it) {
         MVertex *v1 = it->first.getVertex(0);
         MVertex *v2 = it->first.getVertex(1);
@@ -127,7 +127,7 @@ public:
       Msg::Info("Saving the missing faces in file %s", name);
       FILE *f = fopen(name, "w");
       fprintf(f, "View \" \" {\n");
-      for(std::map<MFace, GFace *, MFaceLessThan>::iterator it = faces.begin();
+      for(auto it = faces.begin();
           it != faces.end(); ++it) {
         MVertex *v1 = it->first.getVertex(0);
         MVertex *v2 = it->first.getVertex(1);
@@ -189,26 +189,26 @@ void GetStatistics(double stat[50], double quality[3][100], bool visibleOnly)
   stat[45] = physicals[0].size() + physicals[1].size() + physicals[2].size() +
              physicals[3].size();
 
-  for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it) {
+  for(auto it = m->firstVertex(); it != m->lastVertex(); ++it) {
     if(visibleOnly && !(*it)->getVisibility()) continue;
     stat[4] += (*it)->mesh_vertices.size();
     stat[5] += (*it)->points.size();
   }
 
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it) {
     if(visibleOnly && !(*it)->getVisibility()) continue;
     stat[4] += (*it)->mesh_vertices.size();
     stat[6] += (*it)->lines.size();
   }
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     if(visibleOnly && !(*it)->getVisibility()) continue;
     stat[4] += (*it)->mesh_vertices.size();
     stat[7] += (*it)->triangles.size();
     stat[8] += (*it)->quadrangles.size();
   }
 
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
     if(visibleOnly && !(*it)->getVisibility()) continue;
     stat[4] += (*it)->mesh_vertices.size();
     stat[9] += (*it)->tetrahedra.size();
@@ -231,7 +231,7 @@ void GetStatistics(double stat[50], double quality[3][100], bool visibleOnly)
 
     double N = stat[9] + stat[10] + stat[11] + stat[12] + stat[13];
     if(N) { // if we have 3D elements
-      for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+      for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
         if(visibleOnly && !(*it)->getVisibility()) continue;
         GetQualityMeasure((*it)->tetrahedra, gamma, gammaMin, gammaMax, minSICN,
                           minSICNMin, minSICNMax, minSIGE, minSIGEMin,
@@ -249,7 +249,7 @@ void GetStatistics(double stat[50], double quality[3][100], bool visibleOnly)
     }
     else { // 2D elements
       N = stat[7] + stat[8];
-      for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+      for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
         if(visibleOnly && !(*it)->getVisibility()) continue;
         GetQualityMeasure((*it)->quadrangles, gamma, gammaMin, gammaMax,
                           minSICN, minSICNMin, minSICNMax, minSIGE, minSIGEMin,
@@ -296,7 +296,7 @@ static bool TooManyElements(GModel *m, int dim)
   // try to detect obvious mistakes in characteristic lenghts (one of the most
   // common cause for erroneous bug reports on the mailing list)
   double sumAllLc = 0.;
-  for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it)
+  for(auto it = m->firstVertex(); it != m->lastVertex(); ++it)
     sumAllLc +=
       (*it)->prescribedMeshSizeAtVertex() * CTX::instance()->mesh.lcFactor;
   sumAllLc /= (double)m->getNumVertices();
@@ -314,14 +314,14 @@ static void Mesh0D(GModel *m)
 {
   m->getFields()->initialize();
 
-  for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it) {
+  for(auto it = m->firstVertex(); it != m->lastVertex(); ++it) {
     GVertex *gv = *it;
     if(gv->mesh_vertices.empty())
       gv->mesh_vertices.push_back(new MVertex(gv->x(), gv->y(), gv->z(), gv));
     if(gv->points.empty())
       gv->points.push_back(new MPoint(gv->mesh_vertices.back()));
   }
-  for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it) {
+  for(auto it = m->firstVertex(); it != m->lastVertex(); ++it) {
     GVertex *gv = *it;
     if(gv->getMeshMaster() != gv) {
       if(gv->correspondingVertices.empty()) {
@@ -352,7 +352,7 @@ static void Mesh1D(GModel *m)
   // boundary layers are not yet thread-safe
   if(m->getFields()->getNumBoundaryLayerFields()) Msg::SetNumThreads(1);
 
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it) {
     // Extruded meshes are not yet fully thread-safe (not sure why!)
     if((*it)->meshAttributes.extrude &&
        (*it)->meshAttributes.extrude->mesh.ExtrudeMesh)
@@ -360,7 +360,7 @@ static void Mesh1D(GModel *m)
   }
 
   std::vector<GEdge *> temp;
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it) {
     (*it)->meshStatistics.status = GEdge::PENDING;
     temp.push_back(*it);
   }
@@ -409,7 +409,7 @@ static void Mesh1D(GModel *m)
 
 static void PrintMesh2dStatistics(GModel *m)
 {
-  FILE *statreport = 0;
+  FILE *statreport = nullptr;
   if(CTX::instance()->createAppendMeshStatReport == 1)
     statreport = Fopen(CTX::instance()->meshStatReportFileName.c_str(), "w");
   else if(CTX::instance()->createAppendMeshStatReport == 2)
@@ -438,7 +438,7 @@ static void PrintMesh2dStatistics(GModel *m)
     }
   }
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     if((*it)->geomType() != GEntity::DiscreteSurface) {
       worst = std::min((*it)->meshStatistics.worst_element_shape, worst);
       best = std::max((*it)->meshStatistics.best_element_shape, best);
@@ -490,7 +490,7 @@ static void Mesh2D(GModel *m)
   // boundary layers are not yet thread-safe
   if(m->getFields()->getNumBoundaryLayerFields()) Msg::SetNumThreads(1);
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     // Frontal-Delaunay for quads and co are not yet thread-safe
     if((*it)->getMeshingAlgo() == ALGO_2D_FRONTAL_QUAD ||
        (*it)->getMeshingAlgo() == ALGO_2D_PACK_PRLGRMS ||
@@ -504,7 +504,7 @@ static void Mesh2D(GModel *m)
       Msg::SetNumThreads(1);
   }
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it)
     (*it)->meshStatistics.status = GFace::PENDING;
 
   // boundary layers are special: their generation (including vertices and curve
@@ -512,7 +512,7 @@ static void Mesh2D(GModel *m)
   // surface mesh of the source surfaces
   if(!Mesh2DWithBoundaryLayers(m)) {
     std::set<GFace *, GEntityPtrLessThan> f;
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+    for(auto it = m->firstFace(); it != m->lastFace(); ++it)
       f.insert(*it);
 
     int nIter = 0, nTot = m->getNumFaces();
@@ -583,12 +583,12 @@ FindConnectedRegions(const std::vector<GRegion *> &del,
       _stack.pop();
       oneDomain.insert(r);
       std::vector<GFace *> faces = r->faces();
-      for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+      for(auto it = faces.begin(); it != faces.end();
           ++it) {
         GFace *gf = *it;
         GRegion *other =
           (gf->getRegion(0) == r) ? gf->getRegion(1) : gf->getRegion(0);
-        if(other != 0 && oneDomain.find(other) == oneDomain.end())
+        if(other != nullptr && oneDomain.find(other) == oneDomain.end())
           _stack.push(other);
       }
     }
@@ -629,7 +629,7 @@ void buildUniqueFaces(GRegion *gr, std::set<MFace, MFaceLessThan> &bnd)
     MElement *e = gr->getMeshElement(i);
     for(int j = 0; j < e->getNumFaces(); j++) {
       MFace f = e->getFace(j);
-      std::set<MFace, MFaceLessThan>::iterator it = bnd.find(f);
+      auto it = bnd.find(f);
       if(it == bnd.end())
         bnd.insert(f);
       else
@@ -643,14 +643,14 @@ bool MakeMeshConformal(GModel *gm, int howto)
   fs_cont search;
   buildFaceSearchStructure(gm, search);
   std::set<MFace, MFaceLessThan> bnd;
-  for(GModel::riter rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
+  for(auto rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
     GRegion *gr = *rit;
     buildUniqueFaces(gr, bnd);
   }
   // bnd2 contains non conforming faces
 
   std::set<MFace, MFaceLessThan> bnd2;
-  for(std::set<MFace, MFaceLessThan>::iterator itf = bnd.begin();
+  for(auto itf = bnd.begin();
       itf != bnd.end(); ++itf) {
     GFace *gfound = findInFaceSearchStructure(*itf, search);
     if(!gfound) { bnd2.insert(*itf); }
@@ -660,13 +660,13 @@ bool MakeMeshConformal(GModel *gm, int howto)
   Msg::Info("%d hanging faces", bnd2.size());
 
   std::set<MFace, MFaceLessThan> ncf;
-  for(std::set<MFace, MFaceLessThan>::iterator itf = bnd2.begin();
+  for(auto itf = bnd2.begin();
       itf != bnd2.end(); ++itf) {
     const MFace &f = *itf;
     if(f.getNumVertices() == 4) { // quad face
-      std::set<MFace, MFaceLessThan>::iterator it1 =
+      auto it1 =
         bnd2.find(MFace(f.getVertex(0), f.getVertex(1), f.getVertex(2)));
-      std::set<MFace, MFaceLessThan>::iterator it2 =
+      auto it2 =
         bnd2.find(MFace(f.getVertex(2), f.getVertex(3), f.getVertex(0)));
       if(it1 != bnd2.end() && it2 != bnd2.end()) {
         ncf.insert(MFace(f.getVertex(1), f.getVertex(2), f.getVertex(3),
@@ -688,7 +688,7 @@ bool MakeMeshConformal(GModel *gm, int howto)
   }
   bnd2.clear();
 
-  for(GModel::riter rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
+  for(auto rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
     GRegion *gr = *rit;
     std::vector<MHexahedron *> remainingHexes;
     for(std::size_t i = 0; i < gr->hexahedra.size(); i++) {
@@ -696,7 +696,7 @@ bool MakeMeshConformal(GModel *gm, int howto)
       std::vector<MFace> faces;
       for(int j = 0; j < e->getNumFaces(); j++) {
         MFace f = e->getFace(j);
-        std::set<MFace, MFaceLessThan>::iterator it = ncf.find(f);
+        auto it = ncf.find(f);
         if(it == ncf.end()) { faces.push_back(f); }
         else {
           faces.push_back(
@@ -733,7 +733,7 @@ bool MakeMeshConformal(GModel *gm, int howto)
       std::vector<MFace> faces;
       for(int j = 0; j < e->getNumFaces(); j++) {
         MFace f = e->getFace(j);
-        std::set<MFace, MFaceLessThan>::iterator it = ncf.find(f);
+        auto it = ncf.find(f);
         if(it == ncf.end()) { faces.push_back(f); }
         else {
           faces.push_back(
@@ -776,7 +776,7 @@ static void TestConformity(GModel *gm)
   fs_cont search;
   buildFaceSearchStructure(gm, search);
   int count = 0;
-  for(GModel::riter rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
+  for(auto rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
     GRegion *gr = *rit;
     std::set<MFace, MFaceLessThan> bnd;
     double vol = 0.0;
@@ -785,7 +785,7 @@ static void TestConformity(GModel *gm)
       vol += fabs(e->getVolume());
       for(int j = 0; j < e->getNumFaces(); j++) {
         MFace f = e->getFace(j);
-        std::set<MFace, MFaceLessThan>::iterator it = bnd.find(f);
+        auto it = bnd.find(f);
         if(it == bnd.end())
           bnd.insert(f);
         else
@@ -794,7 +794,7 @@ static void TestConformity(GModel *gm)
     }
     printf("vol(%d) = %12.5E\n", gr->tag(), vol);
 
-    for(std::set<MFace, MFaceLessThan>::iterator itf = bnd.begin();
+    for(auto itf = bnd.begin();
         itf != bnd.end(); ++itf) {
       GFace *gfound = findInFaceSearchStructure(*itf, search);
       if(!gfound) { count++; }
@@ -822,7 +822,7 @@ static void Mesh3D(GModel *m)
      CTX::instance()->mesh.maxNumThreads3D <= Msg::GetMaxThreads())
     Msg::SetNumThreads(CTX::instance()->mesh.maxNumThreads3D);
 
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
     // Extruded meshes are not yet fully thread-safe (not sure why!)
     if((*it)->meshAttributes.extrude &&
        (*it)->meshAttributes.extrude->mesh.ExtrudeMesh)
@@ -858,7 +858,7 @@ static void Mesh3D(GModel *m)
       if(CTX::instance()->mesh.recombine3DAll ||
          gr->meshAttributes.recombine3D) {
         std::vector<GFace *> f = gr->faces();
-        for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); ++it)
+        for(auto it = f.begin(); it != f.end(); ++it)
           quadsToTriangles(*it, 1000000);
       }
     }
@@ -954,7 +954,7 @@ static void Mesh3D(GModel *m)
   std::stringstream debugInfo;
   debugInfo << "No elements in volume ";
   bool emptyRegionFound = false;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
     GRegion *gr = *it;
     if(CTX::instance()->mesh.meshOnlyVisible && !gr->getVisibility())
       continue;
@@ -1003,14 +1003,14 @@ void OptimizeMesh(GModel *m, const std::string &how, bool force, int niter)
   double t1 = Cpu(), w1 = TimeOfDay();
 
   if(how == "" || how == "Gmsh" || how == "Optimize") {
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       optimizeMeshGRegion opt;
       opt(*it, force);
     }
     m->setAllVolumesPositive();
   }
   else if(how == "Netgen") {
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       optimizeMeshGRegionNetgen opt;
       opt(*it, force);
     }
@@ -1056,19 +1056,19 @@ void OptimizeMesh(GModel *m, const std::string &how, bool force, int niter)
 #endif
   }
   else if(how == "Laplace2D") {
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+    for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
       GFace *gf = *it;
       laplaceSmoothing(gf, niter);
     }
   }
   else if(how == "Relocate2D") {
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+    for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
       GFace *gf = *it;
       RelocateVertices(gf, niter);
     }
   }
   else if(how == "Relocate3D") {
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
       GRegion *gr = *it;
       RelocateVertices(gr, niter);
     }
@@ -1105,7 +1105,7 @@ void RecombineMesh(GModel *m)
   Msg::StatusBar(true, "Recombining 2D mesh...");
   double t1 = Cpu(), w1 = TimeOfDay();
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     GFace *gf = *it;
     bool blossom = (CTX::instance()->mesh.algoRecombine == 1 ||
                     CTX::instance()->mesh.algoRecombine == 3);
@@ -1133,7 +1133,7 @@ static void relocateSlaveVertices(GFace *slave,
                                   std::map<MVertex *, MVertex *> &vertS2M,
                                   bool useClosestPoint)
 {
-  for(std::map<MVertex *, MVertex *>::iterator vit = vertS2M.begin();
+  for(auto vit = vertS2M.begin();
       vit != vertS2M.end(); ++vit) {
     MFaceVertex *v = dynamic_cast<MFaceVertex *>(vit->first);
     if(v && v->onWhat() == slave) {
@@ -1161,7 +1161,7 @@ static void relocateSlaveVertices(GEdge *slave,
                                   std::map<MVertex *, MVertex *> &vertS2M,
                                   bool useClosestPoint)
 {
-  for(std::map<MVertex *, MVertex *>::iterator vit = vertS2M.begin();
+  for(auto vit = vertS2M.begin();
       vit != vertS2M.end(); ++vit) {
     MEdgeVertex *v = dynamic_cast<MEdgeVertex *>(vit->first);
     if(v && v->onWhat() == slave) {
@@ -1194,7 +1194,7 @@ static void relocateSlaveVertices(std::vector<GEntity *> &entities,
     }
   }
 
-  for(std::multimap<GEntity *, GEntity *>::iterator it = master2slave.begin();
+  for(auto it = master2slave.begin();
       it != master2slave.end(); ++it) {
     if(it->first->dim() == 2) {
       GFace *master = dynamic_cast<GFace *>(it->first);
@@ -1227,7 +1227,7 @@ void FixPeriodicMesh(GModel *m)
 {
   if(CTX::instance()->abortOnError && Msg::GetErrorCount()) return;
 
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it) {
     GEdge *tgt = *it;
 
     // non complete periodic info (e.g. through extrusion)
@@ -1235,7 +1235,7 @@ void FixPeriodicMesh(GModel *m)
 
     GEdge *src = dynamic_cast<GEdge *>(tgt->getMeshMaster());
 
-    if(src != NULL && src != tgt) {
+    if(src != nullptr && src != tgt) {
       std::map<MVertex *, MVertex *> &v2v = tgt->correspondingVertices;
       std::map<MVertex *, MVertex *> &p2p = tgt->correspondingHighOrderVertices;
       p2p.clear();
@@ -1264,7 +1264,7 @@ void FixPeriodicMesh(GModel *m)
         }
         for(int iVtx = 0; iVtx < 2; iVtx++) {
           MVertex *vtx = tgtLine->getVertex(iVtx);
-          std::map<MVertex *, MVertex *>::iterator tIter = v2v.find(vtx);
+          auto tIter = v2v.find(vtx);
           if(tIter == v2v.end()) {
             Msg::Error("Cannot find periodic counterpart of node %d"
                        " of curve %d on curve %d",
@@ -1275,7 +1275,7 @@ void FixPeriodicMesh(GModel *m)
             vtcs[iVtx] = tIter->second;
         }
 
-        std::map<MEdge, MLine *, MEdgeLessThan>::iterator srcIter =
+        auto srcIter =
           srcEdges.find(MEdge(vtcs[0], vtcs[1]));
         if(srcIter == srcEdges.end()) {
           Msg::Error("Can't find periodic counterpart of mesh edge %d-%d "
@@ -1299,14 +1299,14 @@ void FixPeriodicMesh(GModel *m)
     relocateSlaveVertices(modelEdges, CTX::instance()->mesh.hoPeriodic > 1);
   }
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     GFace *tgt = *it;
 
     // non complete periodic info (e.g. through extrusion)
     if(tgt->vertexCounterparts.empty()) continue;
 
     GFace *src = dynamic_cast<GFace *>(tgt->getMeshMaster());
-    if(src != NULL && src != tgt) {
+    if(src != nullptr && src != tgt) {
       Msg::Info("Reconstructing periodicity for surface connection %d - %d",
                 tgt->tag(), src->tag());
 
@@ -1345,7 +1345,7 @@ void FixPeriodicMesh(GModel *m)
         for(int iVtx = 0; iVtx < nbVtcs; iVtx++) {
           MVertex *vtx = tgtElmt->getVertex(iVtx);
 
-          std::map<MVertex *, MVertex *>::iterator tIter = v2v.find(vtx);
+          auto tIter = v2v.find(vtx);
           if(tIter == v2v.end()) {
             Msg::Error("Cannot find periodic counterpart of node %d "
                        "of surface %d on surface %d",
@@ -1357,7 +1357,7 @@ void FixPeriodicMesh(GModel *m)
         }
 
         MFace tgtFace(vtcs);
-        std::map<MFace, MElement *, MFaceLessThan>::iterator srcIter =
+        auto srcIter =
           srcFaces.find(tgtFace);
         if(srcIter == srcFaces.end()) {
           std::ostringstream faceDef;
diff --git a/Mesh/Generator.h b/Mesh/Generator.h
index 1b09c8d3380804158f028ac78e0524f0cc7e9ab5..f2765a48488451d8c617a9e82e4eb0e6cf386abb 100644
--- a/Mesh/Generator.h
+++ b/Mesh/Generator.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp
index 1161df595feb516d576ce1f1ec8e816bccc9c3a4..1f54f0e00c575b91a252c9be187257eb08399ef9 100644
--- a/Mesh/HighOrder.cpp
+++ b/Mesh/HighOrder.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -52,7 +52,7 @@ static double mylength(GEdge *ge, int i, double *u)
 }
 
 static void myresid(int N, GEdge *ge, double *u, fullVector<double> &r,
-                    double *weight = NULL)
+                    double *weight = nullptr)
 {
   double L[100];
   for(int i = 0; i < N - 1; i++) L[i] = mylength(ge, i, u);
@@ -207,7 +207,7 @@ static bool computeEquidistantParameters(GFace *gf, double u0, double uN,
   return true;
 }
 
-static fullMatrix<double> *lob2lagP6 = NULL;
+static fullMatrix<double> *lob2lagP6 = nullptr;
 
 void createMatLob2LagP6()
 {
@@ -448,7 +448,7 @@ static void getEdgeVertices(GFace *gf, MElement *ele,
     std::pair<MVertex *, MVertex *> p(vMin, vMax);
     std::vector<MVertex *> veEdge;
 
-    edgeContainer::iterator eIter = edgeVertices.find(p);
+    auto eIter = edgeVertices.find(p);
 
     if(eIter != edgeVertices.end()) { // Vertices already exist
       std::vector<MVertex *> &eVtcs = eIter->second;
@@ -864,7 +864,7 @@ static void getFaceVertices(GRegion *gr, MElement *ele,
   for(int i = 0; i < ele->getNumFaces(); i++) {
     MFace face = ele->getFace(i);
     std::vector<MVertex *> vFace;
-    faceContainer::iterator fIter = faceVertices.find(face);
+    auto fIter = faceVertices.find(face);
     if(fIter != faceVertices.end()) { // Vertices already exist
       std::vector<MVertex *> vtcs = fIter->second;
       int orientation;
@@ -1232,14 +1232,14 @@ void SetOrder1(GModel *m, bool onlyVisible, bool skipDiscrete)
   m->destroyMeshCaches();
 
   // replace all elements with first order elements
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it) {
     setFirstOrder(*it, (*it)->lines, onlyVisible, skipDiscrete);
   }
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     setFirstOrder(*it, (*it)->triangles, onlyVisible, skipDiscrete);
     setFirstOrder(*it, (*it)->quadrangles, onlyVisible, skipDiscrete);
   }
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
     setFirstOrder(*it, (*it)->tetrahedra, onlyVisible, skipDiscrete);
     setFirstOrder(*it, (*it)->hexahedra, onlyVisible, skipDiscrete);
     setFirstOrder(*it, (*it)->prisms, onlyVisible, skipDiscrete);
@@ -1247,11 +1247,11 @@ void SetOrder1(GModel *m, bool onlyVisible, bool skipDiscrete)
   }
 
   // remove all high order vertices
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it)
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it)
     deleteHighOrderVertices(*it, onlyVisible, skipDiscrete);
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it)
     deleteHighOrderVertices(*it, onlyVisible, skipDiscrete);
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     deleteHighOrderVertices(*it, onlyVisible, skipDiscrete);
 }
 
@@ -1263,7 +1263,7 @@ void checkHighOrderTriangles(const char *cc, GModel *m,
   double minGGlob = 1.0;
   double avg = 0.0;
   int count = 0, nbfair = 0;
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     for(std::size_t i = 0; i < (*it)->triangles.size(); i++) {
       MTriangle *t = (*it)->triangles[i];
       double disto_ = t->distoShapeMeasure();
@@ -1311,7 +1311,7 @@ void checkHighOrderTetrahedron(const char *cc, GModel *m,
   minJGlob = 1.0;
   double avg = 0.0;
   int count = 0, nbfair = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
     for(std::size_t i = 0; i < (*it)->tetrahedra.size(); i++) {
       MTetrahedron *t = (*it)->tetrahedra[i];
       double disto_ = t->distoShapeMeasure();
@@ -1435,7 +1435,7 @@ void SetOrderN(GModel *m, int order, bool linear, bool incomplete,
   // TODO: we can leak nodes of discrete entities with existing high-order
   // nodes, if we ask a mesh with a different order
 
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it) {
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it) {
     Msg::Info("Meshing curve %d order %d", (*it)->tag(), order);
     Msg::ProgressMeter(++counter, false, msg);
     if(onlyVisible && !(*it)->getVisibility()) continue;
@@ -1445,7 +1445,7 @@ void SetOrderN(GModel *m, int order, bool linear, bool incomplete,
       setHighOrderFromExistingMesh(*it, edgeVertices);
   }
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     Msg::Info("Meshing surface %d order %d", (*it)->tag(), order);
     Msg::ProgressMeter(++counter, false, msg);
     if(onlyVisible && !(*it)->getVisibility()) continue;
@@ -1453,16 +1453,16 @@ void SetOrderN(GModel *m, int order, bool linear, bool incomplete,
       setHighOrder(*it, edgeVertices, faceVertices, linear, incomplete, nPts);
     else
       setHighOrderFromExistingMesh(*it, edgeVertices, faceVertices);
-    if((*it)->getColumns() != 0) (*it)->getColumns()->clearElementData();
+    if((*it)->getColumns() != nullptr) (*it)->getColumns()->clearElementData();
   }
 
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
     Msg::Info("Meshing volume %d order %d", (*it)->tag(), order);
     Msg::ProgressMeter(++counter, false, msg);
     if(onlyVisible && !(*it)->getVisibility()) continue;
     if(getOrder(*it) != order)
       setHighOrder(*it, edgeVertices, faceVertices, incomplete, nPts);
-    if((*it)->getColumns() != 0) (*it)->getColumns()->clearElementData();
+    if((*it)->getColumns() != nullptr) (*it)->getColumns()->clearElementData();
   }
 
   // store nodes in entities
diff --git a/Mesh/HighOrder.h b/Mesh/HighOrder.h
index 137e8ad9f43c2569c1c6d18f83b8b7ffcd9aee10..6a3ae73461209dfebdc31e73beec5576d3639b29 100644
--- a/Mesh/HighOrder.h
+++ b/Mesh/HighOrder.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/automaticMeshSizeField.cpp b/Mesh/automaticMeshSizeField.cpp
index d611caf313c06ddf2834e175ba9fad47f3e29d7e..2dd204163de9a31034bc37b12a5fdc189d7d0ddd 100644
--- a/Mesh/automaticMeshSizeField.cpp
+++ b/Mesh/automaticMeshSizeField.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -53,7 +53,7 @@ static inline bool isPoint(double x1, double y1, double z1, double x2,
 void writeNodalCurvature(double *nodalCurvature, int size, const char *filename)
 {
   FILE *f = fopen(filename, "w");
-  if(f == NULL) {
+  if(f == nullptr) {
     printf("Erreur : fileOutput == NULL\n");
     exit(-1);
   }
@@ -300,7 +300,7 @@ HXTStatus Gmsh2HxtLocal(std::vector<GFace *> &faces, HXTMesh *m,
 
   size_t count = 0;
   c2v.resize(all.size());
-  for(std::set<MVertex *>::iterator it = all.begin(); it != all.end(); it++) {
+  for(auto it = all.begin(); it != all.end(); it++) {
     m->vertices.coord[4 * count + 0] = (*it)->x();
     m->vertices.coord[4 * count + 1] = (*it)->y();
     m->vertices.coord[4 * count + 2] = (*it)->z();
@@ -393,7 +393,7 @@ HXTStatus Gmsh2HxtGlobal(std::vector<GFace *> &faces, HXTMesh *m,
       all.insert(gf->triangles[i]->getVertex(2));
     }
     size_t count = 0;
-    for(std::set<MVertex *>::iterator it = all.begin(); it != all.end(); it++) {
+    for(auto it = all.begin(); it != all.end(); it++) {
       v2c[*it] = count++;
       c2v[count_c2v2++] = *it;
     }
@@ -449,7 +449,7 @@ p8est_connectivity_new_cube(ForestOptions *forestOptions)
 
   return p4est_connectivity_new_copy(
     num_vertices, num_trees, 0, 0, vertices, tree_to_vertex, tree_to_tree,
-    tree_to_face, NULL, &num_ett, NULL, NULL, NULL, &num_ctt, NULL, NULL);
+    tree_to_face, nullptr, &num_ett, nullptr, nullptr, nullptr, &num_ctt, nullptr, nullptr);
 }
 
 static p4est_connectivity_t *
@@ -482,7 +482,7 @@ p8est_connectivity_new_square(ForestOptions *forestOptions)
 
   return p4est_connectivity_new_copy(
     num_vertices, num_trees, 0, 0, vertices, tree_to_vertex, tree_to_tree,
-    tree_to_face, NULL, &num_ett, NULL, NULL, NULL, &num_ctt, NULL, NULL);
+    tree_to_face, nullptr, &num_ett, nullptr, nullptr, nullptr, &num_ctt, nullptr, nullptr);
 }
 static inline double bulkSize(double x, double y, double z, double hBulk)
 {
@@ -553,7 +553,7 @@ static inline void initializeCell(p4est_t *p4est, p4est_topidx_t which_tree,
 HXTStatus forestOptionsCreate(ForestOptions **forestOptions)
 {
   HXT_CHECK(hxtAlignedMalloc(forestOptions, sizeof(ForestOptions)));
-  if(*forestOptions == NULL) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
+  if(*forestOptions == nullptr) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
   return HXT_STATUS_OK;
 }
 
@@ -568,7 +568,7 @@ HXTStatus loadGlobalData(ForestOptions *forestOptions, const char *filename)
 {
   FILE *f = fopen(filename, "r");
   char buf[BUFSIZ] = {""};
-  if(fgets(buf, BUFSIZ, f) == NULL) {
+  if(fgets(buf, BUFSIZ, f) == nullptr) {
     return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
   }
   sscanf(buf, "%lf %lf", &forestOptions->hmin, &forestOptions->hmax);
@@ -583,10 +583,10 @@ HXTStatus loadGlobalData(ForestOptions *forestOptions, const char *filename)
 HXTStatus forestLoad(Forest **forest, const char *forestFile,
                      const char *dataFile, ForestOptions *forestOptions)
 {
-  if(forestFile == NULL) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
+  if(forestFile == nullptr) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
 
   HXT_CHECK(hxtMalloc(forest, sizeof(Forest)));
-  if(*forest == NULL) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
+  if(*forest == nullptr) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
 
   HXT_CHECK(loadGlobalData(forestOptions, dataFile));
 
@@ -601,7 +601,7 @@ HXTStatus forestLoad(Forest **forest, const char *forestFile,
                                     (void *)forestOptions, &connect);
 
   ForestOptions *fO = (ForestOptions *)(*forest)->p4est->user_pointer;
-  if(fO == NULL) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
+  if(fO == nullptr) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
 
   return HXT_STATUS_OK;
 }
@@ -612,7 +612,7 @@ HXTStatus forestCreate(int argc, char **argv, Forest **forest,
                        const char *filename, ForestOptions *forestOptions)
 {
   HXT_CHECK(hxtMalloc(forest, sizeof(Forest)));
-  if(*forest == NULL) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
+  if(*forest == nullptr) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
 
   int mpiret;
   sc_MPI_Comm mpicomm;
@@ -639,7 +639,7 @@ HXTStatus forestCreate(int argc, char **argv, Forest **forest,
     connect = p8est_connectivity_new_square(forestOptions);
   }
 
-  if(connect == NULL) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
+  if(connect == nullptr) return HXT_ERROR(HXT_STATUS_OUT_OF_MEMORY);
 
   // #ifdef P4EST_WITH_METIS
   //   //  Use metis (if p4est is compiled with the flag '--with-metis') to
@@ -649,7 +649,7 @@ HXTStatus forestCreate(int argc, char **argv, Forest **forest,
   // #endif /* P4EST_WITH_METIS */
 
   // Assign bulkSize callback if no sizeFunction is specified.
-  if(forestOptions->sizeFunction == NULL)
+  if(forestOptions->sizeFunction == nullptr)
     forestOptions->sizeFunction = &bulkSize;
 
   (*forest)->p4est = p4est_new(mpicomm, connect, sizeof(size_data_t),
@@ -715,7 +715,7 @@ static int curvatureRefineCallback(p4est_t *p4est, p4est_topidx_t which_tree,
       double kmax = -1.e22; // To get min curvature size
       double kmin = 1.e22;
       double hf = DBL_MAX; // To get min feature size
-      for(std::vector<uint64_t>::iterator tri = candidates.begin();
+      for(auto tri = candidates.begin();
           tri != candidates.end(); ++tri) {
         for(int i = 0; i < 3; ++i) {
           int node =
@@ -842,7 +842,7 @@ static void assignSizeAfterRefinement(p4est_iter_volume_info_t *info,
     if(!candidates.empty()) {
       double kmax = -1.0e22;
       double hf = DBL_MAX;
-      for(std::vector<uint64_t>::iterator tri = candidates.begin();
+      for(auto tri = candidates.begin();
           tri != candidates.end(); ++tri) {
         for(int i = 0; i < 3; ++i) {
           int node =
@@ -1010,28 +1010,28 @@ HXTStatus forestRefine(Forest *forest)
 {
   /* Refine recursively the tree until all cells' size is at most hbulk. */
   p4est_refine_ext(forest->p4est, 1, P4EST_QMAXLEVEL, refineToBulkSizeCallback,
-                   initializeCell, NULL);
+                   initializeCell, nullptr);
   // Refine recursively with respect to the curvature
   p4est_refine_ext(forest->p4est, 1, P4EST_QMAXLEVEL, curvatureRefineCallback,
-                   initializeCell, NULL);
+                   initializeCell, nullptr);
   // Coarsen
-  p4est_coarsen_ext(forest->p4est, 1, 0, coarsenCallback, initializeCell, NULL);
+  p4est_coarsen_ext(forest->p4est, 1, 0, coarsenCallback, initializeCell, nullptr);
   // Balance the octree to get 2:1 ratio between adjacent cells
-  p4est_balance_ext(forest->p4est, P4EST_CONNECT_FACE, initializeCell, NULL);
+  p4est_balance_ext(forest->p4est, P4EST_CONNECT_FACE, initializeCell, nullptr);
   // Assign size on the new cells
 
   forest->forestOptions->file1 = fopen("nonNorme.pos", "w");
-  if(forest->forestOptions->file1 == NULL)
+  if(forest->forestOptions->file1 == nullptr)
     return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
   forest->forestOptions->file2 = fopen("norme.pos", "w");
-  if(forest->forestOptions->file2 == NULL)
+  if(forest->forestOptions->file2 == nullptr)
     return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
 
   fprintf(forest->forestOptions->file1, "View \"nonNorme\" {\n");
   fprintf(forest->forestOptions->file2, "View \"norme\" {\n");
 
-  p4est_iterate(forest->p4est, NULL, forest->forestOptions,
-                assignSizeAfterRefinement, NULL, NULL, NULL);
+  p4est_iterate(forest->p4est, nullptr, forest->forestOptions,
+                assignSizeAfterRefinement, nullptr, nullptr, nullptr);
   // p4est_iterate(forest->p4est, NULL, forest->forestOptions,
   // assignSizeAfterRefinementAniso, NULL, NULL, NULL);
 
@@ -1201,10 +1201,10 @@ static void computeGradientCenter(p4est_iter_face_info_t *info, void *user_data)
 HXTStatus forestComputeGradient(Forest *forest)
 {
   // Iterate on each cell to reset size gradient and half lengths.
-  p4est_iterate(forest->p4est, NULL, NULL, resetCell, NULL, NULL, NULL);
+  p4est_iterate(forest->p4est, nullptr, nullptr, resetCell, nullptr, nullptr, nullptr);
   // Compute gradient at cell center using finite differences
-  p4est_iterate(forest->p4est, NULL, NULL, NULL, computeGradientCenter, NULL,
-                NULL);
+  p4est_iterate(forest->p4est, nullptr, nullptr, nullptr, computeGradientCenter, nullptr,
+                nullptr);
 
   return HXT_STATUS_OK;
 }
@@ -1230,16 +1230,16 @@ static inline void getMinSize(p4est_iter_volume_info_t *info, void *user_data)
 
 HXTStatus forestGetMaxGradient(Forest *forest, double *gradMax)
 {
-  p4est_iterate(forest->p4est, NULL, (void *)gradMax, getMaxGradient, NULL,
-                NULL, NULL);
+  p4est_iterate(forest->p4est, nullptr, (void *)gradMax, getMaxGradient, nullptr,
+                nullptr, nullptr);
   return HXT_STATUS_OK;
 }
 
 HXTStatus forestGetMinSize(Forest *forest, double *minsize)
 {
   double minSize = 1e22;
-  p4est_iterate(forest->p4est, NULL, (void *)&minSize, getMinSize, NULL, NULL,
-                NULL);
+  p4est_iterate(forest->p4est, nullptr, (void *)&minSize, getMinSize, nullptr, nullptr,
+                nullptr);
   *minsize = minSize;
   return HXT_STATUS_OK;
 }
@@ -1505,8 +1505,8 @@ static void limitSize(p4est_iter_face_info_t *info, void *user_data)
 
 HXTStatus forestLimitSize(Forest *forest)
 {
-  p4est_iterate(forest->p4est, NULL, (void *)forest->forestOptions, NULL,
-                limitSize, NULL, NULL);
+  p4est_iterate(forest->p4est, nullptr, (void *)forest->forestOptions, nullptr,
+                limitSize, nullptr, nullptr);
   return HXT_STATUS_OK;
 }
 
@@ -1721,10 +1721,10 @@ HXTStatus forestSearchOne(Forest *forest, double x, double y, double z,
   p->parcourus = 0;
 
   if(linear) {
-    p4est_search(forest->p4est, NULL, searchAndAssignLinear, points);
+    p4est_search(forest->p4est, nullptr, searchAndAssignLinear, points);
   }
   else {
-    p4est_search(forest->p4est, NULL, searchAndAssignConstant, points);
+    p4est_search(forest->p4est, nullptr, searchAndAssignConstant, points);
   }
 
   if(!p->isFound) {
@@ -1751,7 +1751,7 @@ HXTStatus forestSearchOneAniso(Forest *forest, double x, double y, double z,
   p->m = SMetric3(1.0);
   p->isFound = false;
 
-  p4est_search(forest->p4est, NULL, searchAndAssignConstantAniso, points);
+  p4est_search(forest->p4est, nullptr, searchAndAssignConstantAniso, points);
 
   if(!p->isFound)
     Msg::Info("Point (%f,%f,%f) n'a pas été trouvé dans l'octree 8-|", x, y, z);
@@ -1783,7 +1783,7 @@ HXTStatus hxtForestSearch(Forest *forest, std::vector<double> *x,
   }
 
   // Search on all cells
-  p4est_search(forest->p4est, NULL, searchAndAssignLinear, points);
+  p4est_search(forest->p4est, nullptr, searchAndAssignLinear, points);
 
   // Get the sizes
   for(size_t i = 0; i < (*x).size(); ++i) {
@@ -1966,9 +1966,9 @@ HXTStatus featureSize(Forest *forest)
   int elemDrawn = 0;
 
   FILE *file = fopen("medialAxis_toDraw.pos", "w");
-  if(file == NULL) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
+  if(file == nullptr) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
   FILE *file2 = fopen("keptEdges.pos", "w");
-  if(file2 == NULL) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
+  if(file2 == nullptr) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
 
   bool draw = true;
   if(draw) {
@@ -2187,8 +2187,8 @@ static void elementEstimate(p4est_iter_volume_info_t *info, void *user_data)
 
 HXTStatus hxtOctreeElementEstimation(Forest *forest, double *elemEstimate)
 {
-  p4est_iterate(forest->p4est, NULL, (void *)elemEstimate, elementEstimate,
-                NULL, NULL, NULL);
+  p4est_iterate(forest->p4est, nullptr, (void *)elemEstimate, elementEstimate,
+                nullptr, nullptr, nullptr);
   return HXT_STATUS_OK;
 }
 
@@ -2321,25 +2321,25 @@ static void drawDirections(p4est_iter_volume_info_t *info, void *user_data)
 HXTStatus forestInterpolateDirections(Forest *forest)
 {
   intersections = 0;
-  p4est_iterate(forest->p4est, NULL, NULL, markIntersectingCells, NULL, NULL,
-                NULL);
+  p4est_iterate(forest->p4est, nullptr, nullptr, markIntersectingCells, nullptr, nullptr,
+                nullptr);
 
   std::vector<interpolation_data_t> cellCenters;
   cellCounter = 0;
-  p4est_iterate(forest->p4est, NULL, &cellCenters, pushInterpolationData, NULL,
-                NULL, NULL);
-  p4est_iterate(forest->p4est, NULL, &cellCenters, addDistanceContribution,
-                NULL, NULL, NULL);
-  p4est_iterate(forest->p4est, NULL, &cellCenters, assignDirections, NULL, NULL,
-                NULL);
+  p4est_iterate(forest->p4est, nullptr, &cellCenters, pushInterpolationData, nullptr,
+                nullptr, nullptr);
+  p4est_iterate(forest->p4est, nullptr, &cellCenters, addDistanceContribution,
+                nullptr, nullptr, nullptr);
+  p4est_iterate(forest->p4est, nullptr, &cellCenters, assignDirections, nullptr, nullptr,
+                nullptr);
 
   forest->forestOptions->file3 = fopen("directions.pos", "w");
-  if(forest->forestOptions->file3 == NULL)
+  if(forest->forestOptions->file3 == nullptr)
     return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
 
   fprintf(forest->forestOptions->file3, "View \"directions\" {\n");
 
-  p4est_iterate(forest->p4est, NULL, NULL, drawDirections, NULL, NULL, NULL);
+  p4est_iterate(forest->p4est, nullptr, nullptr, drawDirections, nullptr, nullptr, nullptr);
 
   fprintf(forest->forestOptions->file3, "};");
   fclose(forest->forestOptions->file3);
@@ -2355,7 +2355,7 @@ HXTStatus forestInterpolateDirections(Forest *forest)
 HXTStatus saveGlobalData(Forest *forest, const char *filename)
 {
   FILE *f = fopen(filename, "w");
-  if(f == NULL) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
+  if(f == nullptr) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
   fprintf(f, "%f %f\n", forest->forestOptions->hmin,
           forest->forestOptions->hmax);
   fclose(f);
@@ -2426,16 +2426,16 @@ static void exportToQuadCallback(p4est_iter_volume_info_t *info,
 HXTStatus forestExport(Forest *forest, const char *forestFile)
 {
   FILE *f = fopen(forestFile, "w");
-  if(f == NULL) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
+  if(f == nullptr) return HXT_ERROR(HXT_STATUS_FILE_CANNOT_BE_OPENED);
 
   fprintf(f, "View \"sizeField\" {\n");
   if(forest->forestOptions->dim == 3) {
-    p4est_iterate(forest->p4est, NULL, (void *)f, exportToHexCallback, NULL,
-                  NULL, NULL);
+    p4est_iterate(forest->p4est, nullptr, (void *)f, exportToHexCallback, nullptr,
+                  nullptr, nullptr);
   }
   else if(forest->forestOptions->dim == 2) {
-    p4est_iterate(forest->p4est, NULL, (void *)f, exportToQuadCallback, NULL,
-                  NULL, NULL);
+    p4est_iterate(forest->p4est, nullptr, (void *)f, exportToQuadCallback, nullptr,
+                  nullptr, nullptr);
   }
   fprintf(f, "};");
   fclose(f);
@@ -2559,17 +2559,17 @@ HXTStatus automaticMeshSizeField::updateHXT()
       // Get all faces of the model
       std::vector<GFace *> faces;
       std::vector<GRegion *> regions;
-      for(std::set<GRegion *, GEntityPtrLessThan>::iterator it =
+      for(auto it =
             GModel::current()->firstRegion();
           it != GModel::current()->lastRegion(); ++it) {
         regions.push_back(*it);
       }
       if(!regions.empty()) {
-        HXT_CHECK(getAllFacesOfAllRegions(regions, NULL, faces));
+        HXT_CHECK(getAllFacesOfAllRegions(regions, nullptr, faces));
       }
       else {
         Msg::Info("No volume in the model : looping over faces instead.");
-        for(std::set<GFace *, GEntityPtrLessThan>::iterator it =
+        for(auto it =
               GModel::current()->firstFace();
             it != GModel::current()->lastFace(); ++it) {
           faces.push_back(*it);
@@ -2633,7 +2633,7 @@ HXTStatus automaticMeshSizeField::updateHXT()
 
       std::map<MVertex *, uint32_t> v2c2;
       std::vector<MVertex *> c2v2;
-      Gmsh2HxtGlobal(faces, NULL, v2c2, c2v2);
+      Gmsh2HxtGlobal(faces, nullptr, v2c2, c2v2);
 
       size_t nVertices = 0;
 
@@ -2641,10 +2641,10 @@ HXTStatus automaticMeshSizeField::updateHXT()
 
       // Compute curvature of the faces
       int counter = 0;
-      for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); ++it) {
+      for(auto it = gm->firstFace(); it != gm->lastFace(); ++it) {
         HXTMesh *meshFace = faceMeshes[counter++];
 
-        if(meshFace == NULL) { Msg::Error("meshFace == NULL"); }
+        if(meshFace == nullptr) { Msg::Error("meshFace == NULL"); }
 
         GFace *gf = *it;
         std::map<MVertex *, int> nodeIndex;
@@ -2729,7 +2729,7 @@ HXTStatus automaticMeshSizeField::updateHXT()
                             "nodalCurvature.txt");
 
       // Compute Delaunay tetrahedrization of the (empty) surface mesh
-      HXTDelaunayOptions delaunayOptions = {NULL, NULL, 0, 0, 0, 2, 1, 0};
+      HXTDelaunayOptions delaunayOptions = {nullptr, nullptr, 0, 0, 0, 2, 1, 0};
       HXT_CHECK(hxtEmptyMesh(mesh, &delaunayOptions));
 
       // Compute normal vectors
@@ -2842,7 +2842,7 @@ HXTStatus automaticMeshSizeField::updateHXT()
         bbox_vertices[i + 3] = bbox.max()[i];
       }
 
-      mesh = NULL;
+      mesh = nullptr;
 
       // for(std::set<GEdge*, GEntityPtrLessThan>::iterator it =
       // GModel::current()->firstEdge(); it != GModel::current()->lastEdge();
@@ -2883,14 +2883,14 @@ HXTStatus automaticMeshSizeField::updateHXT()
     forestOptions->nodePerTwoPi = _nPointsPerCircle;
     forestOptions->nodePerGap = _nPointsPerGap;
     forestOptions->bbox = bbox_vertices;
-    forestOptions->sizeFunction = NULL;
+    forestOptions->sizeFunction = nullptr;
     forestOptions->nodalCurvature = nodalCurvature;
     forestOptions->nodeNormals = &nodeNormals[0];
     forestOptions->featureSizeAtVertices = &sizeAtVertices;
-    forestOptions->triRTree = (dim == 3) ? &triRTree : NULL;
+    forestOptions->triRTree = (dim == 3) ? &triRTree : nullptr;
     forestOptions->mesh = mesh;
 
-    HXT_CHECK(forestCreate(0, NULL, &forest, NULL, forestOptions));
+    HXT_CHECK(forestCreate(0, nullptr, &forest, nullptr, forestOptions));
 
     if(dim == 3) {
       if(_nPointsPerGap > 0) {
diff --git a/Mesh/automaticMeshSizeField.h b/Mesh/automaticMeshSizeField.h
index fb0694474cb6284334e251b8fc5035fa577f8e9b..79bb692403784f224913d1aa6a6dad25d66860de 100644
--- a/Mesh/automaticMeshSizeField.h
+++ b/Mesh/automaticMeshSizeField.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -146,7 +146,7 @@ public:
     double hmax = -1.0, double hbulk = -1.0, int smoothing = true,
     int gaps = true)
 #if defined(HAVE_HXT) && defined(HAVE_P4EST)
-    : forest(NULL), forestOptions(NULL)
+    : forest(nullptr), forestOptions(nullptr)
 #endif
   {
     _forestFile = fFile;
@@ -206,9 +206,9 @@ public:
   }
 
   void update();
-  virtual double operator()(double X, double Y, double Z, GEntity *ge = 0);
+  virtual double operator()(double X, double Y, double Z, GEntity *ge = nullptr);
   virtual void operator()(double x, double y, double z, SMetric3 &m,
-                          GEntity *ge = 0);
+                          GEntity *ge = nullptr);
 };
 
 #endif
diff --git a/Mesh/delaunay3d.cpp b/Mesh/delaunay3d.cpp
index 12bd7a361a8ec303e9aac202836c568f9f91e14e..bfa339bf6f7edaebe3142872c4f8a85b8d957f73 100644
--- a/Mesh/delaunay3d.cpp
+++ b/Mesh/delaunay3d.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -56,7 +56,7 @@ public:
   inline double &lc() { return _lc; }
   inline operator double *() { return _x; }
   Vert(double X = 0, double Y = 0, double Z = 0, double lc = 0, int num = 0)
-    : _num(num), _t(NULL), _thread(0)
+    : _num(num), _t(nullptr), _thread(0)
   {
     _x[0] = X;
     _x[1] = Y;
@@ -184,8 +184,8 @@ struct Tet {
 
   Tet() : _modified(true)
   {
-    V[0] = V[1] = V[2] = V[3] = NULL;
-    T[0] = T[1] = T[2] = T[3] = NULL;
+    V[0] = V[1] = V[2] = V[3] = nullptr;
+    T[0] = T[1] = T[2] = T[3] = nullptr;
     setAllDeleted();
   }
   int setVerticesNoTest(Vert *v0, Vert *v1, Vert *v2, Vert *v3)
@@ -227,7 +227,7 @@ struct Tet {
   Tet(Vert *v0, Vert *v1, Vert *v2, Vert *v3)
   {
     setVertices(v0, v1, v2, v3);
-    T[0] = T[1] = T[2] = T[3] = NULL;
+    T[0] = T[1] = T[2] = T[3] = nullptr;
     setAllDeleted();
   }
   void setAllDeleted()
@@ -260,7 +260,7 @@ struct conn {
   Face f;
   int i;
   Tet *t;
-  conn() : f(0, 0, 0), i(0), t(0) {}
+  conn() : f(nullptr, nullptr, nullptr), i(0), t(nullptr) {}
   conn(Face _f, int _i, Tet *_t) : f(_f), i(_i), t(_t) {}
   bool operator==(const conn &c) const { return f == c.f; }
   bool operator<(const conn &c) const { return f < c.f; }
@@ -619,7 +619,7 @@ static void SortHilbert(std::vector<Vert *> &v, std::vector<int> &indices)
 static void computeAdjacencies(Tet *t, int iFace, connContainer &faceToTet)
 {
   conn c(t->getFace(iFace), iFace, t);
-  connContainer::iterator it = std::find(faceToTet.begin(), faceToTet.end(), c);
+  auto it = std::find(faceToTet.begin(), faceToTet.end(), c);
   if(it == faceToTet.end()) {
     faceToTet.push_back(c);
   }
@@ -674,7 +674,7 @@ static Tet *tetContainsV(Vert *v, cavityContainer &cavity)
     }
     if(count == 4) return cavity[i];
   }
-  return NULL;
+  return nullptr;
 }
 
 static void buildDelaunayBall(cavityContainer &cavity, connContainer &faceToTet)
@@ -685,7 +685,7 @@ static void buildDelaunayBall(cavityContainer &cavity, connContainer &faceToTet)
     for(std::size_t iFace = 0; iFace < 4; iFace++) {
       Tet *neigh = t->T[iFace];
       conn c(t->getFace(iFace), iFace, neigh);
-      connContainer::iterator it =
+      auto it =
         std::find(faceToTet.begin(), faceToTet.end(), c);
       if(it == faceToTet.end()) {
         faceToTet.push_back(c);
@@ -735,7 +735,7 @@ static Tet *tetInsideCavityWithFAce(Face &f, cavityContainer &cavity)
       }
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 static bool fixDelaunayCavity(Vert *v, cavityContainer &cavity,
@@ -765,7 +765,7 @@ static bool fixDelaunayCavity(Vert *v, cavityContainer &cavity,
       conn &c = bndK[_negatives[i]];
       Tet *toRemove = tetInsideCavityWithFAce(c.f, cavity);
       if(toRemove) {
-        std::vector<Tet *>::iterator it =
+        auto it =
           std::find(cavity.begin(), cavity.end(), toRemove);
         if(it != cavity.end()) {
           cavity.erase(it);
@@ -805,7 +805,7 @@ static void delaunayCavity2(Tet *tet, Tet *prevTet, Vert *v,
 
     for(int iNeigh = iNeighStart; iNeigh < iNeighEnd; iNeigh++) {
       Tet *neigh = t->T[iNeigh];
-      if(neigh == NULL) {
+      if(neigh == nullptr) {
         bnd.push_back(conn(t->getFace(iNeigh), iNeigh, neigh));
       }
       else if(neigh == prev) {
@@ -849,8 +849,8 @@ static Tet *walk(Tet *t, Vert *v, int maxx, double &totSearch, int thread)
   investigatedTets.insert(t);
   while(1) {
     totSearch++;
-    if(t == NULL) {
-      return NULL; // we should NEVER return here
+    if(t == nullptr) {
+      return nullptr; // we should NEVER return here
     }
     // if(t->inSphere(v,thread)){return t;}
     double _min = 0.0;
@@ -878,7 +878,7 @@ static Tet *walk(Tet *t, Vert *v, int maxx, double &totSearch, int thread)
     }
     else if(tets.empty()) {
       Msg::Error("Jump-and-walk failed (no neighbor)");
-      return 0;
+      return nullptr;
     }
     else {
       t = tets.front();
@@ -886,7 +886,7 @@ static Tet *walk(Tet *t, Vert *v, int maxx, double &totSearch, int thread)
     }
   }
   Msg::Error("Jump-and-walk failed (no neighbor)");
-  return 0;
+  return nullptr;
 }
 
 /*
@@ -1065,7 +1065,7 @@ void delaunayTrgl(const std::size_t numThreads,
       // FIND SEEDS
       for(std::size_t K = 0; K < NPTS_AT_ONCE; K++) {
 	vToAdd[K] = (iPGlob < assignTo[K + myThread * NPTS_AT_ONCE].size()) ?
-	  assignTo[K + myThread * NPTS_AT_ONCE][iPGlob] : NULL;
+	  assignTo[K + myThread * NPTS_AT_ONCE][iPGlob] : nullptr;
 
         if(vToAdd[K]) {
           // In 3D, insertion of a point may lead to deletion of tets !!
@@ -1091,11 +1091,11 @@ void delaunayTrgl(const std::size_t numThreads,
             if(bndK[i].t) bndK[i].t->unset(myThread, K);
           cavityK.clear();
           bndK.clear();
-          delaunayCavity2(t[K], NULL, vToAdd[K], cavityK, bndK, myThread, K);
+          delaunayCavity2(t[K], nullptr, vToAdd[K], cavityK, bndK, myThread, K);
           // verify the cavity
           if(fixDelaunayCavity(vToAdd[K], cavityK, bndK, myThread, K,
                                _negatives)) {
-            vToAdd[K] = NULL;
+            vToAdd[K] = nullptr;
             invalidCavities[myThread]++;
           }
         }
@@ -1129,7 +1129,7 @@ void delaunayTrgl(const std::size_t numThreads,
                                  vToAdd[K]);
             Tet *neigh = bndK[i].t;
             t->T[0] = neigh;
-            t->T[1] = t->T[2] = t->T[3] = NULL;
+            t->T[1] = t->T[2] = t->T[3] = nullptr;
             if(neigh) {
               if(neigh->getFace(0) == bndK[i].f)
                 neigh->T[0] = t;
@@ -1149,7 +1149,7 @@ void delaunayTrgl(const std::size_t numThreads,
             computeAdjacencies(t, 3, faceToTet);
           }
           for(std::size_t i = bSize; i < cSize; i++) {
-            cavityK[i]->V[0] = NULL;
+            cavityK[i]->V[0] = nullptr;
           }
         }
       }
@@ -1316,7 +1316,7 @@ void delaunayTriangulation(const int numThreads, const int nptsatonce,
     }
     else {
       v->setNum(N + i + 1);
-      MVertex *mv = new MVertex(v->x(), v->y(), v->z(), NULL, N + (i + 1));
+      MVertex *mv = new MVertex(v->x(), v->y(), v->z(), nullptr, N + (i + 1));
       _temp[v->getNum()] = mv;
       S.push_back(mv);
     }
diff --git a/Mesh/delaunay3d.h b/Mesh/delaunay3d.h
index b732ce8818c8d2cfff2c88003ce4f579dc03300b..625118c45d8413506973334bfd43e5ded1fcfe9e 100644
--- a/Mesh/delaunay3d.h
+++ b/Mesh/delaunay3d.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/filterElements.cpp b/Mesh/filterElements.cpp
index 388b41d9740d798c624edc1ab4088685c4bc1322..fe9d6cd1f0330ba7694af25b28c403fe054e1995 100644
--- a/Mesh/filterElements.cpp
+++ b/Mesh/filterElements.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -185,7 +185,7 @@ void filterColumns(std::vector<MElement *> &elem,
 {
   std::sort(elem.begin(), elem.end());
   std::vector<MElement *> toKeep;
-  for(std::map<MElement *, std::vector<MElement *> >::iterator it =
+  for(auto it =
         _elemColumns.begin();
       it != _elemColumns.end(); ++it) {
     const std::vector<MElement *> &c = it->second;
diff --git a/Mesh/filterElements.h b/Mesh/filterElements.h
index 725e10201612bcae583f98534b7babe4da781adb..5d03e696ca9513981e8dcf747f40e5c4150584ce 100644
--- a/Mesh/filterElements.h
+++ b/Mesh/filterElements.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/gmshCrossFields.cpp b/Mesh/gmshCrossFields.cpp
index d32fb7f8d4f3dd3d1f3415410ec2ab23b9d6d1f8..345170fb75d713ce8a33ed734950ea0468014ca4 100644
--- a/Mesh/gmshCrossFields.cpp
+++ b/Mesh/gmshCrossFields.cpp
@@ -224,7 +224,7 @@ public:
     }
 
     for(size_t i = 0; i < _neighbors.size(); i++) {
-      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it =
+      auto it =
         C.find(_neighbors[i]);
       if(it == C.end())
         Msg::Error("impossible situation");
@@ -430,7 +430,7 @@ static void computeLifting(cross2d *first, int branch,
   // store in _atemp the branch of the neighbor
   std::set<MVertex *, MVertexPtrLessThan> cg;
   {
-    std::set<MEdge, MEdgeLessThan>::iterator it = cutG.begin();
+    auto it = cutG.begin();
     for(; it != cutG.end(); ++it) {
       cg.insert(it->getVertex(0));
       cg.insert(it->getVertex(1));
@@ -526,7 +526,7 @@ static void unDuplicateNodesInCutGraph(
     for(size_t j = 0; j < f[i]->triangles.size(); j++) {
       MTriangle *t = f[i]->triangles[j];
       for(size_t k = 0; k < 3; k++) {
-        std::map<MVertex *, MVertex *, MVertexPtrLessThan>::iterator it =
+        auto it =
           new2old.find(t->getVertex(k));
         if(it != new2old.end()) t->setVertex(k, it->second);
       }
@@ -545,7 +545,7 @@ static void duplicateNodesInCutGraph(
   FILE *_f = fopen("nodes.pos", "w");
   fprintf(_f, "View \" nodes \"{\n");
 
-  v2t_cont::iterator it = adj.begin();
+  auto it = adj.begin();
   std::set<MElement *> touched;
   std::set<MVertex *, MVertexPtrLessThan> vtouched;
 
@@ -565,10 +565,10 @@ static void duplicateNodesInCutGraph(
         _s.pop();
         for(int i = 0; i < 3; i++) {
           MEdge e0 = t->getEdge(i);
-          std::map<MEdge, cross2d, MEdgeLessThan>::iterator it0 = C.find(e0);
+          auto it0 = C.find(e0);
           if(!it0->second.inCutGraph) {
             for(size_t j = 0; j < it0->second._t.size(); j++) {
-              std::vector<MElement *>::iterator ite =
+              auto ite =
                 std::find(els.begin(), els.end(), it0->second._t[j]);
               if(ite != els.end()) {
                 els.erase(ite);
@@ -641,7 +641,7 @@ computeUniqueVectorPerTriangle(GModel *gm, std::vector<GFace *> &f,
       int n = 0;
       for(int k = 0; k < 3; k++) {
         MEdge e = t->getEdge(k);
-        std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
+        auto it = C.find(e);
         if(it != C.end()) {
           if(!it->second.inCutGraph) {
             n++;
@@ -893,11 +893,11 @@ LagrangeMultipliers2(dofManager<double> &myAssembler, int NUMDOF,
   for(size_t i = 0; i < groups.size(); i++) {
     size_t N = groups[i].size();
     MEdge ed = groups[i][0]->_e;
-    std::map<MEdge, MEdge, MEdgeLessThan>::iterator ite =
+    auto ite =
       duplicateEdges.find(ed);
     if(ite != duplicateEdges.end()) ed = ite->second;
     MVertex *v = ed.getVertex(0);
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it =
+    auto it =
       C.find(groups[i][0]->_e);
     SVector3 aaa = lift[it->second._t[0]];
 
@@ -943,7 +943,7 @@ struct cutGraphPassage {
 static void createDofs(dofManager<double> &myAssembler, int NUMDOF,
                        std::set<MVertex *, MVertexPtrLessThan> &vs)
 {
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = vs.begin();
+  for(auto it = vs.begin();
       it != vs.end(); ++it)
     myAssembler.numberVertex(*it, 0, NUMDOF);
 }
@@ -1038,8 +1038,8 @@ static void computePotential(
 
 
   simpleFunction<double> ONE(1.0);
-  laplaceTerm l(NULL, 1, &ONE);
-  laplaceTerm l2(NULL, 2, &ONE);
+  laplaceTerm l(nullptr, 1, &ONE);
+  laplaceTerm l2(nullptr, 2, &ONE);
 
   for(size_t i = 0; i < f.size(); i++) {
     for(size_t j = 0; j < f[i]->triangles.size(); j++) {
@@ -1050,7 +1050,7 @@ static void computePotential(
       SVector3 a0 = lift[t];
       SVector3 a1 = lift2[t];
       double va, vb, vc;
-      std::map<MVertex *, MVertex *, MVertexPtrLessThan>::iterator itx =
+      auto itx =
         new2old.find(t->getVertex(0));
       dof.getDofValue(itx == new2old.end() ? t->getVertex(0) : itx->second, 0,
                       1, va);
@@ -1158,7 +1158,7 @@ static double distance(MTriangle *t,
   //  return drand48();
   SPoint3 p = t->barycenter();
   double dmin = 1.e22;
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = boundaries.begin();
+  for(auto it = boundaries.begin();
       it != boundaries.end(); ++it) {
     SPoint3 pp((*it)->x(), (*it)->y(), (*it)->z());
     double d = p.distance(pp);
@@ -1308,7 +1308,7 @@ computeSingularities(std::map<MEdge, cross2d, MEdgeLessThan> &C,
   FILE *f_ = fopen("sing.pos", "w");
   fprintf(f_, "View \"S\"{\n");
   std::multimap<MVertex *, cross2d *, MVertexPtrLessThan> conn;
-  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+  for(auto it = C.begin();
       it != C.end(); ++it) {
     std::pair<MVertex *, cross2d *> p =
       std::make_pair(it->first.getVertex(0), &it->second);
@@ -1316,9 +1316,9 @@ computeSingularities(std::map<MEdge, cross2d, MEdgeLessThan> &C,
     p = std::make_pair(it->first.getVertex(1), &it->second);
     conn.insert(p);
   }
-  MVertex *v = NULL;
+  MVertex *v = nullptr;
   std::vector<cross2d *> adj;
-  for(std::multimap<MVertex *, cross2d *, MVertexPtrLessThan>::iterator it =
+  for(auto it =
         conn.begin();
       it != conn.end(); ++it) {
     if(it->first == v) { adj.push_back(it->second); }
@@ -1357,7 +1357,7 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
   std::vector<MEdge> cotree;
   std::set<std::pair<double, MTriangle *> > _distances;
   {
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+    auto it = C.begin();
     for(; it != C.end(); ++it) {
       if(it->second._t.size() == 1) {
         boundaries.insert(it->first.getVertex(0));
@@ -1381,7 +1381,7 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
 
     for(int i = 0; i < 3; i++) {
       MEdge e = t->getEdge(i);
-      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
+      auto it = C.find(e);
       for(size_t j = 0; j < it->second._t.size(); j++) {
         MTriangle *tt = it->second._t[j];
         if(touched.find(tt) == touched.end()) {
@@ -1396,12 +1396,12 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
   }
 
   std::sort(tree.begin(), tree.end());
-  std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+  auto it = C.begin();
   std::map<MVertex *, std::vector<MEdge>, MVertexPtrLessThan> _graph;
   for(; it != C.end(); ++it) {
     if(!std::binary_search(tree.begin(), tree.end(), &it->second)) {
       for(int i = 0; i < 2; i++) {
-        std::map<MVertex *, std::vector<MEdge>, MVertexPtrLessThan>::iterator
+        auto
           it0 = _graph.find(it->first.getVertex(i));
         if(it0 == _graph.end()) {
           std::vector<MEdge> ee;
@@ -1433,7 +1433,7 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
 
   while(1) {
     bool somethingDone = false;
-    std::map<MVertex *, std::vector<MEdge> >::iterator it = _graph.begin();
+    auto it = _graph.begin();
     for(; it != _graph.end(); ++it) {
       if(it->second.size() == 1) {
         MVertex *v1 = it->second[0].getVertex(0);
@@ -1441,9 +1441,9 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
         if(boundaries.find(it->first) == boundaries.end() &&
            singularities.find(it->first) == singularities.end()) {
           somethingDone = true;
-          std::map<MVertex *, std::vector<MEdge>, MVertexPtrLessThan>::iterator
+          auto
             it2 = _graph.find(v1 == it->first ? v2 : v1);
-          std::vector<MEdge>::iterator position =
+          auto position =
             std::find(it2->second.begin(), it2->second.end(), it->second[0]);
           it2->second.erase(position);
           it->second.clear();
@@ -1458,7 +1458,7 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
   FILE *fff = fopen("cotree.pos", "w");
   fprintf(fff, "View \"sides\"{\n");
   {
-    std::map<MVertex *, std::vector<MEdge> >::iterator it = _graph.begin();
+    auto it = _graph.begin();
     for(; it != _graph.end(); ++it) {
       for(size_t i = 0; i < it->second.size(); i++) {
         MEdge e = it->second[i];
@@ -1472,7 +1472,7 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
 
   // Add internal boundaries to the cut graph
   {
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+    auto it = C.begin();
     for(; it != C.end(); ++it) {
       if(it->second._t.size() > 1 && it->second.inInternalBoundary) {
         cutG.insert(it->second._e);
@@ -1481,7 +1481,7 @@ static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
   }
 
   {
-    std::set<MEdge, MEdgeLessThan>::iterator it = cutG.begin();
+    auto it = cutG.begin();
     for(; it != cutG.end(); ++it) {
       MEdge e = *it;
       fprintf(fff, "SL(%g,%g,%g,%g,%g,%g){%d,%d};\n", e.getVertex(0)->x(),
@@ -1508,7 +1508,7 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
 {
   std::set<MVertex *, MVertexPtrLessThan> cutgraph;
   std::set<MVertex *, MVertexPtrLessThan> boundaries;
-  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+  for(auto it = C.begin();
       it != C.end(); ++it) {
     MVertex *v0 = it->first.getVertex(0);
     MVertex *v1 = it->first.getVertex(1);
@@ -1525,7 +1525,7 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
   std::set<cross2d *> _all;
 
   std::multimap<MVertex *, cross2d *> conn;
-  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+  for(auto it = C.begin();
       it != C.end(); ++it) {
     std::pair<MVertex *, cross2d *> p =
       std::make_pair(it->first.getVertex(0), &it->second);
@@ -1534,12 +1534,12 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
     conn.insert(p);
   }
 
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = boundaries.begin();
+  for(auto it = boundaries.begin();
       it != boundaries.end(); ++it) {
     MVertex *v = *it;
     std::vector<cross2d *> bnd;
     int countCutGraph = 0;
-    for(std::multimap<MVertex *, cross2d *>::iterator it2 = conn.lower_bound(v);
+    for(auto it2 = conn.lower_bound(v);
         it2 != conn.upper_bound(v); ++it2) {
       if(it2->second->inBoundary) { bnd.push_back(it2->second); }
       if(it2->second->inCutGraph) { countCutGraph++; }
@@ -1565,10 +1565,10 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
 
   std::set<MVertex *, MVertexPtrLessThan> endPoints = singularities;
   {
-    for(std::multimap<MVertex *, cross2d *>::iterator it = conn.begin();
+    for(auto it = conn.begin();
         it != conn.end(); ++it) {
       int count = 0;
-      for(std::multimap<MVertex *, cross2d *>::iterator it2 =
+      for(auto it2 =
             conn.lower_bound(it->first);
           it2 != conn.upper_bound(it->first); ++it2) {
         if(it2->second->inCutGraph) { count++; }
@@ -1579,14 +1579,14 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
 
   for(int AA = 0; AA < 4; AA++) {
     if(cutGraph) {
-      for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
+      for(auto it =
             endPoints.begin();
           it != endPoints.end(); ++it) {
         MVertex *v = *it;
         std::vector<cross2d *> group;
         do {
-          MVertex *vnew = NULL;
-          for(std::multimap<MVertex *, cross2d *>::iterator it2 =
+          MVertex *vnew = nullptr;
+          for(auto it2 =
                 conn.lower_bound(v);
               it2 != conn.upper_bound(v); ++it2) {
             if((_all.find(it2->second) == _all.end()) &&
@@ -1607,7 +1607,7 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
               break;
             }
           }
-          if(vnew == NULL) break;
+          if(vnew == nullptr) break;
           v = vnew;
         } while((boundaries.find(v) == boundaries.end()) &&
                 (endPoints.find(v) == endPoints.end()));
@@ -1618,7 +1618,7 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
       }
     }
     else {
-      for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
+      for(auto it =
             boundaries.begin();
           it != boundaries.end(); ++it) {
         MVertex *v = *it;
@@ -1628,8 +1628,8 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
           //!= cutgraph.end() , 		  singularities.find(v) != singularities.end());
           std::vector<cross2d *> group;
           do {
-            MVertex *vnew = NULL;
-            for(std::multimap<MVertex *, cross2d *>::iterator it2 =
+            MVertex *vnew = nullptr;
+            for(auto it2 =
                   conn.lower_bound(v);
                 it2 != conn.upper_bound(v); ++it2) {
               if((_all.find(it2->second) == _all.end()) &&
@@ -1655,7 +1655,7 @@ groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
                 break;
               }
             }
-            if(vnew == NULL) break;
+            if(vnew == nullptr) break;
             v = vnew;
             //	    printf("NEXT POINT %lu %d
             //%lu\n",v->getNum(),singularities.find(v) == singularities.end(),
@@ -1680,7 +1680,7 @@ fastImplementationExtrinsic(std::map<MEdge, cross2d, MEdgeLessThan> &C,
 {
   double *data = new double[C.size() * 6];
   size_t *graph = new size_t[C.size() * 4];
-  std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+  auto it = C.begin();
   int counter = 0;
 
   for(; it != C.end(); ++it) {
@@ -1781,7 +1781,7 @@ static dofManager<double> *computeH(GModel *gm, std::vector<GFace *> &f,
   dofManager<double> *myAssembler = new dofManager<double>(_lsys);
 
   //  myAssembler.fixVertex(*vs.begin(), 0, 1, 0);
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = vs.begin();
+  for(auto it = vs.begin();
       it != vs.end(); ++it)
     myAssembler->numberVertex(*it, 0, 1);
 
@@ -1792,7 +1792,7 @@ static dofManager<double> *computeH(GModel *gm, std::vector<GFace *> &f,
   fprintf(_f, "View \"grad\"{\n");
 
   simpleFunction<double> ONE(1.0);
-  laplaceTerm l(0, 1, &ONE);
+  laplaceTerm l(nullptr, 1, &ONE);
 
   std::map<MTriangle *, SVector3> gradients_of_theta;
 
@@ -1814,9 +1814,9 @@ static dofManager<double> *computeH(GModel *gm, std::vector<GFace *> &f,
       MEdge e0 = t->getEdge(0);
       MEdge e1 = t->getEdge(1);
       MEdge e2 = t->getEdge(2);
-      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it0 = C.find(e0);
-      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it1 = C.find(e1);
-      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it2 = C.find(e2);
+      auto it0 = C.find(e0);
+      auto it1 = C.find(e1);
+      auto it2 = C.find(e2);
 
       //      printf("%g %ag %g\n",a0,a1,a2);
 
@@ -1973,7 +1973,7 @@ struct edgeCuts {
     idsOfCuts.push_back(id);
     return true;
   }
-  void finish(GModel *gm, FILE *f = NULL)
+  void finish(GModel *gm, FILE *f = nullptr)
   {
     for(size_t i = 0; i < ps.size(); i++) {
       GEdge *ge = gm->getEdgeByTag(indexOfCuts[i]);
@@ -1996,7 +1996,7 @@ struct edgeCuts {
 static bool addCut(const SPoint3 &p, const MEdge &e, int COUNT, int ID,
                    std::map<MEdge, edgeCuts, MEdgeLessThan> &cuts)
 {
-  std::map<MEdge, edgeCuts, MEdgeLessThan>::iterator itc = cuts.find(e);
+  auto itc = cuts.find(e);
   if(itc != cuts.end()) {
     if(!itc->second.add(p, COUNT, ID)) return false;
     return true;
@@ -2043,7 +2043,7 @@ static void computeOneIsoRecur(
   }
   std::vector<MElement *> lst = adj[v0];
 
-  MVertex *vs[2] = {NULL, NULL};
+  MVertex *vs[2] = {nullptr, nullptr};
   int count = 0;
   for(size_t i = 0; i < lst.size(); i++) {
     if((lst[i]->getVertex(0) == v0 && lst[i]->getVertex(1) == v1) ||
@@ -2276,7 +2276,7 @@ static bool computeIsos(
   }
 
   {
-    std::map<MVertex *, MVertex *, MVertexPtrLessThan>::iterator it =
+    auto it =
       new2old.begin();
     for(; it != new2old.end(); ++it) {
       if(singularities.find(it->second) != singularities.end()) {
@@ -2287,7 +2287,7 @@ static bool computeIsos(
 
   std::map<MVertex *, MVertex *, MVertexPtrLessThan> duplicates;
   {
-    std::map<MVertex *, MVertex *, MVertexPtrLessThan>::iterator it =
+    auto it =
       new2old.begin();
     for(; it != new2old.end(); ++it) {
       duplicates[it->first] = it->second;
@@ -2327,7 +2327,7 @@ static bool computeIsos(
   FILE *f = fopen(fn.c_str(), "w");
   fprintf(f, "View\"Big Cut\"{\n");
 
-  std::set<MVertex *, MVertexPtrLessThan>::iterator it = singularities.begin();
+  auto it = singularities.begin();
   for(; it != singularities.end(); ++it) {
     GEntity *ge = (*it)->onWhat();
     if(ge->dim() == 2 || ge->edges().size() == 0) {
@@ -2463,44 +2463,44 @@ static void createJumpyPairs(
         touched.insert(vv);
         MTriangle *t1 = c->_t[0];
         MTriangle *t2 = c->_t[1];
-        MVertex *v0 = NULL;
-        MVertex *v1 = NULL;
+        MVertex *v0 = nullptr;
+        MVertex *v1 = nullptr;
         if(t1->getVertex(0) == vv || t1->getVertex(1) == vv ||
            t1->getVertex(2) == vv) {
-          if(v0 == NULL)
+          if(v0 == nullptr)
             v0 = vv;
-          else if(v1 == NULL)
+          else if(v1 == nullptr)
             v1 = vv;
           else
             Msg::Error("error in JumpyPairs 1");
         }
         if(t2->getVertex(0) == vv || t2->getVertex(1) == vv ||
            t2->getVertex(2) == vv) {
-          if(v0 == NULL)
+          if(v0 == nullptr)
             v0 = vv;
-          else if(v1 == NULL)
+          else if(v1 == nullptr)
             v1 = vv;
           else
             Msg::Error("error in JumpyPairs 1");
         }
-        for(std::multimap<MVertex *, MVertex *>::iterator it =
+        for(auto it =
               old2new.lower_bound(vv);
             it != old2new.upper_bound(vv); ++it) {
           MVertex *vvv = it->second;
           if(t1->getVertex(0) == vvv || t1->getVertex(1) == vvv ||
              t1->getVertex(2) == vvv) {
-            if(v0 == NULL)
+            if(v0 == nullptr)
               v0 = vvv;
-            else if(v1 == NULL)
+            else if(v1 == nullptr)
               v1 = vvv;
             else
               Msg::Error("error in JumpyPairs 1");
           }
           if(t2->getVertex(0) == vvv || t2->getVertex(1) == vvv ||
              t2->getVertex(2) == vvv) {
-            if(v0 == NULL)
+            if(v0 == nullptr)
               v0 = vvv;
-            else if(v1 == NULL)
+            else if(v1 == nullptr)
               v1 = vvv;
             else
               Msg::Error("error in JumpyPairs 2");
@@ -2626,11 +2626,11 @@ public:
     for(size_t i = 0; i < f.size(); i++) {
       for(size_t j = 0; j < f[i]->triangles.size(); j++) {
         MTriangle *t = f[i]->triangles[j];
-        std::map<MEdge, cross2d, MEdgeLessThan>::iterator it0 =
+        auto it0 =
           C.find(t->getEdge(0));
-        std::map<MEdge, cross2d, MEdgeLessThan>::iterator it1 =
+        auto it1 =
           C.find(t->getEdge(1));
-        std::map<MEdge, cross2d, MEdgeLessThan>::iterator it2 =
+        auto it2 =
           C.find(t->getEdge(2));
 
         SVector3 d0 = it0->second.o_i;
@@ -2665,7 +2665,7 @@ public:
     std::string fn = modelName + "_" + name + ".pos";
     FILE *of = fopen(fn.c_str(), "w");
     fprintf(of, "View \"Direction fields\"{\n");
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+    auto it = C.begin();
     for(it = C.begin(); it != C.end(); ++it) {
       double a0 = it->second._a;
       MEdge e0 = it->second._e;
@@ -2772,7 +2772,7 @@ public:
 
     dofManager<double> *dof = new dofManager<double>(_lsys);
 
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+    auto it = C.begin();
     std::vector<MEdge> edges;
     for(; it != C.end(); ++it) {
       if(it->second.inBoundary) { edges.push_back(it->first); }
@@ -2783,13 +2783,13 @@ public:
     // AVERAGE
     dof->numberVertex(*vs.begin(), 1, 1);
 
-    for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = vs.begin();
+    for(auto it = vs.begin();
         it != vs.end(); ++it){
       dof->numberVertex(*it, 0, 1);
     }
 
     simpleFunction<double> ONE(1.0);
-    laplaceTerm l(0, 1, &ONE);
+    laplaceTerm l(nullptr, 1, &ONE);
 
     std::set<GEntity *> firsts;
     for(size_t i = 0; i < f.size(); i++) {
@@ -2827,7 +2827,7 @@ public:
 	xx.normalize();
 
         MEdge edze(vi, vim);
-        std::map<MEdge, cross2d, MEdgeLessThan>::iterator itip = C.find(edze);
+        auto itip = C.find(edze);
         double sign = 1;
         if(itip != C.end()) {
           MTriangle *tt = itip->second._t[0];
@@ -2863,13 +2863,13 @@ public:
       }
     }
 
-    for(std::map<MVertex *, double>::iterator it = gaussianCurvatures.begin();it != gaussianCurvatures.end(); ++it){
+    for(auto it = gaussianCurvatures.begin();it != gaussianCurvatures.end(); ++it){
       Dof E(it->first->getNum(), Dof::createTypeWithTwoInts(0, 1));
       //_lsys->addToRightHandSide(dof->getDofNumber(E),-it->second);
     }
 
     double SSUM = 0;
-    for(std::map<MVertex *, int>::iterator it = sing.begin(); it != sing.end();
+    for(auto it = sing.begin(); it != sing.end();
         ++it) {
       Dof E(it->first->getNum(), Dof::createTypeWithTwoInts(0, 1));
       _lsys->addToRightHandSide(dof->getDofNumber(E),
@@ -2881,7 +2881,7 @@ public:
     // AVERAGE
     Dof EAVG((*vs.begin())->getNum(), Dof::createTypeWithTwoInts(1, 1));
 
-    for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = vs.begin();
+    for(auto it = vs.begin();
         it != vs.end(); ++it){
       Dof E((*it)->getNum(), Dof::createTypeWithTwoInts(0, 1));
       dof->assemble(EAVG, E, 1);
@@ -2896,7 +2896,7 @@ public:
   int computeHFromSingularities(std::map<MVertex *, int> &s)
   {
     myAssembler = computeHFromSingularities(s, 4);
-    for(std::map<MVertex *, int>::iterator it = s.begin(); it != s.end();
+    for(auto it = s.begin(); it != s.end();
         ++it) {
       singularities.insert(it->first);
     }
@@ -2968,7 +2968,7 @@ public:
 
         double H[3];
         for(int k = 0; k < 3; k++) {
-          std::map<MVertex *, MVertex *, MVertexPtrLessThan>::iterator itk =
+          auto itk =
             new2old.find(t->getVertex(k));
           if(itk == new2old.end())
             myAssembler->getDofValue(t->getVertex(k), 0, 1, H[k]);
@@ -3013,13 +3013,13 @@ public:
     double sum = 0;
     int count_ = 0;
 
-    std::map<MEdge, size_t, MEdgeLessThan>::iterator it = aaa.begin();
+    auto it = aaa.begin();
     for(; it != aaa.end(); ++it) {
       Dof d(it->second, Dof::createTypeWithTwoInts(0, 1));
       double t;
       theta->getDofValue(d, t);
       MVertex *v0, *v1;
-      std::map<MVertex *, MVertex *, MVertexPtrLessThan>::iterator it0 =
+      auto it0 =
         new2old.find(it->first.getVertex(0));
       if(it0 == new2old.end())
         v0 = it->first.getVertex(0);
@@ -3031,7 +3031,7 @@ public:
       else
         v1 = it0->second;
       MEdge e(v0, v1);
-      std::map<MEdge, cross2d, MEdgeLessThan>::iterator itc = C.find(e);
+      auto itc = C.find(e);
       // well... at first ...
       itc->second.o_i = SVector3(cos(t), sin(t), 0.0);
       // end well
@@ -3050,7 +3050,7 @@ public:
     }
 
     sum /= count_;
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator itc = C.begin();
+    auto itc = C.begin();
     for(; itc != C.end(); ++itc) {
       if(!itc->second.inBoundary) {
         itc->second._a -= sum;
@@ -3100,7 +3100,7 @@ public:
 
   quadLayoutData(GModel *_gm, std::vector<GFace *> &_f, const std::string &name,
                  bool includeFeatureEdges = true)
-    : gm(_gm), f(_f), myAssembler(NULL)
+    : gm(_gm), f(_f), myAssembler(nullptr)
   {
     modelName = name;
     for(size_t i = 0; i < f.size(); i++) {
@@ -3119,13 +3119,13 @@ public:
 	  SVector3 v1 (vk1->x()-vk->x(),vk1->y()-vk->y(),vk1->z()-vk->z());
 	  SVector3 v2 (vk2->x()-vk->x(),vk2->y()-vk->y(),vk2->z()-vk->z());
 	  double CURV = angle(v1,v2);
-	  std::map<MVertex *, double>::iterator itg = gaussianCurvatures.find(vk);
+	  auto itg = gaussianCurvatures.find(vk);
 	  if (itg == gaussianCurvatures.end()) gaussianCurvatures[vk] = 2*M_PI - CURV;
 	  else itg->second -= CURV;
 	  //---------------------------------------------------------------------
 
           cross2d c(e, t, e1, e2);
-          std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
+          auto it = C.find(e);
           if(it == C.end())
             C.insert(std::make_pair(e, c));
           else {
@@ -3143,20 +3143,20 @@ public:
           for(size_t k = 0; k < e[j]->lines.size(); k++) {
             MLine *l = e[j]->lines[k];
             MEdge e = l->getEdge(0);
-            std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
+            auto it = C.find(e);
             if(it != C.end()) { it->second.inBoundary = true; }
           }
         }
       }
     }
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+    auto it = C.begin();
     for(; it != C.end(); ++it) it->second.finish(C);
     it = C.begin();
     for(; it != C.end(); ++it) it->second.finish2();
     FILE *F = fopen("gc.pos","w");
     fprintf(F,"View\"\"{\n");
     double dd = 0;
-    for (std::map<MVertex*,double>:: iterator it = gaussianCurvatures.begin(); it != gaussianCurvatures.end() ; ++it){
+    for (auto it = gaussianCurvatures.begin(); it != gaussianCurvatures.end() ; ++it){
       fprintf(F,"SP(%g,%g,%g){%g};\n",it->first->x(),it->first->y(),it->first->z(),it->second);
       dd += it->second;
     }
@@ -3174,7 +3174,7 @@ public:
     cutG.clear();
     new2old.clear();
     //    boundaries.clear();
-    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
+    auto it = C.begin();
     for(; it != C.end(); ++it) {
       it->second.inCutGraph = false;
       it->second._btemp = 0;
@@ -3225,7 +3225,7 @@ public:
 
     std::set<MVertex *, MVertexPtrLessThan> isolated_singularities;
     {
-      for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
+      for(auto it =
             singularities.begin();
           it != singularities.end(); ++it) {
         int count = 0;
@@ -3300,8 +3300,8 @@ public:
     MVertex *e1 = e.getVertex(0);
     MVertex *e2 = e.getVertex(1);
 
-    if(e1 == v2) return NULL;
-    if(e2 == v2) return NULL;
+    if(e1 == v2) return nullptr;
+    if(e2 == v2) return nullptr;
 
     SVector3 e1e2(e2->x() - e1->x(), e2->y() - e1->y(), e2->z() - e1->z());
     SVector3 e1v1(v1->x() - e1->x(), v1->y() - e1->y(), v1->z() - e1->z());
@@ -3313,7 +3313,7 @@ public:
 
     if(!v2) {
       //      Msg::Error("Error In CutMesh");
-      return NULL;
+      return nullptr;
     }
 
     SVector3 e2v2(v2->x() - e2->x(), v2->y() - e2->y(), v2->z() - e2->z());
@@ -3329,17 +3329,17 @@ public:
       SPoint3(e.getVertex(1)->x(), e.getVertex(1)->y(), e.getVertex(1)->z()),
       SPoint3(v1->x(), v1->y(), v1->z()), SPoint3(v2->x(), v2->y(), v2->z()),
       x);
-    if(!inters) return NULL;
+    if(!inters) return nullptr;
     return new MEdgeVertex(v2->x() * x[1] + v1->x() * (1. - x[1]),
                            v2->y() * x[1] + v1->y() * (1. - x[1]),
-                           v2->z() * x[1] + v1->z() * (1. - x[1]), NULL, 0);
+                           v2->z() * x[1] + v1->z() * (1. - x[1]), nullptr, 0);
   }
 
   void cut_edge(std::map<MEdge, int, MEdgeLessThan> &ecuts, MVertex *v0,
                 MVertex *v1, MVertex *mid)
   {
     MEdge e(v0, v1);
-    std::map<MEdge, int, MEdgeLessThan>::iterator it = ecuts.find(e);
+    auto it = ecuts.find(e);
     if(it != ecuts.end()) {
       int index = it->second;
       ecuts.erase(it);
@@ -3359,7 +3359,7 @@ public:
     std::vector<MTriangle *> newt;
 
     for(size_t i = 0; i < ts.size(); ++i) {
-      MVertex *vs[3] = {NULL, NULL, NULL};
+      MVertex *vs[3] = {nullptr, nullptr, nullptr};
       for(size_t j = 0; j < 3; ++j) {
         MEdge e = ts[i]->getEdge(j);
         if(e_cut.find(e) == e_cut.end()) {
@@ -3453,7 +3453,7 @@ public:
 
   void cutMesh(std::map<MEdge, edgeCuts, MEdgeLessThan> &cuts)
   {
-    std::map<MEdge, edgeCuts, MEdgeLessThan>::iterator it = cuts.begin();
+    auto it = cuts.begin();
     std::map<MEdge, int, MEdgeLessThan> ecuts;
 
     FILE *F = fopen("addedpoints.pos", "w");
@@ -3468,7 +3468,7 @@ public:
 
         for(size_t k = 0; k < 3; k++) {
           MEdge e = f[i]->triangles[j]->getEdge(k);
-          std::map<MEdge, edgeCuts, MEdgeLessThan>::iterator it = cuts.find(e);
+          auto it = cuts.find(e);
           if(it != cuts.end()) {
             for(size_t l = 0; l < it->second.vs.size(); ++l) {
               std::pair<int, std::pair<MVertex *, std::pair<int, int> > > pp =
@@ -3482,15 +3482,14 @@ public:
           }
         }
 
-        std::set<int>::iterator iti = indices.begin();
+        auto iti = indices.begin();
         std::vector<MTriangle *> ttt;
         ttt.push_back(f[i]->triangles[j]);
         for(; iti != indices.end(); ++iti) {
           //	  if (*iti != 313310)continue;
           GEdge *ge = gm->getEdgeByTag(*iti);
           if(tcuts.count(*iti) == 1) {
-            std::multimap<
-              int, std::pair<MVertex *, std::pair<int, int> > >::iterator itt =
+            auto itt =
               tcuts.lower_bound(*iti);
             MVertex *v0 = itt->second.first;
             int k = itt->second.second.first;
@@ -3499,8 +3498,7 @@ public:
                          *iti, F);
           }
           else if(tcuts.count(*iti) == 2) {
-            std::multimap<
-              int, std::pair<MVertex *, std::pair<int, int> > >::iterator itt =
+            auto itt =
               tcuts.lower_bound(*iti);
             MVertex *v0 = itt->second.first;
             ++itt;
@@ -3508,8 +3506,7 @@ public:
             cutTriangles(ttt, f[i], v0, v1, ge, ecuts, *iti, F);
           }
           else if(tcuts.count(*iti) == 3) {
-            std::multimap<
-              int, std::pair<MVertex *, std::pair<int, int> > >::iterator itt =
+            auto itt =
               tcuts.lower_bound(*iti);
             int k0 = itt->second.second.first;
             int id0 = itt->second.second.second;
@@ -3550,8 +3547,7 @@ public:
             }
           }
           else if(tcuts.count(*iti) == 4) {
-            std::multimap<
-              int, std::pair<MVertex *, std::pair<int, int> > >::iterator itt =
+            auto itt =
               tcuts.lower_bound(*iti);
             int id0 = itt->second.second.second;
             MVertex *v0 = itt->second.first;
@@ -3581,8 +3577,7 @@ public:
 	    }
 	  }
           else if(tcuts.count(*iti) == 6) {
-            std::multimap<
-              int, std::pair<MVertex *, std::pair<int, int> > >::iterator itt =
+            auto itt =
               tcuts.lower_bound(*iti);
 	    std::pair<int,MVertex*> id[10];
 	    for (std::size_t kk=0;kk< tcuts.count(*iti);kk++){
@@ -3610,7 +3605,7 @@ public:
     F = fopen("edges.pos", "w");
     fprintf(F, "View \"\"{\n");
 
-    for(std::map<MEdge, int>::iterator it = ecuts.begin(); it != ecuts.end();
+    for(auto it = ecuts.begin(); it != ecuts.end();
         ++it) {
       GEdge *ge = gm->getEdgeByTag(it->second);
       ge->lines.push_back(
@@ -3638,7 +3633,7 @@ public:
   {
     std::map<MEdge, MEdge, MEdgeLessThan> duplicateEdges;
 
-    for(std::map<MEdge, edgeCuts, MEdgeLessThan>::iterator it = cuts.begin();
+    for(auto it = cuts.begin();
         it != cuts.end(); ++it) {
       MVertex *v0 = it->first.getVertex(0);
       MVertex *v1 = it->first.getVertex(1);
@@ -3649,12 +3644,12 @@ public:
       duplicateEdges[e0] = e1;
     }
 
-    for(std::map<MEdge, MEdge, MEdgeLessThan>::iterator it2 =
+    for(auto it2 =
           duplicateEdges.begin();
         it2 != duplicateEdges.end(); ++it2) {
-      std::map<MEdge, edgeCuts, MEdgeLessThan>::iterator it3 =
+      auto it3 =
         cuts.find(it2->first);
-      std::map<MEdge, edgeCuts, MEdgeLessThan>::iterator it4 =
+      auto it4 =
         cuts.find(it2->second);
       if(it3 != cuts.end() && it4 == cuts.end()) {
         cuts[it2->second] = it3->second;
@@ -3750,7 +3745,7 @@ static void findPhysicalGroupsForSingularities(GModel *gm,
 {
   std::map<int, std::vector<GEntity *> > groups[4];
   gm->getPhysicalGroups(groups);
-  for(std::map<int, std::vector<GEntity *> >::iterator it = groups[0].begin();
+  for(auto it = groups[0].begin();
       it != groups[0].end(); ++it) {
     std::string name = gm->getPhysicalName(0, it->first);
     if(name == "SINGULARITY_OF_INDEX_THREE") {
@@ -3827,8 +3822,8 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
   name = gm->getName() + "_Directions";
   dd->setName(name);
   dd->setFileName(name + ".msh");
-  PViewDataGModel *U = NULL;
-  PViewDataGModel *V = NULL;
+  PViewDataGModel *U = nullptr;
+  PViewDataGModel *V = nullptr;
   if(layout) {
     U = new PViewDataGModel(PViewDataGModel::ElementNodeData);
     V = new PViewDataGModel(PViewDataGModel::ElementNodeData);
@@ -3866,7 +3861,7 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
     V->addData(gm, dataV, 0, 0.0, 1, 1);
     V->finalize();
   }
-  for(std::map<MTriangle *, SVector3>::iterator it = qLayout.d0.begin();
+  for(auto it = qLayout.d0.begin();
       it != qLayout.d0.end(); ++it) {
     std::vector<double> jj;
     jj.push_back(it->second.x());
@@ -3874,7 +3869,7 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
     jj.push_back(it->second.z());
     dataDir[it->first->getNum()] = jj;
   }
-  for(std::map<MTriangle *, SVector3>::iterator it = qLayout.d1.begin();
+  for(auto it = qLayout.d1.begin();
       it != qLayout.d1.end(); ++it) {
     std::vector<double> jj;
     jj.push_back(it->second.x());
@@ -3882,7 +3877,7 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
     jj.push_back(it->second.z());
     dataDirOrtho[it->first->getNum()] = jj;
   }
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = qLayout.vs.begin();
+  for(auto it = qLayout.vs.begin();
       it != qLayout.vs.end(); ++it) {
     double h;
     qLayout.myAssembler->getDofValue(*it, 0, 1, h);
@@ -3917,7 +3912,7 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
 
   Msg::Info("Classifying the model");
   discreteEdge *de = new discreteEdge(
-    GModel::current(), GModel::current()->getMaxElementaryNumber(1) + 1, 0, 0);
+    GModel::current(), GModel::current()->getMaxElementaryNumber(1) + 1, nullptr, nullptr);
   GModel::current()->add(de);
   computeNonManifoldEdges(GModel::current(), de->lines, true);
   classifyFaces(GModel::current(), M_PI / 4 * .999);
@@ -3929,7 +3924,7 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
   gm->writeMSH(mshout, 4.0, false, true);
 
   int countError = 0;
-  for(GModel::fiter it = GModel::current()->firstFace();
+  for(auto it = GModel::current()->firstFace();
       it != GModel::current()->lastFace(); it++) {
     if((*it)->edges().size() != 4) {
       Msg::Warning("quad layout failed : face %lu has %lu boundaries",
@@ -3959,7 +3954,7 @@ static int computeCrossFieldAndH(GModel *gm, std::vector<GFace *> &f,
 
 static void getFacesOfTheModel(GModel *gm, std::vector<GFace *> &f)
 {
-  for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); ++it) {
+  for(auto it = gm->firstFace(); it != gm->lastFace(); ++it) {
     GFace *gf = *it;
     f.push_back(gf);
   }
diff --git a/Mesh/gmshCrossFields.h b/Mesh/gmshCrossFields.h
index 0a5efef47a8cd1e6197925201a968bb30576a942..27b97bda05b27a25eddd02b1f3644dd0f879383f 100644
--- a/Mesh/gmshCrossFields.h
+++ b/Mesh/gmshCrossFields.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp
index 29111e9e125e6b04e658bd085cd13c59deb91100..845be37e33cedbe92876df68fb0093f9baddd332 100644
--- a/Mesh/meshGEdge.cpp
+++ b/Mesh/meshGEdge.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -124,7 +124,7 @@ struct F_Lc_aniso {
     FieldManager *fields = ge->model()->getFields();
     for(int i = 0; i < fields->getNumBoundaryLayerFields(); ++i) {
       Field *bl_field = fields->get(fields->getBoundaryLayerField(i));
-      if(bl_field == NULL) continue;
+      if(bl_field == nullptr) continue;
       BoundaryLayerField *blf = dynamic_cast<BoundaryLayerField *>(bl_field);
       if(blf->isEdgeBL(ge->tag())) break;
       SMetric3 lc_bgm;
@@ -468,7 +468,7 @@ static void filterPoints(GEdge *ge, int nMinimumPoints)
     (((int)ge->mesh_vertices.size() - last) >= nMinimumPoints);
   if(filteringObservesMinimumN) {
     for(int i = 0; i < last; i++) {
-      std::vector<MVertex *>::iterator it = std::find(
+      auto it = std::find(
         ge->mesh_vertices.begin(), ge->mesh_vertices.end(), lengths[i].second);
 
       if(it != ge->mesh_vertices.end()) { ge->mesh_vertices.erase(it); }
@@ -535,7 +535,7 @@ static void addBoundaryLayerPoints(GEdge *ge, double &t_begin, double &t_end,
   // Check if edge is a BL edge
   for(int i = 0; i < n; ++i) {
     Field *bl_field = fields->get(fields->getBoundaryLayerField(i));
-    if(bl_field == NULL) continue;
+    if(bl_field == nullptr) continue;
     BoundaryLayerField *blf = dynamic_cast<BoundaryLayerField *>(bl_field);
     if(blf->isEdgeBL(ge->tag())) return;
   }
@@ -550,7 +550,7 @@ static void addBoundaryLayerPoints(GEdge *ge, double &t_begin, double &t_end,
   // Check if extremity nodes are BL node
   for(int i = 0; i < n; ++i) {
     Field *bl_field = fields->get(fields->getBoundaryLayerField(i));
-    if(bl_field == NULL) continue;
+    if(bl_field == nullptr) continue;
     BoundaryLayerField *blf = dynamic_cast<BoundaryLayerField *>(bl_field);
     blf->setupFor1d(ge->tag());
 
@@ -666,7 +666,7 @@ int meshGEdgeProcessing(GEdge *ge, const double t_begin, double t_end, int &N,
       if(CTX::instance()->mesh.algoRecombine == 2) N = increaseN(N);
     }
     else {
-      for(std::vector<GFace *>::const_iterator it = faces.begin();
+      for(auto it = faces.begin();
           it != faces.end(); it++) {
         if((*it)->meshAttributes.recombine) {
           if(N % 2 == 0) N++;
diff --git a/Mesh/meshGEdge.h b/Mesh/meshGEdge.h
index d8fa9ab5b955163cf3ead3654229bc0138f66d03..c09612af1c8623c086058dbc24c8b44c4186120a 100644
--- a/Mesh/meshGEdge.h
+++ b/Mesh/meshGEdge.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGEdgeExtruded.cpp b/Mesh/meshGEdgeExtruded.cpp
index dfc4c61cedaea299a21f10e2ee41bde601df792e..1de74e13eb63e8a88ab7e4e85513eb9e84bd79e2 100644
--- a/Mesh/meshGEdgeExtruded.cpp
+++ b/Mesh/meshGEdgeExtruded.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp
index b97031cbb926d33478e6007a6ac5c8f6759a19e9..7a0710d598787894fe12d93603edcefe1cfb563e 100644
--- a/Mesh/meshGFace.cpp
+++ b/Mesh/meshGFace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -63,7 +63,7 @@ bool pointInsideParametricDomain(std::vector<SPoint2> &bnd, SPoint2 &p,
 
 static void trueBoundary(GFace *gf, std::vector<SPoint2> &bnd, int debug)
 {
-  FILE *view_t = 0;
+  FILE *view_t = nullptr;
   if(debug) {
     char name[245];
     sprintf(name, "trueBoundary%d.pos", gf->tag());
@@ -73,7 +73,7 @@ static void trueBoundary(GFace *gf, std::vector<SPoint2> &bnd, int debug)
   std::vector<GEdge *> edg = gf->edges();
   std::set<GEdge *> edges(edg.begin(), edg.end());
 
-  for(std::set<GEdge *>::iterator it = edges.begin(); it != edges.end(); ++it) {
+  for(auto it = edges.begin(); it != edges.end(); ++it) {
     GEdge *ge = *it;
     Range<double> r = ge->parBoundsOnFace(gf);
     SPoint2 p[300];
@@ -136,9 +136,9 @@ private:
         MEdge E = _gf->triangles[i]->getEdge(j);
         SPoint2 p1, p2;
         reparamMeshEdgeOnFace(E.getVertex(0), E.getVertex(1), _gf, p1, p2);
-        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it =
+        auto it =
           _middle.find(E);
-        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it2 = eds.find(E);
+        auto it2 = eds.find(E);
         m[j] = p1;
         if(it == _middle.end() && it2 == eds.end()) {
           GPoint gp = _gf->point((p1 + p2) * 0.5);
@@ -191,9 +191,9 @@ private:
         MEdge E = _gf->quadrangles[i]->getEdge(j);
         SPoint2 p1, p2;
         reparamMeshEdgeOnFace(E.getVertex(0), E.getVertex(1), _gf, p1, p2);
-        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it =
+        auto it =
           _middle.find(E);
-        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it2 = eds.find(E);
+        auto it2 = eds.find(E);
         m[j] = p1;
         if(it == _middle.end() && it2 == eds.end()) {
           GPoint gp = _gf->point((p1 + p2) * 0.5);
@@ -247,7 +247,7 @@ private:
   void _restore()
   {
     std::vector<GEdge *> const &edges = _gf->edges();
-    std::vector<GEdge *>::const_iterator ite = edges.begin();
+    auto ite = edges.begin();
     while(ite != edges.end()) {
       for(std::size_t i = 0; i < (*ite)->lines.size(); i++) {
         delete(*ite)->lines[i];
@@ -271,7 +271,7 @@ public:
       return;
     }
     std::vector<GEdge *> const &edges = gf->edges();
-    std::vector<GEdge *>::const_iterator ite = edges.begin();
+    auto ite = edges.begin();
     while(ite != edges.end()) {
       if((*ite)->meshAttributes.method == MESH_TRANSFINITE) {
         Msg::Warning("Full-quad recombination only compatible with "
@@ -330,7 +330,7 @@ static void copyMesh(GFace *source, GFace *target)
   std::vector<GVertex *> s_vtcs = source->vertices();
   s_vtcs.insert(s_vtcs.end(), source->embeddedVertices().begin(),
                 source->embeddedVertices().end());
-  for(std::vector<GEdge *>::iterator it = source->embeddedEdges().begin();
+  for(auto it = source->embeddedEdges().begin();
       it != source->embeddedEdges().end(); it++) {
     if((*it)->getBeginVertex()) s_vtcs.push_back((*it)->getBeginVertex());
     if((*it)->getEndVertex()) s_vtcs.push_back((*it)->getEndVertex());
@@ -338,7 +338,7 @@ static void copyMesh(GFace *source, GFace *target)
   std::vector<GVertex *> t_vtcs = target->vertices();
   t_vtcs.insert(t_vtcs.end(), target->embeddedVertices().begin(),
                 target->embeddedVertices().end());
-  for(std::vector<GEdge *>::iterator it = target->embeddedEdges().begin();
+  for(auto it = target->embeddedEdges().begin();
       it != target->embeddedEdges().end(); it++) {
     if((*it)->getBeginVertex()) t_vtcs.push_back((*it)->getBeginVertex());
     if((*it)->getEndVertex()) t_vtcs.push_back((*it)->getEndVertex());
@@ -355,7 +355,7 @@ static void copyMesh(GFace *source, GFace *target)
   for(std::vector<GVertex *>::const_iterator tvIter = t_vtcs.begin();
       tvIter != t_vtcs.end(); ++tvIter) {
     GVertex *gvt = *tvIter;
-    std::map<GVertex *, GVertex *>::iterator gvsIter =
+    auto gvsIter =
       target->vertexCounterparts.find(gvt);
 
     if(gvsIter == target->vertexCounterparts.end()) {
@@ -398,11 +398,11 @@ static void copyMesh(GFace *source, GFace *target)
   std::set<GEdge *> checkEdges;
   checkEdges.insert(s_edges.begin(), s_edges.end());
 
-  for(std::vector<GEdge *>::iterator te_iter = t_edges.begin();
+  for(auto te_iter = t_edges.begin();
       te_iter != t_edges.end(); ++te_iter) {
     GEdge *get = *te_iter;
 
-    std::map<GEdge *, std::pair<GEdge *, int> >::iterator gesIter =
+    auto gesIter =
       target->edgeCounterparts.find(get);
     if(gesIter == target->edgeCounterparts.end()) {
       Msg::Error("Periodic meshing of surface %d with surface %d: "
@@ -518,11 +518,11 @@ static void remeshUnrecoveredEdges(
 {
   deMeshGFace dem;
 
-  std::set<EdgeToRecover>::iterator itr = edgesNotRecovered.begin();
+  auto itr = edgesNotRecovered.begin();
   for(; itr != edgesNotRecovered.end(); ++itr) {
     std::vector<GFace *> l_faces = itr->ge->faces();
     // un-mesh model faces adjacent to the model edge
-    for(std::vector<GFace *>::iterator it = l_faces.begin();
+    for(auto it = l_faces.begin();
         it != l_faces.end(); ++it) {
       if((*it)->triangles.size() || (*it)->quadrangles.size()) {
         (*it)->meshStatistics.status = GFace::PENDING;
@@ -544,9 +544,9 @@ static void remeshUnrecoveredEdges(
       MVertex *v1 = itr->ge->lines[i]->getVertex(0);
       MVertex *v2 = itr->ge->lines[i]->getVertex(1);
 
-      std::multimap<MVertex *, BDS_Point *>::iterator itp1 =
+      auto itp1 =
         recoverMultiMapInv.lower_bound(v1);
-      std::multimap<MVertex *, BDS_Point *>::iterator itp2 =
+      auto itp2 =
         recoverMultiMapInv.lower_bound(v2);
 
       if(itp1 != recoverMultiMapInv.end() && itp2 != recoverMultiMapInv.end()) {
@@ -636,11 +636,11 @@ remeshUnrecoveredEdges(std::map<MVertex *, BDS_Point *> &recoverMapInv,
 {
   deMeshGFace dem;
 
-  std::set<EdgeToRecover>::iterator itr = edgesNotRecovered.begin();
+  auto itr = edgesNotRecovered.begin();
   for(; itr != edgesNotRecovered.end(); ++itr) {
     std::vector<GFace *> l_faces = itr->ge->faces();
     // un-mesh model faces adjacent to the model edge
-    for(std::vector<GFace *>::iterator it = l_faces.begin();
+    for(auto it = l_faces.begin();
         it != l_faces.end(); ++it) {
       if((*it)->triangles.size() || (*it)->quadrangles.size()) {
         (*it)->meshStatistics.status = GFace::PENDING;
@@ -661,8 +661,8 @@ remeshUnrecoveredEdges(std::map<MVertex *, BDS_Point *> &recoverMapInv,
     for(int i = 0; i < N; i++) {
       MVertex *v1 = itr->ge->lines[i]->getVertex(0);
       MVertex *v2 = itr->ge->lines[i]->getVertex(1);
-      std::map<MVertex *, BDS_Point *>::iterator itp1 = recoverMapInv.find(v1);
-      std::map<MVertex *, BDS_Point *>::iterator itp2 = recoverMapInv.find(v2);
+      auto itp1 = recoverMapInv.find(v1);
+      auto itp2 = recoverMapInv.find(v2);
       if(itp1 != recoverMapInv.end() && itp2 != recoverMapInv.end()) {
         BDS_Point *pp1 = itp1->second;
         BDS_Point *pp2 = itp2->second;
@@ -755,7 +755,7 @@ static bool recoverEdge(BDS_Mesh *m, GFace *gf, GEdge *ge,
                         std::set<EdgeToRecover> *e2r,
                         std::set<EdgeToRecover> *notRecovered, int pass)
 {
-  BDS_GeomEntity *g = 0;
+  BDS_GeomEntity *g = nullptr;
   if(pass == 2) {
     m->add_geom(ge->tag(), 1);
     g = m->get_geom(ge->tag(), 1);
@@ -766,9 +766,9 @@ static bool recoverEdge(BDS_Mesh *m, GFace *gf, GEdge *ge,
   for(std::size_t i = 0; i < ge->lines.size(); i++) {
     MVertex *vstart = ge->lines[i]->getVertex(0);
     MVertex *vend = ge->lines[i]->getVertex(1);
-    std::map<MVertex *, BDS_Point *>::iterator itpstart =
+    auto itpstart =
       recoverMapInv.find(vstart);
-    std::map<MVertex *, BDS_Point *>::iterator itpend =
+    auto itpend =
       recoverMapInv.find(vend);
     if(itpstart != recoverMapInv.end() && itpend != recoverMapInv.end()) {
       BDS_Point *pstart = itpstart->second;
@@ -800,9 +800,9 @@ static bool recoverEdge(BDS_Mesh *m, GFace *gf, GEdge *ge,
   if(pass == 2 && ge->getBeginVertex()) {
     MVertex *vstart = *(ge->getBeginVertex()->mesh_vertices.begin());
     MVertex *vend = *(ge->getEndVertex()->mesh_vertices.begin());
-    std::map<MVertex *, BDS_Point *>::iterator itpstart =
+    auto itpstart =
       recoverMapInv.find(vstart);
-    std::map<MVertex *, BDS_Point *>::iterator itpend =
+    auto itpend =
       recoverMapInv.find(vend);
     if(itpstart != recoverMapInv.end() && itpend != recoverMapInv.end()) {
       BDS_Point *pstart = itpstart->second;
@@ -829,7 +829,7 @@ static void addOrRemove(MVertex *v1, MVertex *v2,
 {
   MEdge e(v1, v2);
   if(removed.find(e) != removed.end()) return;
-  std::set<MEdge, MEdgeLessThan>::iterator it = bedges.find(e);
+  auto it = bedges.find(e);
   if(it == bedges.end())
     bedges.insert(e);
   else {
@@ -851,9 +851,9 @@ static void modifyInitialMeshForBoundaryLayers(
   std::vector<GEdge *> edges = gf->edges();
   std::vector<GEdge *> embedded_edges = gf->getEmbeddedEdges();
   edges.insert(edges.begin(), embedded_edges.begin(), embedded_edges.end());
-  std::vector<GEdge *>::iterator ite = edges.begin();
+  auto ite = edges.begin();
 
-  FILE *ff2 = 0;
+  FILE *ff2 = nullptr;
   if(debug) ff2 = Fopen("tato.pos", "w");
   if(ff2) fprintf(ff2, "View \" \"{\n");
 
@@ -920,7 +920,7 @@ static void modifyInitialMeshForBoundaryLayers(
     ++ite;
   }
 
-  for(BoundaryLayerColumns::iterf itf = _columns->beginf();
+  for(auto itf = _columns->beginf();
       itf != _columns->endf(); ++itf) {
     MVertex *v = itf->first;
     int nbCol = _columns->getNbColumns(v);
@@ -1008,11 +1008,11 @@ static void modifyInitialMeshForBoundaryLayers(
         verts.insert(blTris[i]->getVertex(j));
   }
 
-  discreteEdge ne(gf->model(), 444444, 0, (*edges.begin())->getEndVertex());
+  discreteEdge ne(gf->model(), 444444, nullptr, (*edges.begin())->getEndVertex());
   std::vector<GEdge *> hop;
-  std::set<MEdge, MEdgeLessThan>::iterator it = bedges.begin();
+  auto it = bedges.begin();
 
-  FILE *ff = 0;
+  FILE *ff = nullptr;
   if(debug) ff = Fopen("toto.pos", "w");
   if(ff) fprintf(ff, "View \" \"{\n");
   for(; it != bedges.end(); ++it) {
@@ -1086,7 +1086,7 @@ static void directions_storage(GFace *gf)
   gf->storage3.clear();
   gf->storage4.clear();
 
-  for(std::set<MVertex *>::iterator it = vertices.begin(); it != vertices.end();
+  for(auto it = vertices.begin(); it != vertices.end();
       it++) {
     SPoint2 point;
     SVector3 v1;
@@ -1109,13 +1109,13 @@ static void
 BDS2GMSH(BDS_Mesh *m, GFace *gf,
          std::map<BDS_Point *, MVertex *, PointLessThan> &recoverMap)
 {
-  std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+  auto itt = m->triangles.begin();
   while(itt != m->triangles.end()) {
     BDS_Face *t = *itt;
     if(!t->deleted) {
       BDS_Point *n[4];
       t->getNodes(n);
-      MVertex *v[4] = {0, 0, 0, 0};
+      MVertex *v[4] = {nullptr, nullptr, nullptr, nullptr};
       for(int i = 0; i < 4; i++) {
         if(!n[i]) continue;
         if(recoverMap.find(n[i]) == recoverMap.end()) {
@@ -1189,7 +1189,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   std::set<MVertex *, MVertexPtrLessThan> all_vertices, boundary;
   std::vector<GEdge *>::const_iterator ite = edges.begin();
 
-  FILE *fdeb = NULL;
+  FILE *fdeb = nullptr;
   if(debug && RECUR_ITER == 0) {
     char name[245];
     sprintf(name, "surface%d-boundary-real.pos", gf->tag());
@@ -1199,7 +1199,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
 
   while(ite != edges.end()) {
     if((*ite)->isSeam(gf)) {
-      if(fdeb != NULL) fclose(fdeb);
+      if(fdeb != nullptr) fclose(fdeb);
       return false;
     }
     if(!(*ite)->isMeshDegenerated()) {
@@ -1239,7 +1239,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
     Msg::Error("The 1D mesh seems not to be forming a closed loop (%d boundary "
                "nodes are considered once)",
                boundary.size());
-    for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = boundary.begin();
+    for(auto it = boundary.begin();
         it != boundary.end(); it++) {
       Msg::Debug("Remaining node %lu", (*it)->getNum());
     }
@@ -1265,7 +1265,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
 
   // add embedded vertices
   std::vector<GVertex *> emb_vertx = gf->getEmbeddedVertices();
-  std::vector<GVertex *>::iterator itvx = emb_vertx.begin();
+  auto itvx = emb_vertx.begin();
   while(itvx != emb_vertx.end()) {
     all_vertices.insert((*itvx)->mesh_vertices.begin(),
                         (*itvx)->mesh_vertices.end());
@@ -1280,9 +1280,9 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
     return true;
   }
   else if(all_vertices.size() == 3) {
-    MVertex *vv[3] = {0, 0, 0};
+    MVertex *vv[3] = {nullptr, nullptr, nullptr};
     int i = 0;
-    for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
+    for(auto it =
           all_vertices.begin();
         it != all_vertices.end(); it++) {
       vv[i++] = *it;
@@ -1299,7 +1299,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   std::vector<BDS_Point *> points(all_vertices.size());
   SBoundingBox3d bbox;
   int count = 0;
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
+  for(auto it =
         all_vertices.begin();
       it != all_vertices.end(); it++) {
     MVertex *here = *it;
@@ -1336,7 +1336,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
       doc.points[i].where.h = points[i]->u + XX;
       doc.points[i].where.v = points[i]->v + YY;
       doc.points[i].data = points[i];
-      doc.points[i].adjacent = NULL;
+      doc.points[i].adjacent = nullptr;
     }
 
     // increase the size of the bounding box
@@ -1355,7 +1355,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
       pp->g = g;
       doc.points[points.size() + ip].where.h = bb[ip][0];
       doc.points[points.size() + ip].where.v = bb[ip][1];
-      doc.points[points.size() + ip].adjacent = 0;
+      doc.points[points.size() + ip].adjacent = nullptr;
       doc.points[points.size() + ip].data = pp;
     }
 
@@ -1478,7 +1478,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
 
   if(edgesNotRecovered.size() || gf->meshStatistics.refineAllEdges) {
     std::ostringstream sstream;
-    for(std::set<EdgeToRecover>::iterator itr = edgesNotRecovered.begin();
+    for(auto itr = edgesNotRecovered.begin();
         itr != edgesNotRecovered.end(); ++itr)
       sstream << " " << itr->ge->tag();
     if(gf->meshStatistics.refineAllEdges) {
@@ -1502,7 +1502,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
       gf->meshStatistics.refineAllEdges = false;
     }
     else {
-      std::set<EdgeToRecover>::iterator itr = edgesNotRecovered.begin();
+      auto itr = edgesNotRecovered.begin();
       int I = 0;
       for(; itr != edgesNotRecovered.end(); ++itr) {
         int p1 = itr->p1;
@@ -1531,9 +1531,9 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   // look for a triangle that has a negative node and recursively tag all
   // exterior triangles
   {
-    std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+    auto itt = m->triangles.begin();
     while(itt != m->triangles.end()) {
-      (*itt)->g = 0;
+      (*itt)->g = nullptr;
       ++itt;
     }
     itt = m->triangles.begin();
@@ -1552,7 +1552,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
 
   // now find an edge that has belongs to one of the exterior triangles
   {
-    std::vector<BDS_Edge *>::iterator ite = m->edges.begin();
+    auto ite = m->edges.begin();
     while(ite != m->edges.end()) {
       BDS_Edge *e = *ite;
       if(e->g && e->numfaces() == 2) {
@@ -1567,15 +1567,15 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
       }
       ++ite;
     }
-    std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+    auto itt = m->triangles.begin();
     while(itt != m->triangles.end()) {
-      if((*itt)->g == &CLASS_EXTERIOR) (*itt)->g = 0;
+      if((*itt)->g == &CLASS_EXTERIOR) (*itt)->g = nullptr;
       ++itt;
     }
   }
 
   {
-    std::vector<BDS_Edge *>::iterator ite = m->edges.begin();
+    auto ite = m->edges.begin();
     while(ite != m->edges.end()) {
       BDS_Edge *e = *ite;
       if(e->g && e->numfaces() == 2) {
@@ -1606,10 +1606,10 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   if(CTX::instance()->mesh.algo2d != ALGO_2D_BAMG && !onlyInitialMesh) {
     Msg::Debug("Computing mesh size field at mesh nodes %d",
                edgesToRecover.size());
-    std::set<BDS_Point *, PointLessThan>::iterator it = m->points.begin();
+    auto it = m->points.begin();
     for(; it != m->points.end(); ++it) {
       BDS_Point *pp = *it;
-      std::map<BDS_Point *, MVertex *, PointLessThan>::iterator itv =
+      auto itv =
         recoverMap.find(pp);
       if(itv != recoverMap.end()) {
         MVertex *here = itv->second;
@@ -1630,7 +1630,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   }
 
   // delete useless stuff
-  std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+  auto itt = m->triangles.begin();
   while(itt != m->triangles.end()) {
     BDS_Face *t = *itt;
     if(!t->g) m->del_face(t);
@@ -1639,7 +1639,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   m->cleanup();
 
   {
-    std::vector<BDS_Edge *>::iterator ite = m->edges.begin();
+    auto ite = m->edges.begin();
     while(ite != m->edges.end()) {
       BDS_Edge *e = *ite;
       if(e->numfaces() == 0)
@@ -1669,7 +1669,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   }
 
   if(1) {
-    std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+    auto itt = m->triangles.begin();
     while(itt != m->triangles.end()) {
       BDS_Face *t = *itt;
       if(!t->deleted) {
@@ -1705,9 +1705,9 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   // start mesh generation
   if(!algoDelaunay2D(gf) && !onlyInitialMesh) {
     refineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, true,
-                  &recoverMapInv, NULL);
+                  &recoverMapInv, nullptr);
     refineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, false,
-                  &recoverMapInv, NULL);
+                  &recoverMapInv, nullptr);
   }
 
   gf->meshStatistics.status = GFace::DONE;
@@ -1844,7 +1844,7 @@ static bool buildConsecutiveListOfVertices(
   result.clear();
   count = 0;
 
-  GEdgeLoop::iter it = gel.begin();
+  auto it = gel.begin();
 
   if(MYDEBUG)
     printf("face %d with %d edges case %d\n", gf->tag(),
@@ -1880,13 +1880,13 @@ static bool buildConsecutiveListOfVertices(
 
   std::list<GEdgeSigned> unordered(gel.begin(), gel.end());
 
-  GEdgeSigned found(0, 0);
+  GEdgeSigned found(0, nullptr);
   SPoint2 last_coord(0, 0);
   int counter = 0;
 
   while(unordered.size()) {
     if(MYDEBUG) printf("unordered.size() = %d\n", (int)unordered.size());
-    std::list<GEdgeSigned>::iterator it = unordered.begin();
+    auto it = unordered.begin();
     std::vector<SPoint2> coords;
 
     while(it != unordered.end()) {
@@ -1976,7 +1976,7 @@ static bool buildConsecutiveListOfVertices(
       // It has not worked : either tolerance is wrong or the first seam edge
       // has to be taken with the other parametric coordinates (because it is
       // only present once in the closure of the domain).
-      for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+      for(auto it =
             recoverMapLocal.begin();
           it != recoverMapLocal.end(); ++it) {
         m->del_point(it->first);
@@ -2009,11 +2009,11 @@ static bool buildConsecutiveListOfVertices(
       MVertex *here = edgeLoop[i];
       GEntity *ge = here->onWhat();
 
-      BDS_Point *pp = 0;
+      BDS_Point *pp = nullptr;
       if(ge->dim() == 0) {
         // Point might already be part of other loop
         double smallestDistance = std::numeric_limits<double>::infinity();
-        for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+        for(auto it =
               recoverMap.begin();
             it != recoverMap.end(); ++it) {
           if(it->second == here) {
@@ -2029,7 +2029,7 @@ static bool buildConsecutiveListOfVertices(
           }
         }
       }
-      if(pp == 0) {
+      if(pp == nullptr) {
         double U, V;
         SPoint2 param = coords[i];
         U = param.x();
@@ -2082,7 +2082,7 @@ static GEdge *getGEdge(GFace *gf, MVertex *v1, MVertex *v2)
       if(l->getVertex(1) == v1 && l->getVertex(0) == v2) return ge;
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
@@ -2118,7 +2118,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
   SBoundingBox3d bbox;
   int nbPointsTotal = 0;
   {
-    for(std::list<GEdgeLoop>::iterator it = gf->edgeLoops.begin();
+    for(auto it = gf->edgeLoops.begin();
         it != gf->edgeLoops.end(); it++) {
       std::vector<BDS_Point *> edgeLoop_BDS;
       int nbPointsLocal;
@@ -2150,13 +2150,13 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
   }
 
   {
-    std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+    auto it =
       recoverMap.begin();
     std::map<MVertex *, BDS_Point *> INV;
     for(; it != recoverMap.end(); ++it) {
       recoverMultiMapInv.insert(std::make_pair(it->second, it->first));
 
-      std::map<MVertex *, BDS_Point *>::iterator it2 = INV.find(it->second);
+      auto it2 = INV.find(it->second);
       if(it2 != INV.end()) {
         it->first->_periodicCounterpart = it2->second;
         it2->second->_periodicCounterpart = it->first;
@@ -2174,9 +2174,9 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
     return true;
   }
   else if(nbPointsTotal == 3) {
-    MVertex *vv[3] = {0, 0, 0};
+    MVertex *vv[3] = {nullptr, nullptr, nullptr};
     int i = 0;
-    for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+    for(auto it =
           recoverMap.begin();
         it != recoverMap.end(); it++) {
       vv[i++] = it->second;
@@ -2199,10 +2199,10 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
     // Embedded Vertices
     // add embedded vertices
     std::vector<GVertex *> emb_vertx = gf->getEmbeddedVertices();
-    std::vector<GVertex *>::iterator itvx = emb_vertx.begin();
+    auto itvx = emb_vertx.begin();
 
     std::map<MVertex *, std::set<BDS_Point *> > invertedRecoverMap;
-    for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+    for(auto it =
           recoverMap.begin();
         it != recoverMap.end(); it++) {
       invertedRecoverMap[it->second].insert(it->first);
@@ -2246,7 +2246,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
                   (double)RAND_MAX;
       doc.points[count].where.h = pp->u + XX;
       doc.points[count].where.v = pp->v + YY;
-      doc.points[count].adjacent = NULL;
+      doc.points[count].adjacent = nullptr;
       doc.points[count].data = pp;
       count++;
       ++itvx;
@@ -2261,7 +2261,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
       for(std::size_t i = 0; i < (*ite)->lines.size(); i++) {
         for(std::size_t j = 0; j < 2; j++) {
           MVertex *v = (*ite)->lines[i]->getVertex(j);
-          BDS_Point *pp = 0;
+          BDS_Point *pp = nullptr;
           const std::map<MVertex *, std::set<BDS_Point *> >::iterator it =
             invertedRecoverMap.find(v);
           if(it != invertedRecoverMap.end()) {
@@ -2285,7 +2285,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
               SPoint2 pointOnSurface = edge->reparamOnFace(gf, param, 1);
 
               const std::set<BDS_Point *> &possiblePoints = it->second;
-              for(std::set<BDS_Point *>::iterator pntIt =
+              for(auto pntIt =
                     possiblePoints.begin();
                   pntIt != possiblePoints.end(); ++pntIt) {
                 if(pointOnSurface.distance(SPoint2((*pntIt)->u, (*pntIt)->v)) <
@@ -2294,7 +2294,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
                   break;
                 }
               }
-              if(pp == 0) {
+              if(pp == nullptr) {
                 Msg::Error("Embedded edge node %d is on the seam edge of "
                            "surface %d and no appropriate point could be "
                            "found!",
@@ -2306,7 +2306,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
             }
             facile[v] = pp;
           }
-          if(pp == 0 && vs.find(v) == vs.end()) {
+          if(pp == nullptr && vs.find(v) == vs.end()) {
             vs.insert(v);
             double uv[2] = {0, 0};
             GPoint gp = gf->closestPoint(SPoint3(v->x(), v->y(), v->z()), uv);
@@ -2329,7 +2329,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
                         (double)rand() / (double)RAND_MAX;
             doc.points[count].where.h = pp->u + XX;
             doc.points[count].where.v = pp->v + YY;
-            doc.points[count].adjacent = NULL;
+            doc.points[count].adjacent = nullptr;
             doc.points[count].data = pp;
             count++;
           }
@@ -2354,7 +2354,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
                     (double)RAND_MAX;
         doc.points[count].where.h = pp->u + XX;
         doc.points[count].where.v = pp->v + YY;
-        doc.points[count].adjacent = NULL;
+        doc.points[count].adjacent = nullptr;
         doc.points[count].data = pp;
         count++;
       }
@@ -2381,7 +2381,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
       pp->g = g;
       doc.points[nbPointsTotal + ip].where.h = bb[ip].x();
       doc.points[nbPointsTotal + ip].where.v = bb[ip].y();
-      doc.points[nbPointsTotal + ip].adjacent = 0;
+      doc.points[nbPointsTotal + ip].adjacent = nullptr;
       doc.points[nbPointsTotal + ip].data = pp;
     }
 
@@ -2500,7 +2500,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
 
     if(!gf->meshStatistics.refineAllEdges) {
       std::ostringstream sstream;
-      for(std::set<EdgeToRecover>::iterator itr = edgesNotRecovered.begin();
+      for(auto itr = edgesNotRecovered.begin();
           itr != edgesNotRecovered.end(); ++itr)
         sstream
           << " " << itr->ge->tag() << "("
@@ -2521,9 +2521,9 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
           for(size_t j = 0; j < NN; j++) {
             MVertex *v1 = eds[i]->lines[j]->getVertex(0);
             MVertex *v2 = eds[i]->lines[j]->getVertex(1);
-            std::multimap<MVertex *, BDS_Point *>::iterator itp1 =
+            auto itp1 =
               recoverMultiMapInv.lower_bound(v1);
-            std::multimap<MVertex *, BDS_Point *>::iterator itp2 =
+            auto itp2 =
               recoverMultiMapInv.lower_bound(v2);
             if(itp1 != recoverMultiMapInv.end() &&
                itp2 != recoverMultiMapInv.end())
@@ -2562,9 +2562,9 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
   // look for a triangle that has a negative node and recursively tag all
   // exterior triangles
   {
-    std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+    auto itt = m->triangles.begin();
     while(itt != m->triangles.end()) {
-      (*itt)->g = 0;
+      (*itt)->g = nullptr;
       ++itt;
     }
     itt = m->triangles.begin();
@@ -2604,16 +2604,16 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
       }
       ++ite;
     }
-    std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+    auto itt = m->triangles.begin();
     while(itt != m->triangles.end()) {
-      if((*itt)->g == &CLASS_EXTERIOR) (*itt)->g = 0;
+      if((*itt)->g == &CLASS_EXTERIOR) (*itt)->g = nullptr;
       ++itt;
     }
   }
 
   // delete useless stuff
   {
-    std::vector<BDS_Face *>::iterator itt = m->triangles.begin();
+    auto itt = m->triangles.begin();
     while(itt != m->triangles.end()) {
       BDS_Face *t = *itt;
       if(!t->g) { m->del_face(t); }
@@ -2669,7 +2669,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
     int nb_swap;
     delaunayizeBDS(gf, *m, nb_swap);
 
-    refineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, true, NULL,
+    refineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, true, nullptr,
                   &recoverMap, &true_boundary);
     if(debug) {
       char name[245];
@@ -2685,7 +2685,7 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
       sprintf(name, "surface%d-phase2-param.pos", gf->tag());
       outputScalarField(m->triangles, name, 1, gf);
     }
-    refineMeshBDS(gf, *m, -CTX::instance()->mesh.refineSteps, false, NULL,
+    refineMeshBDS(gf, *m, -CTX::instance()->mesh.refineSteps, false, nullptr,
                   &recoverMap, &true_boundary);
     if(debug) {
       char name[245];
@@ -2729,16 +2729,16 @@ static bool meshGeneratorPeriodic(GFace *gf, int RECUR_ITER,
   std::map<MVertex *, SPoint2> parametricCoordinates;
   if(algoDelaunay2D(gf)) {
     std::map<MVertex *, BDS_Point *> invertMap;
-    std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+    auto it =
       recoverMap.begin();
     while(it != recoverMap.end()) {
       // we have twice vertex MVertex with 2 different coordinates
       MVertex *mv1 = it->second;
       BDS_Point *bds = it->first;
-      std::map<MVertex *, BDS_Point *>::iterator invIt = invertMap.find(mv1);
+      auto invIt = invertMap.find(mv1);
       if(invIt != invertMap.end()) {
         // create a new "fake" vertex that will be destroyed afterwards
-        MVertex *mv2 = 0;
+        MVertex *mv2 = nullptr;
         if(mv1->onWhat()->dim() == 1) {
           double t;
           mv1->getParameter(0, t);
@@ -2958,7 +2958,7 @@ void meshGFace::operator()(GFace *gf, bool print)
               gf->getTypeString().c_str(), algo);
 
   bool singularEdges = false;
-  std::vector<GEdge *>::const_iterator ite = gf->edges().begin();
+  auto ite = gf->edges().begin();
   while(ite != gf->edges().end()) {
     if((*ite)->isSeam(gf)) singularEdges = true;
     ite++;
diff --git a/Mesh/meshGFace.h b/Mesh/meshGFace.h
index 48107cc90a5616ba20a82d5a435374cf32f39012..3a643750deac46f14ed7200d73ae5930f1576719 100644
--- a/Mesh/meshGFace.h
+++ b/Mesh/meshGFace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -48,10 +48,10 @@ void fourthPoint(double *p1, double *p2, double *p3, double *p4);
 void findTransfiniteCorners(GFace *gf, std::vector<MVertex *> &corners);
 int MeshTransfiniteSurface(GFace *gf);
 int MeshExtrudedSurface(
-  GFace *gf, std::set<std::pair<MVertex *, MVertex *> > *constrainedEdges = 0);
+  GFace *gf, std::set<std::pair<MVertex *, MVertex *> > *constrainedEdges = nullptr);
 bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
                    bool onlyInitialMesh, bool debug = true,
-                   std::vector<GEdge *> *replacement_edges = 0);
+                   std::vector<GEdge *> *replacement_edges = nullptr);
 bool pointInsideParametricDomain(std::vector<SPoint2> &bnd, SPoint2 &p,
                                  SPoint2 &out, int &N);
 
diff --git a/Mesh/meshGFaceBDS.cpp b/Mesh/meshGFaceBDS.cpp
index 61f6adb37d82e063d7ce983db3a9e2457a428c36..36d8450231e87f4fa04bb2a542ba18f13a8bfbf7 100644
--- a/Mesh/meshGFaceBDS.cpp
+++ b/Mesh/meshGFaceBDS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -30,14 +30,14 @@ static void getDegeneratedVertices(
 {
   degenerated.clear();
 
-  std::vector<BDS_Edge *>::iterator it = m.edges.begin();
+  auto it = m.edges.begin();
 
   while(it != m.edges.end()) {
     BDS_Edge *e = *it;
     if(!e->deleted && e->numfaces() == 1) {
-      std::map<BDS_Point *, MVertex *, PointLessThan>::iterator itp1 =
+      auto itp1 =
         recoverMap->find(e->p1);
-      std::map<BDS_Point *, MVertex *, PointLessThan>::iterator itp2 =
+      auto itp2 =
         recoverMap->find(e->p2);
       if(itp1 != recoverMap->end() && itp2 != recoverMap->end() &&
          itp1->second == itp2->second) {
@@ -168,8 +168,8 @@ static int edgeSwapTest(GFace *gf, BDS_Edge *e)
 static bool neighboringModified(BDS_Point *p)
 {
   if(p->config_modified) return true;
-  std::vector<BDS_Edge *>::iterator it = p->edges.begin();
-  std::vector<BDS_Edge *>::iterator ite = p->edges.end();
+  auto it = p->edges.begin();
+  auto ite = p->edges.end();
   while(it != ite) {
     BDS_Point *o = (*it)->othervertex(p);
     if(o->config_modified) return true;
@@ -363,7 +363,7 @@ static bool middlePoint(GFace *gf, BDS_Edge *e, double &u, double &v)
 static void getDegeneracy(BDS_Mesh &m, std::vector<BDS_Point *> &deg)
 {
   deg.clear();
-  std::set<BDS_Point *, PointLessThan>::iterator itp = m.points.begin();
+  auto itp = m.points.begin();
   while(itp != m.points.end()) {
     if((*itp)->degenerated) deg.push_back(*itp);
     itp++;
@@ -414,7 +414,7 @@ static void splitEdgePass(GFace *gf, BDS_Mesh &m, double MAXE_, int &nb_split,
   SPoint2 out(gf->parBounds(0).high() + 1.21982512,
               gf->parBounds(1).high() + 1.8635436432);
 
-  for(std::set<BDS_Point *, PointLessThan>::iterator it = m.points.begin();
+  for(auto it = m.points.begin();
       it != m.points.end(); ++it) {
     BDS_Point *p = *it;
     if(!p->_periodicCounterpart && (p->g && p->g->classif_degree == 2)) {
@@ -452,7 +452,7 @@ static void splitEdgePass(GFace *gf, BDS_Mesh &m, double MAXE_, int &nb_split,
 
   for(std::size_t i = 0; i < edges.size(); ++i) {
     BDS_Edge *e = edges[i].second;
-    BDS_Point *mid = NULL;
+    BDS_Point *mid = nullptr;
     if(!e->deleted &&
        (neighboringModified(e->p1) || neighboringModified(e->p2))) {
       double U1 = e->p1->u;
@@ -511,9 +511,9 @@ double getMaxLcWhenCollapsingEdge(GFace *gf, BDS_Mesh &m, BDS_Edge *e,
 
   double maxLc = 0.0;
   std::vector<BDS_Edge *> edges(p->edges);
-  std::vector<BDS_Edge *>::iterator eit = edges.begin();
+  auto eit = edges.begin();
   while(eit != edges.end()) {
-    BDS_Point *newP1 = 0, *newP2 = 0;
+    BDS_Point *newP1 = nullptr, *newP2 = nullptr;
     if((*eit)->p1 == p) {
       newP1 = o;
       newP2 = (*eit)->p2;
@@ -572,7 +572,7 @@ void collapseEdgePass(GFace *gf, BDS_Mesh &m, double MINE_, int MAXNP,
           std::abs(lone2 - 1.0) < std::abs(edges[i].first - 1.0);
       }
 
-      BDS_Point *p = 0;
+      BDS_Point *p = nullptr;
       if(collapseP1Allowed && collapseP2Allowed) {
         if(std::abs(lone1 - lone2) < 1e-12)
           p = e->p1->iD < e->p2->iD ? e->p1 : e->p2;
@@ -596,7 +596,7 @@ void smoothVertexPass(GFace *gf, BDS_Mesh &m, int &nb_smooth, bool q,
 {
   double t1 = Cpu();
   for(int i = 0; i < 1; i++) {
-    std::set<BDS_Point *, PointLessThan>::iterator itp = m.points.begin();
+    auto itp = m.points.begin();
     while(itp != m.points.end()) {
       if(neighboringModified(*itp)) {
         if(m.smooth_point_centroid(*itp, gf, threshold)) nb_smooth++;
@@ -611,10 +611,10 @@ static void
 computeNodalSizes(GFace *gf, BDS_Mesh &m,
                   std::map<BDS_Point *, MVertex *, PointLessThan> *recoverMap)
 {
-  std::set<BDS_Point *, PointLessThan>::iterator itp = m.points.begin();
+  auto itp = m.points.begin();
   while(itp != m.points.end()) {
-    std::vector<BDS_Edge *>::iterator it = (*itp)->edges.begin();
-    std::vector<BDS_Edge *>::iterator ite = (*itp)->edges.end();
+    auto it = (*itp)->edges.begin();
+    auto ite = (*itp)->edges.end();
     double L = 0;
     int ne = 0;
     while(it != ite) {
@@ -634,7 +634,7 @@ computeNodalSizes(GFace *gf, BDS_Mesh &m,
   }
   return;
   {
-    std::set<BDS_Point *, PointLessThan>::iterator itp = m.points.begin();
+    auto itp = m.points.begin();
     while(itp != m.points.end()) {
       (*itp)->lc() = MAX_LC;
       ++itp;
@@ -644,9 +644,9 @@ computeNodalSizes(GFace *gf, BDS_Mesh &m,
       bool degenerated = false;
 
       if(recoverMap) {
-        std::map<BDS_Point *, MVertex *, PointLessThan>::iterator itp1 =
+        auto itp1 =
           recoverMap->find((*it)->p1);
-        std::map<BDS_Point *, MVertex *, PointLessThan>::iterator itp2 =
+        auto itp2 =
           recoverMap->find((*it)->p2);
         if(itp1 != recoverMap->end() && itp2 != recoverMap->end() &&
            itp1->second == itp2->second) {
@@ -704,10 +704,10 @@ void modifyInitialMeshToRemoveDegeneracies(
   std::vector<BDS_Edge *> degenerated_edges;
   getDegeneratedVertices(m, recoverMap, degenerated, degenerated_edges);
 
-  for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
+  for(auto it =
         recoverMap->begin();
       it != recoverMap->end(); ++it) {
-    std::set<MVertex *, MVertexPtrLessThan>::iterator it2 =
+    auto it2 =
       degenerated.find(it->second);
     if(it2 != degenerated.end()) {
       for(size_t K = 0; K < degenerated_edges.size(); K++) {
@@ -752,10 +752,10 @@ void refineMeshBDS(GFace *gf, BDS_Mesh &m, const int NIT,
   // face number to avoid mesh motion
   if(recoverMapInv) {
     std::vector<GVertex *> emb_vertx = gf->getEmbeddedVertices();
-    std::vector<GVertex *>::iterator itvx = emb_vertx.begin();
+    auto itvx = emb_vertx.begin();
     while(itvx != emb_vertx.end()) {
       MVertex *v = *((*itvx)->mesh_vertices.begin());
-      std::map<MVertex *, BDS_Point *>::iterator itp = recoverMapInv->find(v);
+      auto itp = recoverMapInv->find(v);
       if(itp != recoverMapInv->end()) {
         BDS_Point *p = itp->second;
         m.add_geom(-1, 2);
@@ -773,7 +773,7 @@ void refineMeshBDS(GFace *gf, BDS_Mesh &m, const int NIT,
   const double MINE_ = 0.7, MAXE_ = 1.4;
 
   {
-    std::vector<BDS_Edge *>::iterator it = m.edges.begin();
+    auto it = m.edges.begin();
     while(it != m.edges.end()) {
       if(!(*it)->deleted) {
         (*it)->p1->config_modified = true;
@@ -868,7 +868,7 @@ void refineMeshBDS(GFace *gf, BDS_Mesh &m, const int NIT,
     m.cleanup();
 
     double minL = 1.e22, maxL = 0;
-    std::vector<BDS_Edge *>::iterator it = m.edges.begin();
+    auto it = m.edges.begin();
     int LARGE = 0, SMALL = 0, TOTAL = 0;
     while(it != m.edges.end()) {
       if(!(*it)->deleted) {
diff --git a/Mesh/meshGFaceBDS.h b/Mesh/meshGFaceBDS.h
index 2690023d41cbb377e858ada22c0ee6498c8912c1..ed33f3e54005d234f76b505a897d0c6d8bdbf4f4 100644
--- a/Mesh/meshGFaceBDS.h
+++ b/Mesh/meshGFaceBDS.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGFaceBamg.cpp b/Mesh/meshGFaceBamg.cpp
index 6d5b8d4e1e11fbbc8fb76248ad525ff842357452..6b4638620b21b0b200289b74ba27777614583056 100644
--- a/Mesh/meshGFaceBamg.cpp
+++ b/Mesh/meshGFaceBamg.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -72,7 +72,7 @@ void meshGFaceBamg(GFace *gf)
 {
   std::vector<GEdge *> const &edges = gf->edges();
   std::set<MVertex *> bcVertex;
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); it++) {
     for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
       bcVertex.insert((*it)->lines[i]->getVertex(0));
@@ -90,7 +90,7 @@ void meshGFaceBamg(GFace *gf)
 
   Vertex2 *bamgVertices = new Vertex2[all.size()];
   int index = 0;
-  for(std::set<MVertex *>::iterator it = all.begin(); it != all.end(); ++it) {
+  for(auto it = all.begin(); it != all.end(); ++it) {
     if((*it)->onWhat()->dim() <= 1) {
       // for(std::set<MVertex*>::iterator it = bcVertex.begin();
       // it!=bcVertex.end(); ++it){
@@ -105,7 +105,7 @@ void meshGFaceBamg(GFace *gf)
   }
   // exit(1);
   int nbFixedVertices = index;
-  for(std::set<MVertex *>::iterator it = all.begin(); it != all.end(); ++it) {
+  for(auto it = all.begin(); it != all.end(); ++it) {
     // FIXME : SEAMS should have to be taken into account here !!!
     if((*it)->onWhat()->dim() >= 2) {
       SPoint2 p;
@@ -146,7 +146,7 @@ void meshGFaceBamg(GFace *gf)
 
   Seg *bamgBoundary = new Seg[numEdges];
   int count = 0;
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); ++it) {
     for(std::size_t i = 0; i < (*it)->lines.size(); ++i) {
       int nodes[2] = {(int)(*it)->lines[i]->getVertex(0)->getIndex(),
@@ -160,9 +160,9 @@ void meshGFaceBamg(GFace *gf)
   Mesh2 *bamgMesh = new Mesh2(all.size(), gf->triangles.size(), numEdges,
                               bamgVertices, bamgTriangles, bamgBoundary);
 
-  MElementOctree *_octree = NULL;
+  MElementOctree *_octree = nullptr;
 
-  Mesh2 *refinedBamgMesh = 0;
+  Mesh2 *refinedBamgMesh = nullptr;
   int iterMax = 41;
   for(int k = 0; k < iterMax; k++) {
     int nbVert = bamgMesh->nv;
@@ -235,10 +235,10 @@ void meshGFaceBamg(GFace *gf)
   // delete pointers
   if(refinedBamgMesh) delete refinedBamgMesh;
   if(_octree) delete _octree;
-  for(std::vector<MElement *>::iterator it = myParamElems.begin();
+  for(auto it = myParamElems.begin();
       it != myParamElems.end(); it++)
     delete *it;
-  for(std::vector<MVertex *>::iterator it = newVert.begin();
+  for(auto it = newVert.begin();
       it != newVert.end(); it++)
     delete *it;
 }
diff --git a/Mesh/meshGFaceBamg.h b/Mesh/meshGFaceBamg.h
index a76373202d9d1e65c66d59ead247cf105c28ef8c..45e2c681a22bd036791e7ea68f7689164ec9c047 100644
--- a/Mesh/meshGFaceBamg.h
+++ b/Mesh/meshGFaceBamg.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp
index 53fb76afc3b687da22caf74749e096b2dd581145..ec24063e7a8465843f11099d51f925f97e2362cb 100644
--- a/Mesh/meshGFaceDelaunayInsertion.cpp
+++ b/Mesh/meshGFaceDelaunayInsertion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -62,7 +62,7 @@ static inline bool intersection_segments_2(double *p1, double *p2, double *q1,
 
 template <class ITERATOR>
 void _printTris(char *name, ITERATOR it, ITERATOR end, bidimMeshData *data,
-                GFace *gf = NULL, std::set<GEntity *> *degenerated = NULL)
+                GFace *gf = nullptr, std::set<GEntity *> *degenerated = nullptr)
 {
   FILE *ff = Fopen(name, "w");
   if(!ff) {
@@ -395,7 +395,7 @@ MTri3::MTri3(MTriangle *t, double lc, SMetric3 *metric, bidimMeshData *data,
              GFace *gf)
   : deleted(false), base(t)
 {
-  neigh[0] = neigh[1] = neigh[2] = 0;
+  neigh[0] = neigh[1] = neigh[2] = nullptr;
   double center[3];
   double pa[3] = {base->getVertex(0)->x(), base->getVertex(0)->y(),
                   base->getVertex(0)->z()};
@@ -590,7 +590,7 @@ static void recurFindCavityAniso(GFace *gf, std::list<edgeXface> &shell,
     MTri3 *neigh = t->getNeigh(i);
     edgeXface exf(t, i);
     // take care of untouchable internal edges
-    std::set<MEdge, MEdgeLessThan>::iterator it =
+    auto it =
       data.internalEdges.find(MEdge(exf._v(0), exf._v(1)));
     if(!neigh || it != data.internalEdges.end())
       shell.push_back(exf);
@@ -695,7 +695,7 @@ static int insertVertexB(std::list<edgeXface> &shell,
 
   int k = 0;
 
-  std::list<edgeXface>::iterator it = shell.begin();
+  auto it = shell.begin();
 
   bool onePointIsTooClose = false;
 
@@ -722,7 +722,7 @@ static int insertVertexB(std::list<edgeXface> &shell,
     double LL = std::min(lc, lcBGM);
 
     MTri3 *t4 =
-      new MTri3(t, Extend1dMeshIn2dSurfaces(gf) ? LL : lcBGM, 0, &data, gf);
+      new MTri3(t, Extend1dMeshIn2dSurfaces(gf) ? LL : lcBGM, nullptr, &data, gf);
 
     if(oneNewTriangle) {
       force = true;
@@ -774,7 +774,7 @@ static int insertVertexB(std::list<edgeXface> &shell,
     // 30 % of the time is spent here!
     allTets.insert(newTris, newTris + shell.size());
     if(activeTets) {
-      for(std::vector<MTri3 *>::iterator i = new_cavity.begin();
+      for(auto i = new_cavity.begin();
           i != new_cavity.end(); ++i) {
         int active_edge;
         if(isActive(*i, LIMIT_, active_edge) && (*i)->getRadius() > LIMIT_) {
@@ -853,7 +853,7 @@ static MTri3 *search4Triangle(MTri3 *t, MVertex *v, int maxx, int &ITER)
     if(inside) return t;
     if(ITER++ > .5 * maxx) break;
   }
-  return 0;
+  return nullptr;
 }
 
 static MTri3 *search4Triangle(MTri3 *t, double pt[2], bidimMeshData &data,
@@ -891,9 +891,9 @@ static MTri3 *search4Triangle(MTri3 *t, double pt[2], bidimMeshData &data,
     if(ITER++ > (int)AllTris.size()) break;
   }
 
-  if(!force) return 0; // FIXME: removing this leads to horrible performance
+  if(!force) return nullptr; // FIXME: removing this leads to horrible performance
 
-  for(std::set<MTri3 *, compareTri3Ptr>::iterator itx = AllTris.begin();
+  for(auto itx = AllTris.begin();
       itx != AllTris.end(); ++itx) {
     if(!(*itx)->isDeleted()) {
       inside = invMapUV((*itx)->tri(), pt, data, uv, 1.e-8);
@@ -901,7 +901,7 @@ static MTri3 *search4Triangle(MTri3 *t, double pt[2], bidimMeshData &data,
     }
   }
   printf("argh %g %g!!!!\n", pt[0], pt[1]);
-  return 0;
+  return nullptr;
 }
 
 static bool insertAPoint(GFace *gf,
@@ -909,8 +909,8 @@ static bool insertAPoint(GFace *gf,
                          double center[2], double metric[3],
                          bidimMeshData &data,
                          std::set<MTri3 *, compareTri3Ptr> &AllTris,
-                         std::set<MTri3 *, compareTri3Ptr> *ActiveTris = 0,
-                         MTri3 *worst = 0, MTri3 **oneNewTriangle = 0,
+                         std::set<MTri3 *, compareTri3Ptr> *ActiveTris = nullptr,
+                         MTri3 *worst = nullptr, MTri3 **oneNewTriangle = nullptr,
                          bool testStarShapeness = false)
 {
   if(worst) {
@@ -923,7 +923,7 @@ static bool insertAPoint(GFace *gf,
   else
     worst = *it;
 
-  MTri3 *ptin = 0;
+  MTri3 *ptin = nullptr;
   std::list<edgeXface> shell;
   std::list<MTri3 *> cavity;
   double uv[2];
@@ -931,7 +931,7 @@ static bool insertAPoint(GFace *gf,
   // if the point is able to break the bad triangle "worst"
   if(inCircumCircleAniso(gf, worst->tri(), center, metric, data)) {
     recurFindCavityAniso(gf, shell, cavity, metric, center, worst, data);
-    for(std::list<MTri3 *>::iterator itc = cavity.begin(); itc != cavity.end();
+    for(auto itc = cavity.begin(); itc != cavity.end();
         ++itc) {
       if(invMapUV((*itc)->tri(), center, data, uv, 1.e-8)) {
         ptin = *itc;
@@ -998,7 +998,7 @@ static bool insertAPoint(GFace *gf,
       worst->forceRadius(-1);
       AllTris.insert(worst);
       delete v;
-      for(std::list<MTri3 *>::iterator itc = cavity.begin();
+      for(auto itc = cavity.begin();
           itc != cavity.end(); ++itc)
         (*itc)->setDeleted(false);
       return false;
@@ -1009,7 +1009,7 @@ static bool insertAPoint(GFace *gf,
     }
   }
   else {
-    for(std::list<MTri3 *>::iterator itc = cavity.begin(); itc != cavity.end();
+    for(auto itc = cavity.begin(); itc != cavity.end();
         ++itc)
       (*itc)->setDeleted(false);
     AllTris.erase(it);
@@ -1294,7 +1294,7 @@ void bowyerWatsonFrontal(GFace *gf, std::map<MVertex *, MVertex *> *equivalence,
 
   int ITER = 0, active_edge;
   // compute active triangle
-  std::set<MTri3 *, compareTri3Ptr>::iterator it = AllTris.begin();
+  auto it = AllTris.begin();
   for(; it != AllTris.end(); ++it) {
     if(isActive(*it, LIMIT_, active_edge))
       ActiveTris.insert(*it);
@@ -1338,7 +1338,7 @@ void bowyerWatsonFrontal(GFace *gf, std::map<MVertex *, MVertex *> *equivalence,
         if(!true_boundary ||
            pointInsideParametricDomain(*true_boundary, NP, FAR, nnnn))
           insertAPoint(gf, AllTris.end(), newPoint, metric, DATA, AllTris,
-                       &ActiveTris, worst, NULL, testStarShapeness);
+                       &ActiveTris, worst, nullptr, testStarShapeness);
       }
     }
   }
@@ -1499,7 +1499,7 @@ void bowyerWatsonFrontalLayers(
 
   int ITER = 0, active_edge;
   // compute active triangle
-  std::set<MTri3 *, compareTri3Ptr>::iterator it = AllTris.begin();
+  auto it = AllTris.begin();
   std::set<MEdge, MEdgeLessThan> _front;
   for(; it != AllTris.end(); ++it) {
     if(isActive(*it, LIMIT_, active_edge)) {
@@ -1536,7 +1536,7 @@ void bowyerWatsonFrontalLayers(
            _printTris (name, AllTris, Us,Vs,true);
          }
       */
-      std::set<MTri3 *, compareTri3Ptr>::iterator WORST_ITER =
+      auto WORST_ITER =
         ActiveTris.begin();
 
       MTri3 *worst = (*WORST_ITER);
@@ -1563,7 +1563,7 @@ void bowyerWatsonFrontalLayers(
         else
           optimalPointFrontalB(gf, worst, active_edge, DATA, newPoint, metric);
 
-        insertAPoint(gf, AllTris.end(), newPoint, 0, DATA, AllTris, &ActiveTris,
+        insertAPoint(gf, AllTris.end(), newPoint, nullptr, DATA, AllTris, &ActiveTris,
                      worst);
         // else if (!worst->isDeleted() && worst->getRadius() > LIMIT_){
         //   ActiveTrisNotInFront.insert(worst);
@@ -1631,7 +1631,7 @@ void bowyerWatsonParallelograms(
   // std::sort(packed.begin(), packed.end(), MVertexPtrLessThanLexicographic());
   SortHilbert(packed);
 
-  MTri3 *oneNewTriangle = 0;
+  MTri3 *oneNewTriangle = nullptr;
   for(std::size_t i = 0; i < packed.size();) {
     MTri3 *worst = *AllTris.begin();
     if(worst->isDeleted()) {
@@ -1648,13 +1648,13 @@ void bowyerWatsonParallelograms(
       buildMetric(gf, newPoint, metric);
 
       bool success = insertAPoint(gf, AllTris.begin(), newPoint, metric, DATA,
-                                  AllTris, 0, oneNewTriangle, &oneNewTriangle);
-      if(!success) oneNewTriangle = 0;
+                                  AllTris, nullptr, oneNewTriangle, &oneNewTriangle);
+      if(!success) oneNewTriangle = nullptr;
       i++;
     }
 
     if(1.0 * AllTris.size() > 2.5 * DATA.vSizes.size()) {
-      std::set<MTri3 *, compareTri3Ptr>::iterator itd = AllTris.begin();
+      auto itd = AllTris.begin();
       while(itd != AllTris.end()) {
         if((*itd)->isDeleted()) {
           delete *itd;
@@ -1695,7 +1695,7 @@ void bowyerWatsonParallelogramsConstrained(
 
   std::sort(packed.begin(), packed.end(), MVertexPtrLessThanLexicographic());
 
-  MTri3 *oneNewTriangle = 0;
+  MTri3 *oneNewTriangle = nullptr;
   for(std::size_t i = 0; i < packed.size();) {
     MTri3 *worst = *AllTris.begin();
     if(worst->isDeleted()) {
@@ -1712,13 +1712,13 @@ void bowyerWatsonParallelogramsConstrained(
       buildMetric(gf, newPoint, metric);
 
       bool success = insertAPoint(gf, AllTris.begin(), newPoint, metric, DATA,
-                                  AllTris, 0, oneNewTriangle, &oneNewTriangle);
-      if(!success) oneNewTriangle = 0;
+                                  AllTris, nullptr, oneNewTriangle, &oneNewTriangle);
+      if(!success) oneNewTriangle = nullptr;
       i++;
     }
 
     if(1.0 * AllTris.size() > 2.5 * DATA.vSizes.size()) {
-      std::set<MTri3 *, compareTri3Ptr>::iterator itd = AllTris.begin();
+      auto itd = AllTris.begin();
       while(itd != AllTris.end()) {
         if((*itd)->isDeleted()) {
           delete *itd;
@@ -1773,7 +1773,7 @@ static MTri3 *getTriToBreak(MVertex *v, std::vector<MTri3 *> &t, int &ITER)
   for(size_t i = 0; i < t.size(); i++) {
     if(!t[i]->isDeleted() && inCircumCircleXY(t[i]->tri(), v)) return t[i];
   }
-  return 0;
+  return nullptr;
 }
 
 static bool triOnBox(MTriangle *t, MVertex *box[4])
@@ -1849,7 +1849,7 @@ void delaunayMeshIn2D(std::vector<MVertex *> &v,
 
     for(std::size_t k = 0; k < std::min(cavity.size(), shell.size()); k++) {
       cavity[k]->setDeleted(false);
-      for(std::size_t l = 0; l < 3; l++) { cavity[k]->setNeigh(l, 0); }
+      for(std::size_t l = 0; l < 3; l++) { cavity[k]->setNeigh(l, nullptr); }
     }
     connectTris(extended_cavity.begin(), extended_cavity.end(), conn);
   }
diff --git a/Mesh/meshGFaceDelaunayInsertion.h b/Mesh/meshGFaceDelaunayInsertion.h
index df0ea524ccacc4cf8989d6a0f826dee025eaa214..c2769a0afa66278216f6bdd94d7ba9440c0f80b1 100644
--- a/Mesh/meshGFaceDelaunayInsertion.h
+++ b/Mesh/meshGFaceDelaunayInsertion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -37,7 +37,7 @@ struct bidimMeshData {
     else
       indices[mv] = index;
     if(parametricCoordinates) {
-      std::map<MVertex *, SPoint2>::iterator it =
+      auto it =
         parametricCoordinates->find(mv);
       if(it != parametricCoordinates->end()) {
         u = it->second.x();
@@ -57,14 +57,14 @@ struct bidimMeshData {
   inline MVertex *equivalent(MVertex *v1) const
   {
     if(equivalence) {
-      std::map<MVertex *, MVertex *>::iterator it = equivalence->find(v1);
-      if(it == equivalence->end()) return 0;
+      auto it = equivalence->find(v1);
+      if(it == equivalence->end()) return nullptr;
       return it->second;
     }
-    return 0;
+    return nullptr;
   }
-  bidimMeshData(std::map<MVertex *, MVertex *> *e = 0,
-                std::map<MVertex *, SPoint2> *p = 0)
+  bidimMeshData(std::map<MVertex *, MVertex *> *e = nullptr,
+                std::map<MVertex *, SPoint2> *p = nullptr)
     : equivalence(e), parametricCoordinates(p)
   {
   }
@@ -92,16 +92,16 @@ public:
   inline MVertex *otherSide(int i)
   {
     MTri3 *n = neigh[i];
-    if(!n) return 0;
+    if(!n) return nullptr;
     MVertex *v1 = base->getVertex((i + 2) % 3);
     MVertex *v2 = base->getVertex(i);
     for(int j = 0; j < 3; j++)
       if(n->tri()->getVertex(j) != v1 && n->tri()->getVertex(j) != v2)
         return n->tri()->getVertex(j);
-    return 0;
+    return nullptr;
   }
-  MTri3(MTriangle *t, double lc, SMetric3 *m = 0, bidimMeshData *data = 0,
-        GFace *gf = 0);
+  MTri3(MTriangle *t, double lc, SMetric3 *m = nullptr, bidimMeshData *data = nullptr,
+        GFace *gf = nullptr);
   inline void setTri(MTriangle *t) { base = t; }
   inline MTriangle *tri() const { return base; }
   inline void setNeigh(int iN, MTri3 *n) { neigh[iN] = n; }
@@ -148,30 +148,30 @@ void connectTriangles(std::list<MTri3 *> &);
 void connectTriangles(std::vector<MTri3 *> &);
 void connectTriangles(std::set<MTri3 *, compareTri3Ptr> &AllTris);
 void bowyerWatson(GFace *gf, int MAXPNT = 1000000000,
-                  std::map<MVertex *, MVertex *> *equivalence = 0,
-                  std::map<MVertex *, SPoint2> *parametricCoordinates = 0);
+                  std::map<MVertex *, MVertex *> *equivalence = nullptr,
+                  std::map<MVertex *, SPoint2> *parametricCoordinates = nullptr);
 void bowyerWatsonFrontal(
-  GFace *gf, std::map<MVertex *, MVertex *> *equivalence = 0,
-  std::map<MVertex *, SPoint2> *parametricCoordinates = 0,
-  std::vector<SPoint2> *true_boundary = 0);
+  GFace *gf, std::map<MVertex *, MVertex *> *equivalence = nullptr,
+  std::map<MVertex *, SPoint2> *parametricCoordinates = nullptr,
+  std::vector<SPoint2> *true_boundary = nullptr);
 void bowyerWatsonFrontalLayers(
-  GFace *gf, bool quad, std::map<MVertex *, MVertex *> *equivalence = 0,
-  std::map<MVertex *, SPoint2> *parametricCoordinates = 0);
+  GFace *gf, bool quad, std::map<MVertex *, MVertex *> *equivalence = nullptr,
+  std::map<MVertex *, SPoint2> *parametricCoordinates = nullptr);
 void bowyerWatsonParallelograms(
-  GFace *gf, std::map<MVertex *, MVertex *> *equivalence = 0,
-  std::map<MVertex *, SPoint2> *parametricCoordinates = 0);
+  GFace *gf, std::map<MVertex *, MVertex *> *equivalence = nullptr,
+  std::map<MVertex *, SPoint2> *parametricCoordinates = nullptr);
 void bowyerWatsonParallelogramsConstrained(
   GFace *gf, const std::set<MVertex *> &constr_vertices,
-  std::map<MVertex *, MVertex *> *equivalence = 0,
-  std::map<MVertex *, SPoint2> *parametricCoordinates = 0);
+  std::map<MVertex *, MVertex *> *equivalence = nullptr,
+  std::map<MVertex *, SPoint2> *parametricCoordinates = nullptr);
 void buildBackgroundMesh(
   GFace *gf, bool crossFieldClosestPoint = false,
-  std::map<MVertex *, MVertex *> *equivalence = 0,
-  std::map<MVertex *, SPoint2> *parametricCoordinates = 0);
+  std::map<MVertex *, MVertex *> *equivalence = nullptr,
+  std::map<MVertex *, SPoint2> *parametricCoordinates = nullptr);
 
 void delaunayMeshIn2D(std::vector<MVertex *> &, std::vector<MTriangle *> &,
                       bool removeBox = true,
-                      std::vector<MEdge> *edgesToRecover = 0,
+                      std::vector<MEdge> *edgesToRecover = nullptr,
                       bool hilbertSort = true);
 
 struct edgeXface {
diff --git a/Mesh/meshGFaceExtruded.cpp b/Mesh/meshGFaceExtruded.cpp
index 408a9775ac3f872056f3f6a85cdde6b1db7bd42b..37aefde01f659ed33cdf5661ba2cf67ed509dbd4 100644
--- a/Mesh/meshGFaceExtruded.cpp
+++ b/Mesh/meshGFaceExtruded.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -300,7 +300,7 @@ int MeshExtrudedSurface(
   MVertexRTree pos(CTX::instance()->geom.tolerance * CTX::instance()->lc);
   pos.insert(gf->mesh_vertices);
   std::vector<GEdge *> const &edges = gf->edges();
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); it++) {
     pos.insert((*it)->mesh_vertices);
     if((*it)->getBeginVertex())
diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp
index debd573ccfa415e5581dd6b8333e33bd692e707c..08d8c5fa0ef20ed9290aa43461b4fbaa1cf58696 100644
--- a/Mesh/meshGFaceOptimize.cpp
+++ b/Mesh/meshGFaceOptimize.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -96,8 +96,8 @@ static void setLcs(MTriangle *t, std::map<MVertex *, double> &vSizes,
         double dy = vi->y() - vj->y();
         double dz = vi->z() - vj->z();
         double l = sqrt(dx * dx + dy * dy + dz * dz);
-        std::map<MVertex *, double>::iterator iti = vSizes.find(vi);
-        std::map<MVertex *, double>::iterator itj = vSizes.find(vj);
+        auto iti = vSizes.find(vi);
+        auto itj = vSizes.find(vj);
         if(iti->second < 0 || iti->second > l) iti->second = l;
         if(itj->second < 0 || itj->second > l) itj->second = l;
       }
@@ -113,7 +113,7 @@ bool buildMeshGenerationDataStructures(
   for(std::size_t i = 0; i < gf->triangles.size(); i++)
     setLcsInit(gf->triangles[i], vSizesMap);
 
-  std::map<MVertex *, double>::iterator itfind = vSizesMap.find(NULL);
+  auto itfind = vSizesMap.find(nullptr);
   if(itfind != vSizesMap.end()) {
     Msg::Error("Some NULL points exist in 2D mesh");
     return false;
@@ -126,7 +126,7 @@ bool buildMeshGenerationDataStructures(
   std::set<MVertex *> embeddedVertices;
   {
     std::vector<GVertex *> emb_vertx = gf->getEmbeddedVertices();
-    std::vector<GVertex *>::iterator itvx = emb_vertx.begin();
+    auto itvx = emb_vertx.begin();
     while(itvx != emb_vertx.end()) {
       if((*itvx)->mesh_vertices.size()) {
         MVertex *v = *((*itvx)->mesh_vertices.begin());
@@ -171,7 +171,7 @@ bool buildMeshGenerationDataStructures(
     }
   }
 
-  for(std::map<MVertex *, double>::iterator it = vSizesMap.begin();
+  for(auto it = vSizesMap.begin();
       it != vSizesMap.end(); ++it) {
     SPoint2 param;
     reparamMeshVertexOnFace(it->first, gf, param);
@@ -193,7 +193,7 @@ bool buildMeshGenerationDataStructures(
                     data.vSizesBGM[data.getIndex(gf->triangles[i]->getVertex(2))]);
 
     double LL = Extend1dMeshIn2dSurfaces(gf) ? std::min(lc, lcBGM) : lcBGM;
-    AllTris.insert(new MTri3(gf->triangles[i], LL, 0, &data, gf));
+    AllTris.insert(new MTri3(gf->triangles[i], LL, nullptr, &data, gf));
   }
   gf->triangles.clear();
   connectTriangles(AllTris);
@@ -210,7 +210,7 @@ void computeEquivalences(GFace *gf, bidimMeshData &data)
       MVertex *v[3];
       for(int j = 0; j < 3; j++) {
         v[j] = t->getVertex(j);
-        std::map<MVertex *, MVertex *>::iterator it =
+        auto it =
           data.equivalence->find(v[j]);
         if(it != data.equivalence->end()) {
           v[j] = it->second;
@@ -232,7 +232,7 @@ struct equivalentTriangle {
   {
     for(int i = 0; i < 3; i++) {
       MVertex *v = t->getVertex(i);
-      std::map<MVertex *, MVertex *>::iterator it = equivalence->find(v);
+      auto it = equivalence->find(v);
       if(it == equivalence->end())
         _v[i] = v;
       else
@@ -259,7 +259,7 @@ bool computeEquivalentTriangles(GFace *gf,
   std::set<equivalentTriangle> eqTs;
   for(std::size_t i = 0; i < gf->triangles.size(); i++) {
     equivalentTriangle et(gf->triangles[i], equivalence);
-    std::set<equivalentTriangle>::iterator iteq = eqTs.find(et);
+    auto iteq = eqTs.find(et);
     if(iteq == eqTs.end())
       eqTs.insert(et);
     else {
@@ -357,10 +357,10 @@ void buildEdgeToElement(std::vector<T *> &elements, e2t_cont &adj)
     T *t = elements[i];
     for(int j = 0; j < t->getNumEdges(); j++) {
       MEdge e = t->getEdge(j);
-      e2t_cont::iterator it = adj.find(e);
+      auto it = adj.find(e);
       if(it == adj.end()) {
         std::pair<MElement *, MElement *> one =
-          std::make_pair(t, (MElement *)0);
+          std::make_pair(t, (MElement *)nullptr);
         adj[e] = one;
       }
       else {
@@ -392,7 +392,7 @@ void buildEdgeToElements(std::vector<MElement *> &tris, e2t_cont &adj)
 void buildListOfEdgeAngle(e2t_cont adj, std::vector<edge_angle> &edges_detected,
                           std::vector<edge_angle> &edges_lonly)
 {
-  e2t_cont::iterator it = adj.begin();
+  auto it = adj.begin();
   for(; it != adj.end(); ++it) {
     if(it->second.second)
       edges_detected.push_back(edge_angle(it->first.getVertex(0),
@@ -408,7 +408,7 @@ void buildListOfEdgeAngle(e2t_cont adj, std::vector<edge_angle> &edges_detected,
 
 static void parametricCoordinates(MElement *t, GFace *gf,
                                   double u[4], double v[4],
-                                  MVertex *close = 0)
+                                  MVertex *close = nullptr)
 {
   for(std::size_t j = 0; j < t->getNumVertices(); j++) {
     MVertex *ver = t->getVertex(j);
@@ -453,7 +453,7 @@ static int _removeTwoQuadsNodes(GFace *gf)
   v2t_cont adj;
   buildVertexToElement(gf->triangles, adj);
   buildVertexToElement(gf->quadrangles, adj);
-  v2t_cont::iterator it = adj.begin();
+  auto it = adj.begin();
   std::set<MElement *> touched;
   std::set<MVertex *> vtouched;
   while(it != adj.end()) {
@@ -475,7 +475,7 @@ static int _removeTwoQuadsNodes(GFace *gf)
         MVertex *v1 = q1->getVertex((comm + 1) % 4);
         MVertex *v2 = q1->getVertex((comm + 2) % 4);
         MVertex *v3 = q1->getVertex((comm + 3) % 4);
-        MVertex *v4 = 0;
+        MVertex *v4 = nullptr;
         for(int i = 0; i < 4; i++) {
           if(q2->getVertex(i) != v1 &&
              q2->getVertex(i) != v3 &&
@@ -765,10 +765,10 @@ static int _removeDiamonds(GFace *const gf)
     MVertex *const v4 = q->getVertex(3);
 
     if(has_none_of(touched, v1, v2, v3, v4)) {
-      v2t_cont::iterator it1 = adj.find(v1);
-      v2t_cont::iterator it2 = adj.find(v2);
-      v2t_cont::iterator it3 = adj.find(v3);
-      v2t_cont::iterator it4 = adj.find(v4);
+      auto it1 = adj.find(v1);
+      auto it2 = adj.find(v2);
+      auto it3 = adj.find(v3);
+      auto it4 = adj.find(v4);
 
       if(are_all_on_surface(v1, v2, v3, v4, gf) && are_size_three(it1, it3) &&
          _tryToCollapseThatVertex(gf, it1->second, it3->second, q, v1, v3)) {
@@ -875,7 +875,7 @@ static void _relocate(GFace *gf, MVertex *ver,
   double metric[3];
   SPoint2 after(0, 0);
   double COUNT = 0.0;
-  for(std::map<MVertex *, SPoint2, MVertexPtrLessThan>::iterator it =
+  for(auto it =
         pts.begin();
       it != pts.end(); ++it) {
     SPoint2 adj = it->second;
@@ -915,7 +915,7 @@ void getAllBoundaryLayerVertices(GFace *gf, std::set<MVertex *> &vs)
   vs.clear();
   BoundaryLayerColumns *_columns = gf->getColumns();
   if(!_columns) return;
-  for(std::multimap<MVertex *, BoundaryLayerData>::iterator it =
+  for(auto it =
         _columns->_data.begin();
       it != _columns->_data.end(); it++) {
     BoundaryLayerData &data = it->second;
@@ -939,7 +939,7 @@ void laplaceSmoothing(GFace *gf, int niter, bool infinity_norm)
   buildVertexToElement(gf->triangles, adj);
   buildVertexToElement(gf->quadrangles, adj);
   for(int i = 0; i < niter; i++) {
-    v2t_cont::iterator it = adj.begin();
+    auto it = adj.begin();
     while(it != adj.end()) {
       if(vs.find(it->first) == vs.end()) {
         _relocate(gf, it->first, it->second);
@@ -977,7 +977,7 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
 
   {
     std::vector<GEdge *> const &_edges = gf->edges();
-    std::vector<GEdge *>::const_iterator ite = _edges.begin();
+    auto ite = _edges.begin();
     while(ite != _edges.end()) {
       if(!(*ite)->isMeshDegenerated()) {
         if((*ite)->isSeam(gf)) {
@@ -1010,7 +1010,7 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
 
   std::map<MVertex *, std::pair<MElement *, MElement *> > makeGraphPeriodic;
 
-  for(e2t_cont::iterator it = adj.begin(); it != adj.end(); ++it) {
+  for(auto it = adj.begin(); it != adj.end(); ++it) {
     if(it->second.second && it->second.first->getNumVertices() == 3 &&
        it->second.second->getNumVertices() == 3 &&
        (!std::binary_search(emb_edgeverts.begin(), emb_edgeverts.end(),
@@ -1023,11 +1023,11 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
     else if(!it->second.second && it->second.first->getNumVertices() == 3) {
       for(int i = 0; i < 2; i++) {
         MVertex *const v = it->first.getVertex(i);
-        std::map<MVertex *, std::pair<MElement *, MElement *> >::iterator itv =
+        auto itv =
           makeGraphPeriodic.find(v);
         if(itv == makeGraphPeriodic.end()) {
           makeGraphPeriodic[v] =
-            std::make_pair(it->second.first, static_cast<MElement *>(NULL));
+            std::make_pair(it->second.first, static_cast<MElement *>(nullptr));
         }
         else {
           if(itv->second.first != it->second.first)
@@ -1084,7 +1084,7 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
       }
 
       if(cubicGraph) {
-        std::map<MVertex *, std::pair<MElement *, MElement *> >::iterator itv =
+        auto itv =
           makeGraphPeriodic.begin();
         std::size_t CC = pairs.size();
         for(; itv != makeGraphPeriodic.end(); ++itv) {
@@ -1097,7 +1097,7 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
       double matzeit = 0.0;
       char MATCHFILE[256];
       sprintf(MATCHFILE, ".face.match");
-      if(perfect_match(ncount, NULL, ecount, &elist, &elen, NULL, MATCHFILE, 0,
+      if(perfect_match(ncount, nullptr, ecount, &elist, &elen, nullptr, MATCHFILE, 0,
                        0, 0, 0, &matzeit)) {
         Msg::Error("Perfect Match failed in quadrangulation, try something else");
         free(elist);
@@ -1119,7 +1119,7 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
             MElement *t2 = n2t[i2];
             touched.insert(t1);
             touched.insert(t2);
-            MVertex *other = NULL;
+            MVertex *other = nullptr;
             for(int i = 0; i < 3; i++) {
               if(t1->getVertex(0) != t2->getVertex(i) &&
                  t1->getVertex(1) != t2->getVertex(i) &&
@@ -1156,7 +1156,7 @@ static void _recombineIntoQuads(GFace *gf, bool blossom, bool cubicGraph = 1)
   }
 
   // simple greedy recombination
-  std::vector<RecombineTriangle>::iterator itp = pairs.begin();
+  auto itp = pairs.begin();
   while(itp != pairs.end()) {
     if(itp->angle < gf->meshAttributes.recombineAngle) {
       MElement *t1 = itp->t1;
@@ -1223,7 +1223,7 @@ static double printStats(GFace *gf, const char *message)
 // remove nodes, this will produce an invalide model mesh (and crash).
 static bool _isModelOkForTopologicalOpti(GModel *m)
 {
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++){
+  for(auto it = m->firstFace(); it != m->lastFace(); it++){
     GFace *gf = *it;
     for(std::size_t j = 0; j < gf->getNumMeshElements(); j++){
       MElement *e = gf->getMeshElement(j);
@@ -1392,7 +1392,7 @@ void splitElementsInBoundaryLayerIfNeeded(GFace *gf)
     int n = fields->getNumBoundaryLayerFields();
     for(int i = 0; i < n; ++i) {
       Field *bl_field = fields->get(fields->getBoundaryLayerField(i));
-      if(bl_field == NULL) continue;
+      if(bl_field == nullptr) continue;
       BoundaryLayerField *blf = dynamic_cast<BoundaryLayerField *>(bl_field);
       if(blf->iRecombine)
         ++numNoSplit;
diff --git a/Mesh/meshGFaceOptimize.h b/Mesh/meshGFaceOptimize.h
index 9a1971e76327f5e047a896fa091e4a511ef87434..489e5cae1f582e5d0a9a7d8f56320902117cd34e 100644
--- a/Mesh/meshGFaceOptimize.h
+++ b/Mesh/meshGFaceOptimize.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -113,8 +113,8 @@ struct RecombineTriangle {
   {
     n1 = me.getVertex(0);
     n2 = me.getVertex(1);
-    n3 = 0;
-    n4 = 0;
+    n3 = nullptr;
+    n4 = nullptr;
 
     if(t1->getVertex(0) != n1 && t1->getVertex(0) != n2)
       n3 = t1->getVertex(0);
diff --git a/Mesh/meshGFaceTransfinite.cpp b/Mesh/meshGFaceTransfinite.cpp
index e8387f548de875cf09e332b9165a0b820757d62c..8039346216ce713cf5a2944949e716fe134cef69 100644
--- a/Mesh/meshGFaceTransfinite.cpp
+++ b/Mesh/meshGFaceTransfinite.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -51,13 +51,13 @@ void findTransfiniteCorners(GFace *gf, std::vector<MVertex *> &corners)
     // try to find the corners automatically
     std::vector<GEdge *> fedges = gf->edges();
     GEdgeLoop el(fedges);
-    for(GEdgeLoop::iter it = el.begin(); it != el.end(); it++)
+    for(auto it = el.begin(); it != el.end(); it++)
       corners.push_back(it->getBeginVertex()->mesh_vertices[0]);
 
     // try reaaally hard for 3-sided faces
     if(corners.size() == 3) {
-      GEdge *first = 0, *last = 0;
-      for(std::vector<GEdge *>::iterator it = fedges.begin();
+      GEdge *first = nullptr, *last = nullptr;
+      for(auto it = fedges.begin();
           it != fedges.end(); it++) {
         if(((*it)->getBeginVertex()->mesh_vertices[0] == corners[0] &&
             (*it)->getEndVertex()->mesh_vertices[0] == corners[1]) ||
@@ -159,7 +159,7 @@ int MeshTransfiniteSurface(GFace *gf)
   // make sure that all bounding edges have begin/end points: everything in here
   // depends on it
   const std::vector<GEdge *> &edges = gf->edges();
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); it++) {
     if(!(*it)->getBeginVertex() || !(*it)->getEndVertex()) {
       Msg::Error("Transfinite algorithm cannot be applied with curve %d which "
diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp
index e97d4072a0b2467ba60faa2eeb5ac784d709e8b3..7cff106eb0db364da049d21841f3f074f671cb63 100644
--- a/Mesh/meshGRegion.cpp
+++ b/Mesh/meshGRegion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -49,7 +49,7 @@ int splitQuadRecovery::buildPyramids(GModel *gm)
 
   Msg::Info("Generating pyramids for hybrid mesh...");
   int npyram = 0;
-  for(GModel::riter it = gm->firstRegion(); it != gm->lastRegion(); it++){
+  for(auto it = gm->firstRegion(); it != gm->lastRegion(); it++){
     GRegion *gr = *it;
     if(gr->meshAttributes.method == MESH_TRANSFINITE) continue;
     if(gr->isFullyDiscrete()) continue;
@@ -60,7 +60,7 @@ int splitQuadRecovery::buildPyramids(GModel *gm)
     for(std::size_t i = 0; i < faces.size(); i++){
       GFace *gf = faces[i];
       for(std::size_t j = 0; j < gf->quadrangles.size(); j++){
-        std::map<MFace, MVertex *, MFaceLessThan>::iterator it2 =
+        auto it2 =
           _quad.find(gf->quadrangles[j]->getFace(0));
         if(it2 != _quad.end()){
           npyram++;
@@ -116,7 +116,7 @@ void MeshDelaunayVolume(std::vector<GRegion *> &regions)
   // not reclassified on the original surfaces
   if(CTX::instance()->mesh.compoundClassify == 0){
     std::set<GFace *, GEntityPtrLessThan> comp;
-    for(std::set<GFace *, GEntityPtrLessThan>::iterator it = allFacesSet.begin();
+    for(auto it = allFacesSet.begin();
         it != allFacesSet.end(); it++){
       GFace *gf = *it;
       if(!gf->compoundSurface)
@@ -154,7 +154,7 @@ void MeshDelaunayVolume(std::vector<GRegion *> &regions)
   bool success = meshGRegionBoundaryRecovery(gr, &sqr);
 
   // sort triangles in all model faces in order to be able to search in vectors
-  std::vector<GFace *>::iterator itf = allFaces.begin();
+  auto itf = allFaces.begin();
   while(itf != allFaces.end()) {
     std::sort((*itf)->triangles.begin(), (*itf)->triangles.end(),
               compareMTriangleLexicographic());
@@ -260,14 +260,14 @@ bool buildFaceSearchStructure(GModel *model, fs_cont &search,
   search.clear();
 
   std::set<GFace *> faces_to_consider;
-  GModel::riter rit = model->firstRegion();
+  auto rit = model->firstRegion();
   while(rit != model->lastRegion()) {
     std::vector<GFace *> _faces = (*rit)->faces();
     faces_to_consider.insert(_faces.begin(), _faces.end());
     rit++;
   }
 
-  std::set<GFace *>::iterator fit = faces_to_consider.begin();
+  auto fit = faces_to_consider.begin();
   while(fit != faces_to_consider.end()) {
     for(std::size_t i = 0; i < (*fit)->getNumMeshElements(); i++) {
       MFace ff = (*fit)->getMeshElement(i)->getFace(0);
@@ -283,7 +283,7 @@ bool buildEdgeSearchStructure(GModel *model, es_cont &search)
 {
   search.clear();
 
-  GModel::eiter eit = model->firstEdge();
+  auto eit = model->firstEdge();
   while(eit != model->lastEdge()) {
     for(std::size_t i = 0; i < (*eit)->lines.size(); i++) {
       MVertex *p1 = (*eit)->lines[i]->getVertex(0);
@@ -301,15 +301,15 @@ GFace *findInFaceSearchStructure(MVertex *p1, MVertex *p2, MVertex *p3,
                                  const fs_cont &search)
 {
   MFace ff(p1, p2, p3);
-  fs_cont::const_iterator it = search.find(ff);
-  if(it == search.end()) return 0;
+  auto it = search.find(ff);
+  if(it == search.end()) return nullptr;
   return it->second;
 }
 
 GFace *findInFaceSearchStructure(const MFace &ff, const fs_cont &search)
 {
-  fs_cont::const_iterator it = search.find(ff);
-  if(it == search.end()) return 0;
+  auto it = search.find(ff);
+  if(it == search.end()) return nullptr;
   return it->second;
 }
 
@@ -318,7 +318,7 @@ GEdge *findInEdgeSearchStructure(MVertex *p1, MVertex *p2,
 {
   MVertex *p = std::min(p1, p2);
 
-  for(es_cont::const_iterator it = search.lower_bound(p);
+  for(auto it = search.lower_bound(p);
       it != search.upper_bound(p); ++it) {
     MLine *l = it->second.first;
     GEdge *ge = it->second.second;
@@ -326,5 +326,5 @@ GEdge *findInEdgeSearchStructure(MVertex *p1, MVertex *p2,
        (l->getVertex(1) == p1 || l->getVertex(1) == p2))
       return ge;
   }
-  return 0;
+  return nullptr;
 }
diff --git a/Mesh/meshGRegion.h b/Mesh/meshGRegion.h
index e92182297fd5ed74d6b17ec8cdd9d43d9910752d..82b70bb797f91fc297af1bdf57904b22600ac72e 100644
--- a/Mesh/meshGRegion.h
+++ b/Mesh/meshGRegion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGRegionBoundaryLayer.cpp b/Mesh/meshGRegionBoundaryLayer.cpp
index 01da0df796679ea57f17f7a4e8a9815df9628314..1b234477b2285dc2323e09c9063300a01c399e9b 100644
--- a/Mesh/meshGRegionBoundaryLayer.cpp
+++ b/Mesh/meshGRegionBoundaryLayer.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -36,7 +36,7 @@ static GFace *haveTowGEdges(std::vector<GFace *> &faces, GEdge *ge1, GEdge *ge2)
        std::find(e.begin(), e.end(), ge2) != e.end())
       return faces[i];
   }
-  return NULL;
+  return nullptr;
 }
 
 static void meshPolygon(GRegion *gr, std::vector<MLine *> &poly,
@@ -133,10 +133,10 @@ public:
       if(gf == _f_per_normal[i]) return _v_per_face[i];
     }
     // if (gf) printf("NONE for face %d\n",gf->tag());
-    return NULL;
+    return nullptr;
   }
 
-  SVector3 average_normal(GFace *gf = NULL) const
+  SVector3 average_normal(GFace *gf = nullptr) const
   {
     SVector3 n(0, 0, 0);
     //    printf("%d %d\n",_normals.size(),_f_per_normal.size());
@@ -193,7 +193,7 @@ public:
     for(size_t i = 0; i < _gr->tetrahedra.size(); i++) {
       for(int j = 0; j < 4; j++) {
         MFace f = _gr->tetrahedra[i]->getFace(j);
-        std::map<MFace, SVector3, MFaceLessThan>::iterator it = t_normals.find(f);
+        auto it = t_normals.find(f);
         if(it == t_normals.end()) {
           SVector3 n = f.normal();
           MVertex *v = _gr->tetrahedra[i]->getVertex(3 - j);
@@ -226,7 +226,7 @@ public:
     std::vector<GEdge *> edges = gr->edges();
     std::vector<GFace *> faces = gr->faces();
     for(size_t i = 0; i < edges.size(); i++) {
-      GFace *f[2] = {NULL, NULL};
+      GFace *f[2] = {nullptr, nullptr};
       std::vector<GFace *> efaces = edges[i]->faces();
       int count = 0;
       bool seam = false;
@@ -245,7 +245,7 @@ public:
         for(size_t j = 0; j < edges[i]->lines.size(); j++) {
           for(int k = 0; k < 2; k++) {
             MVertex *v = edges[i]->lines[j]->getVertex(k);
-            std::set<blyr_mvertex>::iterator it = _vertices.find(v);
+            auto it = _vertices.find(v);
             if(it == _vertices.end()) Msg::Error("Unknow node in boundary layer");
             it->add_line(edges[i]->lines[j], edges[i]);
           }
@@ -260,7 +260,7 @@ public:
     for(size_t i = 0; i < bls.size(); i++) {
       for(size_t j = 0; j < bls[i]->triangles.size(); j++) {
         MTriangle *t = bls[i]->triangles[j];
-        std::map<MFace, SVector3, MFaceLessThan>::iterator it =
+        auto it =
           t_normals.find(t->getFace(0));
         SVector3 n;
         if(it == t_normals.end())
@@ -269,7 +269,7 @@ public:
           n = it->second;
         for(int k = 0; k < 3; k++) {
           MVertex *v = t->getVertex(k);
-          std::set<blyr_mvertex>::iterator it = _vertices.find(v);
+          auto it = _vertices.find(v);
           if(it == _vertices.end()) Msg::Error("Unknown node in boundary layer");
           it->add_triangle(t, n, bls[i]);
         }
@@ -283,7 +283,7 @@ public:
       if(_ridges[i]._ge == ge) return &_ridges[i];
     }
     Msg::Error("Unknown ridge %d", ge->tag());
-    return NULL;
+    return nullptr;
   }
 
   void classify_ridges()
@@ -298,9 +298,9 @@ public:
         MLine *l = ge->lines[j];
         MVertex *l0 = l->getVertex(0);
         MVertex *l1 = l->getVertex(1);
-        MVertex *op1 = 0;
+        MVertex *op1 = nullptr;
         SVector3 N[2];
-        std::set<blyr_mvertex>::iterator it = _vertices.find(l->getVertex(0));
+        auto it = _vertices.find(l->getVertex(0));
         for(size_t k = 0; k < it->_triangles.size(); k++) {
           MVertex *v0 = it->_triangles[k]->getVertex(0);
           MVertex *v1 = it->_triangles[k]->getVertex(1);
@@ -364,7 +364,7 @@ public:
 
   void classify_corners()
   {
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
     }
   }
@@ -430,7 +430,7 @@ public:
     mean_plane plane;
     computeMeanPlaneSimple(aaa, plane);
 
-    std::map<std::pair<GFace *, GFace *>, std::vector<MVertex *> >::iterator
+    auto
       it = v._v_per_ridge.begin();
 
     std::vector<MLine *> plane_lines;
@@ -440,8 +440,8 @@ public:
       GFace *f0 = it->first.first;
       GFace *f1 = it->first.second;
       std::vector<MVertex *> &verts = it->second;
-      MVertex *v0 = NULL;
-      MVertex *v1 = NULL;
+      MVertex *v0 = nullptr;
+      MVertex *v1 = nullptr;
       for(size_t i = 0; i < v._v_per_face.size(); i++) {
         if(f0 == v._f_per_normal[i]) v0 = v._v_per_face[i];
         if(f1 == v._f_per_normal[i]) v1 = v._v_per_face[i];
@@ -463,15 +463,15 @@ public:
                    (p1.y() - plane.y) * plane.plan[1][1] +
                    (p1.z() - plane.z) * plane.plan[1][2]);
 
-      MVertex *v_plane_0 = NULL;
-      std::map<MVertex *, MVertex *>::iterator itp = plane_vertices.find(v0);
+      MVertex *v_plane_0 = nullptr;
+      auto itp = plane_vertices.find(v0);
       if(itp != plane_vertices.end())
         v_plane_0 = itp->second;
       else {
         v_plane_0 = new MVertex(P0.x(), P0.y(), 0, _gr);
         plane_vertices[v0] = v_plane_0;
       }
-      MVertex *v_plane_1 = NULL;
+      MVertex *v_plane_1 = nullptr;
       itp = plane_vertices.find(v1);
       if(itp != plane_vertices.end())
         v_plane_1 = itp->second;
@@ -528,7 +528,7 @@ public:
     }
 
     std::map<int, MVertex *> plane_vertices_inv;
-    for(std::map<MVertex *, MVertex *>::iterator it = plane_vertices.begin();
+    for(auto it = plane_vertices.begin();
         it != plane_vertices.end(); ++it)
       plane_vertices_inv[it->second->getNum()] = it->first;
     //    printf("%d vertices there\n",plane_vertices_inv.size());
@@ -621,8 +621,8 @@ public:
           MLine *l = r._ge->lines[j];
           MVertex *v0 = l->getVertex(0);
           MVertex *v1 = l->getVertex(1);
-          std::set<blyr_mvertex>::iterator it0 = _vertices.find(v0);
-          std::set<blyr_mvertex>::iterator it1 = _vertices.find(v1);
+          auto it0 = _vertices.find(v0);
+          auto it1 = _vertices.find(v1);
 
           MVertex *o00 = it0->extruded_vertex(f0);
           MVertex *o01 = it0->extruded_vertex(f1);
@@ -640,7 +640,7 @@ public:
   void extrude_vertices_on_faces()
   {
     std::vector<blyr_mvertex> new_vertices;
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
       //      printf ("%d has %d lines %d tris\n",it->_v->getNum(),
       //      it->_lines.size(), it->_triangles.size());
@@ -649,7 +649,7 @@ public:
         GEdge *ge1 = it->_gedges[1];
         blyr_ridge *ridge0 = getRidge(ge0);
         blyr_ridge *ridge1 = getRidge(ge1);
-        if(ridge0 == NULL && ridge1 == NULL) // not a ridge
+        if(ridge0 == nullptr && ridge1 == nullptr) // not a ridge
           continue;
         else {
           if(ridge0->getType() == blyr_ridge::INTERNAL) {
@@ -672,7 +672,7 @@ public:
   void extrude_one_external()
   {
     std::vector<blyr_mvertex> vplus;
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
       if(it->_lines.size() > 2) {
         std::vector<blyr_ridge *> _internals;
@@ -718,7 +718,7 @@ public:
                  n2.y(), n2.z());
           SPoint3 p(it->_v->x() + n.x(), it->_v->y() + n.y(),
                     it->_v->z() + n.z());
-          GFace *gf = NULL;
+          GFace *gf = nullptr;
           for(size_t k = 0; k < it->_gfaces.size(); k++) {
             std::vector<GEdge *> e = it->_gfaces[k]->edges();
             if(std::find(e.begin(), e.end(), ridge->_ge) == e.end()) {
@@ -748,7 +748,7 @@ public:
               }
             }
           }
-          std::set<blyr_mvertex>::iterator ite =
+          auto ite =
             _vertices.find(blyr_mvertex(_externals_v[0]));
           if(ite != _vertices.end()) {
             blv._v_per_face.push_back(ite->_v_per_face[0]);
@@ -772,7 +772,7 @@ public:
               std::pair<GFace *, GFace *> pa =
                 std::make_pair(_internals[k]->_f[0], _internals[k]->_f[1]);
               it->_v_per_ridge[pa] = fan;
-              std::set<blyr_mvertex>::iterator iti =
+              auto iti =
                 _vertices.find(blyr_mvertex(_internals_v[k]));
               MVertex *o = iti->_v_per_face[0];
               gf->quadrangles.push_back(
@@ -802,7 +802,7 @@ public:
 
   void extrude_vertices_basic()
   {
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
       if(!it->_triangles.empty()) add_one_normal(*it);
     }
@@ -810,7 +810,7 @@ public:
 
   void extrude_vertices()
   {
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
       if(it->_lines.empty()) {
         // simple vertex that is extruded along the average of face normals
@@ -828,7 +828,7 @@ public:
         blyr_ridge *ridge1 = getRidge(ge1);
         //	printf("%d %d %g %g %d
         //%d\n",ge0->tag(),ge1->tag(),ridge0->min_angle,ridge0->max_angle,ridge0->getType(),blyr_ridge::FLAT);
-        if(ridge0 == NULL && ridge1 == NULL) { // not a ridge
+        if(ridge0 == nullptr && ridge1 == nullptr) { // not a ridge
           if(!it->_triangles.empty()) add_one_normal(*it);
         }
         else {
@@ -906,7 +906,7 @@ public:
   void extrude_vertices_on_edges()
   {
     std::vector<blyr_mvertex> additional_vertices;
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
       MVertex *v = it->_v;
 
@@ -963,12 +963,12 @@ public:
             SVector3(mev->x() - v->x(), mev->y() - v->y(), mev->z() - v->z());
         }
         else {
-          vplus.push_back(blyr_mvertex(NULL));
+          vplus.push_back(blyr_mvertex(nullptr));
         }
       }
 
       // CREATE A VOLUME VERTEX IN CASE OF A FULL INTERNAL CORNER
-      MVertex *vr = NULL;
+      MVertex *vr = nullptr;
       if(_externals.empty()) {
         vr =
           new MVertex(v->x() + NR.x(), v->y() + NR.y(), v->z() + NR.z(), _gr);
@@ -977,7 +977,7 @@ public:
 
       // ADD POINTS ON BOTH NEIGHBORING FACES IF RIDGE IS INTERNAL
       for(size_t iGe = 0; iGe < it->_gedges.size(); iGe++) {
-        if(vplus[iGe]._v != NULL) {
+        if(vplus[iGe]._v != nullptr) {
           GEdge *gei = it->_gedges[iGe];
           blyr_ridge *ridgei = getRidge(gei);
 
@@ -987,14 +987,14 @@ public:
               blyr_ridge *ridgej = getRidge(gej);
               GFace *gf = haveTowGEdges(_faces, gei, gej);
               if(gf) {
-                MVertex *vf = NULL;
+                MVertex *vf = nullptr;
                 //		printf("s %d %d %d -- %d %d -- %d -- %p
                 //%p\n",v->getNum(),iGe,jGe,gei->tag(),gej->tag(),gf->tag(),vplus[iGe]._v,vplus[jGe]._v);
 
                 SVector3 dx1(vplus[iGe]._v->x() - v->x(),
                              vplus[iGe]._v->y() - v->y(),
                              vplus[iGe]._v->z() - v->z());
-                if((vplus[jGe]._v != NULL) && (jGe > iGe)) {
+                if((vplus[jGe]._v != nullptr) && (jGe > iGe)) {
                   SVector3 dx2(vplus[jGe]._v->x() - v->x(),
                                vplus[jGe]._v->y() - v->y(),
                                vplus[jGe]._v->z() - v->z());
@@ -1063,7 +1063,7 @@ public:
                     vplus[jGe]._f_per_normal.push_back(gf);
                   }
                 }
-                else if(vplus[jGe]._v == NULL) {
+                else if(vplus[jGe]._v == nullptr) {
                   //		  printf("-------------------------------------->%d
                   //%d %d -- %d %d -- %d -- %p
                   //%p\n",v->getNum(),iGe,jGe,gei->tag(),gej->tag(),gf->tag(),vplus[iGe]._v,vplus[jGe]._v);
@@ -1120,7 +1120,7 @@ public:
       for(size_t iGe = 0; iGe < it->_gedges.size(); iGe++) {
         GEdge *ge = it->_gedges[iGe];
         MLine *ml = it->_lines[iGe];
-        std::map<GEdge *, MVertex *>::iterator itev = e2v.find(ge);
+        auto itev = e2v.find(ge);
         if(itev != e2v.end()) {
           MVertex *mev = itev->second;
           if(ml->getVertex(0) == v)
@@ -1170,9 +1170,9 @@ public:
         MVertex *v0 = _faces[i]->triangles[j]->getVertex(0);
         MVertex *v1 = _faces[i]->triangles[j]->getVertex(1);
         MVertex *v2 = _faces[i]->triangles[j]->getVertex(2);
-        std::set<blyr_mvertex>::iterator it0 = _vertices.find(v0);
-        std::set<blyr_mvertex>::iterator it1 = _vertices.find(v1);
-        std::set<blyr_mvertex>::iterator it2 = _vertices.find(v2);
+        auto it0 = _vertices.find(v0);
+        auto it1 = _vertices.find(v1);
+        auto it2 = _vertices.find(v2);
         MVertex *o0 = it0->extruded_vertex(_faces[i]);
         MVertex *o1 = it1->extruded_vertex(_faces[i]);
         MVertex *o2 = it2->extruded_vertex(_faces[i]);
@@ -1200,8 +1200,8 @@ public:
           MLine *l = r._ge->lines[j];
           MVertex *v0 = l->getVertex(0);
           MVertex *v1 = l->getVertex(1);
-          std::set<blyr_mvertex>::iterator it0 = _vertices.find(v0);
-          std::set<blyr_mvertex>::iterator it1 = _vertices.find(v1);
+          auto it0 = _vertices.find(v0);
+          auto it1 = _vertices.find(v1);
 
           MVertex *o00 = it0->extruded_vertex(f0);
           MVertex *o01 = it0->extruded_vertex(f1);
@@ -1214,8 +1214,7 @@ public:
           std::vector<MVertex *> fan0;
           std::vector<MVertex *> fan1;
 
-          std::map<std::pair<GFace *, GFace *>,
-                   std::vector<MVertex *> >::iterator it =
+          auto it =
             it0->_v_per_ridge.find(pa_pos);
           if(it != it0->_v_per_ridge.end())
             fan0 = it->second;
@@ -1256,7 +1255,7 @@ public:
 
   void extrude_external_corners()
   {
-    std::set<blyr_mvertex>::iterator it = _vertices.begin();
+    auto it = _vertices.begin();
     for(; it != _vertices.end(); ++it) {
       const blyr_mvertex &v = *it;
       for(size_t j = 0; j < v._triangles_at_corner.size(); j++) {
diff --git a/Mesh/meshGRegionBoundaryRecovery.cpp b/Mesh/meshGRegionBoundaryRecovery.cpp
index 3983a65e582a20e3e28c928cec78f8df442b2fbf..d6f9f91ea82a296a68152a56e3fcd62103b546f6 100644
--- a/Mesh/meshGRegionBoundaryRecovery.cpp
+++ b/Mesh/meshGRegionBoundaryRecovery.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -101,23 +101,23 @@ namespace tetgenBR {
       numberofpointattributes = 0;
       numberoftetrahedronattributes = 0;
       numberofsegmentconstraints = 0;
-      segmentconstraintlist = 0;
+      segmentconstraintlist = nullptr;
       numberoffacetconstraints = 0;
-      facetconstraintlist = 0;
+      facetconstraintlist = nullptr;
       numberofpoints = 0;
-      pointlist = 0;
-      pointattributelist = 0;
+      pointlist = nullptr;
+      pointattributelist = nullptr;
       numberofpointmakers = 0;
-      pointmarkerlist = 0;
+      pointmarkerlist = nullptr;
       numberofpointmtrs = 0;
-      pointmtrlist = 0;
+      pointmtrlist = nullptr;
       numberofedges = 0;
-      edgelist = 0;
-      edgemarkerlist = 0;
+      edgelist = nullptr;
+      edgemarkerlist = nullptr;
       numberofholes = 0;
-      holelist = 0;
+      holelist = nullptr;
       numberofregions = 0;
-      regionlist = 0;
+      regionlist = nullptr;
       mesh_dim = 0;
     }
   };
@@ -157,7 +157,7 @@ namespace tetgenBR {
     {
       std::set<MVertex *, MVertexPtrLessThan> all;
       std::vector<GFace *> const &f = _gr->faces();
-      for(std::vector<GFace *>::const_iterator it = f.begin(); it != f.end();
+      for(auto it = f.begin(); it != f.end();
           ++it) {
         GFace *gf = *it;
         for(std::size_t i = 0; i < gf->triangles.size(); i++) {
@@ -191,7 +191,7 @@ namespace tetgenBR {
         }
       }
       std::vector<GEdge *> const &e = _gr->embeddedEdges();
-      for(std::vector<GEdge *>::const_iterator it = e.begin(); it != e.end();
+      for(auto it = e.begin(); it != e.end();
           ++it) {
         GEdge *ge = *it;
         for(std::size_t i = 0; i < ge->lines.size(); i++) {
@@ -200,7 +200,7 @@ namespace tetgenBR {
         }
       }
       std::vector<GVertex *> const &v = _gr->embeddedVertices();
-      for(std::vector<GVertex *>::const_iterator it = v.begin(); it != v.end();
+      for(auto it = v.begin(); it != v.end();
           ++it) {
         GVertex *gv = *it;
         for(std::size_t i = 0; i < gv->points.size(); i++) {
@@ -301,7 +301,7 @@ namespace tetgenBR {
       ver2tetarray = new tetrahedron[_vertices.size() + in->firstnumber];
       for(std::size_t i = 0; i < _vertices.size() + in->firstnumber; i++) {
         setpointtype(idx2verlist[i], VOLVERTEX); // initial type.
-        ver2tetarray[i] = NULL;
+        ver2tetarray[i] = nullptr;
       }
 
 
@@ -375,7 +375,7 @@ namespace tetgenBR {
           // Push the current tet onto the stack.
           ver2tetarray[idx] = encode(tetloop);
           decode(tptr, checktet);
-          if(checktet.tet != NULL) {
+          if(checktet.tet != nullptr) {
             p[0] = org(tetloop); // a
             p[1] = dest(tetloop); // b
             p[2] = apex(tetloop); // c
@@ -389,7 +389,7 @@ namespace tetgenBR {
               for(int j = 0; j < 3; j++) {
                 // Go to the face [b',a',d], or [c',b',d], or [a',c',d].
                 esym(checktet, face2);
-                if(face2.tet[face2.ver & 3] == NULL) {
+                if(face2.tet[face2.ver & 3] == nullptr) {
                   k = ((j + 1) % 3);
                   if(q[k] == p[0]) { // b', c', a' = a
                     if(q[j] == p[1]) { // a', b', c' = b
@@ -435,7 +435,7 @@ namespace tetgenBR {
                 prevchktet = checktet;
               }
               decode(tptr, checktet);
-            } while(checktet.tet != NULL);
+            } while(checktet.tet != nullptr);
           } // if(checktet.tet != NULL)
         } // for(tetloop.ver = 0; ...
       } // i
@@ -449,10 +449,10 @@ namespace tetgenBR {
 
       tetrahedrons->traversalinit();
       tetloop.tet = tetrahedrontraverse();
-      while(tetloop.tet != (tetrahedron *)NULL) {
+      while(tetloop.tet != (tetrahedron *)nullptr) {
         tptr = encode(tetloop);
         for(tetloop.ver = 0; tetloop.ver < 4; tetloop.ver++) {
-          if(tetloop.tet[tetloop.ver] == NULL) {
+          if(tetloop.tet[tetloop.ver] == nullptr) {
             // Create a hull tet.
             maketetrahedron(&hulltet);
             p[0] = org(tetloop);
@@ -464,12 +464,12 @@ namespace tetgenBR {
             for(int j = 0; j < 3; j++) {
               fsym(hulltet, face2);
               while(1) {
-                if(face2.tet == NULL) break;
+                if(face2.tet == nullptr) break;
                 esymself(face2);
                 if(apex(face2) == dummypoint) break;
                 fsymself(face2);
               }
-              if(face2.tet != NULL) {
+              if(face2.tet != nullptr) {
                 // Found an adjacent hull tet.
                 assert(face2.tet[face2.ver & 3] == NULL);
                 esym(hulltet, face1);
@@ -482,7 +482,7 @@ namespace tetgenBR {
           // Create the point-to-tet map.
           setpoint2tet((point)(tetloop.tet[4 + tetloop.ver]), tptr);
           // Clean the temporary used space.
-          tetloop.tet[8 + tetloop.ver] = NULL;
+          tetloop.tet[8 + tetloop.ver] = nullptr;
         }
         tetloop.tet = tetrahedrontraverse();
       }
@@ -505,7 +505,7 @@ namespace tetgenBR {
       point p[4];
       int idx;
 
-      for(std::vector<GFace *>::const_iterator it = f_list.begin();
+      for(auto it = f_list.begin();
           it != f_list.end(); ++it) {
         GFace *gf = *it;
         for(std::size_t i = 0; i < gf->triangles.size(); i++) {
@@ -521,7 +521,7 @@ namespace tetgenBR {
           recentsh = newsh;
           for(int j = 0; j < 3; j++) {
             makeshellface(subsegs, &newseg);
-            setshvertices(newseg, sorg(newsh), sdest(newsh), NULL);
+            setshvertices(newseg, sorg(newsh), sdest(newsh), nullptr);
             // Set the default segment marker '-1'.
             setshellmark(newseg, -1);
             ssbond(newsh, newseg);
@@ -532,7 +532,7 @@ namespace tetgenBR {
 
       if(_sqr){
         std::map<MFace, GFace *, MFaceLessThan> f = _sqr->getTri();
-        for(std::map<MFace, GFace *, MFaceLessThan>::iterator it = f.begin();
+        for(auto it = f.begin();
             it != f.end(); it++){
           const MFace &mf = it->first;
           for(int j = 0; j < 3; j++) {
@@ -547,7 +547,7 @@ namespace tetgenBR {
           recentsh = newsh;
           for(int j = 0; j < 3; j++) {
             makeshellface(subsegs, &newseg);
-            setshvertices(newseg, sorg(newsh), sdest(newsh), NULL);
+            setshvertices(newseg, sorg(newsh), sdest(newsh), nullptr);
             // Set the default segment marker '-1'.
             setshellmark(newseg, -1);
             ssbond(newsh, newseg);
@@ -573,7 +573,7 @@ namespace tetgenBR {
       // Process the set of PSC edges.
       // Remeber that all segments have default marker '-1'.
       //    int COUNTER = 0;
-      for(std::vector<GEdge *>::const_iterator it = e_list.begin();
+      for(auto it = e_list.begin();
           it != e_list.end(); ++it) {
         GEdge *ge = *it;
         for(std::size_t i = 0; i < ge->lines.size(); i++) {
@@ -586,8 +586,8 @@ namespace tetgenBR {
             continue; // Skip this edge.
           }
           // Find a face contains the edge p[0], p[1].
-          newseg.sh = NULL;
-          searchsh.sh = NULL;
+          newseg.sh = nullptr;
+          searchsh.sh = nullptr;
           idx = pointmark(p[0]) - in->firstnumber;
           for(int j = idx2shlist[idx]; j < idx2shlist[idx + 1]; j++) {
             checkpt = sdest(shperverlist[j]);
@@ -604,20 +604,20 @@ namespace tetgenBR {
               }
             }
           } // j
-          if(searchsh.sh != NULL) {
+          if(searchsh.sh != nullptr) {
             // Check if this edge is already a segment of the mesh.
             sspivot(searchsh, checkseg);
-            if(checkseg.sh != NULL) {
+            if(checkseg.sh != nullptr) {
               // This segment already exist.
               newseg = checkseg;
             }
             else {
               // Create a new segment at this edge.
               makeshellface(subsegs, &newseg);
-              setshvertices(newseg, p[0], p[1], NULL);
+              setshvertices(newseg, p[0], p[1], nullptr);
               ssbond(searchsh, newseg);
               spivot(searchsh, neighsh);
-              if(neighsh.sh != NULL) {
+              if(neighsh.sh != nullptr) {
                 ssbond(neighsh, newseg);
               }
             }
@@ -639,9 +639,9 @@ namespace tetgenBR {
               }
               segloop.sh = shellfacetraverse(subsegs);
               }*/
-            if(newseg.sh == NULL) {
+            if(newseg.sh == nullptr) {
               makeshellface(subsegs, &newseg);
-              setshvertices(newseg, p[0], p[1], NULL);
+              setshvertices(newseg, p[0], p[1], nullptr);
             }
           }
           setshellmark(newseg, ge->tag());
@@ -765,7 +765,7 @@ namespace tetgenBR {
         // The new vertices must be added at the end of the point list.
         points->traversalinit();
         pointloop = pointtraverse();
-        while(pointloop != (point)NULL) {
+        while(pointloop != (point)nullptr) {
           if(issteinerpoint(pointloop)) {
             // Check if this Steiner point locates on boundary.
             if(pointtype(pointloop) == FREESEGVERTEX) {
@@ -773,17 +773,17 @@ namespace tetgenBR {
               assert(parentseg.sh != NULL);
               l_edges.insert(shellmark(parentseg));
               // Get the GEdge containing this vertex.
-              GEdge *ge = NULL;
-              GFace *gf = NULL;
+              GEdge *ge = nullptr;
+              GFace *gf = nullptr;
               int etag = shellmark(parentseg);
-              for(std::vector<GEdge *>::const_iterator it = e_list.begin();
+              for(auto it = e_list.begin();
                   it != e_list.end(); ++it) {
                 if((*it)->tag() == etag) {
                   ge = *it;
                   break;
                 }
               }
-              if(ge != NULL) {
+              if(ge != nullptr) {
                 MEdgeVertex *v = new MEdgeVertex(pointloop[0], pointloop[1],
                                                  pointloop[2], ge, 0);
                 double uu = 0;
@@ -795,18 +795,18 @@ namespace tetgenBR {
                 _extras[pointmark(pointloop) - in->firstnumber] = v;
               }
               spivot(parentseg, parentsh);
-              if(parentsh.sh != NULL) {
-                if(ge == NULL) {
+              if(parentsh.sh != nullptr) {
+                if(ge == nullptr) {
                   // We treat this vertex a facet vertex.
                   int ftag = shellmark(parentsh);
-                  for(std::vector<GFace *>::const_iterator it = f_list.begin();
+                  for(auto it = f_list.begin();
                       it != f_list.end(); ++it) {
                     if((*it)->tag() == ftag) {
                       gf = *it;
                       break;
                     }
                   }
-                  if(gf != NULL) {
+                  if(gf != nullptr) {
                     MFaceVertex *v = new MFaceVertex(pointloop[0], pointloop[1],
                                                      pointloop[2], gf, 0, 0);
                     SPoint2 param;
@@ -827,7 +827,7 @@ namespace tetgenBR {
                   if(spinsh.sh == parentsh.sh) break;
                 }
               }
-              if((ge == NULL) && (gf == NULL)) {
+              if((ge == nullptr) && (gf == nullptr)) {
                 // Create an interior mesh vertex.
                 MVertex *v =
                   new MVertex(pointloop[0], pointloop[1], pointloop[2], _gr);
@@ -841,16 +841,16 @@ namespace tetgenBR {
               assert(parentsh.sh != NULL);
               l_faces.insert(shellmark(parentsh));
               // Get the GFace containing this vertex.
-              GFace *gf = NULL;
+              GFace *gf = nullptr;
               int ftag = shellmark(parentsh);
-              for(std::vector<GFace *>::const_iterator it = f_list.begin();
+              for(auto it = f_list.begin();
                   it != f_list.end(); ++it) {
                 if((*it)->tag() == ftag) {
                   gf = *it;
                   break;
                 }
               }
-              if(gf != NULL) {
+              if(gf != nullptr) {
                 MFaceVertex *v = new MFaceVertex(pointloop[0], pointloop[1],
                                                  pointloop[2], gf, 0, 0);
                 SPoint2 param;
@@ -892,7 +892,7 @@ namespace tetgenBR {
         // There are Steiner points on segments!
         face segloop;
         // Re-create the segment mesh in the corresponding GEdges.
-        for(std::set<int>::iterator it = l_edges.begin(); it != l_edges.end();
+        for(auto it = l_edges.begin(); it != l_edges.end();
             ++it) {
           // Find the GFace with tag = *it.
 
@@ -915,7 +915,7 @@ namespace tetgenBR {
           segloop.shver = 0;
           subsegs->traversalinit();
           segloop.sh = shellfacetraverse(subsegs);
-          while(segloop.sh != NULL) {
+          while(segloop.sh != nullptr) {
             if(shellmark(segloop) == etag) {
               p[0] = sorg(segloop);
               p[1] = sdest(segloop);
@@ -937,7 +937,7 @@ namespace tetgenBR {
         // There are Steiner points on facets!
         face subloop;
         // Re-create the surface mesh in the corresponding GFaces.
-        for(std::set<int>::iterator it = l_faces.begin(); it != l_faces.end();
+        for(auto it = l_faces.begin(); it != l_faces.end();
             ++it) {
           // Find the GFace with tag = *it.
 
@@ -965,7 +965,7 @@ namespace tetgenBR {
           subloop.shver = 0;
           subfaces->traversalinit();
           subloop.sh = shellfacetraverse(subfaces);
-          while(subloop.sh != NULL) {
+          while(subloop.sh != nullptr) {
             if(shellmark(subloop) == ftag) {
               p[0] = sorg(subloop);
               p[1] = sdest(subloop);
@@ -993,7 +993,7 @@ namespace tetgenBR {
       tetrahedrons->traversalinit();
       tetloop.tet = tetrahedrontraverse();
 
-      while(tetloop.tet != (tetrahedron *)NULL) {
+      while(tetloop.tet != (tetrahedron *)nullptr) {
         p[0] = org(tetloop);
         p[1] = dest(tetloop);
         p[2] = apex(tetloop);
@@ -1022,7 +1022,7 @@ namespace tetgenBR {
 
     // Put all coordinates back so they are not pertubated anymore (pertubation
     // done in delaunayTriangulation)
-    for(std::map<MVertex *, SPoint3>::iterator vIter =
+    for(auto vIter =
           originalCoordinates.begin();
         vIter != originalCoordinates.end(); ++vIter) {
       const SPoint3 &coordinates = vIter->second;
@@ -1040,7 +1040,7 @@ namespace tetgenBR {
   // 'mfilename' is a filename without suffix.
   void tetgenmesh::outsurfacemesh(const char *mfilename)
   {
-    FILE *outfile = NULL;
+    FILE *outfile = nullptr;
     char sfilename[256];
     int firstindex;
 
@@ -1058,7 +1058,7 @@ namespace tetgenBR {
     points->traversalinit();
     pointloop = pointtraverse();
     pointnumber = firstindex; // in->firstnumber;
-    while(pointloop != (point)NULL) {
+    while(pointloop != (point)nullptr) {
       // Point number, x, y and z coordinates.
       fprintf(outfile, "%4d    %.17g  %.17g  %.17g", pointnumber, pointloop[0],
               pointloop[1], pointloop[2]);
@@ -1084,7 +1084,7 @@ namespace tetgenBR {
     fprintf(outfile, "%ld  1\n", subfaces->items);
     subfaces->traversalinit();
     faceloop.sh = shellfacetraverse(subfaces);
-    while(faceloop.sh != (shellface *)NULL) {
+    while(faceloop.sh != (shellface *)nullptr) {
       torg = sorg(faceloop);
       tdest = sdest(faceloop);
       tapex = sapex(faceloop);
@@ -1109,7 +1109,7 @@ namespace tetgenBR {
     subsegs->traversalinit();
     edgeloop.sh = shellfacetraverse(subsegs);
     edgenumber = firstindex; // in->firstnumber;
-    while(edgeloop.sh != (shellface *)NULL) {
+    while(edgeloop.sh != (shellface *)nullptr) {
       torg = sorg(edgeloop);
       tdest = sdest(edgeloop);
       fprintf(outfile, "%5d   %4d  %4d  %d\n", edgenumber,
@@ -1133,7 +1133,7 @@ namespace tetgenBR {
     int shift = 0;
     int marker;
 
-    if(mfilename != (char *)NULL && mfilename[0] != '\0') {
+    if(mfilename != (char *)nullptr && mfilename[0] != '\0') {
       strcpy(mefilename, mfilename);
     }
     else {
@@ -1145,7 +1145,7 @@ namespace tetgenBR {
       printf("Writing %s.\n", mefilename);
     }
     outfile = fopen(mefilename, "w");
-    if(outfile == (FILE *)NULL) {
+    if(outfile == (FILE *)nullptr) {
       Msg::Error("Could not open file '%s'", mefilename);
       return;
     }
@@ -1163,7 +1163,7 @@ namespace tetgenBR {
     points->traversalinit();
     ptloop = pointtraverse();
     // pointnumber = 1;
-    while(ptloop != (point)NULL) {
+    while(ptloop != (point)nullptr) {
       // Point coordinates.
       fprintf(outfile, "%.17g  %.17g  %.17g", ptloop[0], ptloop[1], ptloop[2]);
       fprintf(outfile, "    0\n");
@@ -1189,7 +1189,7 @@ namespace tetgenBR {
 
     tetrahedrons->traversalinit();
     tetptr = tetrahedrontraverse();
-    while(tetptr != (tetrahedron *)NULL) {
+    while(tetptr != (tetrahedron *)nullptr) {
       if(!b->reversetetori) {
         p1 = (point)tetptr[4];
         p2 = (point)tetptr[5];
@@ -1223,7 +1223,7 @@ namespace tetgenBR {
 
     subfaces->traversalinit();
     sface.sh = shellfacetraverse(subfaces);
-    while(sface.sh != NULL) {
+    while(sface.sh != nullptr) {
       p1 = sorg(sface);
       p2 = sdest(sface);
       p3 = sapex(sface);
@@ -1260,7 +1260,7 @@ bool meshGRegionBoundaryRecovery(GRegion *gr, splitQuadRecovery *sqr)
     else if(err == 3) {
       std::map<int, MVertex *> all;
       std::vector<GFace *> f = gr->faces();
-      for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); ++it) {
+      for(auto it = f.begin(); it != f.end(); ++it) {
         GFace *gf = *it;
         for(std::size_t i = 0; i < gf->triangles.size(); i++) {
           for(int j = 0; j < 3; j++) {
@@ -1270,7 +1270,7 @@ bool meshGRegionBoundaryRecovery(GRegion *gr, splitQuadRecovery *sqr)
         }
       }
       std::vector<GEdge *> const &e = gr->embeddedEdges();
-      for(std::vector<GEdge *>::const_iterator it = e.begin(); it != e.end();
+      for(auto it = e.begin(); it != e.end();
           ++it) {
         GEdge *ge = *it;
         for(std::size_t i = 0; i < ge->lines.size(); i++) {
@@ -1281,7 +1281,7 @@ bool meshGRegionBoundaryRecovery(GRegion *gr, splitQuadRecovery *sqr)
         }
       }
       std::vector<GVertex *> const &v = gr->embeddedVertices();
-      for(std::vector<GVertex *>::const_iterator it = v.begin(); it != v.end();
+      for(auto it = v.begin(); it != v.end();
           ++it) {
         GVertex *gv = *it;
         for(std::size_t i = 0; i < gv->points.size(); i++) {
diff --git a/Mesh/meshGRegionBoundaryRecovery.h b/Mesh/meshGRegionBoundaryRecovery.h
index 59146c9788ae83840b839fae60338c84d5786771..bd962021549a49cd8912e754858cea9ba2391494 100644
--- a/Mesh/meshGRegionBoundaryRecovery.h
+++ b/Mesh/meshGRegionBoundaryRecovery.h
@@ -9,6 +9,6 @@
 class GRegion;
 class splitQuadRecovery;
 
-bool meshGRegionBoundaryRecovery(GRegion *gr, splitQuadRecovery *sqr = 0);
+bool meshGRegionBoundaryRecovery(GRegion *gr, splitQuadRecovery *sqr = nullptr);
 
 #endif
diff --git a/Mesh/meshGRegionCarveHole.cpp b/Mesh/meshGRegionCarveHole.cpp
index 09369ba3654253f10d7ed837b92bbb157ce484ec..cb080336d04081244259e7871340ca429a96ef23 100644
--- a/Mesh/meshGRegionCarveHole.cpp
+++ b/Mesh/meshGRegionCarveHole.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -60,7 +60,7 @@ void addFaces(std::vector<T *> &elements, std::set<MFace, MFaceLessThan> &faces)
   for(std::size_t i = 0; i < elements.size(); i++) {
     for(int j = 0; j < elements[i]->getNumFaces(); j++) {
       MFace f = elements[i]->getFace(j);
-      std::set<MFace, MFaceLessThan>::iterator it = faces.find(f);
+      auto it = faces.find(f);
       if(it == faces.end())
         faces.insert(f);
       else
@@ -119,7 +119,7 @@ void carveHole(GRegion *gr, int num, double distance,
   if(!gf) return;
   std::set<MFace, MFaceLessThan> faces;
   std::vector<GFace *> f = gr->faces();
-  for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); it++) {
+  for(auto it = f.begin(); it != f.end(); it++) {
     addFaces((*it)->triangles, faces);
     addFaces((*it)->quadrangles, faces);
   }
@@ -129,7 +129,7 @@ void carveHole(GRegion *gr, int num, double distance,
   addFaces(gr->pyramids, faces);
 
   std::set<MVertex *> verts;
-  for(std::set<MFace, MFaceLessThan>::iterator it = faces.begin();
+  for(auto it = faces.begin();
       it != faces.end(); it++) {
     for(std::size_t i = 0; i < it->getNumVertices(); i++) {
       it->getVertex(i)->setEntity(gf);
diff --git a/Mesh/meshGRegionDelaunayInsertion.cpp b/Mesh/meshGRegionDelaunayInsertion.cpp
index da4c6d55f3c3d4dbd694e1ceb41c19056cacf162..38082e5fbba08764ba5ccd34a5e0288df5dc1c64 100644
--- a/Mesh/meshGRegionDelaunayInsertion.cpp
+++ b/Mesh/meshGRegionDelaunayInsertion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -115,7 +115,7 @@ static void createAllEmbeddedEdges(GRegion *gr,
                                    std::set<MEdge, MEdgeLessThan> &allEmbeddedEdges)
 {
   std::vector<GEdge *> const &e = gr->embeddedEdges();
-  for(std::vector<GEdge *>::const_iterator it = e.begin(); it != e.end();
+  for(auto it = e.begin(); it != e.end();
       ++it) {
     for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
       allEmbeddedEdges.insert(
@@ -127,7 +127,7 @@ static void createAllEmbeddedEdges(GRegion *gr,
 static void createAllEmbeddedEdges(GRegion *gr, edgeContainerB &embedded)
 {
   std::vector<GEdge *> const &e = gr->embeddedEdges();
-  for(std::vector<GEdge *>::const_iterator it = e.begin(); it != e.end();
+  for(auto it = e.begin(); it != e.end();
       ++it) {
     for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
       embedded.addNewEdge(
@@ -140,7 +140,7 @@ static void createAllEmbeddedFaces(GRegion *gr,
                                    std::set<MFace, MFaceLessThan> &allEmbeddedFaces)
 {
   std::vector<GFace *> const &f = gr->embeddedFaces();
-  for(std::vector<GFace *>::const_iterator it = f.begin(); it != f.end();
+  for(auto it = f.begin(); it != f.end();
       ++it) {
     for(std::size_t i = 0; i < (*it)->triangles.size(); i++) {
       allEmbeddedFaces.insert((*it)->triangles[i]->getFace(0));
@@ -177,7 +177,7 @@ struct faceXtet {
   MTet4 *t1;
   int i1;
 
-  faceXtet(MTet4 *_t = 0, int iFac = 0) : t1(_t), i1(iFac)
+  faceXtet(MTet4 *_t = nullptr, int iFac = 0) : t1(_t), i1(iFac)
   {
     unsorted[0] = v[0] = t1->tet()->getVertex(faces[iFac][0]);
     unsorted[1] = v[1] = t1->tet()->getVertex(faces[iFac][1]);
@@ -249,7 +249,7 @@ void connectTets_vector2_templ(std::size_t _size, ITER beg, ITER end,
 
 template <class ITER>
 void connectTets(ITER beg, ITER end,
-                 const std::set<MFace, MFaceLessThan> *allEmbeddedFaces = 0)
+                 const std::set<MFace, MFaceLessThan> *allEmbeddedFaces = nullptr)
 {
   std::set<faceXtet> conn;
   while(beg != end) {
@@ -260,7 +260,7 @@ void connectTets(ITER beg, ITER end,
         if(!allEmbeddedFaces ||
            allEmbeddedFaces->find(MFace(fxt.v[0], fxt.v[1], fxt.v[2])) ==
              allEmbeddedFaces->end()) {
-          std::set<faceXtet>::iterator found = conn.find(fxt);
+          auto found = conn.find(fxt);
           if(found == conn.end())
             conn.insert(fxt);
           else if(found->t1 != *beg) {
@@ -310,7 +310,7 @@ static void removeFromCavity(std::vector<faceXtet> &shell,
 
   for(int i = 0; i < 4; i++) {
     faceXtet fxt2(toRemove.t1, i);
-    std::vector<faceXtet>::iterator it =
+    auto it =
       std::find(shell.begin(), shell.end(), fxt2);
     if(it == shell.end()) {
       MTet4 *opposite = toRemove.t1->getNeigh(toRemove.i1);
@@ -333,7 +333,7 @@ static void extendCavity(std::vector<faceXtet> &shell,
   MTet4 *opposite = t->getNeigh(toExtend.i1);
   for(int i = 0; i < 4; i++) {
     faceXtet fxt(opposite, i);
-    std::vector<faceXtet>::iterator it =
+    auto it =
       std::find(shell.begin(), shell.end(), fxt);
     if(it == shell.end())
       shell.push_back(fxt);
@@ -355,7 +355,7 @@ static bool verifyShell(MVertex *v, MTet4 *t, std::vector<faceXtet> &shell)
     faceXtet fxt(t, i);
     bool starShaped = fxt.visible(v);
     if(!starShaped) {
-      std::vector<faceXtet>::iterator its =
+      auto its =
         std::find(shell.begin(), shell.end(), fxt);
       if(its == shell.end())
         NBAD_AFTER++;
@@ -371,7 +371,7 @@ int makeCavityStarShaped(std::vector<faceXtet> &shell,
                          std::vector<MTet4 *> &cavity, MVertex *v)
 {
   std::vector<faceXtet> wrong;
-  for(std::vector<faceXtet>::iterator it = shell.begin(); it != shell.end();
+  for(auto it = shell.begin(); it != shell.end();
       ++it) {
     faceXtet &fxt = *it;
     bool starShaped = fxt.visible(v);
@@ -472,7 +472,7 @@ bool insertVertexB(std::vector<faceXtet> &shell, std::vector<MTet4 *> &cavity,
   std::vector<MTet4 *> new_tets;
   new_tets.reserve(shell.size());
 
-  std::vector<faceXtet>::iterator it = shell.begin();
+  auto it = shell.begin();
 
   bool onePointIsTooClose = false;
   while(it != shell.end()) {
@@ -509,8 +509,8 @@ bool insertVertexB(std::vector<faceXtet> &shell, std::vector<MTet4 *> &cavity,
   }
   else /* one point is too close */ {
     for(std::size_t i = 0; i < shell.size(); i++) myFactory.Free(new_tets[i]);
-    std::vector<MTet4 *>::iterator ittet = cavity.begin();
-    std::vector<MTet4 *>::iterator ittete = cavity.end();
+    auto ittet = cavity.begin();
+    auto ittete = cavity.end();
     while(ittet != ittete) {
       (*ittet)->setDeleted(false);
       ++ittet;
@@ -532,9 +532,9 @@ static void setLcs(MTriangle *t,
     double dy = vi->y() - vj->y();
     double dz = vi->z() - vj->z();
     double l = std::sqrt(dx * dx + dy * dy + dz * dz);
-    std::map<MVertex *, double, MVertexPtrLessThan>::iterator iti =
+    auto iti =
       vSizes.find(vi);
-    std::map<MVertex *, double, MVertexPtrLessThan>::iterator itj =
+    auto itj =
       vSizes.find(vj);
     if(CTX::instance()->mesh.lcExtendFromBoundary == 2) {
       // use smallest edge length
@@ -586,7 +586,7 @@ static void setLcs(MTetrahedron *t,
 
       // smallest tet edge
       if(bndVertices.find(vi) == bndVertices.end()) {
-        std::map<MVertex *, double, MVertexPtrLessThan>::iterator iti =
+        auto iti =
           vSizes.find(vi);
 
         double const length =
@@ -596,7 +596,7 @@ static void setLcs(MTetrahedron *t,
       }
 
       if(bndVertices.find(vj) == bndVertices.end()) {
-        std::map<MVertex *, double, MVertexPtrLessThan>::iterator itj =
+        auto itj =
           vSizes.find(vj);
 
         double const length =
@@ -611,7 +611,7 @@ static void setLcs(MTetrahedron *t,
 static void completeTheSetOfFaces(GModel *model, std::set<GFace *> &faces_bound)
 {
   std::set<GFace *> toAdd;
-  for(GModel::fiter it = model->firstFace(); it != model->lastFace(); ++it) {
+  for(auto it = model->firstFace(); it != model->lastFace(); ++it) {
     if(faces_bound.find(*it) != faces_bound.end()) {
       if((*it)->compound.size()) {
         for(std::size_t i = 0; i < (*it)->compound.size(); ++i) {
@@ -629,7 +629,7 @@ GRegion *getRegionFromBoundingFaces(GModel *model,
 {
   completeTheSetOfFaces(model, faces_bound);
 
-  GModel::riter git = model->firstRegion();
+  auto git = model->firstRegion();
   while(git != model->lastRegion()) {
     GRegion *gr = *git;
     ExtrudeParams *ep = gr->meshAttributes.extrude;
@@ -641,7 +641,7 @@ GRegion *getRegionFromBoundingFaces(GModel *model,
       std::vector<GFace *> _faces = (*git)->faces();
       if(_faces.size() == faces_bound.size()) {
         bool ok = true;
-        for(std::vector<GFace *>::iterator it = _faces.begin();
+        for(auto it = _faces.begin();
             it != _faces.end(); ++it) {
           if(faces_bound.find(*it) == faces_bound.end()) ok = false;
         }
@@ -650,7 +650,7 @@ GRegion *getRegionFromBoundingFaces(GModel *model,
     }
     ++git;
   }
-  return 0;
+  return nullptr;
 }
 
 void non_recursive_classify(MTet4 *t, std::list<MTet4 *> &theRegion,
@@ -719,7 +719,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
     double avg = 0;
     int count = 0;
     for(int i = 0; i < nbRanges; i++) quality_ranges[i] = 0;
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double vol = fabs((*it)->tet()->getVolume());
         double qual = (*it)->getQuality();
@@ -751,7 +751,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
 
   while(1) {
     std::vector<MTet4 *> newTets;
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         for(int i = 0; i < 4; i++) {
           for(int j = 0; j < 4; j++) {
@@ -764,7 +764,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
       }
     }
 
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double qq = (*it)->getQuality();
         if(qq < qMin) {
@@ -781,7 +781,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
     illegals.clear();
     for(int i = 0; i < nbRanges; i++) quality_ranges[i] = 0;
 
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double qq = (*it)->getQuality();
         if(qq < qMin)
@@ -817,7 +817,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
     }
 
     // relocate vertices
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double qq = (*it)->getQuality();
         if(qq < qMin)
@@ -831,7 +831,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
     double worst = 1.0;
     double avg = 0;
     int count = 0;
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double vol = fabs((*it)->tet()->getVolume());
         double qual = (*it)->getQuality();
@@ -867,7 +867,7 @@ void adaptMeshGRegion::operator()(GRegion *gr)
     Msg::Info("%3.2f < quality < %3.2f: %9d elements", low, high, quality_ranges[i]);
   }
 
-  for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+  for(auto it = allTets.begin(); it != allTets.end(); ++it) {
     if(!(*it)->isDeleted()) {
       gr->tetrahedra.push_back((*it)->tet());
       delete *it;
@@ -921,7 +921,7 @@ void optimizeMesh(GRegion *gr, const qmTetrahedron::Measures &qm)
     double avg = 0;
     int count = 0;
     for(int i = 0; i < nbRanges; i++) quality_ranges[i] = 0;
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double vol = fabs((*it)->tet()->getVolume());
         double qual = (*it)->getQuality();
@@ -956,7 +956,7 @@ void optimizeMesh(GRegion *gr, const qmTetrahedron::Measures &qm)
     illegals.clear();
     for(int i = 0; i < nbRanges; i++) quality_ranges[i] = 0;
 
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double qq = (*it)->getQuality();
         if(qq < qMin) {
@@ -994,7 +994,7 @@ void optimizeMesh(GRegion *gr, const qmTetrahedron::Measures &qm)
 
     // relocate vertices
     if(gr->hexahedra.empty() && gr->prisms.empty() && gr->pyramids.empty()) {
-      for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+      for(auto it = allTets.begin(); it != allTets.end(); ++it) {
         if(!(*it)->isDeleted()) {
           double qq = (*it)->getQuality();
           if(qq < qMin){
@@ -1010,7 +1010,7 @@ void optimizeMesh(GRegion *gr, const qmTetrahedron::Measures &qm)
     double worst = 1.0;
     double avg = 0;
     int count = 0;
-    for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+    for(auto it = allTets.begin(); it != allTets.end(); ++it) {
       if(!(*it)->isDeleted()) {
         double vol = fabs((*it)->tet()->getVolume());
         double qual = (*it)->getQuality();
@@ -1045,7 +1045,7 @@ void optimizeMesh(GRegion *gr, const qmTetrahedron::Measures &qm)
               quality_ranges[i]);
   }
 
-  for(CONTAINER::iterator it = allTets.begin(); it != allTets.end(); ++it) {
+  for(auto it = allTets.begin(); it != allTets.end(); ++it) {
     if(!(*it)->isDeleted()) {
       gr->tetrahedra.push_back((*it)->tet());
       delete *it;
@@ -1112,7 +1112,7 @@ double tetcircumcenter(double a[3], double b[3], double c[3], double d[3],
   circumcenter[1] = ycirca + a[1];
   circumcenter[2] = zcirca + a[2];
 
-  if(xi != (double *)NULL) {
+  if(xi != (double *)nullptr) {
     /* To interpolate a linear function at the circumcenter, define a    */
     /*   coordinate system with a xi-axis directed from `a' to `b',      */
     /*   an eta-axis directed from `a' to `c', and a zeta-axis directed  */
@@ -1132,7 +1132,7 @@ static void memoryCleanup(MTet4Factory &myFactory,
                           std::set<MTet4 *, compareTet4Ptr> &allTets)
 {
   // int n1 = allTets.size();
-  std::set<MTet4 *, compareTet4Ptr>::iterator itd = allTets.begin();
+  auto itd = allTets.begin();
   while(itd != allTets.end()) {
     if((*itd)->isDeleted()) {
       myFactory.Free((*itd));
@@ -1152,14 +1152,14 @@ static int isCavityCompatibleWithEmbeddedEdges(std::vector<MTet4 *> &cavity,
   std::vector<MEdge> ed;
   ed.reserve(shell.size() * 3);
 
-  for(std::vector<faceXtet>::iterator it = shell.begin(); it != shell.end();
+  for(auto it = shell.begin(); it != shell.end();
       it++) {
     ed.push_back(MEdge(it->v[0], it->v[1]));
     ed.push_back(MEdge(it->v[1], it->v[2]));
     ed.push_back(MEdge(it->v[2], it->v[0]));
   }
 
-  for(std::vector<MTet4 *>::iterator itc = cavity.begin(); itc != cavity.end();
+  for(auto itc = cavity.begin(); itc != cavity.end();
       ++itc) {
     for(int j = 0; j < 6; j++) {
       MEdge e = (*itc)->tet()->getEdge(j);
@@ -1180,14 +1180,14 @@ static int isCavityCompatibleWithEmbeddedFace(
   std::vector<MFace> shellFaces;
   shellFaces.reserve(shell.size());
 
-  for(std::vector<faceXtet>::const_iterator it = shell.begin();
+  for(auto it = shell.begin();
       it != shell.end(); it++) {
     const faceXtet &face = (*it);
     shellFaces.push_back(
       MFace(face.unsorted[0], face.unsorted[1], face.unsorted[2]));
   }
 
-  for(std::vector<MTet4 *>::const_iterator itc = cavity.begin();
+  for(auto itc = cavity.begin();
       itc != cavity.end(); ++itc) {
     for(int j = 0; j < 4; j++) {
       MFace f = (*itc)->tet()->getFace(j);
@@ -1238,10 +1238,10 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
     std::map<MVertex *, double, MVertexPtrLessThan> vSizesMap;
     std::set<MVertex *, MVertexPtrLessThan> bndVertices;
 
-    for(GModel::riter rit = gr->model()->firstRegion();
+    for(auto rit = gr->model()->firstRegion();
         rit != gr->model()->lastRegion(); ++rit) {
       std::vector<GEdge *> const &e = (*rit)->embeddedEdges();
-      for(std::vector<GEdge *>::const_iterator it = e.begin(); it != e.end();
+      for(auto it = e.begin(); it != e.end();
           ++it) {
         for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
           MVertex *vi = (*it)->lines[i]->getVertex(0);
@@ -1251,9 +1251,9 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
           double dz = vi->z() - vj->z();
           double l = std::sqrt(dx * dx + dy * dy + dz * dz);
 
-          std::map<MVertex *, double, MVertexPtrLessThan>::iterator iti =
+          auto iti =
             vSizesMap.find(vi);
-          std::map<MVertex *, double, MVertexPtrLessThan>::iterator itj =
+          auto itj =
             vSizesMap.find(vj);
 
           // smallest tet edge
@@ -1263,20 +1263,20 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
       }
     }
 
-    for(GModel::riter rit = gr->model()->firstRegion();
+    for(auto rit = gr->model()->firstRegion();
         rit != gr->model()->lastRegion(); ++rit) {
       std::vector<GVertex *> const &vertices = (*rit)->embeddedVertices();
-      for(std::vector<GVertex *>::const_iterator it = vertices.begin();
+      for(auto it = vertices.begin();
           it != vertices.end(); ++it) {
         MVertex *v = (*it)->getMeshVertex(0);
         double l = (*it)->prescribedMeshSizeAtVertex();
-        std::map<MVertex *, double, MVertexPtrLessThan>::iterator itv =
+        auto itv =
           vSizesMap.find(v);
         if(itv == vSizesMap.end() || itv->second > l) vSizesMap[v] = l;
       }
     }
 
-    for(GModel::fiter it = gr->model()->firstFace();
+    for(auto it = gr->model()->firstFace();
         it != gr->model()->lastFace(); ++it) {
       GFace *gf = *it;
       for(std::size_t i = 0; i < gf->triangles.size(); i++) {
@@ -1286,7 +1286,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
     for(std::size_t i = 0; i < gr->tetrahedra.size(); i++)
       setLcs(gr->tetrahedra[i], vSizesMap, bndVertices);
 
-    for(std::map<MVertex *, double, MVertexPtrLessThan>::iterator it =
+    for(auto it =
           vSizesMap.begin();
         it != vSizesMap.end(); ++it) {
       it->first->setIndex(NUM++);
@@ -1312,7 +1312,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
     buildFaceSearchStructure(gr->model(), search, true); // only triangles
     if(sqr) search.insert(sqr->getTri().begin(), sqr->getTri().end());
 
-    for(MTet4Factory::iterator it = allTets.begin(); it != allTets.end();
+    for(auto it = allTets.begin(); it != allTets.end();
         ++it) {
       if(!(*it)->onWhat()) {
         std::list<MTet4 *> theRegion;
@@ -1331,16 +1331,16 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
           // a geometrical region (with no mesh) associated to the list of faces
           // has been found
           Msg::Info("Found volume %d", myGRegion->tag());
-          for(std::list<MTet4 *>::iterator it2 = theRegion.begin();
+          for(auto it2 = theRegion.begin();
               it2 != theRegion.end(); ++it2) {
             (*it2)->setOnWhat(myGRegion);
 
             // Make sure that Steiner points will end up in the right region
             std::vector<MVertex *> vertices;
             (*it2)->tet()->getVertices(vertices);
-            for(std::vector<MVertex *>::iterator itv = vertices.begin();
+            for(auto itv = vertices.begin();
                 itv != vertices.end(); ++itv) {
-              if((*itv)->onWhat() != NULL && (*itv)->onWhat()->dim() == 3 &&
+              if((*itv)->onWhat() != nullptr && (*itv)->onWhat()->dim() == 3 &&
                  (*itv)->onWhat() != myGRegion) {
                 myGRegion->addMeshVertex((*itv));
                 (*itv)->setEntity(myGRegion);
@@ -1351,7 +1351,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
         else {
           // the tets are in the void
           Msg::Info("Found void region");
-          for(std::list<MTet4 *>::iterator it2 = theRegion.begin();
+          for(auto it2 = theRegion.begin();
               it2 != theRegion.end(); ++it2)
             (*it2)->setDeleted(true);
         }
@@ -1361,20 +1361,20 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
   }
   else {
     // FIXME ... too simple
-    for(MTet4Factory::iterator it = allTets.begin(); it != allTets.end(); ++it)
+    for(auto it = allTets.begin(); it != allTets.end(); ++it)
       (*it)->setOnWhat(gr);
   }
 
-  for(MTet4Factory::iterator it = allTets.begin(); it != allTets.end(); ++it) {
-    (*it)->setNeigh(0, 0);
-    (*it)->setNeigh(1, 0);
-    (*it)->setNeigh(2, 0);
-    (*it)->setNeigh(3, 0);
+  for(auto it = allTets.begin(); it != allTets.end(); ++it) {
+    (*it)->setNeigh(0, nullptr);
+    (*it)->setNeigh(1, nullptr);
+    (*it)->setNeigh(2, nullptr);
+    (*it)->setNeigh(3, nullptr);
   }
   // store all embedded faces
   std::set<MFace, MFaceLessThan> allEmbeddedFaces;
   edgeContainerB allEmbeddedEdges;
-  for(GModel::riter it = gr->model()->firstRegion();
+  for(auto it = gr->model()->firstRegion();
       it != gr->model()->lastRegion(); ++it) {
     createAllEmbeddedFaces((*it), allEmbeddedFaces);
     createAllEmbeddedEdges((*it), allEmbeddedEdges);
@@ -1424,7 +1424,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
       double pd[3] = {base->getVertex(3)->x(), base->getVertex(3)->y(),
                       base->getVertex(3)->z()};
 
-      tetcircumcenter(pa, pb, pc, pd, center, NULL, NULL, NULL);
+      tetcircumcenter(pa, pb, pc, pd, center, nullptr, nullptr, nullptr);
 
       // A TEST !!!
       std::vector<faceXtet> shell;
@@ -1432,7 +1432,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
       MVertex vv(center[0], center[1], center[2], worst->onWhat());
       findCavity(shell, cavity, &vv, worst);
       bool FOUND = false;
-      for(std::vector<MTet4 *>::iterator itc = cavity.begin();
+      for(auto itc = cavity.begin();
           itc != cavity.end(); ++itc) {
         MTetrahedron *toto = (*itc)->tet();
         // (*itc)->setDeleted(false);
@@ -1494,7 +1494,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
                           myFactory, allTets, allEmbeddedFaces)) {
           COUNT_MISS_1++;
           myFactory.changeTetRadius(allTets.begin(), 0.);
-          for(std::vector<MTet4 *>::iterator itc = cavity.begin();
+          for(auto itc = cavity.begin();
               itc != cavity.end(); ++itc)
             (*itc)->setDeleted(false);
           delete v;
@@ -1511,7 +1511,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
       else {
         myFactory.changeTetRadius(allTets.begin(), 0.0);
         COUNT_MISS_2++;
-        for(std::vector<MTet4 *>::iterator itc = cavity.begin();
+        for(auto itc = cavity.begin();
             itc != cavity.end(); ++itc)
           (*itc)->setDeleted(false);
       }
@@ -1540,7 +1540,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
   // relocate vertices
   int nbReloc = 0;
   for(int SM = 0; SM < CTX::instance()->mesh.nbSmoothing; SM++) {
-    for(MTet4Factory::iterator it = allTets.begin(); it != allTets.end();
+    for(auto it = allTets.begin(); it != allTets.end();
         ++it) {
       if(!(*it)->isDeleted()) {
         double qq = (*it)->getQuality();
@@ -1557,7 +1557,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
     MTet4 *worst = *allTets.begin();
     if(!worst->isDeleted()) {
       worst->onWhat()->tetrahedra.push_back(worst->tet());
-      worst->tet() = 0;
+      worst->tet() = nullptr;
     }
     myFactory.Free(worst);
     allTets.erase(allTets.begin());
diff --git a/Mesh/meshGRegionDelaunayInsertion.h b/Mesh/meshGRegionDelaunayInsertion.h
index 96d8baaecbe95ab8f68d35ddb4358e5fc664e3ff..a8e316da36347f6a5919ef584b094fef7c3a86c7 100644
--- a/Mesh/meshGRegionDelaunayInsertion.h
+++ b/Mesh/meshGRegionDelaunayInsertion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -64,19 +64,19 @@ private:
 public:
   static int radiusNorm; // 2 is euclidian norm, -1 is infinite norm
   ~MTet4() {}
-  MTet4() : deleted(false), circum_radius(0.0), base(0), gr(0)
+  MTet4() : deleted(false), circum_radius(0.0), base(nullptr), gr(nullptr)
   {
-    neigh[0] = neigh[1] = neigh[2] = neigh[3] = 0;
+    neigh[0] = neigh[1] = neigh[2] = neigh[3] = nullptr;
   }
   MTet4(MTetrahedron *t, double qual)
-    : deleted(false), circum_radius(qual), base(t), gr(0)
+    : deleted(false), circum_radius(qual), base(t), gr(nullptr)
   {
-    neigh[0] = neigh[1] = neigh[2] = neigh[3] = 0;
+    neigh[0] = neigh[1] = neigh[2] = neigh[3] = nullptr;
   }
   MTet4(MTetrahedron *t, const qmTetrahedron::Measures &qm)
-    : deleted(false), base(t), gr(0)
+    : deleted(false), base(t), gr(nullptr)
   {
-    neigh[0] = neigh[1] = neigh[2] = neigh[3] = 0;
+    neigh[0] = neigh[1] = neigh[2] = neigh[3] = nullptr;
     double vol;
     circum_radius = qmTetrahedron::qm(t, qm, &vol);
   }
@@ -90,14 +90,14 @@ public:
     double B[4] = {v1->x(), v1->y(), v1->z()};
     double C[4] = {v2->x(), v2->y(), v2->z()};
     double D[4] = {v3->x(), v3->y(), v3->z()};
-    tetcircumcenter(A, B, C, D, res, NULL, NULL, NULL);
+    tetcircumcenter(A, B, C, D, res, nullptr, nullptr, nullptr);
   }
 
   void setup(MTetrahedron *t, std::vector<double> &sizes,
              std::vector<double> &sizesBGM)
   {
     base = t;
-    neigh[0] = neigh[1] = neigh[2] = neigh[3] = 0;
+    neigh[0] = neigh[1] = neigh[2] = neigh[3] = nullptr;
     double center[3];
     circumcenter(center);
     const double dx = base->getVertex(0)->x() - center[0];
@@ -134,7 +134,7 @@ public:
              std::vector<double> &sizesBGM, double lcA, double lcB)
   {
     base = t;
-    neigh[0] = neigh[1] = neigh[2] = neigh[3] = 0;
+    neigh[0] = neigh[1] = neigh[2] = neigh[3] = nullptr;
     double center[3];
     circumcenter(center);
     const double dx = base->getVertex(0)->x() - center[0];
@@ -215,12 +215,12 @@ public:
   }
 };
 
-void connectTets(std::list<MTet4 *> &, const std::set<MFace, MFaceLessThan> * = 0);
-void connectTets(std::vector<MTet4 *> &, const std::set<MFace, MFaceLessThan> * = 0);
+void connectTets(std::list<MTet4 *> &, const std::set<MFace, MFaceLessThan> * = nullptr);
+void connectTets(std::vector<MTet4 *> &, const std::set<MFace, MFaceLessThan> * = nullptr);
 void delaunayMeshIn3D(std::vector<MVertex *> &, std::vector<MTetrahedron *> &,
                       bool removeBox = false);
 void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarget,
-                            bool _classify = true, splitQuadRecovery *sqr = 0);
+                            bool _classify = true, splitQuadRecovery *sqr = nullptr);
 void bowyerWatsonFrontalLayers(GRegion *gr, bool hex);
 
 struct compareTet4Ptr {
@@ -301,7 +301,7 @@ public:
   void Free(MTet4 *t)
   {
     if(t->tet()) delete t->tet();
-    t->tet() = 0;
+    t->tet() = nullptr;
 #ifdef GMSH_PRE_ALLOCATE_STRATEGY
     emptySlots.push(t);
     t->setDeleted(true);
diff --git a/Mesh/meshGRegionExtruded.cpp b/Mesh/meshGRegionExtruded.cpp
index 821d64e6019190b10089d260189fd62280a9d5c4..d90d2e5ac52c799f6794f4bd5c1de23aca4d27f7 100644
--- a/Mesh/meshGRegionExtruded.cpp
+++ b/Mesh/meshGRegionExtruded.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -164,7 +164,7 @@ static void extrudeMesh(GFace *from, GRegion *to, MVertexRTree &pos)
   // add all vertices on surface seams
   std::set<MVertex *> seam;
   std::vector<GEdge *> const &l_edges = from->edges();
-  for(std::vector<GEdge *>::const_iterator it = l_edges.begin();
+  for(auto it = l_edges.begin();
       it != l_edges.end(); ++it) {
     if((*it)->isSeam(from)) {
       seam.insert((*it)->mesh_vertices.begin(), (*it)->mesh_vertices.end());
@@ -240,13 +240,13 @@ static void insertAllVertices(GRegion *gr, MVertexRTree &pos)
   std::vector<MVertex*> embedded = gr->getEmbeddedMeshVertices();
   pos.insert(embedded);
   std::vector<GFace *> faces = gr->faces();
-  for(std::vector<GFace *>::iterator itf = faces.begin(); itf != faces.end();
+  for(auto itf = faces.begin(); itf != faces.end();
       itf++) {
     pos.insert((*itf)->mesh_vertices);
     std::vector<MVertex *> embedded = (*itf)->getEmbeddedMeshVertices();
     pos.insert(embedded);
     std::vector<GEdge *> const &edges = (*itf)->edges();
-    for(std::vector<GEdge *>::const_iterator ite = edges.begin(); ite != edges.end();
+    for(auto ite = edges.begin(); ite != edges.end();
         ite++) {
       pos.insert((*ite)->mesh_vertices);
       if((*ite)->getBeginVertex())
@@ -495,7 +495,7 @@ int SubdivideExtrudedMesh(GModel *m)
 #endif
 
   MVertexRTree pos(CTX::instance()->geom.tolerance * CTX::instance()->lc);
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
     ExtrudeParams *ep = (*it)->meshAttributes.extrude;
     if(ep && ep->mesh.ExtrudeMesh && ep->geo.Mode == EXTRUDED_ENTITY &&
        !ep->mesh.Recombine) {
@@ -586,7 +586,7 @@ int SubdivideExtrudedMesh(GModel *m)
   int nIter = 0;
   while(1) {
     int nPending = 0;
-    for(std::set<GFace *>::iterator it = faces.begin(); it != faces.end();
+    for(auto it = faces.begin(); it != faces.end();
         it++) {
       GFace *gf = *it;
       if(gf->meshStatistics.status == GFace::PENDING){
diff --git a/Mesh/meshGRegionHxt.cpp b/Mesh/meshGRegionHxt.cpp
index 02bb7e562f7b2a44d25c88ada13b0b09ba69ffe6..541f8fc82759937a0bcfe9c3a71c32dc0271ab1f 100644
--- a/Mesh/meshGRegionHxt.cpp
+++ b/Mesh/meshGRegionHxt.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -163,8 +163,8 @@ static HXTStatus Hxt2Gmsh(std::vector<GRegion *> &regions, HXTMesh *m,
   Msg::Debug("Start Hxt2Gmsh");
   std::vector<GFace *> allSurfaces;
   std::vector<GEdge *> allCurves;
-  HXT_CHECK(getAllSurfaces(regions, NULL, allSurfaces));
-  HXT_CHECK(getAllCurves(regions, allSurfaces, NULL, allCurves));
+  HXT_CHECK(getAllSurfaces(regions, nullptr, allSurfaces));
+  HXT_CHECK(getAllCurves(regions, allSurfaces, nullptr, allCurves));
   std::map<uint32_t, GEdge *> i2e;
   std::map<uint32_t, GFace *> i2f;
   for(size_t i = 0; i < allSurfaces.size(); i++)
@@ -173,7 +173,7 @@ static HXTStatus Hxt2Gmsh(std::vector<GRegion *> &regions, HXTMesh *m,
     i2e[allCurves[i]->tag()] = allCurves[i];
 
   c2v.resize(m->vertices.num);
-  for(size_t i = c2v.size(); i < m->vertices.num; i++) { c2v[i] = NULL; }
+  for(size_t i = c2v.size(); i < m->vertices.num; i++) { c2v[i] = nullptr; }
 
   for(size_t j = 0; j < allCurves.size(); j++) {
     GEdge *ge = allCurves[j];
@@ -197,7 +197,7 @@ static HXTStatus Hxt2Gmsh(std::vector<GRegion *> &regions, HXTMesh *m,
     uint32_t c = m->lines.color[i];
     MVertex *v0 = c2v[i0];
     MVertex *v1 = c2v[i1];
-    std::map<uint32_t, GEdge *>::iterator ge = i2e.find(c);
+    auto ge = i2e.find(c);
     if(ge == i2e.end()) {
       if(warning != c) {
         warning = c;
@@ -226,7 +226,7 @@ static HXTStatus Hxt2Gmsh(std::vector<GRegion *> &regions, HXTMesh *m,
     MVertex *v0 = c2v[i0];
     MVertex *v1 = c2v[i1];
     MVertex *v2 = c2v[i2];
-    std::map<uint32_t, GFace *>::iterator gf = i2f.find(c);
+    auto gf = i2f.find(c);
     if(gf == i2f.end()) {
       if(warning != c) {
         warning = c;
@@ -446,8 +446,8 @@ static HXTStatus _meshGRegionHxt(std::vector<GRegion *> &regions)
     1, // int refine;
     CTX::instance()->mesh.optimize, // int optimize;
     { // quality
-      0, // double (*callback)(.., userData)
-      0, // void* userData;
+      nullptr, // double (*callback)(.., userData)
+      nullptr, // void* userData;
       CTX::instance()->mesh.optimizeThreshold // double qualityMin;
     },
     { // nodalSize
@@ -494,8 +494,8 @@ static HXTStatus _delaunayMeshIn3DHxt(std::vector<MVertex *> &verts,
   mesh->vertices.size = nvert;
 
   HXTDelaunayOptions delOptions = {
-    NULL, // bbox
-    NULL, // nodalSizes
+    nullptr, // bbox
+    nullptr, // nodalSizes
     0, // numVertcesInMesh
     0, // insertionFirst
     0, // partitionability
diff --git a/Mesh/meshGRegionHxt.h b/Mesh/meshGRegionHxt.h
index 6f50d0d8d6ece9a9613d24724868365f89ecc45e..a37c6318a3377de6e01f997678e8772e0d9a67a6 100644
--- a/Mesh/meshGRegionHxt.h
+++ b/Mesh/meshGRegionHxt.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGRegionLocalMeshMod.cpp b/Mesh/meshGRegionLocalMeshMod.cpp
index a8bd1f761cb7200c5e58ce7794ceebb5352f6dc3..aae87d6bc0a2bfe9aef3d449c59d93d71a2b1362 100644
--- a/Mesh/meshGRegionLocalMeshMod.cpp
+++ b/Mesh/meshGRegionLocalMeshMod.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -401,7 +401,7 @@ bool faceSwap(std::vector<MTet4 *> &newTets, MTet4 *t1, int iLocalFace,
   MVertex *f1 = t1->tet()->getVertex(faces[iLocalFace][0]);
   MVertex *f2 = t1->tet()->getVertex(faces[iLocalFace][1]);
   MVertex *f3 = t1->tet()->getVertex(faces[iLocalFace][2]);
-  MVertex *v2 = 0;
+  MVertex *v2 = nullptr;
   for(int i = 0; i < 4; i++) {
     MVertex *v = t2->tet()->getVertex(i);
     if(v != f1 && v != f2 && v != f3) {
@@ -712,8 +712,8 @@ double smoothing_objective_function_3D(double X, double Y, double Z, MVertex *v,
   v->y() = Y;
   v->z() = Z;
 
-  std::vector<MTet4 *>::iterator it = ts.begin();
-  std::vector<MTet4 *>::iterator ite = ts.end();
+  auto it = ts.begin();
+  auto ite = ts.end();
   double qMin = 1, vol;
   while(it != ite) {
     qMin = std::min(
@@ -832,10 +832,10 @@ int LaplaceSmoothing(GRegion *gr)
   int N = 0;
   for(std::size_t i = 0; i < gr->mesh_vertices.size(); i++) {
     MVertex *v = gr->mesh_vertices[i];
-    std::multimap<MVertex *, MElement *>::iterator it =
+    auto it =
       vertexToElement.lower_bound(v);
-    std::multimap<MVertex *, MElement *>::iterator it_low = it;
-    std::multimap<MVertex *, MElement *>::iterator it_up =
+    auto it_low = it;
+    auto it_up =
       vertexToElement.upper_bound(v);
     double minQual = 1.e22;
     double volTot = 0.0;
diff --git a/Mesh/meshGRegionLocalMeshMod.h b/Mesh/meshGRegionLocalMeshMod.h
index 8c03804d96f01a0f906d8540f9a9d0f7d06db1c8..b7b73be119f36c5cf1d9ea9a7eb14b54d4c6fed9 100644
--- a/Mesh/meshGRegionLocalMeshMod.h
+++ b/Mesh/meshGRegionLocalMeshMod.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -32,7 +32,7 @@ bool smoothVertexOptimize(MTet4 *t, int iVertex,
 
 bool collapseVertex(std::vector<MTet4 *> &newTets, MTet4 *t, int iVertex,
                     int iTarget, const qmTetrahedron::Measures &cr,
-                    const localMeshModAction = GMSH_DOIT, double *result = 0);
+                    const localMeshModAction = GMSH_DOIT, double *result = nullptr);
 
 bool edgeSplit(std::vector<MTet4 *> &newTets, MTet4 *tet, MVertex *newVertex,
                int iLocalEdge, const qmTetrahedron::Measures &cr);
diff --git a/Mesh/meshGRegionMMG.cpp b/Mesh/meshGRegionMMG.cpp
index d61bc4615fbd42463728879d94f805a3f409b674..392101dbd40ffef470577b51e1c687b5a9ab5c47 100644
--- a/Mesh/meshGRegionMMG.cpp
+++ b/Mesh/meshGRegionMMG.cpp
@@ -33,7 +33,7 @@ static void MMG2gmsh(GRegion *gr, MMG5_pMesh mmg,
   int np, ne, nt, na, ref;
   double cx, cy, cz;
 
-  if(MMG3D_Get_meshSize(mmg, &np, &ne, NULL, &nt, NULL, &na) != 1)
+  if(MMG3D_Get_meshSize(mmg, &np, &ne, nullptr, &nt, nullptr, &na) != 1)
     Msg::Error("Mmg3d: unable to get mesh size");
 
   // Store the nodes from the Mmg structures into the gmsh structures
@@ -41,10 +41,10 @@ static void MMG2gmsh(GRegion *gr, MMG5_pMesh mmg,
   // TODO: when MMG is allowed to modify the surface mesh, reclassify nodes
   // accordingly
   for(int k = 1; k <= np; k++) {
-    if(MMG3D_Get_vertex(mmg, &cx, &cy, &cz, &ref, NULL, NULL) != 1)
+    if(MMG3D_Get_vertex(mmg, &cx, &cy, &cz, &ref, nullptr, nullptr) != 1)
       Msg::Error("Mmg3d: unable to get vertex %d", k);
 
-    std::map<int, MVertex *>::iterator it = mmg2gmsh.find(ref);
+    auto it = mmg2gmsh.find(ref);
 
     if(it == mmg2gmsh.end()) {
       MVertex *v = new MVertex(cx, cy, cz, gr);
@@ -58,7 +58,7 @@ static void MMG2gmsh(GRegion *gr, MMG5_pMesh mmg,
   // Store the tets from the Mmg structures into the Gmsh structures
   for(int k = 1; k <= ne; k++) {
     int v1mmg, v2mmg, v3mmg, v4mmg;
-    if(MMG3D_Get_tetrahedron(mmg, &v1mmg, &v2mmg, &v3mmg, &v4mmg, &ref, NULL) !=
+    if(MMG3D_Get_tetrahedron(mmg, &v1mmg, &v2mmg, &v3mmg, &v4mmg, &ref, nullptr) !=
        1)
       Msg::Error("Mmg3d: unable to get tetrahedron %d", k);
 
@@ -113,7 +113,7 @@ static void gmsh2MMG(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
   // Count boundary triangles
   std::vector<GFace *> f = gr->faces();
   int nt = 0;
-  for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); ++it) {
+  for(auto it = f.begin(); it != f.end(); ++it) {
     nt += (*it)->triangles.size();
   }
 
@@ -129,13 +129,13 @@ static void gmsh2MMG(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
     Msg::Error("Mmg3d: unable to set metric size");
 
   std::map<MVertex *, std::pair<double, int> > LCS;
-  for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); ++it) {
+  for(auto it = f.begin(); it != f.end(); ++it) {
     for(unsigned int i = 0; i < (*it)->triangles.size(); i++) {
       MTriangle *t = (*it)->triangles[i];
       double L = t->maxEdge();
       for(int k = 0; k < 3; k++) {
         MVertex *v = t->getVertex(k);
-        std::map<MVertex *, std::pair<double, int> >::iterator itv =
+        auto itv =
           LCS.find(v);
         if(itv != LCS.end()) {
           itv->second.first += L;
@@ -150,7 +150,7 @@ static void gmsh2MMG(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
 
   int k = 1;
   std::map<int, int> gmsh2mmg_num;
-  for(std::set<MVertex *>::iterator it = allVertices.begin();
+  for(auto it = allVertices.begin();
       it != allVertices.end(); ++it) {
     if(MMG3D_Set_vertex(mmg, (*it)->x(), (*it)->y(), (*it)->z(),
                         (*it)->getNum(), k) != 1)
@@ -171,7 +171,7 @@ static void gmsh2MMG(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
     // double lc = BGM_MeshSize(v->onWhat(), U, V, v->x(), v->y(), v->z());
     SMetric3 m = BGM_MeshMetric(v->onWhat(), U, V, v->x(), v->y(), v->z());
 
-    std::map<MVertex *, std::pair<double, int> >::iterator itv = LCS.find(v);
+    auto itv = LCS.find(v);
     if(itv != LCS.end()) {
       mmg2gmsh[(*it)->getNum()] = *it;
       // if (CTX::instance()->mesh.lcExtendFromBoundary){
@@ -201,7 +201,7 @@ static void gmsh2MMG(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
   }
 
   k = 1;
-  for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); ++it) {
+  for(auto it = f.begin(); it != f.end(); ++it) {
     for(unsigned int i = 0; i < (*it)->triangles.size(); i++) {
       if(MMG3D_Set_triangle(
            mmg, gmsh2mmg_num[(*it)->triangles[i]->getVertex(0)->getNum()],
@@ -221,13 +221,13 @@ static void updateSizes(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
 
   std::map<MVertex *, std::pair<double, int> > LCS;
   // if (CTX::instance()->mesh.lcExtendFromBoundary){
-  for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); ++it) {
+  for(auto it = f.begin(); it != f.end(); ++it) {
     for(unsigned int i = 0; i < (*it)->triangles.size(); i++) {
       MTriangle *t = (*it)->triangles[i];
       double L = t->maxEdge();
       for(int k = 0; k < 3; k++) {
         MVertex *v = t->getVertex(k);
-        std::map<MVertex *, std::pair<double, int> >::iterator itv =
+        auto itv =
           LCS.find(v);
         if(itv != LCS.end()) {
           itv->second.first += L;
@@ -243,18 +243,18 @@ static void updateSizes(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
 
   int np;
 
-  MMG3D_Get_meshSize(mmg, &np, NULL, NULL, NULL, NULL, NULL);
+  MMG3D_Get_meshSize(mmg, &np, nullptr, nullptr, nullptr, nullptr, nullptr);
   for(int k = 1; k <= np; k++) {
     double cx, cy, cz;
-    if(MMG3D_Get_vertex(mmg, &cx, &cy, &cz, NULL, NULL, NULL) != 1)
+    if(MMG3D_Get_vertex(mmg, &cx, &cy, &cz, nullptr, nullptr, nullptr) != 1)
       Msg::Error("Mmg3d: unable to get vertex %d", k);
 
     SMetric3 m = BGM_MeshMetric(gr, 0, 0, cx, cy, cz);
 
-    std::map<int, MVertex *>::iterator it = mmg2gmsh.find(k);
+    auto it = mmg2gmsh.find(k);
 
     if(it != mmg2gmsh.end() && CTX::instance()->mesh.lcExtendFromBoundary) {
-      std::map<MVertex *, std::pair<double, int> >::iterator itv =
+      auto itv =
         LCS.find(it->second);
       if(itv != LCS.end()) {
         double LL = itv->second.first / itv->second.second;
@@ -278,8 +278,8 @@ static void updateSizes(GRegion *gr, MMG5_pMesh mmg, MMG5_pSol sol,
 
 void refineMeshMMG(GRegion *gr)
 {
-  MMG5_pMesh mmg = NULL;
-  MMG5_pSol sol = NULL;
+  MMG5_pMesh mmg = nullptr;
+  MMG5_pSol sol = nullptr;
 
   std::map<int, MVertex *> mmg2gmsh;
 
@@ -302,7 +302,7 @@ void refineMeshMMG(GRegion *gr)
   for(int ITER = 0; ITER < iterMax; ITER++) {
     int nT, nTnow, np;
 
-    MMG3D_Get_meshSize(mmg, NULL, &nT, NULL, NULL, NULL, NULL);
+    MMG3D_Get_meshSize(mmg, nullptr, &nT, nullptr, nullptr, nullptr, nullptr);
 
     // Mmg parameters : verbosity + nosurf option
     int verb_mmg = (Msg::GetVerbosity() < 2) ? -1 : Msg::GetVerbosity() - 4;
@@ -325,7 +325,7 @@ void refineMeshMMG(GRegion *gr)
       Msg::Error("Mmg3d: failed (iteration %d)", ITER);
     }
     else {
-      MMG3D_Get_meshSize(mmg, &np, &nTnow, NULL, NULL, NULL, NULL);
+      MMG3D_Get_meshSize(mmg, &np, &nTnow, nullptr, nullptr, nullptr, nullptr);
       Msg::Info("Mmg3d: success (iteration %d) - %d nodes %d tetrahedra", ITER,
                 np, nTnow);
 
diff --git a/Mesh/meshGRegionMMG.h b/Mesh/meshGRegionMMG.h
index d4f58a50cce948e454c04f76fc5634b61725d35e..275ca37877b2d29945230df5a96011d97c02aacc 100644
--- a/Mesh/meshGRegionMMG.h
+++ b/Mesh/meshGRegionMMG.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGRegionNetgen.cpp b/Mesh/meshGRegionNetgen.cpp
index 833f8e13b2801fff236095b29d805843a0b2c5f4..2e692bccbafee9a88a00d7408351911829f63c93 100644
--- a/Mesh/meshGRegionNetgen.cpp
+++ b/Mesh/meshGRegionNetgen.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -28,7 +28,7 @@ static void getAllBoundingVertices(
   GRegion *gr, std::set<MVertex *, MVertexPtrLessThan> &allBoundingVertices)
 {
   std::vector<GFace *> faces = gr->faces();
-  std::vector<GFace *>::iterator it = faces.begin();
+  auto it = faces.begin();
 
   while(it != faces.end()) {
     GFace *gf = (*it);
@@ -52,7 +52,7 @@ static Ng_Mesh *buildNetgenStructure(GRegion *gr, bool importVolumeMesh,
   std::set<MVertex *, MVertexPtrLessThan> allBoundingVertices;
   getAllBoundingVertices(gr, allBoundingVertices);
 
-  std::set<MVertex *, MVertexPtrLessThan>::iterator itv =
+  auto itv =
     allBoundingVertices.begin();
   int I = 1;
   while(itv != allBoundingVertices.end()) {
@@ -77,7 +77,7 @@ static Ng_Mesh *buildNetgenStructure(GRegion *gr, bool importVolumeMesh,
     }
   }
   std::vector<GFace *> faces = gr->faces();
-  std::vector<GFace *>::iterator it = faces.begin();
+  auto it = faces.begin();
   while(it != faces.end()) {
     GFace *gf = (*it);
     for(std::size_t i = 0; i < gf->triangles.size(); i++) {
@@ -199,7 +199,7 @@ static void setRand(double r[6])
 static void meshNormalsPointOutOfTheRegion(GRegion *gr)
 {
   std::vector<GFace *> faces = gr->faces();
-  std::vector<GFace *>::iterator it = faces.begin();
+  auto it = faces.begin();
 
   // perform intersection check in normalized coordinates
   SBoundingBox3d bbox = gr->bounds();
@@ -242,7 +242,7 @@ static void meshNormalsPointOutOfTheRegion(GRegion *gr)
       N[1] += rrr[2] * v1[1] + rrr[3] * v2[1];
       N[2] += rrr[4] * v1[2] + rrr[5] * v2[2];
       norme(N);
-      std::vector<GFace *>::iterator it_b = faces.begin();
+      auto it_b = faces.begin();
       while(it_b != faces.end()) {
         GFace *gf_b = (*it_b);
         for(std::size_t i_b = 0; i_b < gf_b->triangles.size(); i_b++) {
@@ -306,7 +306,7 @@ void meshGRegionNetgen(GRegion *gr)
 #else
   // sanity check for frontal algo
   std::vector<GFace *> faces = gr->faces();
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end(); it++) {
+  for(auto it = faces.begin(); it != faces.end(); it++) {
     if((*it)->quadrangles.size()) {
       Msg::Error("Cannot use frontal 3D algorithm with quadrangles on boundary");
       return;
diff --git a/Mesh/meshGRegionNetgen.h b/Mesh/meshGRegionNetgen.h
index 11745c7aa9177ed4cb3619158cbd7d9701f009fc..4deebb8df04ac7ef0a20a87ebdedc1a852b435c4 100644
--- a/Mesh/meshGRegionNetgen.h
+++ b/Mesh/meshGRegionNetgen.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshGRegionTransfinite.cpp b/Mesh/meshGRegionTransfinite.cpp
index 046304f8d407e25d3c4a26fc07324608b24599ee..da8f27991f7571911882e6416a938234f142d963 100644
--- a/Mesh/meshGRegionTransfinite.cpp
+++ b/Mesh/meshGRegionTransfinite.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -149,7 +149,7 @@ private:
 
 public:
   GOrientedTransfiniteFace()
-    : _gf(0), _ll(0), _hh(0), _permutation(-1), _index(-1)
+    : _gf(nullptr), _ll(0), _hh(0), _permutation(-1), _index(-1)
   {
   }
   GOrientedTransfiniteFace(GFace *gf, std::vector<MVertex *> &corners)
@@ -247,7 +247,7 @@ public:
     case 6: index = (M * N - N * (m + 1) + n); break;
     case 7: index = (m + M * n); break;
     }
-    MVertex *v = 0;
+    MVertex *v = nullptr;
     if(index >= 0 && index < (int)_list.size()) v = _list[index];
     if(index < 0 || index >= (int)_list.size() || !v) {
       Msg::Error("Wrong index in transfinite mesh of surface %d: "
@@ -269,7 +269,7 @@ void findTransfiniteCorners(GRegion *gr, std::vector<MVertex *> &corners)
   else {
     // try to find the corners automatically
     std::vector<GFace *> faces = gr->faces();
-    GFace *gf = 0;
+    GFace *gf = nullptr;
     if(faces.size() == 6) {
       // any face will do as a starting face
       gf = faces.front();
@@ -323,7 +323,7 @@ int MeshTransfiniteVolume(GRegion *gr)
   // make sure that all bounding edges have begin/end points: everything in here
   // depends on it
   const std::vector<GEdge *> &edges = gr->edges();
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); it++) {
     if(!(*it)->getBeginVertex() || !(*it)->getEndVertex()) {
       Msg::Error("Transfinite algorithm cannot be applied with curve %d which "
@@ -342,7 +342,7 @@ int MeshTransfiniteVolume(GRegion *gr)
   }
 
   std::vector<GOrientedTransfiniteFace> orientedFaces(6);
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       ++it) {
     GOrientedTransfiniteFace f(*it, corners);
     if(f.index() < 0) {
diff --git a/Mesh/meshMetric.cpp b/Mesh/meshMetric.cpp
index cd907fc353341b4f5097e42ad9f78b288f217f5d..9b8c7c87bc9f0079452a91c0e174f582c7bb1f3e 100644
--- a/Mesh/meshMetric.cpp
+++ b/Mesh/meshMetric.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -21,7 +21,7 @@ meshMetric::meshMetric(GModel *gm)
   std::map<MElement *, MElement *> newD;
 
   if(_dim == 2) {
-    for(GModel::fiter fit = gm->firstFace(); fit != gm->lastFace(); ++fit) {
+    for(auto fit = gm->firstFace(); fit != gm->lastFace(); ++fit) {
       for(std::size_t i = 0; i < (*fit)->getNumMeshElements(); i++) {
         MElement *e = (*fit)->getMeshElement(i);
         MElement *copy = e->copy(_vertexMap, newP, newD);
@@ -30,7 +30,7 @@ meshMetric::meshMetric(GModel *gm)
     }
   }
   else if(_dim == 3) {
-    for(GModel::riter rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
+    for(auto rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
       for(std::size_t i = 0; i < (*rit)->getNumMeshElements(); i++) {
         MElement *e = (*rit)->getMeshElement(i);
         MElement *copy = e->copy(_vertexMap, newP, newD);
@@ -82,7 +82,7 @@ void meshMetric::updateMetrics()
     return;
   }
 
-  v2t_cont ::iterator it = _adj.begin();
+  auto it = _adj.begin();
   for(; it != _adj.end(); it++) {
     MVertex *ver = it->first;
     _nodalMetrics[ver] = setOfMetrics[0][ver];
@@ -120,8 +120,8 @@ void meshMetric::exportInfo(const char *fileendname)
   out_ls << "View \"ls\"{" << std::endl;
   out_hess << "View \"hessian\"{" << std::endl;
   out_hessmat << "View \"hessian_mat\"{" << std::endl;
-  std::vector<MElement *>::iterator itelem = _elements.begin();
-  std::vector<MElement *>::iterator itelemen = _elements.end();
+  auto itelem = _elements.begin();
+  auto itelemen = _elements.end();
   for(; itelem != itelemen; itelem++) {
     MElement *e = *itelem;
     if(e->getDim() == 2) {
@@ -214,7 +214,7 @@ meshMetric::~meshMetric()
 
 void meshMetric::computeValues()
 {
-  v2t_cont ::iterator it = _adj.begin();
+  auto it = _adj.begin();
   while(it != _adj.end()) {
     std::vector<MElement *> lt = it->second;
     MVertex *ver = it->first;
@@ -241,10 +241,10 @@ std::vector<MVertex *> getLSBlob(std::size_t minNbPt, v2t_cont::iterator it,
     bvv = vv; // Vector of vertices in blob and in boundary of blob
   do {
     std::set<MVertex *> nbvv; // Set of vertices in new boundary
-    for(std::vector<MVertex *>::iterator itBV = bvv.begin(); itBV != bvv.end();
+    for(auto itBV = bvv.begin(); itBV != bvv.end();
         itBV++) { // For each boundary vertex...
       std::vector<MElement *> &adjBV = adj[*itBV];
-      for(std::vector<MElement *>::iterator itBVEl = adjBV.begin();
+      for(auto itBVEl = adjBV.begin();
           itBVEl != adjBV.end(); itBVEl++) {
         for(std::size_t iV = 0; iV < (*itBVEl)->getNumVertices();
             iV++) { // ... look for adjacent vertices...
@@ -278,7 +278,7 @@ void meshMetric::computeHessian()
   std::size_t sysDim = (_dim == 2) ? 6 : 10;
   std::size_t minNbPtBlob = 3 * sysDim;
 
-  for(v2t_cont::iterator it = _adj.begin(); it != _adj.end(); it++) {
+  for(auto it = _adj.begin(); it != _adj.end(); it++) {
     MVertex *ver = it->first;
     std::vector<MVertex *> vv = getLSBlob(minNbPtBlob, it, _adj);
     fullMatrix<double> A(vv.size(), sysDim), ATA(sysDim, sysDim);
@@ -409,11 +409,11 @@ void meshMetric::computeMetricHessian(MVertex *ver, SMetric3 &hessian,
                                       double y, double z)
 {
   SVector3 gr;
-  if(ver != NULL) {
+  if(ver != nullptr) {
     gr = grads[ver];
     hessian = hessians[ver];
   }
-  else if(ver == NULL) {
+  else if(ver == nullptr) {
     _fct->gradient(x, y, z, gr(0), gr(1), gr(2));
     _fct->hessian(x, y, z, hessian(0, 0), hessian(0, 1), hessian(0, 2),
                   hessian(1, 0), hessian(1, 1), hessian(1, 2), hessian(2, 0),
@@ -724,7 +724,7 @@ void meshMetric::scaleMetric(int nbElementsTarget, nodalMetricTensor &nmt)
     }
   }
   double scale = pow((double)nbElementsTarget / N, 2.0 / _dim);
-  for(nodalMetricTensor::iterator it = nmt.begin(); it != nmt.end(); ++it) {
+  for(auto it = nmt.begin(); it != nmt.end(); ++it) {
     if(_dim == 3) {
       it->second *= scale;
     }
@@ -766,7 +766,7 @@ void meshMetric::computeMetric(int metricNumber)
   computeValues();
   computeHessian();
 
-  for(v2t_cont::iterator it = _adj.begin(); it != _adj.end(); it++) {
+  for(auto it = _adj.begin(); it != _adj.end(); it++) {
     MVertex *ver = it->first;
     SMetric3 hessian, metric;
     double size;
@@ -817,7 +817,7 @@ double meshMetric::operator()(double x, double y, double z, GEntity *ge)
   else {
     Msg::Warning("point %g %g %g not found, looking for nearest node", x, y, z);
     double minDist = 1.e100;
-    for(nodalField::iterator it = _nodalSizes.begin(); it != _nodalSizes.end();
+    for(auto it = _nodalSizes.begin(); it != _nodalSizes.end();
         it++) {
       const double dist = xyz.distance(it->first->point());
       if(dist <= minDist) {
@@ -853,22 +853,22 @@ void meshMetric::operator()(double x, double y, double z, SMetric3 &metr,
         double size;
         switch(_technique) {
         case(LEVELSET):
-          computeMetricLevelSet(NULL, hessian, metric, size, x, y, z);
+          computeMetricLevelSet(nullptr, hessian, metric, size, x, y, z);
           break;
         case(HESSIAN):
-          computeMetricHessian(NULL, hessian, metric, size, x, y, z);
+          computeMetricHessian(nullptr, hessian, metric, size, x, y, z);
           break;
         case(FREY):
-          computeMetricFrey(NULL, hessian, metric, size, x, y, z);
+          computeMetricFrey(nullptr, hessian, metric, size, x, y, z);
           break;
         case(EIGENDIRECTIONS):
-          computeMetricEigenDir(NULL, hessian, metric, size, x, y, z);
+          computeMetricEigenDir(nullptr, hessian, metric, size, x, y, z);
           break;
         case(EIGENDIRECTIONS_LINEARINTERP_H):
-          computeMetricEigenDir(NULL, hessian, metric, size, x, y, z);
+          computeMetricEigenDir(nullptr, hessian, metric, size, x, y, z);
           break;
         case(ISOTROPIC_LINEARINTERP_H):
-          computeMetricIsoLinInterp(NULL, hessian, metric, size, x, y, z);
+          computeMetricIsoLinInterp(nullptr, hessian, metric, size, x, y, z);
           break;
         }
         newSetOfMetrics[iMetric] = metric;
@@ -929,7 +929,7 @@ void meshMetric::operator()(double x, double y, double z, SMetric3 &metr,
       Msg::Warning("point %g %g %g not found, looking for nearest node", x, y,
                    z);
       double minDist = 1.e100;
-      for(nodalMetricTensor::iterator it = _nodalMetrics.begin();
+      for(auto it = _nodalMetrics.begin();
           it != _nodalMetrics.end(); it++) {
         const double dist = xyz.distance(it->first->point());
         if(dist <= minDist) {
diff --git a/Mesh/meshMetric.h b/Mesh/meshMetric.h
index 6a87f1c7eee07c5f27a1b38719a9848ae1a22ea8..5b6e9c4c6aa992d99c3c73dd714b7f24a3a8a525 100644
--- a/Mesh/meshMetric.h
+++ b/Mesh/meshMetric.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -140,9 +140,9 @@ public:
 
   // get metric at point(x,y,z)  (previously computes intersection of metrics if
   // not done yet)
-  virtual double operator()(double x, double y, double z, GEntity *ge = 0);
+  virtual double operator()(double x, double y, double z, GEntity *ge = nullptr);
   virtual void operator()(double x, double y, double z, SMetric3 &metr,
-                          GEntity *ge = 0);
+                          GEntity *ge = nullptr);
 
   // export pos files of fct, fct gradients (fct is the lattest fct passed to
   // meshMetric !!) and resulting metric (intersection of all computed metrics)
diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp
index 94bb11e7b2c6cd1da3e19ad33be3adbdab7c7513..5b65845f2779b9ae307a5de65e1b8b1aca846594 100644
--- a/Mesh/meshPartition.cpp
+++ b/Mesh/meshPartition.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -117,8 +117,8 @@ private:
 
 public:
   Graph(GModel *model)
-    : _model(model), _nparts(0), _ne(0), _nn(0), _dim(0), _xadj(0), _adjncy(0),
-      _vwgt(0)
+    : _model(model), _nparts(0), _ne(0), _nn(0), _dim(0), _xadj(nullptr), _adjncy(nullptr),
+      _vwgt(nullptr)
   {
   }
   ~Graph() { clear(); }
@@ -157,7 +157,7 @@ public:
   void elementResize(std::size_t size)
   {
     _element.clear();
-    _element.resize(size, 0);
+    _element.resize(size, nullptr);
   }
   void element(std::size_t i, MElement *element) { _element[i] = element; };
   void vertexResize(std::size_t size)
@@ -177,26 +177,26 @@ public:
   {
     if(_xadj) {
       delete[] _xadj;
-      _xadj = 0;
+      _xadj = nullptr;
     }
     if(_adjncy) {
       delete[] _adjncy;
-      _adjncy = 0;
+      _adjncy = nullptr;
     }
     if(_vwgt) {
       delete[] _vwgt;
-      _vwgt = 0;
+      _vwgt = nullptr;
     }
   }
   void clearDualGraph()
   {
     if(_xadj) {
       delete[] _xadj;
-      _xadj = 0;
+      _xadj = nullptr;
     }
     if(_adjncy) {
       delete[] _adjncy;
-      _adjncy = 0;
+      _adjncy = nullptr;
     }
   }
   void eraseVertex()
@@ -222,7 +222,7 @@ public:
   }
   void assignGhostCells()
   {
-    std::vector<GEntity *> ghostEntities(_nparts, (GEntity *)NULL);
+    std::vector<GEntity *> ghostEntities(_nparts, (GEntity *)nullptr);
     int elementaryNumber = _model->getMaxElementaryNumber(_dim);
     for(std::size_t i = 1; i <= _nparts; i++) {
       switch(_dim) {
@@ -441,7 +441,7 @@ static std::size_t getSizeOfEind(GModel *model)
 {
   std::size_t size = 0;
   // Loop over volumes
-  for(GModel::const_riter it = model->firstRegion(); it != model->lastRegion();
+  for(auto it = model->firstRegion(); it != model->lastRegion();
       ++it) {
     size += 4 * (*it)->tetrahedra.size();
     size += 8 * (*it)->hexahedra.size();
@@ -451,20 +451,20 @@ static std::size_t getSizeOfEind(GModel *model)
   }
 
   // Loop over surfaces
-  for(GModel::const_fiter it = model->firstFace(); it != model->lastFace();
+  for(auto it = model->firstFace(); it != model->lastFace();
       ++it) {
     size += 3 * (*it)->triangles.size();
     size += 4 * (*it)->quadrangles.size();
   }
 
   // Loop over curves
-  for(GModel::const_eiter it = model->firstEdge(); it != model->lastEdge();
+  for(auto it = model->firstEdge(); it != model->lastEdge();
       ++it) {
     size += 2 * (*it)->lines.size();
   }
 
   // Loop over points
-  for(GModel::const_viter it = model->firstVertex(); it != model->lastVertex();
+  for(auto it = model->firstVertex(); it != model->lastVertex();
       ++it) {
     size += 1 * (*it)->points.size();
   }
@@ -541,7 +541,7 @@ static int makeGraph(GModel *model, Graph &graph, int selectDim)
 
   // Loop over volumes
   if(selectDim < 0 || selectDim == 3) {
-    for(GModel::const_riter it = model->firstRegion();
+    for(auto it = model->firstRegion();
         it != model->lastRegion(); ++it) {
       GRegion *r = *it;
       fillElementsToNodesMap(graph, r, eptrIndex, eindIndex, numVertex,
@@ -559,7 +559,7 @@ static int makeGraph(GModel *model, Graph &graph, int selectDim)
 
   // Loop over surfaces
   if(selectDim < 0 || selectDim == 2) {
-    for(GModel::const_fiter it = model->firstFace(); it != model->lastFace();
+    for(auto it = model->firstFace(); it != model->lastFace();
         ++it) {
       GFace *f = *it;
       fillElementsToNodesMap(graph, f, eptrIndex, eindIndex, numVertex,
@@ -571,7 +571,7 @@ static int makeGraph(GModel *model, Graph &graph, int selectDim)
 
   // Loop over curves
   if(selectDim < 0 || selectDim == 1) {
-    for(GModel::const_eiter it = model->firstEdge(); it != model->lastEdge();
+    for(auto it = model->firstEdge(); it != model->lastEdge();
         ++it) {
       GEdge *e = *it;
       fillElementsToNodesMap(graph, e, eptrIndex, eindIndex, numVertex,
@@ -581,7 +581,7 @@ static int makeGraph(GModel *model, Graph &graph, int selectDim)
 
   // Loop over points
   if(selectDim < 0 || selectDim == 0) {
-    for(GModel::const_viter it = model->firstVertex();
+    for(auto it = model->firstVertex();
         it != model->lastVertex(); ++it) {
       GVertex *v = *it;
       fillElementsToNodesMap(graph, v, eptrIndex, eindIndex, numVertex,
@@ -704,13 +704,13 @@ static int partitionGraph(Graph &graph, bool verbose)
 
     if(metisOptions[METIS_OPTION_PTYPE] == METIS_PTYPE_KWAY) {
       metisError = METIS_PartGraphKway(&ne, &ncon, graph.xadj(), graph.adjncy(),
-                                       graph.vwgt(), 0, 0, &numPart, 0, 0,
+                                       graph.vwgt(), nullptr, nullptr, &numPart, nullptr, nullptr,
                                        metisOptions, &objval, &epart[0]);
     }
     else {
       metisError = METIS_PartGraphRecursive(
-        &ne, &ncon, graph.xadj(), graph.adjncy(), graph.vwgt(), 0, 0, &numPart,
-        0, 0, metisOptions, &objval, &epart[0]);
+        &ne, &ncon, graph.xadj(), graph.adjncy(), graph.vwgt(), nullptr, nullptr, &numPart,
+        nullptr, nullptr, metisOptions, &objval, &epart[0]);
     }
 
     switch(metisError) {
@@ -790,7 +790,7 @@ static void removeVerticesEntity(ITERATOR it_beg, ITERATOR it_end)
     for(std::size_t i = 0; i < (*it)->getNumMeshElements(); i++) {
       for(std::size_t j = 0; j < (*it)->getMeshElement(i)->getNumVertices();
           j++) {
-        (*it)->getMeshElement(i)->getVertex(j)->setEntity(0);
+        (*it)->getMeshElement(i)->getVertex(j)->setEntity(nullptr);
       }
     }
     (*it)->mesh_vertices.clear();
@@ -806,19 +806,19 @@ static void assignMeshVertices(GModel *model)
   removeVerticesEntity(model->firstRegion(), model->lastRegion());
 
   // Loop over points
-  for(GModel::const_viter it = model->firstVertex(); it != model->lastVertex();
+  for(auto it = model->firstVertex(); it != model->lastVertex();
       ++it) {
     setVerticesToEntity(*it, (*it)->points.begin(), (*it)->points.end());
   }
 
   // Loop over curves
-  for(GModel::const_eiter it = model->firstEdge(); it != model->lastEdge();
+  for(auto it = model->firstEdge(); it != model->lastEdge();
       ++it) {
     setVerticesToEntity(*it, (*it)->lines.begin(), (*it)->lines.end());
   }
 
   // Loop over surfaces
-  for(GModel::const_fiter it = model->firstFace(); it != model->lastFace();
+  for(auto it = model->firstFace(); it != model->lastFace();
       ++it) {
     setVerticesToEntity(*it, (*it)->triangles.begin(), (*it)->triangles.end());
     setVerticesToEntity(*it, (*it)->quadrangles.begin(),
@@ -826,7 +826,7 @@ static void assignMeshVertices(GModel *model)
   }
 
   // Loop over volumes
-  for(GModel::const_riter it = model->firstRegion(); it != model->lastRegion();
+  for(auto it = model->firstRegion(); it != model->lastRegion();
       ++it) {
     setVerticesToEntity(*it, (*it)->tetrahedra.begin(),
                         (*it)->tetrahedra.end());
@@ -911,7 +911,7 @@ divideNonConnectedEntities(GModel *model, int dim,
   if(dim < 0 || dim == 0) {
     int elementaryNumber = model->getMaxElementaryNumber(0);
 
-    for(GModel::const_viter it = vertices.begin(); it != vertices.end(); ++it) {
+    for(auto it = vertices.begin(); it != vertices.end(); ++it) {
       if((*it)->geomType() == GEntity::PartitionPoint) {
         partitionVertex *vertex = static_cast<partitionVertex *>(*it);
 
@@ -931,7 +931,7 @@ divideNonConnectedEntities(GModel *model, int dim,
             // Move B-Rep
             std::vector<GEdge *> BRepEdges = vertex->edges();
             if(!BRepEdges.empty()) {
-              for(std::vector<GEdge *>::iterator itBRep = BRepEdges.begin();
+              for(auto itBRep = BRepEdges.begin();
                   itBRep != BRepEdges.end(); ++itBRep) {
                 if(vertex == (*itBRep)->getBeginVertex()) {
                   (*itBRep)->setVertex(pvertex, 1);
@@ -970,7 +970,7 @@ divideNonConnectedEntities(GModel *model, int dim,
 
     int elementaryNumber = model->getMaxElementaryNumber(1);
 
-    for(GModel::const_eiter it = edges.begin(); it != edges.end(); ++it) {
+    for(auto it = edges.begin(); it != edges.end(); ++it) {
       if((*it)->geomType() == GEntity::PartitionCurve) {
         partitionEdge *edge = static_cast<partitionEdge *>(*it);
 
@@ -1008,7 +1008,7 @@ divideNonConnectedEntities(GModel *model, int dim,
           oldOrientations.reserve(BRepFaces.size());
 
           if(!BRepFaces.empty()) {
-            for(std::vector<GFace *>::iterator itBRep = BRepFaces.begin();
+            for(auto itBRep = BRepFaces.begin();
                 itBRep != BRepFaces.end(); ++itBRep) {
               oldOrientations.push_back((*itBRep)->delEdge(edge));
             }
@@ -1017,12 +1017,12 @@ divideNonConnectedEntities(GModel *model, int dim,
           for(std::size_t i = 0; i < connectedElements.size(); i++) {
             // Create the new partitionEdge
             partitionEdge *pedge = new partitionEdge(
-              model, ++elementaryNumber, 0, 0, edge->getPartitions());
+              model, ++elementaryNumber, nullptr, nullptr, edge->getPartitions());
             // Assign parent entity
             pedge->setParentEntity(edge->getParentEntity());
             // Add to model
             model->add(pedge);
-            for(std::set<MElement *, MElementPtrLessThan>::iterator itSet =
+            for(auto itSet =
                   connectedElements[i].begin();
                 itSet != connectedElements[i].end(); ++itSet) {
               // Add elements
@@ -1031,7 +1031,7 @@ divideNonConnectedEntities(GModel *model, int dim,
             // Move B-Rep
             if(BRepFaces.size() > 0) {
               std::size_t i = 0;
-              for(std::vector<GFace *>::iterator itBRep = BRepFaces.begin();
+              for(auto itBRep = BRepFaces.begin();
                   itBRep != BRepFaces.end(); ++itBRep) {
                 (*itBRep)->setEdge(pedge, oldOrientations[i]);
                 pedge->addFace(*itBRep);
@@ -1067,7 +1067,7 @@ divideNonConnectedEntities(GModel *model, int dim,
 
     int elementaryNumber = model->getMaxElementaryNumber(2);
 
-    for(GModel::const_fiter it = faces.begin(); it != faces.end(); ++it) {
+    for(auto it = faces.begin(); it != faces.end(); ++it) {
       if((*it)->geomType() == GEntity::PartitionSurface) {
         partitionFace *face = static_cast<partitionFace *>(*it);
 
@@ -1105,7 +1105,7 @@ divideNonConnectedEntities(GModel *model, int dim,
           std::list<GRegion *> BRepRegions = face->regions();
           std::vector<int> oldOrientations;
           if(BRepRegions.size() > 0) {
-            for(std::list<GRegion *>::iterator itBRep = BRepRegions.begin();
+            for(auto itBRep = BRepRegions.begin();
                 itBRep != BRepRegions.end(); ++itBRep) {
               oldOrientations.push_back((*itBRep)->delFace(face));
             }
@@ -1119,7 +1119,7 @@ divideNonConnectedEntities(GModel *model, int dim,
             pface->setParentEntity(face->getParentEntity());
             // Add to model
             model->add(pface);
-            for(std::set<MElement *, MElementPtrLessThan>::iterator itSet =
+            for(auto itSet =
                   connectedElements[i].begin();
                 itSet != connectedElements[i].end(); ++itSet) {
               // Add elements
@@ -1128,7 +1128,7 @@ divideNonConnectedEntities(GModel *model, int dim,
             // Move B-Rep
             if(BRepRegions.size() > 0) {
               std::size_t i = 0;
-              for(std::list<GRegion *>::iterator itBRep = BRepRegions.begin();
+              for(auto itBRep = BRepRegions.begin();
                   itBRep != BRepRegions.end(); ++itBRep) {
                 (*itBRep)->setFace(pface, oldOrientations[i]);
                 pface->addRegion(*itBRep);
@@ -1165,7 +1165,7 @@ divideNonConnectedEntities(GModel *model, int dim,
 
     int elementaryNumber = model->getMaxElementaryNumber(3);
 
-    for(GModel::const_riter it = regions.begin(); it != regions.end(); ++it) {
+    for(auto it = regions.begin(); it != regions.end(); ++it) {
       if((*it)->geomType() == GEntity::PartitionVolume) {
         partitionRegion *region = static_cast<partitionRegion *>(*it);
 
@@ -1217,7 +1217,7 @@ divideNonConnectedEntities(GModel *model, int dim,
             pregion->setParentEntity(region->getParentEntity());
             // Add to model
             model->add(pregion);
-            for(std::set<MElement *, MElementPtrLessThan>::iterator itSet =
+            for(auto itSet =
                   connectedElements[i].begin();
                 itSet != connectedElements[i].end(); ++itSet) {
               // Add elements
@@ -1252,8 +1252,8 @@ static void createNewEntities(GModel *model, hashmapelementpart &elmToPartition)
   std::set<GVertex *, GEntityPtrLessThan> vertices = model->getVertices();
 
   int elementaryNumber = model->getMaxElementaryNumber(0);
-  for(GModel::const_viter it = vertices.begin(); it != vertices.end(); ++it) {
-    std::vector<partitionVertex *> newVertices(model->getNumPartitions(), 0);
+  for(auto it = vertices.begin(); it != vertices.end(); ++it) {
+    std::vector<partitionVertex *> newVertices(model->getNumPartitions(), nullptr);
 
     assignElementsToEntities(model, elmToPartition, newVertices,
                              (*it)->points.begin(), (*it)->points.end(),
@@ -1271,8 +1271,8 @@ static void createNewEntities(GModel *model, hashmapelementpart &elmToPartition)
   }
 
   elementaryNumber = model->getMaxElementaryNumber(1);
-  for(GModel::const_eiter it = edges.begin(); it != edges.end(); ++it) {
-    std::vector<partitionEdge *> newEdges(model->getNumPartitions(), 0);
+  for(auto it = edges.begin(); it != edges.end(); ++it) {
+    std::vector<partitionEdge *> newEdges(model->getNumPartitions(), nullptr);
 
     assignElementsToEntities(model, elmToPartition, newEdges,
                              (*it)->lines.begin(), (*it)->lines.end(),
@@ -1290,8 +1290,8 @@ static void createNewEntities(GModel *model, hashmapelementpart &elmToPartition)
   }
 
   elementaryNumber = model->getMaxElementaryNumber(2);
-  for(GModel::const_fiter it = faces.begin(); it != faces.end(); ++it) {
-    std::vector<partitionFace *> newFaces(model->getNumPartitions(), 0);
+  for(auto it = faces.begin(); it != faces.end(); ++it) {
+    std::vector<partitionFace *> newFaces(model->getNumPartitions(), nullptr);
 
     assignElementsToEntities(model, elmToPartition, newFaces,
                              (*it)->triangles.begin(), (*it)->triangles.end(),
@@ -1314,8 +1314,8 @@ static void createNewEntities(GModel *model, hashmapelementpart &elmToPartition)
   }
 
   elementaryNumber = model->getMaxElementaryNumber(3);
-  for(GModel::const_riter it = regions.begin(); it != regions.end(); ++it) {
-    std::vector<partitionRegion *> newRegions(model->getNumPartitions(), 0);
+  for(auto it = regions.begin(); it != regions.end(); ++it) {
+    std::vector<partitionRegion *> newRegions(model->getNumPartitions(), nullptr);
 
     assignElementsToEntities(model, elmToPartition, newRegions,
                              (*it)->tetrahedra.begin(), (*it)->tetrahedra.end(),
@@ -1363,22 +1363,22 @@ static void fillElementToEntity(GModel *model, hashmapelement &elmToEntity,
 {
   // Loop over volumes
   if(dim < 0 || dim == 3) {
-    for(GModel::const_riter it = model->firstRegion();
+    for(auto it = model->firstRegion();
         it != model->lastRegion(); ++it) {
-      for(std::vector<MTetrahedron *>::iterator itElm =
+      for(auto itElm =
             (*it)->tetrahedra.begin();
           itElm != (*it)->tetrahedra.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
-      for(std::vector<MHexahedron *>::iterator itElm = (*it)->hexahedra.begin();
+      for(auto itElm = (*it)->hexahedra.begin();
           itElm != (*it)->hexahedra.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
-      for(std::vector<MPrism *>::iterator itElm = (*it)->prisms.begin();
+      for(auto itElm = (*it)->prisms.begin();
           itElm != (*it)->prisms.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
-      for(std::vector<MPyramid *>::iterator itElm = (*it)->pyramids.begin();
+      for(auto itElm = (*it)->pyramids.begin();
           itElm != (*it)->pyramids.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
-      for(std::vector<MTrihedron *>::iterator itElm = (*it)->trihedra.begin();
+      for(auto itElm = (*it)->trihedra.begin();
           itElm != (*it)->trihedra.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
     }
@@ -1386,12 +1386,12 @@ static void fillElementToEntity(GModel *model, hashmapelement &elmToEntity,
 
   // Loop over surfaces
   if(dim < 0 || dim == 2) {
-    for(GModel::const_fiter it = model->firstFace(); it != model->lastFace();
+    for(auto it = model->firstFace(); it != model->lastFace();
         ++it) {
-      for(std::vector<MTriangle *>::iterator itElm = (*it)->triangles.begin();
+      for(auto itElm = (*it)->triangles.begin();
           itElm != (*it)->triangles.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
-      for(std::vector<MQuadrangle *>::iterator itElm =
+      for(auto itElm =
             (*it)->quadrangles.begin();
           itElm != (*it)->quadrangles.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
@@ -1400,9 +1400,9 @@ static void fillElementToEntity(GModel *model, hashmapelement &elmToEntity,
 
   // Loop over curves
   if(dim < 0 || dim == 1) {
-    for(GModel::const_eiter it = model->firstEdge(); it != model->lastEdge();
+    for(auto it = model->firstEdge(); it != model->lastEdge();
         ++it) {
-      for(std::vector<MLine *>::iterator itElm = (*it)->lines.begin();
+      for(auto itElm = (*it)->lines.begin();
           itElm != (*it)->lines.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
     }
@@ -1410,9 +1410,9 @@ static void fillElementToEntity(GModel *model, hashmapelement &elmToEntity,
 
   // Loop over points
   if(dim < 0 || dim == 0) {
-    for(GModel::const_viter it = model->firstVertex();
+    for(auto it = model->firstVertex();
         it != model->lastVertex(); ++it) {
-      for(std::vector<MPoint *>::iterator itElm = (*it)->points.begin();
+      for(auto itElm = (*it)->points.begin();
           itElm != (*it)->points.end(); ++itElm)
         elmToEntity.insert(std::pair<MElement *, GEntity *>(*itElm, *it));
     }
@@ -1448,7 +1448,7 @@ static MElement *getReferenceElement(
         break;
       }
     }
-    if(isEqual) return 0;
+    if(isEqual) return nullptr;
   }
 
   while(minSizeElementPairs.size() > 1) {
@@ -1503,7 +1503,7 @@ static PART_ENTITY *createPartitionEntity(
   GEntity *referenceEntity, PART_ENTITY **newEntity,
   typename std::multimap<PART_ENTITY *, GEntity *, LESS_PART_ENTITY> &pentities)
 {
-  PART_ENTITY *ppe = 0;
+  PART_ENTITY *ppe = nullptr;
   // Create the new partition entity for the mesh
   if(ret.first == ret.second) {
     // Create new entity and add them to the model
@@ -1514,8 +1514,7 @@ static PART_ENTITY *createPartitionEntity(
     *newEntity = ppe;
   }
   else {
-    for(typename std::multimap<PART_ENTITY *, GEntity *,
-                               LESS_PART_ENTITY>::iterator it = ret.first;
+    for(auto it = ret.first;
         it != ret.second; ++it) {
       if(referenceEntity == it->second) { ppe = it->first; }
     }
@@ -1539,7 +1538,7 @@ static partitionFace *assignPartitionBoundary(
   std::multimap<partitionFace *, GEntity *, partitionFacePtrLessThan> &pfaces,
   hashmapelement &elementToEntity, int &numEntity)
 {
-  partitionFace *newEntity = 0;
+  partitionFace *newEntity = nullptr;
   partitionFace pf(model, partitions);
   std::pair<std::multimap<partitionFace *, GEntity *,
                           partitionFacePtrLessThan>::iterator,
@@ -1608,7 +1607,7 @@ static partitionEdge *assignPartitionBoundary(
   std::multimap<partitionEdge *, GEntity *, partitionEdgePtrLessThan> &pedges,
   hashmapelement &elementToEntity, int &numEntity)
 {
-  partitionEdge *newEntity = 0;
+  partitionEdge *newEntity = nullptr;
   partitionEdge pe(model, partitions);
   std::pair<std::multimap<partitionEdge *, GEntity *,
                           partitionEdgePtrLessThan>::iterator,
@@ -1656,7 +1655,7 @@ static partitionVertex *assignPartitionBoundary(
     &pvertices,
   hashmapelement &elementToEntity, int &numEntity)
 {
-  partitionVertex *newEntity = 0;
+  partitionVertex *newEntity = nullptr;
   partitionVertex pv(model, partitions);
   std::pair<std::multimap<partitionVertex *, GEntity *,
                           partitionVertexPtrLessThan>::iterator,
@@ -1729,7 +1728,7 @@ static void assignBrep(GModel *model,
   if(e->dim() == 2) {
     partitionFace *entity = static_cast<partitionFace *>(e);
 
-    for(std::map<GEntity *, MElement *, GEntityPtrFullLessThan>::iterator it =
+    for(auto it =
           boundaryEntityAndRefElement.begin();
         it != boundaryEntityAndRefElement.end(); ++it) {
       static_cast<GRegion *>(it->first)->setFace(
@@ -1740,7 +1739,7 @@ static void assignBrep(GModel *model,
   else if(e->dim() == 1) {
     partitionEdge *entity = static_cast<partitionEdge *>(e);
 
-    for(std::map<GEntity *, MElement *, GEntityPtrFullLessThan>::iterator it =
+    for(auto it =
           boundaryEntityAndRefElement.begin();
         it != boundaryEntityAndRefElement.end(); ++it) {
       static_cast<GFace *>(it->first)->setEdge(
@@ -1751,7 +1750,7 @@ static void assignBrep(GModel *model,
   else if(e->dim() == 0) {
     partitionVertex *entity = static_cast<partitionVertex *>(e);
 
-    for(std::map<GEntity *, MElement *, GEntityPtrFullLessThan>::iterator it =
+    for(auto it =
           boundaryEntityAndRefElement.begin();
         it != boundaryEntityAndRefElement.end(); ++it) {
       static_cast<GEdge *>(it->first)->setVertex(
@@ -1782,10 +1781,10 @@ static void assignNewEntityBRep(Graph &graph, hashmapelement &elementToEntity)
     }
   }
 
-  for(hashmapentity::iterator it = brep.begin(); it != brep.end(); ++it) {
+  for(auto it = brep.begin(); it != brep.end(); ++it) {
     switch(it->first->dim()) {
     case 3:
-      for(setorientity::iterator itSet = it->second.begin();
+      for(auto itSet = it->second.begin();
           itSet != it->second.end(); ++itSet) {
         static_cast<GRegion *>(it->first)->setFace(
           static_cast<GFace *>(itSet->second), itSet->first);
@@ -1794,7 +1793,7 @@ static void assignNewEntityBRep(Graph &graph, hashmapelement &elementToEntity)
       }
       break;
     case 2:
-      for(setorientity::iterator itSet = it->second.begin();
+      for(auto itSet = it->second.begin();
           itSet != it->second.end(); ++itSet) {
         static_cast<GFace *>(it->first)->setEdge(
           static_cast<GEdge *>(itSet->second), itSet->first);
@@ -1803,7 +1802,7 @@ static void assignNewEntityBRep(Graph &graph, hashmapelement &elementToEntity)
       }
       break;
     case 1:
-      for(setorientity::iterator itSet = it->second.begin();
+      for(auto itSet = it->second.begin();
           itSet != it->second.end(); ++itSet) {
         static_cast<GEdge *>(it->first)->setVertex(
           static_cast<GVertex *>(itSet->second), itSet->first);
@@ -1846,7 +1845,7 @@ static void createPartitionTopology(
     Msg::Info(" - Creating partition surfaces");
 
     for(std::size_t i = 0; i < model->getNumPartitions(); i++) {
-      for(std::set<MElement *, MElementPtrLessThan>::iterator it =
+      for(auto it =
             boundaryElements[i].begin();
           it != boundaryElements[i].end(); ++it) {
         for(int j = 0; j < (*it)->getNumFaces(); j++) {
@@ -1894,7 +1893,7 @@ static void createPartitionTopology(
 
     if(meshDim == 2) {
       for(std::size_t i = 0; i < model->getNumPartitions(); i++) {
-        for(std::set<MElement *, MElementPtrLessThan>::iterator it =
+        for(auto it =
               boundaryElements[i].begin();
             it != boundaryElements[i].end(); ++it) {
           for(int j = 0; j < (*it)->getNumEdges(); j++) {
@@ -1914,7 +1913,7 @@ static void createPartitionTopology(
 
       std::map<idx_t, std::vector<int> > mapOfPartitions;
       idx_t mapOfPartitionsTag = 0;
-      for(GModel::const_fiter it = model->firstFace(); it != model->lastFace();
+      for(auto it = model->firstFace(); it != model->lastFace();
           ++it) {
         if((*it)->geomType() == GEntity::PartitionSurface) {
           std::vector<int> partitions =
@@ -1922,11 +1921,11 @@ static void createPartitionTopology(
           mapOfPartitions.insert(std::pair<idx_t, std::vector<int> >(
             mapOfPartitionsTag, partitions));
           // Must absolutely be in the same order as in the makeGraph function
-          for(std::vector<MTriangle *>::iterator itElm =
+          for(auto itElm =
                 (*it)->triangles.begin();
               itElm != (*it)->triangles.end(); ++itElm)
             part[partIndex++] = mapOfPartitionsTag;
-          for(std::vector<MQuadrangle *>::iterator itElm =
+          for(auto itElm =
                 (*it)->quadrangles.begin();
               itElm != (*it)->quadrangles.end(); ++itElm)
             part[partIndex++] = mapOfPartitionsTag;
@@ -1939,7 +1938,7 @@ static void createPartitionTopology(
         subBoundaryElements = subGraph.getBoundaryElements(mapOfPartitionsTag);
 
       for(idx_t i = 0; i < mapOfPartitionsTag; i++) {
-        for(std::set<MElement *, MElementPtrLessThan>::iterator it =
+        for(auto it =
               subBoundaryElements[i].begin();
             it != subBoundaryElements[i].end(); ++it) {
           for(int j = 0; j < (*it)->getNumEdges(); j++) {
@@ -1989,7 +1988,7 @@ static void createPartitionTopology(
     Msg::Info(" - Creating partition points");
     if(meshDim == 1) {
       for(std::size_t i = 0; i < model->getNumPartitions(); i++) {
-        for(std::set<MElement *, MElementPtrLessThan>::iterator it =
+        for(auto it =
               boundaryElements[i].begin();
             it != boundaryElements[i].end(); ++it) {
           for(std::size_t j = 0; j < (*it)->getNumPrimaryVertices(); j++) {
@@ -2009,7 +2008,7 @@ static void createPartitionTopology(
 
       std::map<idx_t, std::vector<int> > mapOfPartitions;
       idx_t mapOfPartitionsTag = 0;
-      for(GModel::const_eiter it = model->firstEdge(); it != model->lastEdge();
+      for(auto it = model->firstEdge(); it != model->lastEdge();
           ++it) {
         if((*it)->geomType() == GEntity::PartitionCurve) {
           std::vector<int> partitions =
@@ -2017,7 +2016,7 @@ static void createPartitionTopology(
           mapOfPartitions.insert(std::pair<idx_t, std::vector<int> >(
             mapOfPartitionsTag, partitions));
           // Must absolutely be in the same order as in the makeGraph function
-          for(std::vector<MLine *>::iterator itElm = (*it)->lines.begin();
+          for(auto itElm = (*it)->lines.begin();
               itElm != (*it)->lines.end(); ++itElm)
             part[partIndex++] = mapOfPartitionsTag;
           mapOfPartitionsTag++;
@@ -2029,7 +2028,7 @@ static void createPartitionTopology(
         subBoundaryElements = subGraph.getBoundaryElements(mapOfPartitionsTag);
 
       for(idx_t i = 0; i < mapOfPartitionsTag; i++) {
-        for(std::set<MElement *, MElementPtrLessThan>::iterator it =
+        for(auto it =
               subBoundaryElements[i].begin();
             it != subBoundaryElements[i].end(); ++it) {
           for(std::size_t j = 0; j < (*it)->getNumPrimaryVertices(); j++) {
@@ -2077,7 +2076,7 @@ static void addPhysical(GModel *model, GEntity *entity,
                         std::vector<GModel::piter> &iterators, int &numPhysical)
 {
   GEntity *parent = entity->getParentEntity();
-  if(parent == 0) return;
+  if(parent == nullptr) return;
 
   if(!CTX::instance()->mesh.partitionCreatePhysicals ||
      CTX::instance()->mesh.partitionOldStyleMsh2) {
@@ -2127,7 +2126,7 @@ static void addPhysical(GModel *model, GEntity *entity,
       std::to_string(physical[phys]) + "}_dim{" + std::to_string(dim) + "}";
 
     int number = 0;
-    hashmap<std::string, int>::iterator it = nameToNumber.find(name);
+    auto it = nameToNumber.find(name);
     if(it == nameToNumber.end()) {
       number = ++numPhysical;
       iterators[entity->dim()] = model->setPhysicalName(
@@ -2164,7 +2163,7 @@ static void addPhysical(GModel *model, GEntity *entity,
     name += "physical{0}_dim{" + std::to_string(dim) + "}";
 
     int number = 0;
-    hashmap<std::string, int>::iterator it = nameToNumber.find(name);
+    auto it = nameToNumber.find(name);
     if(it == nameToNumber.end()) {
       number = ++numPhysical;
       iterators[entity->dim()] = model->setPhysicalName(
@@ -2186,7 +2185,7 @@ static void assignPhysicals(GModel *model)
   model->getInnerPhysicalNamesIterators(iterators);
   int numPhysical = model->getMaxPhysicalNumber(-1);
   // Loop over volumes
-  for(GModel::const_riter it = model->firstRegion(); it != model->lastRegion();
+  for(auto it = model->firstRegion(); it != model->lastRegion();
       ++it) {
     if((*it)->geomType() == GEntity::PartitionVolume) {
       addPhysical(model, *it, nameToNumber, iterators, numPhysical);
@@ -2194,7 +2193,7 @@ static void assignPhysicals(GModel *model)
   }
 
   // Loop over surfaces
-  for(GModel::const_fiter it = model->firstFace(); it != model->lastFace();
+  for(auto it = model->firstFace(); it != model->lastFace();
       ++it) {
     if((*it)->geomType() == GEntity::PartitionSurface) {
       addPhysical(model, *it, nameToNumber, iterators, numPhysical);
@@ -2202,7 +2201,7 @@ static void assignPhysicals(GModel *model)
   }
 
   // Loop over curves
-  for(GModel::const_eiter it = model->firstEdge(); it != model->lastEdge();
+  for(auto it = model->firstEdge(); it != model->lastEdge();
       ++it) {
     if((*it)->geomType() == GEntity::PartitionCurve) {
       addPhysical(model, *it, nameToNumber, iterators, numPhysical);
@@ -2210,7 +2209,7 @@ static void assignPhysicals(GModel *model)
   }
 
   // Loop over points
-  for(GModel::const_viter it = model->firstVertex(); it != model->lastVertex();
+  for(auto it = model->firstVertex(); it != model->lastVertex();
       ++it) {
     if((*it)->geomType() == GEntity::PartitionPoint) {
       addPhysical(model, *it, nameToNumber, iterators, numPhysical);
@@ -2278,8 +2277,8 @@ int PartitionFaceMinEdgeLength(GFace *gf, int np, double tol)
   idx_t nvtxs = gf->triangles.size(), ncon = 1, nparts = np, objval;
   std::vector<idx_t> epart(gf->triangles.size());
   real_t ubvec = tol;
-  METIS_PartGraphKway(&nvtxs, &ncon, &xadjncy[0], &adjncy[0], NULL, NULL,
-                      &adjncyw[0], &nparts, NULL, &ubvec, NULL, &objval,
+  METIS_PartGraphKway(&nvtxs, &ncon, &xadjncy[0], &adjncy[0], nullptr, nullptr,
+                      &adjncyw[0], &nparts, nullptr, &ubvec, nullptr, &objval,
                       &epart[0]);
   for(size_t i = 0; i < gf->triangles.size(); ++i) {
     gf->triangles[i]->setPartition(epart[i]);
@@ -2411,7 +2410,7 @@ int UnpartitionMesh(GModel *model)
   std::set<MVertex *> verts;
 
   // Loop over points
-  for(GModel::viter it = vertices.begin(); it != vertices.end(); ++it) {
+  for(auto it = vertices.begin(); it != vertices.end(); ++it) {
     GVertex *vertex = *it;
 
     if(vertex->geomType() == GEntity::PartitionPoint) {
@@ -2433,7 +2432,7 @@ int UnpartitionMesh(GModel *model)
   }
 
   // Loop over curves
-  for(GModel::eiter it = edges.begin(); it != edges.end(); ++it) {
+  for(auto it = edges.begin(); it != edges.end(); ++it) {
     GEdge *edge = *it;
     if(edge->geomType() == GEntity::PartitionCurve) {
       partitionEdge *pedge = static_cast<partitionEdge *>(edge);
@@ -2446,8 +2445,8 @@ int UnpartitionMesh(GModel *model)
       }
       pedge->lines.clear();
       pedge->mesh_vertices.clear();
-      pedge->setBeginVertex(0);
-      pedge->setEndVertex(0);
+      pedge->setBeginVertex(nullptr);
+      pedge->setEndVertex(nullptr);
 
       model->remove(pedge);
       delete pedge;
@@ -2459,7 +2458,7 @@ int UnpartitionMesh(GModel *model)
   }
 
   // Loop over surfaces
-  for(GModel::fiter it = faces.begin(); it != faces.end(); ++it) {
+  for(auto it = faces.begin(); it != faces.end(); ++it) {
     GFace *face = *it;
 
     if(face->geomType() == GEntity::PartitionSurface) {
@@ -2492,7 +2491,7 @@ int UnpartitionMesh(GModel *model)
   }
 
   // Loop over volumes
-  for(GModel::riter it = regions.begin(); it != regions.end(); ++it) {
+  for(auto it = regions.begin(); it != regions.end(); ++it) {
     GRegion *region = *it;
 
     if(region->geomType() == GEntity::PartitionVolume) {
@@ -2543,7 +2542,7 @@ int UnpartitionMesh(GModel *model)
 
   std::map<std::pair<int, int>, std::string> physicalNames =
     model->getPhysicalNames();
-  for(GModel::piter it = physicalNames.begin(); it != physicalNames.end();
+  for(auto it = physicalNames.begin(); it != physicalNames.end();
       ++it) {
     std::size_t found = it->second.find("_");
     if(found != std::string::npos) {
diff --git a/Mesh/meshPartition.h b/Mesh/meshPartition.h
index f15575781c2262a04e9b63b510830b5c7217fe1d..40b097a9d136c0abd20cf1ff0ade28d19ceae50c 100644
--- a/Mesh/meshPartition.h
+++ b/Mesh/meshPartition.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshRefine.cpp b/Mesh/meshRefine.cpp
index 39dc8a08bf58e9b30cb3009b7ae84b7da5efc866..575c88ed856c53f1d1d5ef90abdda1ab9c726159 100644
--- a/Mesh/meshRefine.cpp
+++ b/Mesh/meshRefine.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -280,7 +280,7 @@ static void Subdivide(GRegion *gr, bool splitIntoHexas,
         std::vector<MVertex *> newv;
         for(int j = 0; j < t->getNumFaces(); j++) {
           MFace face = t->getFace(j);
-          faceContainer::iterator fIter = faceVertices.find(face);
+          auto fIter = faceVertices.find(face);
           if(fIter != faceVertices.end()) {
             newv.push_back(fIter->second[0]);
           }
@@ -324,7 +324,7 @@ static void Subdivide(GRegion *gr, bool splitIntoHexas,
         std::vector<MVertex *> newv;
         for(int j = 0; j < 2; j++) {
           MFace face = p->getFace(j);
-          faceContainer::iterator fIter = faceVertices.find(face);
+          auto fIter = faceVertices.find(face);
           if(fIter != faceVertices.end()) {
             newv.push_back(fIter->second[0]);
           }
@@ -500,11 +500,11 @@ void RefineMesh(GModel *m, bool linear, bool splitIntoQuads,
 
   // Subdivide the second order elements to create the refined linear
   // mesh
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it)
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it)
     Subdivide(*it);
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it)
     Subdivide(*it, splitIntoQuads, splitIntoHexas, faceVertices, linear);
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     Subdivide(*it, splitIntoHexas, faceVertices);
 
   // Check all 3D elements for negative volume and reverse if needed
@@ -524,7 +524,7 @@ void BarycentricRefineMesh(GModel *m)
 
   // Only update triangles in 2D, only update tets in 3D
   if(m->getNumRegions() == 0) {
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+    for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
       GFace *gf = *it;
       std::size_t numt = gf->triangles.size();
       if(!numt) continue;
@@ -547,7 +547,7 @@ void BarycentricRefineMesh(GModel *m)
     }
   }
   else {
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
       GRegion *gr = *it;
       std::size_t numt = gr->tetrahedra.size();
       if(!numt) continue;
@@ -736,7 +736,7 @@ void subdivide_pyramid(MElement *element, GRegion *gr,
                        faceContainer &faceVertices,
                        std::vector<MHexahedron *> &dwarfs88)
 {
-  std::vector<MVertex *> v(105, (MVertex *)NULL);
+  std::vector<MVertex *> v(105, (MVertex *)nullptr);
 
   v[29] = element->getVertex(0);
   v[27] = element->getVertex(1);
diff --git a/Mesh/meshRefine.h b/Mesh/meshRefine.h
index 5f266ab34bfdf732344a5bf7b3f662edb61cf2bb..9f7ac81fb21ecdb46bc63aa5d59b93d85d7e1770 100644
--- a/Mesh/meshRefine.h
+++ b/Mesh/meshRefine.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/meshRelocateVertex.cpp b/Mesh/meshRelocateVertex.cpp
index 43a3f2f6d1a135073f677514e531c4cb0c0fdd30..616845d417e21100b3352864ada99c0a00ce8a71 100644
--- a/Mesh/meshRelocateVertex.cpp
+++ b/Mesh/meshRelocateVertex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -251,7 +251,7 @@ static void _relocateVertexOfPyramid(MVertex *ver,
   if(ver->onWhat()->dim() != 3) return;
   double x = 0.0, y = 0.0, z = 0.0;
   int N = 0;
-  MElement *pyramid = NULL;
+  MElement *pyramid = nullptr;
 
   for(std::size_t i = 0; i < lt.size(); i++) {
     double XCG = 0.0, YCG = 0.0, ZCG = 0.0;
@@ -418,7 +418,7 @@ void RelocateVertices(GFace *gf, int niter, double tol)
   buildVertexToElement(gf->triangles, adj);
   buildVertexToElement(gf->quadrangles, adj);
   for(int i = 0; i < niter; i++) {
-    v2t_cont::iterator it = adj.begin();
+    auto it = adj.begin();
     while(it != adj.end()) {
       if(vs.find(it->first) == vs.end()) {
         _relocateVertex(gf, it->first, it->second, tol);
@@ -438,7 +438,7 @@ void RelocateVertices(GRegion *region, int niter, double tol)
   buildVertexToElement(region->prisms, adj);
   buildVertexToElement(region->hexahedra, adj);
   for(int i = 0; i < niter + 2; i++) {
-    v2t_cont::iterator it = adj.begin();
+    auto it = adj.begin();
     double relax = std::min((double)(i + 1) / niter, 1.0);
     while(it != adj.end()) {
       _relocateVertexGolden(it->first, it->second, relax, tol);
@@ -496,7 +496,7 @@ void RelocateVerticesOfPyramids(GRegion *region, int niter, double tol)
 
   for(int i = 0; i < 10; i++) {
     double X = (double)(i + 1) / 10.;
-    v2t_cont::iterator it = adj.begin();
+    auto it = adj.begin();
     while(it != adj.end()) {
       _relocateVertexOfPyramid(it->first, it->second, X);
       ++it;
@@ -504,7 +504,7 @@ void RelocateVerticesOfPyramids(GRegion *region, int niter, double tol)
   }
   //  return;
   for(int i = 0; i < niter + 2; i++) {
-    v2t_cont::iterator it = adj.begin();
+    auto it = adj.begin();
     double relax = std::min((double)(i + 1) / niter, 1.0);
     while(it != adj.end()) {
       _relocateVertexGolden(it->first, it->second, relax, tol);
diff --git a/Mesh/meshRelocateVertex.h b/Mesh/meshRelocateVertex.h
index 5df4d7ad4fdb4b17eade5d3cb920e4423d8a141c..2c57bcd7cc8017fc21be77d158f5562f8e95cd71 100644
--- a/Mesh/meshRelocateVertex.h
+++ b/Mesh/meshRelocateVertex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/qualityMeasures.cpp b/Mesh/qualityMeasures.cpp
index ecb19162b4b5bff927874f8656bb30b2022082b5..f4c0c3a275a3d7b644c3e8e7e6c2a0ef394eb9d3 100644
--- a/Mesh/qualityMeasures.cpp
+++ b/Mesh/qualityMeasures.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Mesh/qualityMeasures.h b/Mesh/qualityMeasures.h
index 3da9bc00fccc6652949ca79e97ca846ceaefd72b..45f674fab982627cd28ded40f1536072d492874b 100644
--- a/Mesh/qualityMeasures.h
+++ b/Mesh/qualityMeasures.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -66,31 +66,31 @@ public:
 class qmTetrahedron {
 public:
   enum Measures { QMTET_GAMMA, QMTET_ETA, QMTET_ONE, QMTET_COND };
-  static double qm(MTetrahedron *t, const Measures &cr, double *volume = 0);
+  static double qm(MTetrahedron *t, const Measures &cr, double *volume = nullptr);
   static double qm(const BDS_Point *p1, const BDS_Point *p2,
                    const BDS_Point *p3);
   static double qm(const MVertex *v1, const MVertex *v2, const MVertex *v3,
-                   const MVertex *v4, const Measures &cr, double *volume = 0);
+                   const MVertex *v4, const Measures &cr, double *volume = nullptr);
   static double qm(const double &x1, const double &y1, const double &z1,
                    const double &x2, const double &y2, const double &z2,
                    const double &x3, const double &y3, const double &z3,
                    const double &x4, const double &y4, const double &z4,
-                   const Measures &cr, double *volume = 0);
+                   const Measures &cr, double *volume = nullptr);
   static double eta(const double &x1, const double &y1, const double &z1,
                     const double &x2, const double &y2, const double &z2,
                     const double &x3, const double &y3, const double &z3,
                     const double &x4, const double &y4, const double &z4,
-                    double *volume = 0);
+                    double *volume = nullptr);
   static double gamma(const double &x1, const double &y1, const double &z1,
                       const double &x2, const double &y2, const double &z2,
                       const double &x3, const double &y3, const double &z3,
                       const double &x4, const double &y4, const double &z4,
-                      double *volume = 0);
+                      double *volume = nullptr);
   static double cond(const double &x1, const double &y1, const double &z1,
                      const double &x2, const double &y2, const double &z2,
                      const double &x3, const double &y3, const double &z3,
                      const double &x4, const double &y4, const double &z4,
-                     double *volume = 0);
+                     double *volume = nullptr);
   static double minNCJ(const MTetrahedron *e);
   //  static void NCJRange(const MTetrahedron *e, double &valMin, double
   //  &valMax);
diff --git a/Mesh/qualityMeasuresJacobian.cpp b/Mesh/qualityMeasuresJacobian.cpp
index 9290d88b75f997d2eb7f059ad51bdbf245a6d006..845f068d981f756506812b47ccbb858ca4f37272 100644
--- a/Mesh/qualityMeasuresJacobian.cpp
+++ b/Mesh/qualityMeasuresJacobian.cpp
@@ -972,11 +972,11 @@ namespace jacobianBasedQuality {
   {
     GModel *m = GModel::current();
     std::set<GEntity *, GEntityPtrFullLessThan> entities;
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++)
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++)
       entities.insert(*it);
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
+    for(auto it = m->firstFace(); it != m->lastFace(); it++)
       entities.insert(*it);
-    for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
+    for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
       entities.insert(*it);
 
     std::set<GEntity *, GEntityPtrFullLessThan>::iterator it;
diff --git a/Mesh/qualityMeasuresJacobian.h b/Mesh/qualityMeasuresJacobian.h
index af1cd25cdbf40bf4e146c51a112dd71eb245f860..3a5ad16f7e667df20d3df4099ab71cb62d268ab1 100644
--- a/Mesh/qualityMeasuresJacobian.h
+++ b/Mesh/qualityMeasuresJacobian.h
@@ -17,30 +17,30 @@ template <class scalar> class fullMatrix;
 namespace jacobianBasedQuality {
 
   void minMaxJacobianDeterminant(MElement *el, double &min, double &max,
-                                 const fullMatrix<double> *normals = NULL,
+                                 const fullMatrix<double> *normals = nullptr,
                                  bool debug = false);
   double minIGEMeasure(MElement *el, bool knownValid = false,
                        bool reversedOk = false,
-                       const fullMatrix<double> *normals = NULL,
+                       const fullMatrix<double> *normals = nullptr,
                        bool debug = false);
   double minICNMeasure(MElement *el, bool knownValid = false,
                        bool reversedOk = false,
-                       const fullMatrix<double> *normals = NULL,
+                       const fullMatrix<double> *normals = nullptr,
                        bool debug = false);
   void sampleJacobianDeterminant(MElement *el, int order, double &min,
                                  double &max,
-                                 const fullMatrix<double> *normals = NULL);
+                                 const fullMatrix<double> *normals = nullptr);
   void sampleIGEMeasure(MElement *el, int order, double &min, double &max);
   void sampleICNMeasure(MElement *el, int order, double &min, double &max);
   void sampleJacobianDeterminant(MElement *el, int order,
                                  fullVector<double> &jac,
-                                 const fullMatrix<double> *normals = NULL);
+                                 const fullMatrix<double> *normals = nullptr);
   void sampleIGEMeasure(MElement *el, int order, fullVector<double> &ige);
   void sampleICNMeasure(MElement *el, int order, fullVector<double> &icn);
 
   // For regression tests:
   void testAllMeasuresAllElements();
-  void testAllMeasures(MElement *el, const fullMatrix<double> *normals = NULL);
+  void testAllMeasures(MElement *el, const fullMatrix<double> *normals = nullptr);
 
   class _coeffData {
   protected:
diff --git a/Numeric/BasisFactory.cpp b/Numeric/BasisFactory.cpp
index 0a6d49a4845101e4b30e94a27a99991cfc45b89b..0a7dd04e2b524596c5c5a60600e78993e0cdf52d 100644
--- a/Numeric/BasisFactory.cpp
+++ b/Numeric/BasisFactory.cpp
@@ -27,7 +27,7 @@ const nodalBasis *BasisFactory::getNodalBasis(int tag)
   if(it != fs.end()) { return it->second; }
   // Get the parent type to see which kind of basis
   // we want to create
-  nodalBasis *F = NULL;
+  nodalBasis *F = nullptr;
   if(tag == MSH_TRI_MINI)
     F = new miniBasisTri();
   else if(tag == MSH_TET_MINI)
@@ -45,7 +45,7 @@ const nodalBasis *BasisFactory::getNodalBasis(int tag)
     case(TYPE_PYR): F = new pyramidalBasis(tag); break;
     default:
       Msg::Error("Unknown type of element %d (in BasisFactory)", tag);
-      return NULL;
+      return nullptr;
     }
   }
 
@@ -153,28 +153,28 @@ const bezierBasis *BasisFactory::getBezierBasis(int tag)
 
 void BasisFactory::clearAll()
 {
-  std::map<int, nodalBasis *>::iterator itF = fs.begin();
+  auto itF = fs.begin();
   while(itF != fs.end()) {
     delete itF->second;
     itF++;
   }
   fs.clear();
 
-  std::map<FuncSpaceData, JacobianBasis *>::iterator itJ = js.begin();
+  auto itJ = js.begin();
   while(itJ != js.end()) {
     delete itJ->second;
     itJ++;
   }
   js.clear();
 
-  std::map<FuncSpaceData, GradientBasis *>::iterator itG = gs.begin();
+  auto itG = gs.begin();
   while(itG != gs.end()) {
     delete itG->second;
     itG++;
   }
   gs.clear();
 
-  std::map<FuncSpaceData, bezierBasis *>::iterator itB = bs.begin();
+  auto itB = bs.begin();
   while(itB != bs.end()) {
     delete itB->second;
     itB++;
diff --git a/Numeric/BasisFactory.h b/Numeric/BasisFactory.h
index 209fb57082dd98361dc0bd06b6910c496756871f..a3aa02283cc991b22a4c5ec9bfb627f1ba93ea81 100644
--- a/Numeric/BasisFactory.h
+++ b/Numeric/BasisFactory.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/BergotBasis.cpp b/Numeric/BergotBasis.cpp
index 38ba3ae891985e3fbbf84bf82575f4e38fd954b8..fbf3bbd3d60ecb07a1452ef495dd5bf1c1a12496 100644
--- a/Numeric/BergotBasis.cpp
+++ b/Numeric/BergotBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/BergotBasis.h b/Numeric/BergotBasis.h
index 03a9b22d00f700ef4609dcff24399a4c4a86ca5e..bde4179571736df709df8416c2b5f1dcee3c9887 100644
--- a/Numeric/BergotBasis.h
+++ b/Numeric/BergotBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/CMakeLists.txt b/Numeric/CMakeLists.txt
index fca10b3cae90bfb5619ecb9f7c3b909bc4a1e4d9..02397591fcfa7219bd2f4cda5c7933599030e300 100644
--- a/Numeric/CMakeLists.txt
+++ b/Numeric/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/CondNumBasis.cpp b/Numeric/CondNumBasis.cpp
index 6f5f08e584541297e3d1c68b9c142ff7e1ec0417..8fd52737f5290a80162e4986543751cbe0acf3f8 100644
--- a/Numeric/CondNumBasis.cpp
+++ b/Numeric/CondNumBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/CondNumBasis.h b/Numeric/CondNumBasis.h
index d26ce862602ec8e59c33c3cc99d0ac5780bcb44c..10bca06b72870d8ea808807020ca074fe4b0f319 100644
--- a/Numeric/CondNumBasis.h
+++ b/Numeric/CondNumBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/ConjugateGradients.cpp b/Numeric/ConjugateGradients.cpp
index e39eda2c6b60744657ee457cc61be9918f2ab70e..286a8d8b116e653ff587db6f0e50e476d9c5a253 100644
--- a/Numeric/ConjugateGradients.cpp
+++ b/Numeric/ConjugateGradients.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/ConjugateGradients.h b/Numeric/ConjugateGradients.h
index b86847a6077938db8913bb23edc07be55dfd2116..654d7405f79e8ea24298501a9e58f8379ed9b92d 100644
--- a/Numeric/ConjugateGradients.h
+++ b/Numeric/ConjugateGradients.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/ElementType.cpp b/Numeric/ElementType.cpp
index 8588d706f5b49ccfc2fa9667912f897f3a78e0d1..36e4ca95ae1e1d5deafb121f4f1fe46e5af235c7 100644
--- a/Numeric/ElementType.cpp
+++ b/Numeric/ElementType.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/ElementType.h b/Numeric/ElementType.h
index 6508260a203f55f36443e2165038d24a1f779cfb..a2ea581b2b7786d39e1a92838c6dea2602506321 100644
--- a/Numeric/ElementType.h
+++ b/Numeric/ElementType.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/FuncSpaceData.h b/Numeric/FuncSpaceData.h
index acb7ea41beb7515c4f759421e9f82137872411b8..20475ee5b6a7f9df3318a44434e7f26a41c0e2b9 100644
--- a/Numeric/FuncSpaceData.h
+++ b/Numeric/FuncSpaceData.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussIntegration.cpp b/Numeric/GaussIntegration.cpp
index ae823fc2b20d92b9396c7c6080384f5c8a817137..1504867cd0d6976c863d64f5a9ac94f79a3f5c2e 100644
--- a/Numeric/GaussIntegration.cpp
+++ b/Numeric/GaussIntegration.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussIntegration.h b/Numeric/GaussIntegration.h
index 900f0800d4e9f306ee06cfce94ef4916b8cdc06e..cb624570f9587d70168fe6f2e10df89e5930662c 100644
--- a/Numeric/GaussIntegration.h
+++ b/Numeric/GaussIntegration.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussJacobi1D.cpp b/Numeric/GaussJacobi1D.cpp
index 0650a29dbc7a70c8927c04374f8921825be909e5..03942de958f37e94bff5fd4dc047e57be86e2aa2 100644
--- a/Numeric/GaussJacobi1D.cpp
+++ b/Numeric/GaussJacobi1D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -4178,8 +4178,8 @@ static double _gaussJacobiWt_20[5][5][20] = {
 
 void getGaussJacobiQuadrature(int a, int b, int n, double **pt, double **wt)
 {
-  *pt = NULL;
-  *wt = NULL;
+  *pt = nullptr;
+  *wt = nullptr;
   if(a < 0 || a > 4 || b < 0 || b > 4)
     Msg::Error("Gauss-Jacobi %i %i quadrature not available.", a, b);
   switch(n) {
diff --git a/Numeric/GaussJacobi1D.h b/Numeric/GaussJacobi1D.h
index cae4cfa8de7eeaba9a61ee6cc22fb53344663b80..4913080b9e89176fe35e89d9f2615e2a77754316 100644
--- a/Numeric/GaussJacobi1D.h
+++ b/Numeric/GaussJacobi1D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussLegendre1D.h b/Numeric/GaussLegendre1D.h
index f529c90a622c307c8118c7c5f075a42be7ce8381..23c71b4cebfc784d6256698f67c6d748c8a3f5de 100644
--- a/Numeric/GaussLegendre1D.h
+++ b/Numeric/GaussLegendre1D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -286,8 +286,8 @@ inline void gmshGaussLegendre1D(int nbQuadPoints, double **t, double **w)
     *w = GL_wt20;
     break;
   default:
-    *t = 0;
-    *w = 0;
+    *t = nullptr;
+    *w = nullptr;
     break;
   }
 }
diff --git a/Numeric/GaussLegendreSimplex.cpp b/Numeric/GaussLegendreSimplex.cpp
index c2a94dc048f1a616cc1c140ea71784b1538e65e8..37c9f5ac53f71abc0ae67bb2591c8e28ba3b73f1 100644
--- a/Numeric/GaussLegendreSimplex.cpp
+++ b/Numeric/GaussLegendreSimplex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadratureHex.cpp b/Numeric/GaussQuadratureHex.cpp
index 6b8485849eefd70512782693935805f279001410..936ee734c421dfe82a9b8f15d774117d7baccfb1 100644
--- a/Numeric/GaussQuadratureHex.cpp
+++ b/Numeric/GaussQuadratureHex.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadratureLin.cpp b/Numeric/GaussQuadratureLin.cpp
index c179700f77b998345aad71f72f705f143a793284..c76e161d1a313b7fa68836d8c0e99c272cf25111 100644
--- a/Numeric/GaussQuadratureLin.cpp
+++ b/Numeric/GaussQuadratureLin.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadraturePri.cpp b/Numeric/GaussQuadraturePri.cpp
index 077e474938c9ab8780957b2b062498166a7991d9..fe6dea40fde0a397f52b0caec5be669140508232 100644
--- a/Numeric/GaussQuadraturePri.cpp
+++ b/Numeric/GaussQuadraturePri.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadraturePyr.cpp b/Numeric/GaussQuadraturePyr.cpp
index 217c17c79242dd59834df6a2ca645780e9f466e2..b747f700641e930b437d2cd9e5909a3024dd6953 100644
--- a/Numeric/GaussQuadraturePyr.cpp
+++ b/Numeric/GaussQuadraturePyr.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadratureQuad.cpp b/Numeric/GaussQuadratureQuad.cpp
index 8ea0c3158534e265ecf9221e996d9ecd68eeeb47..05607202e3c2ba49d3c02d554b1abcf57b76eca1 100644
--- a/Numeric/GaussQuadratureQuad.cpp
+++ b/Numeric/GaussQuadratureQuad.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadratureTet.cpp b/Numeric/GaussQuadratureTet.cpp
index c0c0b9b39f6209ce4f8b5bdceb50f54b84a2ac4b..371f76bf11659c616cff74c2291f9b4942d92d0e 100644
--- a/Numeric/GaussQuadratureTet.cpp
+++ b/Numeric/GaussQuadratureTet.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/GaussQuadratureTri.cpp b/Numeric/GaussQuadratureTri.cpp
index b5bbd7ceef9f819df30f5f9c1e0676d39e52af1d..5cdab1426f119e3482afea3f6c4e52c80472f85e 100644
--- a/Numeric/GaussQuadratureTri.cpp
+++ b/Numeric/GaussQuadratureTri.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasis.cpp b/Numeric/HierarchicalBasis.cpp
index b57fbe6f2633f470077d3fc888187607e1011917..65364c82c15057d5c905beb4b7c5cd3a565b1eec 100644
--- a/Numeric/HierarchicalBasis.cpp
+++ b/Numeric/HierarchicalBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasis.h b/Numeric/HierarchicalBasis.h
index fd789105d214c4c6f3f9b0c0e66e69de33e613fc..cb794fcfb3ac26d33e0397c8a4de98b0226fb512 100644
--- a/Numeric/HierarchicalBasis.h
+++ b/Numeric/HierarchicalBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1.cpp b/Numeric/HierarchicalBasisH1.cpp
index 470d56704f141020379b1cd169183c8f71da1040..82cfab63caf6b9451730cb4bafac9acd38ae021d 100644
--- a/Numeric/HierarchicalBasisH1.cpp
+++ b/Numeric/HierarchicalBasisH1.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1.h b/Numeric/HierarchicalBasisH1.h
index 74f27601e56cdd88b875e4ddf64c73ccd2518752..8dcd3f72b7ce0384d70877463f02582330d5537f 100644
--- a/Numeric/HierarchicalBasisH1.h
+++ b/Numeric/HierarchicalBasisH1.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Brick.cpp b/Numeric/HierarchicalBasisH1Brick.cpp
index 2468dea266ff76a9707574aa98ed0598d3b83d07..7a9696ce0dd2b53fe34b1558505dd5b3418c4efe 100644
--- a/Numeric/HierarchicalBasisH1Brick.cpp
+++ b/Numeric/HierarchicalBasisH1Brick.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -112,7 +112,7 @@ void HierarchicalBasisH1Brick::generateBasis(double const &u, double const &v,
   }
   // edge shape functions:
   int indexEdgeBasis = 0;
-  std::vector<double> *vectorTarget1(0);
+  std::vector<double> *vectorTarget1(nullptr);
   for(int iEdge = 0; iEdge < _nedge; iEdge++) {
     switch(iEdge) {
     case(0):
@@ -137,7 +137,7 @@ void HierarchicalBasisH1Brick::generateBasis(double const &u, double const &v,
   }
   // face shape functions:
   int indexFaceFunction = 0;
-  std::vector<double> *vectorTarget2(0);
+  std::vector<double> *vectorTarget2(nullptr);
   for(int iFace = 0; iFace < _nfaceQuad; iFace++) {
     int indexLambda;
     switch(iFace) {
@@ -308,8 +308,8 @@ void HierarchicalBasisH1Brick::generateGradientBasis(
   }
   // edge gradient:
   int indexEdgeBasis = 0;
-  std::vector<double> *vectorTarget1(0);
-  std::vector<std::vector<double> > *dvectorTarget1(0);
+  std::vector<double> *vectorTarget1(nullptr);
+  std::vector<std::vector<double> > *dvectorTarget1(nullptr);
   for(int iEdge = 0; iEdge < _nedge; iEdge++) {
     switch(iEdge) {
     case(0):
@@ -346,8 +346,8 @@ void HierarchicalBasisH1Brick::generateGradientBasis(
   }
   // face gradient:
   int indexFaceFunction = 0;
-  std::vector<double> *vectorTarget2(0);
-  std::vector<std::vector<double> > *dvectorTarget2(0);
+  std::vector<double> *vectorTarget2(nullptr);
+  std::vector<std::vector<double> > *dvectorTarget2(nullptr);
   for(int iFace = 0; iFace < _nfaceQuad; iFace++) {
     int indexLambda;
     switch(iFace) {
diff --git a/Numeric/HierarchicalBasisH1Brick.h b/Numeric/HierarchicalBasisH1Brick.h
index a44d1faaec3eeabda67a4647331c25324737b075..070ba48bedb46cb19d4be62373704f0ccadf4ea8 100644
--- a/Numeric/HierarchicalBasisH1Brick.h
+++ b/Numeric/HierarchicalBasisH1Brick.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Line.cpp b/Numeric/HierarchicalBasisH1Line.cpp
index 6746d1357a80cae661be69f599d89f69dbe4ecab..11149d6317be5042b6e0e7c3514cd4c8c060f32c 100644
--- a/Numeric/HierarchicalBasisH1Line.cpp
+++ b/Numeric/HierarchicalBasisH1Line.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Line.h b/Numeric/HierarchicalBasisH1Line.h
index 441103117cc785bb50306adba371b7b4fb3bbd55..19490e9183b58ff0924d381926cf0eeca7310fe0 100644
--- a/Numeric/HierarchicalBasisH1Line.h
+++ b/Numeric/HierarchicalBasisH1Line.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Pri.cpp b/Numeric/HierarchicalBasisH1Pri.cpp
index 5d268799c65730a0a731f34fbed19b83d0bf0c40..53237198d7409e31e0625b70b1350b7fcdbe6d9b 100644
--- a/Numeric/HierarchicalBasisH1Pri.cpp
+++ b/Numeric/HierarchicalBasisH1Pri.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Pri.h b/Numeric/HierarchicalBasisH1Pri.h
index a81b85dc2823b7111dca8ac2b65a1dd136b83e06..92bf3b31d2bc694daab37cdfeb6951473ffaacbd 100644
--- a/Numeric/HierarchicalBasisH1Pri.h
+++ b/Numeric/HierarchicalBasisH1Pri.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Quad.cpp b/Numeric/HierarchicalBasisH1Quad.cpp
index 48e86f013cde4535d26ba858a51e8ad348bdb562..150ae04b94c407b4645f2a312185f4e09072aa53 100644
--- a/Numeric/HierarchicalBasisH1Quad.cpp
+++ b/Numeric/HierarchicalBasisH1Quad.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Quad.h b/Numeric/HierarchicalBasisH1Quad.h
index 5ecea34e02497b173d0428b8cb442e9e0a8158ac..91342bde538e8481931102eb3765943f4f5eaebe 100644
--- a/Numeric/HierarchicalBasisH1Quad.h
+++ b/Numeric/HierarchicalBasisH1Quad.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Tetra.cpp b/Numeric/HierarchicalBasisH1Tetra.cpp
index 1ea0dee63fe973898d159151ff7e594404f40236..22ba9e04e4a76dee94715e4537ddd11c74db3f49 100644
--- a/Numeric/HierarchicalBasisH1Tetra.cpp
+++ b/Numeric/HierarchicalBasisH1Tetra.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Tetra.h b/Numeric/HierarchicalBasisH1Tetra.h
index c2647b77e636df5246fa18246820989a5610d027..0fc0892a8be0025ae8ea9c138dcf641c479a4a45 100644
--- a/Numeric/HierarchicalBasisH1Tetra.h
+++ b/Numeric/HierarchicalBasisH1Tetra.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Tria.cpp b/Numeric/HierarchicalBasisH1Tria.cpp
index 968ff27dcf1309dec310d2deed05a392f897821c..64828b542c7d2f65bb668be55cbba6883fe928bb 100644
--- a/Numeric/HierarchicalBasisH1Tria.cpp
+++ b/Numeric/HierarchicalBasisH1Tria.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisH1Tria.h b/Numeric/HierarchicalBasisH1Tria.h
index ca6a7e08e89feca9b09564856673bea878235f47..b38797b84014683490d402ac17fe990cc37b5597 100644
--- a/Numeric/HierarchicalBasisH1Tria.h
+++ b/Numeric/HierarchicalBasisH1Tria.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurl.cpp b/Numeric/HierarchicalBasisHcurl.cpp
index be742dcaaaf5d35b4a9546034b08623c7b805c2e..31c81e4d1825207e335af671b25e693866e05753 100644
--- a/Numeric/HierarchicalBasisHcurl.cpp
+++ b/Numeric/HierarchicalBasisHcurl.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurl.h b/Numeric/HierarchicalBasisHcurl.h
index b0777f445b41947023d9bad94041160f6d88c33d..794b70d4413c51efd6be033326a12ef0ac40621e 100644
--- a/Numeric/HierarchicalBasisHcurl.h
+++ b/Numeric/HierarchicalBasisHcurl.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlBrick.cpp b/Numeric/HierarchicalBasisHcurlBrick.cpp
index e149c73bfa92afa4c5879b3629e15858e0d865a1..4d891b37ded5f67883ce07a75f79940fd3db7d52 100644
--- a/Numeric/HierarchicalBasisHcurlBrick.cpp
+++ b/Numeric/HierarchicalBasisHcurlBrick.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlBrick.h b/Numeric/HierarchicalBasisHcurlBrick.h
index d8ea1c241db7eb4bcd18a27ca0adcf63a08a7955..6ba6e9795e0400c4a06027a1a6e26ba1f992a94a 100644
--- a/Numeric/HierarchicalBasisHcurlBrick.h
+++ b/Numeric/HierarchicalBasisHcurlBrick.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlLine.cpp b/Numeric/HierarchicalBasisHcurlLine.cpp
index 2f1a4c00276a7bbb32948f612e0ab35b7367950d..13768cdb44827942446cee52fb5ed54ce3a38ff5 100644
--- a/Numeric/HierarchicalBasisHcurlLine.cpp
+++ b/Numeric/HierarchicalBasisHcurlLine.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlLine.h b/Numeric/HierarchicalBasisHcurlLine.h
index d661452d3913940557c9a7a139b930b000cefc90..5e376e4a2df4192a1e586ae3b5b1bb0406a32ea6 100644
--- a/Numeric/HierarchicalBasisHcurlLine.h
+++ b/Numeric/HierarchicalBasisHcurlLine.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlPri.cpp b/Numeric/HierarchicalBasisHcurlPri.cpp
index 384d443d1e5938417fa5a035fd78b41c00ab05f3..ecc5d97a2d92d5f7b582996667483cd3c83dd72a 100644
--- a/Numeric/HierarchicalBasisHcurlPri.cpp
+++ b/Numeric/HierarchicalBasisHcurlPri.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -886,7 +886,7 @@ void HierarchicalBasisHcurlPri::orientOneFace(
         n3[1] = dlambda[1][1];
         for(int i = 0; i < 3; i++) {
           double product2 = 0;
-          std::vector<double> *normal(0);
+          std::vector<double> *normal(nullptr);
           switch(i) {
           case(0):
             product2 = lambda[1] * lambda[0];
diff --git a/Numeric/HierarchicalBasisHcurlPri.h b/Numeric/HierarchicalBasisHcurlPri.h
index 602950a26a6fb9b951337c2b91b9f377a440091b..af3f3cebc0c52aa95193046161bb4c770a695f0b 100644
--- a/Numeric/HierarchicalBasisHcurlPri.h
+++ b/Numeric/HierarchicalBasisHcurlPri.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlQuad.cpp b/Numeric/HierarchicalBasisHcurlQuad.cpp
index 44da30d3d5d69e19f285d4180bf4a86437be150d..38b9464b10ab406b2a15a1d24c4ff5d13d88c9ca 100644
--- a/Numeric/HierarchicalBasisHcurlQuad.cpp
+++ b/Numeric/HierarchicalBasisHcurlQuad.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlQuad.h b/Numeric/HierarchicalBasisHcurlQuad.h
index b0fe95787ce95d8dc2ecbe541099c965704d777b..f9ba0db371b0f52557441bc85f1aa1547d25f137 100644
--- a/Numeric/HierarchicalBasisHcurlQuad.h
+++ b/Numeric/HierarchicalBasisHcurlQuad.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlTetra.cpp b/Numeric/HierarchicalBasisHcurlTetra.cpp
index 8898e6652f0f989adbef58d9a70e4088ab2ba1ca..eaebf965192463e62111b2a3059775700237dabb 100644
--- a/Numeric/HierarchicalBasisHcurlTetra.cpp
+++ b/Numeric/HierarchicalBasisHcurlTetra.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -614,7 +614,7 @@ void HierarchicalBasisHcurlTetra::orientOneFace(
       // edge-based face functions
       for(int i = 0; i < 3; i++) {
         double product2 = 0;
-        std::vector<double> *normal(0);
+        std::vector<double> *normal(nullptr);
         switch(i) {
         case(0):
           product2 = lambda[1] * lambda[0];
diff --git a/Numeric/HierarchicalBasisHcurlTetra.h b/Numeric/HierarchicalBasisHcurlTetra.h
index fb1383794bc7a05ebde15465f4409b1684c960e3..6e5211d53347541f41c93ea265c3c5a10dd6eb13 100644
--- a/Numeric/HierarchicalBasisHcurlTetra.h
+++ b/Numeric/HierarchicalBasisHcurlTetra.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HierarchicalBasisHcurlTria.cpp b/Numeric/HierarchicalBasisHcurlTria.cpp
index 27882a5c4567c50584c2e68cdc0f3edf25c9da42..b9241a353f3c17622c8c54494360f9f5f791a04c 100644
--- a/Numeric/HierarchicalBasisHcurlTria.cpp
+++ b/Numeric/HierarchicalBasisHcurlTria.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -507,7 +507,7 @@ void HierarchicalBasisHcurlTria::orientOneFace(
       // edge-based face functions
       for(int i = 0; i < 3; i++) {
         double product2 = 0;
-        std::vector<double> *normal(0);
+        std::vector<double> *normal(nullptr);
         switch(i) {
         case(0):
           product2 = lambda[1] * lambda[0];
diff --git a/Numeric/HierarchicalBasisHcurlTria.h b/Numeric/HierarchicalBasisHcurlTria.h
index 1119ccb8a5671e0ddd5cbb5c52c57c4132a25f08..24e4ba956d64265e91220918dceb235ae2820aa4 100644
--- a/Numeric/HierarchicalBasisHcurlTria.h
+++ b/Numeric/HierarchicalBasisHcurlTria.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HilbertCurve.cpp b/Numeric/HilbertCurve.cpp
index badd21322e2c04dff7c3c5238dce305400167467..c6d80cc4555f66595ae339c87980dbd8e925091c 100644
--- a/Numeric/HilbertCurve.cpp
+++ b/Numeric/HilbertCurve.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/HilbertCurve.h b/Numeric/HilbertCurve.h
index 5c4d5fded5e7cff0a9ab901f8c65e520cf2ca51d..876fece5b5bc53933d57115480aeb17f38cf09e0 100644
--- a/Numeric/HilbertCurve.h
+++ b/Numeric/HilbertCurve.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/InnerVertexPlacement.cpp b/Numeric/InnerVertexPlacement.cpp
index 72bbc17166981b706e77446bfb19a58858780cc8..a6d1ad614fb507e103219f9cbde73cf7aefc0e9f 100644
--- a/Numeric/InnerVertexPlacement.cpp
+++ b/Numeric/InnerVertexPlacement.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -32,7 +32,7 @@ namespace {
 
 fullMatrix<double> *getInnerVertexPlacement(int type, int order)
 {
-  if(type < 3 || type > 8) return NULL;
+  if(type < 3 || type > 8) return nullptr;
   std::map<int, fullMatrix<double> *>::iterator it;
   it = storedMatrices[type - 3].find(order);
   if(it != storedMatrices[type - 3].end()) { return it->second; }
diff --git a/Numeric/InnerVertexPlacement.h b/Numeric/InnerVertexPlacement.h
index 0cbf3147b4882dd13fef8f2aa7415a1abf64fc0d..87373feec1f0cec2ebaae539dd7dd7c789510ed6 100644
--- a/Numeric/InnerVertexPlacement.h
+++ b/Numeric/InnerVertexPlacement.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/Iso.cpp b/Numeric/Iso.cpp
index c98bbe3a5f24c9fc0e8f36b452363a613f2bafbe..f83c2f41b642035488ea5ec012afca4e2edf3c46 100644
--- a/Numeric/Iso.cpp
+++ b/Numeric/Iso.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/Iso.h b/Numeric/Iso.h
index 79b621e1bfab3a6652cbb8a1c707b21a5c0fb580..8bf86032e8ee8721f67acb4b474a100eb224c637 100644
--- a/Numeric/Iso.h
+++ b/Numeric/Iso.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/JacobianBasis.cpp b/Numeric/JacobianBasis.cpp
index 73635fcb823901517434599e7cfaf75d895f3b83..6aba6584fdf7c2b52c5b4adbd70b1a14a017a882 100644
--- a/Numeric/JacobianBasis.cpp
+++ b/Numeric/JacobianBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/JacobianBasis.h b/Numeric/JacobianBasis.h
index 857ff30fdc9103b6081bab194574113c47c48db4..73806b4c9f8e4c51ccec5dc9c1fd408c32097195 100644
--- a/Numeric/JacobianBasis.h
+++ b/Numeric/JacobianBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -123,7 +123,7 @@ public:
                                 fullMatrix<double> &gradLambdaJ) const;
   inline void getSignedJacobian(const fullMatrix<double> &nodesXYZ,
                                 fullVector<double> &jacobian,
-                                const fullMatrix<double> *normals = NULL) const
+                                const fullMatrix<double> *normals = nullptr) const
   {
     getJacobianGeneral(numSamplingPnts, _gradBasis->dShapeMat_dX,
                        _gradBasis->dShapeMat_dY, _gradBasis->dShapeMat_dZ,
@@ -133,7 +133,7 @@ public:
                                 const fullMatrix<double> &nodesY,
                                 const fullMatrix<double> &nodesZ,
                                 fullMatrix<double> &jacobian,
-                                const fullMatrix<double> *normals = NULL) const
+                                const fullMatrix<double> *normals = nullptr) const
   {
     getJacobianGeneral(numSamplingPnts, _gradBasis->dShapeMat_dX,
                        _gradBasis->dShapeMat_dY, _gradBasis->dShapeMat_dZ,
@@ -142,7 +142,7 @@ public:
   inline void
   getSignedIdealJacobian(const fullMatrix<double> &nodesXYZ,
                          fullVector<double> &jacobian,
-                         const fullMatrix<double> *normals = NULL) const
+                         const fullMatrix<double> *normals = nullptr) const
   {
     getJacobianGeneral(numSamplingPnts, _gradBasis->dShapeIdealMat_dX,
                        _gradBasis->dShapeIdealMat_dY,
@@ -152,7 +152,7 @@ public:
   inline void getSignedIdealJacobian(
     const fullMatrix<double> &nodesX, const fullMatrix<double> &nodesY,
     const fullMatrix<double> &nodesZ, fullMatrix<double> &jacobian,
-    const fullMatrix<double> *normals = NULL) const
+    const fullMatrix<double> *normals = nullptr) const
   {
     getJacobianGeneral(numSamplingPnts, _gradBasis->dShapeIdealMat_dX,
                        _gradBasis->dShapeIdealMat_dY,
@@ -164,7 +164,7 @@ public:
   {
     getJacobianGeneral(numSamplingPnts, _gradBasis->dShapeMat_dX,
                        _gradBasis->dShapeMat_dY, _gradBasis->dShapeMat_dZ,
-                       nodesXYZ, false, true, jacobian, NULL);
+                       nodesXYZ, false, true, jacobian, nullptr);
   }
   inline void getScaledJacobian(const fullMatrix<double> &nodesX,
                                 const fullMatrix<double> &nodesY,
@@ -173,12 +173,12 @@ public:
   {
     getJacobianGeneral(numSamplingPnts, _gradBasis->dShapeMat_dX,
                        _gradBasis->dShapeMat_dY, _gradBasis->dShapeMat_dZ,
-                       nodesX, nodesY, nodesZ, false, true, jacobian, NULL);
+                       nodesX, nodesY, nodesZ, false, true, jacobian, nullptr);
   }
   inline void
   getSignedJacobianFast(const fullMatrix<double> &nodesXYZ,
                         fullVector<double> &jacobian,
-                        const fullMatrix<double> *normals = NULL) const
+                        const fullMatrix<double> *normals = nullptr) const
   {
     getJacobianGeneral(numSamplingPntsFast, dFastShapeMat_dX, dFastShapeMat_dY,
                        dFastShapeMat_dZ, nodesXYZ, false, false, jacobian,
@@ -187,7 +187,7 @@ public:
   inline void
   getScaledJacobianFast(const fullMatrix<double> &nodesXYZ,
                         fullVector<double> &jacobian,
-                        const fullMatrix<double> *normals = NULL) const
+                        const fullMatrix<double> *normals = nullptr) const
   {
     getJacobianGeneral(numSamplingPntsFast, dFastShapeMat_dX, dFastShapeMat_dY,
                        dFastShapeMat_dZ, nodesXYZ, false, true, jacobian,
diff --git a/Numeric/Numeric.cpp b/Numeric/Numeric.cpp
index c815e7b97fa025aadcd37ce2b1f8d3dfa81d4f19..4580a297db86d1f2f88564c34b72293c21e1d8b6 100644
--- a/Numeric/Numeric.cpp
+++ b/Numeric/Numeric.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/Numeric.h b/Numeric/Numeric.h
index ef9063b2beb2c93290094085044d71fc4f9a310e..6707555021a3e9945877c04abb2719103d019f0f 100644
--- a/Numeric/Numeric.h
+++ b/Numeric/Numeric.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -153,7 +153,7 @@ double triangle_area(double p0[3], double p1[3], double p2[3]);
 double triangle_area2d(double p0[2], double p1[2], double p2[2]);
 void circumCenterXY(double *p1, double *p2, double *p3, double *res);
 void circumCenterXYZ(double *p1, double *p2, double *p3, double *res,
-                     double *uv = 0);
+                     double *uv = nullptr);
 // operate a transformation on the 4 points of a Quad in 3D, to have an
 // equivalent Quad in 2D
 void planarQuad_xyz2xy(double *x, double *y, double *z, double *xn, double *yn);
diff --git a/Numeric/approximationError.cpp b/Numeric/approximationError.cpp
index b6f8091e003530bd61d6416c07b507a6b77d3265..6b009af1ebb40e861c21e5c678e8d6d2e4f1cece 100644
--- a/Numeric/approximationError.cpp
+++ b/Numeric/approximationError.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/approximationError.h b/Numeric/approximationError.h
index 092c2e62c30834b0389d79db69e0910ee6f4a2e7..d0fa0facd17190d0e480cbc9b5140be3b4809f54 100644
--- a/Numeric/approximationError.h
+++ b/Numeric/approximationError.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/bezierBasis.cpp b/Numeric/bezierBasis.cpp
index 9ca80dd0e0fc6684f224d63afc4c10f3f1487e2f..a118e12de5cac3379f3790cce5d595b679810f05 100644
--- a/Numeric/bezierBasis.cpp
+++ b/Numeric/bezierBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -183,7 +183,7 @@ namespace {
 } // namespace
 
 bezierBasis::bezierBasis(FuncSpaceData data)
-  : _funcSpaceData(data), _raiser(NULL)
+  : _funcSpaceData(data), _raiser(nullptr)
 {
   if(_funcSpaceData.getType() == TYPE_PYR)
     _constructPyr();
@@ -601,8 +601,8 @@ void bezierBasisRaiser::computeCoeff(const fullVector<double> &coeffA,
       "or A != B == C");
 }
 
-bezierCoeffMemoryPool *bezierCoeff::_pool0 = NULL;
-bezierCoeffMemoryPool *bezierCoeff::_pool1 = NULL;
+bezierCoeffMemoryPool *bezierCoeff::_pool0 = nullptr;
+bezierCoeffMemoryPool *bezierCoeff::_pool1 = nullptr;
 fullMatrix<double> bezierCoeff::_sub = fullMatrix<double>();
 
 bezierCoeff::bezierCoeff(FuncSpaceData data, const fullMatrix<double> &lagCoeff,
@@ -782,8 +782,8 @@ void bezierCoeff::releasePools()
 {
   delete _pool0;
   delete _pool1;
-  _pool0 = NULL;
-  _pool1 = NULL;
+  _pool0 = nullptr;
+  _pool1 = nullptr;
 }
 
 void bezierCoeff::updateDataPtr(long diff)
@@ -1433,7 +1433,7 @@ double *bezierCoeffMemoryPool::giveBlock(bezierCoeff *bez)
       _bezierCoeff.push_back(bez);
     else if(_bezierCoeff[idx]) {
       Msg::Error("this block is being used!?");
-      return NULL;
+      return nullptr;
     }
     else
       _bezierCoeff[idx] = bez;
@@ -1459,7 +1459,7 @@ double *bezierCoeffMemoryPool::giveBlock(bezierCoeff *bez)
   // NULL which should never happens.
   Msg::Error("Wrong state of bezierCoeffMemoryPool."
              "_bezierCoeff[i] not correct?");
-  return NULL;
+  return nullptr;
 }
 
 void bezierCoeffMemoryPool::releaseBlock(double *block, bezierCoeff *bez)
@@ -1470,7 +1470,7 @@ void bezierCoeffMemoryPool::releaseBlock(double *block, bezierCoeff *bez)
   //    Msg::Info("It's a good guess!");
   //  else
   //    Msg::Info("Did not work :'( ");
-  _bezierCoeff[idx] = NULL;
+  _bezierCoeff[idx] = nullptr;
   if(idx == _endOfSearch - 1) {
     do {
       --_endOfSearch;
diff --git a/Numeric/bezierBasis.h b/Numeric/bezierBasis.h
index 701c30a97523e4ecfd89d2e6eabd1122652f28ca..abd1ca651c3be0eae0f52735652b1b731e541acc 100644
--- a/Numeric/bezierBasis.h
+++ b/Numeric/bezierBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/cartesian.h b/Numeric/cartesian.h
index 1377fa8b2f76dc880bd61333e084cfebd9bc1830..21e29dd72b1d037c8818ccd2532fe06465cbb2da 100644
--- a/Numeric/cartesian.h
+++ b/Numeric/cartesian.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -79,7 +79,7 @@ private:
   void _printElements(FILE *f, bool simplex, int startingNum = 1)
   {
     int num = startingNum;
-    for(cellIter it = _activeCells.begin(); it != _activeCells.end(); ++it) {
+    for(auto it = _activeCells.begin(); it != _activeCells.end(); ++it) {
       int i, j, k;
       getCellIJK(*it, i, j, k);
       if(!simplex) {
@@ -318,7 +318,7 @@ public:
   }
   void createNodalValues()
   {
-    for(cellIter it = _activeCells.begin(); it != _activeCells.end(); ++it) {
+    for(auto it = _activeCells.begin(); it != _activeCells.end(); ++it) {
       const int &t = *it;
       int i, j, k;
       getCellIJK(t, i, j, k);
diff --git a/Numeric/curvature.cpp b/Numeric/curvature.cpp
index 90100e300c3c93ae38e4c8609199346f6adb9760..9c3818fdb536bdea6c80bc5b952e05648765bc83 100644
--- a/Numeric/curvature.cpp
+++ b/Numeric/curvature.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/curvature.h b/Numeric/curvature.h
index 0abc9049af31e574ef8fec438f57eb98bdf32b60..a7a4702d93c4132c6a73c4553ca72618197d79e5 100644
--- a/Numeric/curvature.h
+++ b/Numeric/curvature.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/decasteljau.cpp b/Numeric/decasteljau.cpp
index 96242dae9ec914fc050ecb4737786912d6217531..f7f9c0ce6ca38f9a61caaf0d5c791c2fad4b41e5 100644
--- a/Numeric/decasteljau.cpp
+++ b/Numeric/decasteljau.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/decasteljau.h b/Numeric/decasteljau.h
index da2768a638a57d52d1d5b917fb85a9803410bdd4..5799218d9251340d77fa698b65590a3cc58091fc 100644
--- a/Numeric/decasteljau.h
+++ b/Numeric/decasteljau.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/discreteFrechetDistance.cpp b/Numeric/discreteFrechetDistance.cpp
index bb87c663c16e14f60f4b0043ae93ed16e1f67592..c43752f480aed6608b962e60307d58d1c8ffb3a1 100644
--- a/Numeric/discreteFrechetDistance.cpp
+++ b/Numeric/discreteFrechetDistance.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/discreteFrechetDistance.h b/Numeric/discreteFrechetDistance.h
index e9cbdcf5c60c3aaa14f37af8daae81bf43a2bb2c..b755c3c92b77673984eaea56f9e5e00e87ac5840 100644
--- a/Numeric/discreteFrechetDistance.h
+++ b/Numeric/discreteFrechetDistance.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/fullMatrix.cpp b/Numeric/fullMatrix.cpp
index 4dece398ab0d548cbc5c78840610a9bc6fab7c79..3c830453282ed44be09e52ad1387aa2e03c8149b 100644
--- a/Numeric/fullMatrix.cpp
+++ b/Numeric/fullMatrix.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/fullMatrix.h b/Numeric/fullMatrix.h
index 1df324ca36cb1b24f3705cfeb528c6f6c3d5710a..2024956c4a163eac7d977fd76372caa64ab0342f 100644
--- a/Numeric/fullMatrix.h
+++ b/Numeric/fullMatrix.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/hausdorffDistance.cpp b/Numeric/hausdorffDistance.cpp
index 12f525439c7d5846ff70c402826fd553d48df91b..7e2d819842987519e0c63b028c6dc86de030f3d7 100644
--- a/Numeric/hausdorffDistance.cpp
+++ b/Numeric/hausdorffDistance.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/hausdorffDistance.h b/Numeric/hausdorffDistance.h
index 9b0af6b3ca55eb6acba81a94ba4b401631717d12..d7c578edaf2914daf1fc1cf12d406fb84a96874b 100644
--- a/Numeric/hausdorffDistance.h
+++ b/Numeric/hausdorffDistance.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/incompleteBasis.cpp b/Numeric/incompleteBasis.cpp
index fea57c344f4ba406cf2613c9b0f9cf2790713b45..c54fe713f9c61b4918c26830272f2c23265a8a9d 100644
--- a/Numeric/incompleteBasis.cpp
+++ b/Numeric/incompleteBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -55,7 +55,7 @@ incompleteBasis::incompleteBasis(int tag)
   // If the element is complete, compute the incomplete basis anyway
   : nodalBasis(ElementType::getType(ElementType::getParentType(tag),
                                     ElementType::getOrder(tag), true)),
-    completeBasis(NULL), polyBasis(NULL)
+    completeBasis(nullptr), polyBasis(nullptr)
 {
   int tagComplete = ElementType::getType(parentType, order, false);
   switch(parentType) {
diff --git a/Numeric/incompleteBasis.h b/Numeric/incompleteBasis.h
index 879a7979a1250b2f680b597bb6b75967bc55d0d7..b357f3342acfa10be685147a65fe2d50713ca842 100644
--- a/Numeric/incompleteBasis.h
+++ b/Numeric/incompleteBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/mathEvaluator.cpp b/Numeric/mathEvaluator.cpp
index c861b1b4999f43589c0e4200676d065ddd8cdb6d..3ee5aaeb951699e76d2715867b35dc523a91d3cf 100644
--- a/Numeric/mathEvaluator.cpp
+++ b/Numeric/mathEvaluator.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/mathEvaluator.h b/Numeric/mathEvaluator.h
index 97954d909d7aacf3d40968bfd306d4a5434b9bf8..44349d2992820e6f7082aea5ecdeada1f5ef6a29 100644
--- a/Numeric/mathEvaluator.h
+++ b/Numeric/mathEvaluator.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/miniBasis.cpp b/Numeric/miniBasis.cpp
index 780fa0eadc811e1838a7c69d55c0c18386957da3..74c4147d5bf99f0b5829cfbad46bf41a3f701980 100644
--- a/Numeric/miniBasis.cpp
+++ b/Numeric/miniBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/miniBasis.h b/Numeric/miniBasis.h
index 066b45f255ce2b72281f3cc84fa2697eb68402f4..2f38c4caa0544731649e83fbd9ee596182882a50 100644
--- a/Numeric/miniBasis.h
+++ b/Numeric/miniBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/nodalBasis.cpp b/Numeric/nodalBasis.cpp
index d020071ece798aee4d02bcac57c0c69009b13e93..09af9d187ec8c02ff72635fde6fcfb59e506f3ba 100644
--- a/Numeric/nodalBasis.cpp
+++ b/Numeric/nodalBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -685,7 +685,7 @@ namespace ClosureGen {
             nodeSum += faces[iFace][iNode] < 0 ?
                          faces[iFace][iNode] :
                          closureFull[i][faces[iFace][iNode]];
-          std::map<int, int>::iterator it = nodeSum2Face.find(nodeSum);
+          auto it = nodeSum2Face.find(nodeSum);
           if(it == nodeSum2Face.end()) Msg::Error("Prism face not found");
           int mappedFaceId = it->second;
           if(mappedFaceId > 1) {
diff --git a/Numeric/nodalBasis.h b/Numeric/nodalBasis.h
index 01ab42be6c1babf56f0408f15f31d2674dbb033b..57981b507cf0f4512d7d45846988d003a799d53e 100644
--- a/Numeric/nodalBasis.h
+++ b/Numeric/nodalBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/orthogonalBasis.cpp b/Numeric/orthogonalBasis.cpp
index 6e60aaa95800d8f6f5dd2768ee8ef05e6775b4d1..7783f22b10356d79181dd457aa5371ee7d4d794b 100644
--- a/Numeric/orthogonalBasis.cpp
+++ b/Numeric/orthogonalBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/orthogonalBasis.h b/Numeric/orthogonalBasis.h
index 2f708ecb40ca145c1a6e422794f0583fb92c8b4d..0c043e12e98af116cb1da2b8c17702f291d540ed 100644
--- a/Numeric/orthogonalBasis.h
+++ b/Numeric/orthogonalBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/pointsGenerators.cpp b/Numeric/pointsGenerators.cpp
index 55858eb5018cf890940fe329f530d19819f8ff7c..6e3dd0ed7265fcd8992a0ea6988ad94ae431cd8d 100644
--- a/Numeric/pointsGenerators.cpp
+++ b/Numeric/pointsGenerators.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/pointsGenerators.h b/Numeric/pointsGenerators.h
index e7ce96abaebb1074ad07ae7c445423d7d9e0c288..24651f3dd430dbc0943dd71700cf24ca046475e9 100644
--- a/Numeric/pointsGenerators.h
+++ b/Numeric/pointsGenerators.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/polynomialBasis.cpp b/Numeric/polynomialBasis.cpp
index 2520896d78751ab928394cca7497c588ad13786e..2c2d9cce8325a32b900e07de45d0ccf886e31f29 100644
--- a/Numeric/polynomialBasis.cpp
+++ b/Numeric/polynomialBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/polynomialBasis.h b/Numeric/polynomialBasis.h
index ad04666bd0bd8ffb32405085dc1afda887e26cfc..3bbcd9c6686de76e371359380d7d43dc8ce46908 100644
--- a/Numeric/polynomialBasis.h
+++ b/Numeric/polynomialBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/pyramidalBasis.cpp b/Numeric/pyramidalBasis.cpp
index 4f95895d00b1372b5635d6415f58defb8e07c6fe..c483fec1f7cc963963529dd1c0af1788067282f8 100644
--- a/Numeric/pyramidalBasis.cpp
+++ b/Numeric/pyramidalBasis.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -8,7 +8,7 @@
 #include "pyramidalBasis.h"
 #include "pointsGenerators.h"
 
-pyramidalBasis::pyramidalBasis(int tag) : nodalBasis(tag), bergot(0)
+pyramidalBasis::pyramidalBasis(int tag) : nodalBasis(tag), bergot(nullptr)
 {
   if(serendip && order > 2) {
     Msg::Warning("Serendipity pyramid for order %i not yet implemented", order);
diff --git a/Numeric/pyramidalBasis.h b/Numeric/pyramidalBasis.h
index f721d471d92989ff46a0c031765b3f6761267afb..7cb8343dee4157e3dcf21ec4862863e4ad72fb39 100644
--- a/Numeric/pyramidalBasis.h
+++ b/Numeric/pyramidalBasis.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/robustPredicates.h b/Numeric/robustPredicates.h
index 2a741bcd12e6c5891e937d7051e6af0346062c9d..65089216983422d4e2f64623803dee57f80da660 100644
--- a/Numeric/robustPredicates.h
+++ b/Numeric/robustPredicates.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Numeric/simpleFunction.h b/Numeric/simpleFunction.h
index 2d5db5e5d781a9f9f8fdf2612d4fcf6a2cd0754f..284e78ea3f2620177eed7df2338f43a9124ce567 100644
--- a/Numeric/simpleFunction.h
+++ b/Numeric/simpleFunction.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -44,7 +44,7 @@ class constantPerElement : public simpleFunction<scalar> {
   mutable MElement *_e;
 
 public:
-  constantPerElement() : _e(0) {}
+  constantPerElement() : _e(nullptr) {}
   void set(MElement *e, scalar v) { _data[e] = v; }
   void setElement(MElement *e) const { _e = e; }
   virtual scalar operator()(double x, double y, double z) const
@@ -61,7 +61,7 @@ class simpleFunctionOnElement : public simpleFunction<scalar> {
   mutable MElement *_e;
 
 public:
-  simpleFunctionOnElement(scalar val = 0) : simpleFunction<scalar>(val), _e(0)
+  simpleFunctionOnElement(scalar val = 0) : simpleFunction<scalar>(val), _e(nullptr)
   {
   }
   virtual ~simpleFunctionOnElement() {}
diff --git a/Numeric/simpleFunctionPython.h b/Numeric/simpleFunctionPython.h
index 0443cc748adbc11a20c2045783d0d2196c6ab1be..c0265b9025b0971a50f3c05356c40f65a54c2f45 100644
--- a/Numeric/simpleFunctionPython.h
+++ b/Numeric/simpleFunctionPython.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/CMakeLists.txt b/Parser/CMakeLists.txt
index d3cf8b5f99c638508bf3584a8658abbea17b7ffc..db7e4d87b1f2550d722a38b9fa8029570dd6c3d9 100644
--- a/Parser/CMakeLists.txt
+++ b/Parser/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/FunctionManager.cpp b/Parser/FunctionManager.cpp
index 8c6fe4ce88697a7a5d11f53d3695da6cf198d1ca..52aae410393abc7cd9f6c6f65c7a49f81d9690fd 100644
--- a/Parser/FunctionManager.cpp
+++ b/Parser/FunctionManager.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -29,7 +29,7 @@ class FunctionManagerMap
   std::map<std::string, File_Position> m;
 };
 
-FunctionManager *FunctionManager::instance = 0;
+FunctionManager *FunctionManager::instance = nullptr;
 
 FunctionManager::FunctionManager()
 {
diff --git a/Parser/FunctionManager.h b/Parser/FunctionManager.h
index db8b765562c08b63b57e157d52a1a6fc03548233..9585ad4feef2447b5e17ea265c7a5a65d991638d 100644
--- a/Parser/FunctionManager.h
+++ b/Parser/FunctionManager.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/Gmsh.l b/Parser/Gmsh.l
index 40285a58228ff1dfe22c6ca98e4566f992332b88..1a33d78330b47889d787011743aeb70082017a47 100644
--- a/Parser/Gmsh.l
+++ b/Parser/Gmsh.l
@@ -1,5 +1,5 @@
 %{
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp
index c5892e1afbc48e696c08fa04efe903f56a45edb1..f5c8612c2330b773a6ad0432df4c8e75a6ade21e 100644
--- a/Parser/Gmsh.tab.cpp
+++ b/Parser/Gmsh.tab.cpp
@@ -570,7 +570,7 @@
 /* Copy the first part of user declarations.  */
 #line 1 "Gmsh.y"
 
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y
index cff5f78fd822e56253c637368ed4cf5001918462..cec8417a49dcf66407c5a040f523a0e5e47fcda0 100644
--- a/Parser/Gmsh.y
+++ b/Parser/Gmsh.y
@@ -1,5 +1,5 @@
 %{
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp
index 7b45cf506de56a12cec299d4949347f9faf0943c..eb4ea6a2b17d559935da99bf7d5b355153e3a006 100644
--- a/Parser/Gmsh.yy.cpp
+++ b/Parser/Gmsh.yy.cpp
@@ -1308,7 +1308,7 @@ int gmsh_yy_flex_debug = 0;
 char *gmsh_yytext;
 #line 1 "Gmsh.l"
 #line 2 "Gmsh.l"
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Parser/Parser.h b/Parser/Parser.h
index d5e7e7ed62194c279785905ff24541f04af64363..2b27d55574224b6079f95e1507614c010f79fcaf 100644
--- a/Parser/Parser.h
+++ b/Parser/Parser.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/AnalyseMeshQuality.cpp b/Plugin/AnalyseMeshQuality.cpp
index 88784ea06b204f8ab50660e36cf53e99a997d0ba..58e9d7a6c7e6846f24331b20938aa7256846ee08 100644
--- a/Plugin/AnalyseMeshQuality.cpp
+++ b/Plugin/AnalyseMeshQuality.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -25,14 +25,14 @@
 #endif
 
 StringXNumber CurvedMeshOptions_Number[] = {
-  {GMSH_FULLRC, "JacobianDeterminant", NULL, 0},
-  {GMSH_FULLRC, "IGEMeasure", NULL, 0},
-  {GMSH_FULLRC, "ICNMeasure", NULL, 0},
-  {GMSH_FULLRC, "HidingThreshold", NULL, 99},
-  {GMSH_FULLRC, "ThresholdGreater", NULL, 1},
-  {GMSH_FULLRC, "CreateView", NULL, 0},
-  {GMSH_FULLRC, "Recompute", NULL, 0},
-  {GMSH_FULLRC, "DimensionOfElements", NULL, -1}
+  {GMSH_FULLRC, "JacobianDeterminant", nullptr, 0},
+  {GMSH_FULLRC, "IGEMeasure", nullptr, 0},
+  {GMSH_FULLRC, "ICNMeasure", nullptr, 0},
+  {GMSH_FULLRC, "HidingThreshold", nullptr, 99},
+  {GMSH_FULLRC, "ThresholdGreater", nullptr, 1},
+  {GMSH_FULLRC, "CreateView", nullptr, 0},
+  {GMSH_FULLRC, "Recompute", nullptr, 0},
+  {GMSH_FULLRC, "DimensionOfElements", nullptr, -1}
 #if defined(HAVE_VISUDEV)
   ,
   {GMSH_FULLRC, "Element to draw quality", NULL, 0}
@@ -234,7 +234,7 @@ PView *GMSH_AnalyseMeshQualityPlugin::execute(PView *v)
 #endif
   }
 
-  return NULL;
+  return nullptr;
 }
 
 void GMSH_AnalyseMeshQualityPlugin::_computeMinMaxJandValidity(int dim)
@@ -244,15 +244,15 @@ void GMSH_AnalyseMeshQualityPlugin::_computeMinMaxJandValidity(int dim)
   std::set<GEntity *, GEntityPtrFullLessThan> entities;
   switch(dim) {
   case 3:
-    for(GModel::riter it = _m->firstRegion(); it != _m->lastRegion(); it++)
+    for(auto it = _m->firstRegion(); it != _m->lastRegion(); it++)
       entities.insert(*it);
     break;
   case 2:
-    for(GModel::fiter it = _m->firstFace(); it != _m->lastFace(); it++)
+    for(auto it = _m->firstFace(); it != _m->lastFace(); it++)
       entities.insert(*it);
     break;
   case 1:
-    for(GModel::eiter it = _m->firstEdge(); it != _m->lastEdge(); it++)
+    for(auto it = _m->firstEdge(); it != _m->lastEdge(); it++)
       entities.insert(*it);
     break;
   default: return;
@@ -263,7 +263,7 @@ void GMSH_AnalyseMeshQualityPlugin::_computeMinMaxJandValidity(int dim)
   for(it = entities.begin(); it != entities.end(); ++it) {
     GEntity *entity = *it;
     unsigned num = entity->getNumMeshElements();
-    fullMatrix<double> *normals = NULL;
+    fullMatrix<double> *normals = nullptr;
     switch(dim) {
     case 3:
       Msg::StatusBar(true, "Volume %d: checking the Jacobian of %d elements",
diff --git a/Plugin/AnalyseMeshQuality.h b/Plugin/AnalyseMeshQuality.h
index 8fb25a42a75ca0280addd26cf71cfe68ac70815d..112b43cd25345260539ac367381bf5e752e8d164 100644
--- a/Plugin/AnalyseMeshQuality.h
+++ b/Plugin/AnalyseMeshQuality.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -58,7 +58,7 @@ private:
 public:
   GMSH_AnalyseMeshQualityPlugin()
   {
-    _m = NULL;
+    _m = nullptr;
     for(int i = 0; i < 3; ++i) {
       _computedJac[i] = false;
       _computedIGE[i] = false;
diff --git a/Plugin/Annotate.cpp b/Plugin/Annotate.cpp
index 379b035fa90fec8e97e0fd9f6b44990b0b109989..b56d1ed798cf221568c68a6b7d6d8db27081f55d 100644
--- a/Plugin/Annotate.cpp
+++ b/Plugin/Annotate.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -18,7 +18,7 @@ StringXNumber AnnotateOptions_Number[] = {
   {GMSH_FULLRC, "Z", GMSH_AnnotatePlugin::callbackZ, 0.},
   {GMSH_FULLRC, "ThreeD", GMSH_AnnotatePlugin::callback3D, 0.},
   {GMSH_FULLRC, "FontSize", GMSH_AnnotatePlugin::callbackFontSize, 14.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 StringXString AnnotateOptions_String[] = {
   {GMSH_FULLRC, "Text", GMSH_AnnotatePlugin::callbackText, "My Text"},
diff --git a/Plugin/Annotate.h b/Plugin/Annotate.h
index f3042e006dddb36489e4ce2697e7061a6301f528..4a7a20a03353519eeecf461519bb5dd9a11a3f23 100644
--- a/Plugin/Annotate.h
+++ b/Plugin/Annotate.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/BoundaryAngles.cpp b/Plugin/BoundaryAngles.cpp
index 4290b244be93293dc47fc12e512083c1e7f46e38..9060ce119bdf65a13d881a3b8298de38f6aa2193 100644
--- a/Plugin/BoundaryAngles.cpp
+++ b/Plugin/BoundaryAngles.cpp
@@ -18,15 +18,15 @@
 #include <vector>
 
 StringXNumber BoundaryAnglesOptions_Number[] = {
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "Save", NULL, 0.},
-  {GMSH_FULLRC, "Visible", NULL, 0.},
-  {GMSH_FULLRC, "Remove", NULL, 0.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "Save", nullptr, 0.},
+  {GMSH_FULLRC, "Visible", nullptr, 0.},
+  {GMSH_FULLRC, "Remove", nullptr, 0.},
 };
 
 StringXString BoundaryAnglesOptions_String[] = {
-  {GMSH_FULLRC, "Filename", NULL, "Angles_Surface"},
-  {GMSH_FULLRC, "Dir", NULL, ""},
+  {GMSH_FULLRC, "Filename", nullptr, "Angles_Surface"},
+  {GMSH_FULLRC, "Dir", nullptr, ""},
 };
 
 extern "C" {
@@ -88,14 +88,14 @@ PView *GMSH_BoundaryAnglesPlugin::execute(PView *v)
   std::string opt_dir = BoundaryAnglesOptions_String[1].def;
   // get the mesh of the current model, and iterate on the surfaces
   GModel *m = GModel::current();
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     GFace *gf = *it;
     std::set<std::pair<MEdge, MElement *>, Less_EdgeEle> boundaryEdges;
     for(std::size_t i = 0; i < gf->getNumMeshElements(); i++) {
       MElement *e = gf->getMeshElement(i);
       for(int j = 0; j < e->getNumEdges(); j++) {
         std::pair<MEdge, MElement *> ed(e->getEdge(j), e);
-        std::set<std::pair<MEdge, MElement *>, Less_EdgeEle>::iterator it =
+        auto it =
           boundaryEdges.find(ed);
         if(it == boundaryEdges.end()) { boundaryEdges.insert(ed); }
         else {
@@ -109,7 +109,7 @@ PView *GMSH_BoundaryAnglesPlugin::execute(PView *v)
     PViewDataList *data = getDataList(view);
     std::vector<MEdge> edges;
     SVector3 normal(0, 0, 1.);
-    for(std::set<std::pair<MEdge, MElement *>, Less_EdgeEle>::iterator it =
+    for(auto it =
           boundaryEdges.begin();
         it != boundaryEdges.end(); ++it) {
       edges.push_back(it->first);
@@ -124,7 +124,7 @@ PView *GMSH_BoundaryAnglesPlugin::execute(PView *v)
         // order; reverse if necessary
         {
           // First edge (and element) of the boundary
-          std::set<std::pair<MEdge, MElement *>, Less_EdgeEle>::iterator it2 =
+          auto it2 =
             boundaryEdges.begin();
           // Loop on every sorted and consecutive nodes
           for(int j = 0; j < static_cast<int>(nodes[0].size()) - 1; j++) {
@@ -193,5 +193,5 @@ PView *GMSH_BoundaryAnglesPlugin::execute(PView *v)
     
   }
 
-  return 0;
+  return nullptr;
 }
diff --git a/Plugin/Bubbles.cpp b/Plugin/Bubbles.cpp
index 0e90c22b4a589fc8fc10f210df9803c4eb4dfb3d..f38ac6f52cce03bcddc34516d2b739cb03aae0f6 100644
--- a/Plugin/Bubbles.cpp
+++ b/Plugin/Bubbles.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,11 +12,11 @@
 #include "OS.h"
 
 StringXNumber BubblesOptions_Number[] = {
-  {GMSH_FULLRC, "ShrinkFactor", NULL, 0.},
+  {GMSH_FULLRC, "ShrinkFactor", nullptr, 0.},
 };
 
 StringXString BubblesOptions_String[] = {
-  {GMSH_FULLRC, "OutputFile", NULL, "bubbles.geo"}};
+  {GMSH_FULLRC, "OutputFile", nullptr, "bubbles.geo"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterBubblesPlugin() { return new GMSH_BubblesPlugin(); }
@@ -100,13 +100,13 @@ PView *GMSH_BubblesPlugin::execute(PView *v)
   double lc = norm(SVector3(bbox.max(), bbox.min())) / 100;
   fprintf(fp, "lc = %g;\n", lc);
 
-  for(GModel::viter vit = m->firstVertex(); vit != m->lastVertex(); vit++)
+  for(auto vit = m->firstVertex(); vit != m->lastVertex(); vit++)
     (*vit)->writeGEO(fp, "lc");
 
-  for(GModel::eiter eit = m->firstEdge(); eit != m->lastEdge(); eit++)
+  for(auto eit = m->firstEdge(); eit != m->lastEdge(); eit++)
     (*eit)->writeGEO(fp);
 
-  for(GModel::fiter fit = m->firstFace(); fit != m->lastFace(); fit++) {
+  for(auto fit = m->firstFace(); fit != m->lastFace(); fit++) {
     (*fit)->writeGEO(fp);
     fprintf(fp, "Delete { Surface {%d}; }\n", (*fit)->tag());
 
@@ -121,7 +121,7 @@ PView *GMSH_BubblesPlugin::execute(PView *v)
           (*fit)->triangles[i]->barycenter());
 
     // add boundary vertices in map to get cells "closer" to the boundary
-    for(std::map<MVertex *, std::vector<SPoint3> >::iterator it = v2t.begin();
+    for(auto it = v2t.begin();
         it != v2t.end(); it++) {
       MVertex *v = it->first;
       if(v->onWhat() && v->onWhat()->dim() < 2)
@@ -129,7 +129,7 @@ PView *GMSH_BubblesPlugin::execute(PView *v)
           SPoint3(it->first->x(), it->first->y(), it->first->z()));
     }
 
-    for(std::map<MVertex *, std::vector<SPoint3> >::iterator it = v2t.begin();
+    for(auto it = v2t.begin();
         it != v2t.end(); it++) {
       if(it->second.size() > 2) {
         // get barycenter of cell boundary points and order them
diff --git a/Plugin/Bubbles.h b/Plugin/Bubbles.h
index 28c5de7cdc3052778508050af87242b959dd58f9..863742f1236aea255addcbd676bbcc958bf2d14b 100644
--- a/Plugin/Bubbles.h
+++ b/Plugin/Bubbles.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt
index 62c831536f22a3279bb1796195c031375871a369..bce0d1f2bfa3cf73f990c4e1d1c90558149daf17 100644
--- a/Plugin/CMakeLists.txt
+++ b/Plugin/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Crack.cpp b/Plugin/Crack.cpp
index 03a2c0041fc4dd377d031d733bfedbe0bb80e111..932cba18dc3ddcaa23c41d3aec54ce4b7447a27c 100644
--- a/Plugin/Crack.cpp
+++ b/Plugin/Crack.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -15,12 +15,12 @@
 #include "Context.h"
 
 StringXNumber CrackOptions_Number[] = {
-  {GMSH_FULLRC, "Dimension", NULL, 1.},
-  {GMSH_FULLRC, "PhysicalGroup", NULL, 1.},
-  {GMSH_FULLRC, "OpenBoundaryPhysicalGroup", NULL, 0.},
-  {GMSH_FULLRC, "NormalX", NULL, 0.},
-  {GMSH_FULLRC, "NormalY", NULL, 0.},
-  {GMSH_FULLRC, "NormalZ", NULL, 1.}};
+  {GMSH_FULLRC, "Dimension", nullptr, 1.},
+  {GMSH_FULLRC, "PhysicalGroup", nullptr, 1.},
+  {GMSH_FULLRC, "OpenBoundaryPhysicalGroup", nullptr, 0.},
+  {GMSH_FULLRC, "NormalX", nullptr, 0.},
+  {GMSH_FULLRC, "NormalY", nullptr, 0.},
+  {GMSH_FULLRC, "NormalZ", nullptr, 1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCrackPlugin() { return new GMSH_CrackPlugin(); }
@@ -149,7 +149,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
           bnd.erase(ed);
       }
     }
-    for(std::set<EdgeData, MEdgeDataLessThan>::iterator it = bnd.begin();
+    for(auto it = bnd.begin();
         it != bnd.end(); it++)
       bndVertices.insert(it->data.begin(), it->data.end());
   }
@@ -187,7 +187,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
       }
     }
   }
-  for(std::set<MVertex *>::iterator it = bndVertices.begin();
+  for(auto it = bndVertices.begin();
       it != bndVertices.end(); it++)
     crackVertices.erase(*it);
 
@@ -204,7 +204,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
           // element touches the crack: find the closest crack element
           SPoint3 b = e->barycenter();
           double d = 1e200;
-          MElement *ce = 0;
+          MElement *ce = nullptr;
           for(std::size_t k = 0; k < crackElements.size(); k++) {
             double d2 = b.distance(crackElements[k]->barycenter());
             if(d2 < d) {
@@ -255,10 +255,10 @@ PView *GMSH_CrackPlugin::execute(PView *view)
   // single new surface/curve, which is probably fine as in solvers we won't use
   // the internal seams.
 
-  GEdge *crackEdge = 0;
-  GFace *crackFace = 0;
+  GEdge *crackEdge = nullptr;
+  GFace *crackFace = nullptr;
   if(dim == 1) {
-    crackEdge = new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, 0, 0);
+    crackEdge = new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, nullptr, nullptr);
     m->add(crackEdge);
   }
   else {
@@ -271,7 +271,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
 
   // duplicate internal crack nodes
   std::map<MVertex *, MVertex *> vxv;
-  for(std::set<MVertex *>::iterator it = crackVertices.begin();
+  for(auto it = crackVertices.begin();
       it != crackVertices.end(); it++) {
     MVertex *v = *it;
     MVertex *newv = new MVertex(v->x(), v->y(), v->z(), crackEntity);
@@ -298,7 +298,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
   }
 
   // replace vertices in elements on one side of the crack
-  for(std::set<MElement *>::iterator it = oneside.begin(); it != oneside.end();
+  for(auto it = oneside.begin(); it != oneside.end();
       it++) {
     MElement *e = *it;
     for(std::size_t i = 0; i < e->getNumVertices(); i++) {
diff --git a/Plugin/Crack.h b/Plugin/Crack.h
index 9b299d57a6d5abba5c5e1fa75d8e17a10a462c46..57b8a7de3fef8e665f5b8d674b4a418eeebbfd8c 100644
--- a/Plugin/Crack.h
+++ b/Plugin/Crack.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Curl.cpp b/Plugin/Curl.cpp
index 424db57f0f1306a0f1324e80418741026d13e74b..eb208797295c9cd356c4f8a0c5126081070caa93 100644
--- a/Plugin/Curl.cpp
+++ b/Plugin/Curl.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,7 +7,7 @@
 #include "shapeFunctions.h"
 #include "GmshDefines.h"
 
-StringXNumber CurlOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber CurlOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCurlPlugin() { return new GMSH_CurlPlugin(); }
diff --git a/Plugin/Curl.h b/Plugin/Curl.h
index 88fb0ff3aa26d0c733ff2dd0c8b1e437b7b500cd..538e10592fa81acee2825ad23ee1b7637041999d 100644
--- a/Plugin/Curl.h
+++ b/Plugin/Curl.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CurvedBndDist.cpp b/Plugin/CurvedBndDist.cpp
index d5f99353a5abc1f7239ef492f7ee9cf2303935ec..96d00cda58977eb3053eb2a816e1bfae56ff1dd3 100644
--- a/Plugin/CurvedBndDist.cpp
+++ b/Plugin/CurvedBndDist.cpp
@@ -141,7 +141,7 @@ PView *GMSH_CurvedBndDistPlugin::execute(PView *v)
   PViewDataList *data = getDataList(pv);
   data->Time.push_back(0.);
   GModel *m = GModel::current();
-  for(GModel::fiter iface = m->firstFace(); iface != m->lastFace(); ++iface) {
+  for(auto iface = m->firstFace(); iface != m->lastFace(); ++iface) {
     GFace *face = *iface;
     for(size_t iElement = 0; iElement < face->getNumMeshElements();
         ++iElement) {
@@ -151,7 +151,7 @@ PView *GMSH_CurvedBndDistPlugin::execute(PView *v)
         int clId = elbasis.getClosureId(iEdge, 1);
         const std::vector<int> &closure = elbasis.closures[clId];
         std::vector<MVertex *> vertices;
-        GEdge *edge = NULL;
+        GEdge *edge = nullptr;
         for(size_t i = 0; i < closure.size(); ++i) {
           MVertex *v = element->getVertex(closure[i]);
           vertices.push_back(v);
diff --git a/Plugin/CutBox.cpp b/Plugin/CutBox.cpp
index 3ef52abe11d306079df38d906ef9f71f0d5d229e..e856dfc7c164b54b583646360622999d270db1c8 100644
--- a/Plugin/CutBox.cpp
+++ b/Plugin/CutBox.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -30,7 +30,7 @@ StringXNumber CutBoxOptions_Number[] = {
   {GMSH_FULLRC, "NumPointsW", GMSH_CutBoxPlugin::callbackW, 20},
   {GMSH_FULLRC, "ConnectPoints", GMSH_CutBoxPlugin::callbackConnect, 1},
   {GMSH_FULLRC, "Boundary", GMSH_CutBoxPlugin::callbackBoundary, 1},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCutBoxPlugin() { return new GMSH_CutBoxPlugin(); }
diff --git a/Plugin/CutBox.h b/Plugin/CutBox.h
index 2b9a5a99f09847c324d5f5a190866a73307a6169..0778e603dc75dc09d8cc51715fc689ce7d8b4ef2 100644
--- a/Plugin/CutBox.h
+++ b/Plugin/CutBox.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CutGrid.cpp b/Plugin/CutGrid.cpp
index 45cb7412604e79fb77c728e1448bb44245bab87d..22308725dd3ac2b2c9ac62deb3bddee0fc40a3c2 100644
--- a/Plugin/CutGrid.cpp
+++ b/Plugin/CutGrid.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -25,7 +25,7 @@ StringXNumber CutGridOptions_Number[] = {
   {GMSH_FULLRC, "NumPointsU", GMSH_CutGridPlugin::callbackU, 20},
   {GMSH_FULLRC, "NumPointsV", GMSH_CutGridPlugin::callbackV, 20},
   {GMSH_FULLRC, "ConnectPoints", GMSH_CutGridPlugin::callbackConnect, 1},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCutGridPlugin() { return new GMSH_CutGridPlugin(); }
diff --git a/Plugin/CutGrid.h b/Plugin/CutGrid.h
index 136ea992b100daef7b55e1317c31e6d3d708dfe9..8880ff3ce9c06c8acb526d2f07c760b66cf40276 100644
--- a/Plugin/CutGrid.h
+++ b/Plugin/CutGrid.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CutMesh.cpp b/Plugin/CutMesh.cpp
index 7088300f731da98e484c855000750f1923a91ee0..bc1154ed235983efad9978a0ac4c0ff8959d9cf3 100644
--- a/Plugin/CutMesh.cpp
+++ b/Plugin/CutMesh.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,9 +7,9 @@
 #include "GModel.h"
 #include "gmshLevelset.h"
 
-StringXNumber CutMeshOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.},
-                                         {GMSH_FULLRC, "Split", NULL, 0.},
-                                         {GMSH_FULLRC, "SaveTri", NULL, 0.}};
+StringXNumber CutMeshOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.},
+                                         {GMSH_FULLRC, "Split", nullptr, 0.},
+                                         {GMSH_FULLRC, "SaveTri", nullptr, 0.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCutMeshPlugin() { return new GMSH_CutMeshPlugin(); }
diff --git a/Plugin/CutMesh.h b/Plugin/CutMesh.h
index 5fa3eec9df729e78c55023d6b26aba7531fa1cfa..8938c81d7c4b6c0da9e75a0299a36966565d8ec8 100644
--- a/Plugin/CutMesh.h
+++ b/Plugin/CutMesh.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CutParametric.cpp b/Plugin/CutParametric.cpp
index 06615d938cf961c000b45f666d74ade52dd5b5c0..5f72e98602806a9149d556a6120f4fc1b59d7b38 100644
--- a/Plugin/CutParametric.cpp
+++ b/Plugin/CutParametric.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,7 +22,7 @@ StringXNumber CutParametricOptions_Number[] = {
   {GMSH_FULLRC, "MaxV", GMSH_CutParametricPlugin::callbackMaxV, 2 * 3.1416},
   {GMSH_FULLRC, "NumPointsV", GMSH_CutParametricPlugin::callbackNV, 180.},
   {GMSH_FULLRC, "ConnectPoints", GMSH_CutParametricPlugin::callbackConnect, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 StringXString CutParametricOptions_String[] = {
   {GMSH_FULLRC, "X", GMSH_CutParametricPlugin::callbackX,
diff --git a/Plugin/CutParametric.h b/Plugin/CutParametric.h
index c974b40ac43ad96af2b127d9144f9d9ed5aea319..9c03b4b99484579813d1e63db47a04ac51ed133f 100644
--- a/Plugin/CutParametric.h
+++ b/Plugin/CutParametric.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp
index 71b4e45e93fcdae6002be3c0de5f83b9965474a7..0bf0b579cbffe2ae3b849e19da43d8f030ebc862 100644
--- a/Plugin/CutPlane.cpp
+++ b/Plugin/CutPlane.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,7 +22,7 @@ StringXNumber CutPlaneOptions_Number[] = {
   {GMSH_FULLRC, "ExtractVolume", GMSH_CutPlanePlugin::callbackVol, 0},
   {GMSH_FULLRC, "RecurLevel", GMSH_CutPlanePlugin::callbackRecur, 4},
   {GMSH_FULLRC, "TargetError", GMSH_CutPlanePlugin::callbackTarget, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCutPlanePlugin() { return new GMSH_CutPlanePlugin(); }
diff --git a/Plugin/CutPlane.h b/Plugin/CutPlane.h
index 78e5ef27bdc20e4a5d702c146e61faa3e9fc7b83..f33a73f720179205bcf97584d26d994430238b68 100644
--- a/Plugin/CutPlane.h
+++ b/Plugin/CutPlane.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/CutSphere.cpp b/Plugin/CutSphere.cpp
index 6cf8be7bad528644a5212f2bfb13a7849ecbc5ee..8e588937a8998bcbbeccf59663cc3f7d6e79d8ba 100644
--- a/Plugin/CutSphere.cpp
+++ b/Plugin/CutSphere.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -20,7 +20,7 @@ StringXNumber CutSphereOptions_Number[] = {
   {GMSH_FULLRC, "ExtractVolume", GMSH_CutSpherePlugin::callbackVol, 0.},
   {GMSH_FULLRC, "RecurLevel", GMSH_CutSpherePlugin::callbackRecur, 4},
   {GMSH_FULLRC, "TargetError", GMSH_CutSpherePlugin::callbackTarget, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterCutSpherePlugin()
diff --git a/Plugin/CutSphere.h b/Plugin/CutSphere.h
index 7b8c83ea83f9743063819022a6842dc983f7111f..e748be998d0812e81740cdbcd04c0b6d6c71815d 100644
--- a/Plugin/CutSphere.h
+++ b/Plugin/CutSphere.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/DiscretizationError.cpp b/Plugin/DiscretizationError.cpp
index a445b40a06b233b5ca5aefd32a1effeca532f156..96c7aa6d0cb22457498f303645ff26904c05d7bc 100644
--- a/Plugin/DiscretizationError.cpp
+++ b/Plugin/DiscretizationError.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -14,7 +14,7 @@
 #include <MTriangle.h>
 
 StringXNumber DiscretizationErrorOptions_Number[] = {
-  {GMSH_FULLRC, "SuperSamplingNodes", NULL, 10.}};
+  {GMSH_FULLRC, "SuperSamplingNodes", nullptr, 10.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterDiscretizationErrorPlugin()
@@ -61,7 +61,7 @@ PView *GMSH_DiscretizationErrorPlugin::execute(PView *v)
   PView *v2 = new PView();
   PViewDataList *data2 = getDataList(v2);
 
-  for(GModel::fiter itFace = GModel::current()->firstFace();
+  for(auto itFace = GModel::current()->firstFace();
       itFace != GModel::current()->lastFace(); ++itFace) {
     // sample quadrangles
     /* 13 14 15 16
@@ -69,7 +69,7 @@ PView *GMSH_DiscretizationErrorPlugin::execute(PView *v)
      * 5  6  7  8
      * 1  2  3  4
      */
-    for(std::vector<MQuadrangle *>::iterator itQuad =
+    for(auto itQuad =
           (*itFace)->quadrangles.begin();
         itQuad != (*itFace)->quadrangles.end(); ++itQuad) {
       for(j = 0; j < nEdgeNodes; j++) { // u
@@ -106,7 +106,7 @@ PView *GMSH_DiscretizationErrorPlugin::execute(PView *v)
      * 3  5  8
      * 1  2  4  7
      */
-    for(std::vector<MTriangle *>::iterator itTri = (*itFace)->triangles.begin();
+    for(auto itTri = (*itFace)->triangles.begin();
         itTri != (*itFace)->triangles.end(); ++itTri) {
       counter = 0;
       for(i = 0; i < nEdgeNodes; i++) {
diff --git a/Plugin/DiscretizationError.h b/Plugin/DiscretizationError.h
index ddc1651aed4c73259be02c0f523938a18dc7d670..297089517cf8d5b2fe274793a3b0eaa2505d72c8 100644
--- a/Plugin/DiscretizationError.h
+++ b/Plugin/DiscretizationError.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Distance.cpp b/Plugin/Distance.cpp
index f12517b9b19b63e78a08be6298104510dd4cb1f2..32365e9cd884f6d17b47f5bab63d741c5375dc58 100644
--- a/Plugin/Distance.cpp
+++ b/Plugin/Distance.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -23,12 +23,12 @@
 template <class scalar> class simpleFunction;
 
 StringXNumber DistanceOptions_Number[] = {
-  {GMSH_FULLRC, "PhysicalPoint", NULL, 0.},
-  {GMSH_FULLRC, "PhysicalLine", NULL, 0.},
-  {GMSH_FULLRC, "PhysicalSurface", NULL, 0.},
-  {GMSH_FULLRC, "DistanceType", NULL, 0},
-  {GMSH_FULLRC, "MinScale", NULL, 0},
-  {GMSH_FULLRC, "MaxScale", NULL, 0}
+  {GMSH_FULLRC, "PhysicalPoint", nullptr, 0.},
+  {GMSH_FULLRC, "PhysicalLine", nullptr, 0.},
+  {GMSH_FULLRC, "PhysicalSurface", nullptr, 0.},
+  {GMSH_FULLRC, "DistanceType", nullptr, 0},
+  {GMSH_FULLRC, "MinScale", nullptr, 0},
+  {GMSH_FULLRC, "MaxScale", nullptr, 0}
 };
 
 extern "C" {
@@ -38,7 +38,7 @@ GMSH_Plugin *GMSH_RegisterDistancePlugin() { return new GMSH_DistancePlugin(); }
 GMSH_DistancePlugin::GMSH_DistancePlugin()
 {
   _maxDim = 0;
-  _data = NULL;
+  _data = nullptr;
 }
 
 std::string GMSH_DistancePlugin::getHelp() const
@@ -74,7 +74,7 @@ void GMSH_DistancePlugin::printView(std::vector<GEntity *> &entities,
 
   double minDist = 1.e22;
   double maxDist = 0.0;
-  for(std::map<MVertex *, double>::iterator itv = distanceMap.begin();
+  for(auto itv = distanceMap.begin();
       itv != distanceMap.end(); ++itv) {
     double dist = itv->second;
     if(dist > maxDist) maxDist = dist;
@@ -110,7 +110,7 @@ void GMSH_DistancePlugin::printView(std::vector<GEntity *> &entities,
         std::vector<double> dist;
         for(std::size_t j = 0; j < numNodes; j++) {
           MVertex *v = nods[j];
-          std::map<MVertex *, double>::iterator it = distanceMap.find(v);
+          auto it = distanceMap.find(v);
           dist.push_back(it->second);
         }
 
@@ -289,7 +289,7 @@ PView *GMSH_DistancePlugin::execute(PView *v)
       double mu = type * L;
       simpleFunction<double> DIFF(mu * mu), ONE(1.0);
       distanceTerm distance(GModel::current(), 1, &DIFF, &ONE);
-      for(std::vector<MElement *>::iterator it = allElems.begin();
+      for(auto it = allElems.begin();
           it != allElems.end(); it++) {
         SElement se((*it));
         distance.addToMatrix(*dofView, &se);
@@ -297,7 +297,7 @@ PView *GMSH_DistancePlugin::execute(PView *v)
       groupOfElements gr(allElems);
       distance.addToRightHandSide(*dofView, gr);
       lsys->systemSolve();
-      for(std::map<MVertex *, double>::iterator itv = distanceMap.begin();
+      for(auto itv = distanceMap.begin();
           itv != distanceMap.end(); ++itv) {
         MVertex *v = itv->first;
         double value;
diff --git a/Plugin/Distance.h b/Plugin/Distance.h
index 7dfc60a1a5a0084aa2c30ce599e4e31360321224..2692772b646b2d18444907abd16f44c5949bd9bb 100644
--- a/Plugin/Distance.h
+++ b/Plugin/Distance.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Divergence.cpp b/Plugin/Divergence.cpp
index 0f7dd2718abe7279d4c00e89003bb4359167cdac..cad5f5579c53c7edd60c0c4000f4460bd4f91eaa 100644
--- a/Plugin/Divergence.cpp
+++ b/Plugin/Divergence.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,7 +7,7 @@
 #include "shapeFunctions.h"
 #include "GmshDefines.h"
 
-StringXNumber DivergenceOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber DivergenceOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterDivergencePlugin()
diff --git a/Plugin/Divergence.h b/Plugin/Divergence.h
index 0c813c6bef05c93c16aaccbf9da0a4694ddef382..93aa7198678507b22a1f84ed3f28c7e8ec333455 100644
--- a/Plugin/Divergence.h
+++ b/Plugin/Divergence.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Eigenvalues.cpp b/Plugin/Eigenvalues.cpp
index b2118123e5a7e7caf9e3516b16fa1c6a12951ca1..a2b92b25f01625f32ebba9fe7abf7c8b85018722 100644
--- a/Plugin/Eigenvalues.cpp
+++ b/Plugin/Eigenvalues.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,7 +7,7 @@
 #include "Numeric.h"
 #include "GmshDefines.h"
 
-StringXNumber EigenvaluesOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber EigenvaluesOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterEigenvaluesPlugin()
@@ -109,5 +109,5 @@ PView *GMSH_EigenvaluesPlugin::execute(PView *v)
   dmax->setFileName(data1->getName() + "_MaxEigenvalues.pos");
   dmax->finalize();
 
-  return 0;
+  return nullptr;
 }
diff --git a/Plugin/Eigenvalues.h b/Plugin/Eigenvalues.h
index c2577e3bf7964e46e1c9efcd4c7f5ad4790917c9..55b0ccf66544c1d9647315b4ac9f5bc62c25917a 100644
--- a/Plugin/Eigenvalues.h
+++ b/Plugin/Eigenvalues.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Eigenvectors.cpp b/Plugin/Eigenvectors.cpp
index 480eabe1e4ac3ab370fde200885f556506ab837d..c1c43aadb7c15cc0ffe11e28af275cb6e6271bdd 100644
--- a/Plugin/Eigenvectors.cpp
+++ b/Plugin/Eigenvectors.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -9,8 +9,8 @@
 #include "GmshDefines.h"
 
 StringXNumber EigenvectorsOptions_Number[] = {
-  {GMSH_FULLRC, "ScaleByEigenvalues", NULL, 1.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "ScaleByEigenvalues", nullptr, 1.},
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterEigenvectorsPlugin()
@@ -132,5 +132,5 @@ PView *GMSH_EigenvectorsPlugin::execute(PView *v)
   dmax->setFileName(data1->getName() + "_MaxEigenvectors.pos");
   dmax->finalize();
 
-  return 0;
+  return nullptr;
 }
diff --git a/Plugin/Eigenvectors.h b/Plugin/Eigenvectors.h
index 18d3ea32f3bf1eeac23d7838a8683e5230685bd2..ab6ae7a78113ba738e9910b7dc6d58ebe182aae0 100644
--- a/Plugin/Eigenvectors.h
+++ b/Plugin/Eigenvectors.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/ExtractEdges.cpp b/Plugin/ExtractEdges.cpp
index 3c6227fcbc342d121f9551c49e05b5d89275ef09..2ab0e7d932802a0083a1e4e144c1a9b4306c18c3 100644
--- a/Plugin/ExtractEdges.cpp
+++ b/Plugin/ExtractEdges.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,8 +12,8 @@
 #endif
 
 StringXNumber ExtractEdgesOptions_Number[] = {
-  {GMSH_FULLRC, "Angle", NULL, 40.},
-  {GMSH_FULLRC, "IncludeBoundary", NULL, 1.},
+  {GMSH_FULLRC, "Angle", nullptr, 40.},
+  {GMSH_FULLRC, "IncludeBoundary", nullptr, 1.},
 };
 
 extern "C" {
@@ -58,14 +58,14 @@ static void add_edge(edge_angle &ea, PViewDataList *data)
 PView *GMSH_ExtractEdgesPlugin::execute(PView *v)
 {
   std::vector<MTriangle *> elements;
-  for(GModel::fiter it = GModel::current()->firstFace();
+  for(auto it = GModel::current()->firstFace();
       it != GModel::current()->lastFace(); ++it)
     elements.insert(elements.end(), (*it)->triangles.begin(),
                     (*it)->triangles.end());
 
   if(elements.empty()) {
     Msg::Error("No triangles in mesh to extract edges from");
-    return 0;
+    return nullptr;
   }
 
   PView *v2 = new PView();
diff --git a/Plugin/ExtractEdges.h b/Plugin/ExtractEdges.h
index 7a443b30b35f5f965a877ad7377f92c365f16852..5987a034d9902b24af78bdd2fce0c687b4e203d8 100644
--- a/Plugin/ExtractEdges.h
+++ b/Plugin/ExtractEdges.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/ExtractElements.cpp b/Plugin/ExtractElements.cpp
index dbead1dea60697140375080328ffbfdd8520d922..9fb5aa3a1d460421b884bbb9fb3b9c399d04f4c1 100644
--- a/Plugin/ExtractElements.cpp
+++ b/Plugin/ExtractElements.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,9 +7,9 @@
 #include "Numeric.h"
 
 StringXNumber ExtractElementsOptions_Number[] = {
-  {GMSH_FULLRC, "MinVal", NULL, 0.},     {GMSH_FULLRC, "MaxVal", NULL, 0.},
-  {GMSH_FULLRC, "TimeStep", NULL, 0.},   {GMSH_FULLRC, "Visible", NULL, 1.},
-  {GMSH_FULLRC, "Dimension", NULL, -1.}, {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "MinVal", nullptr, 0.},     {GMSH_FULLRC, "MaxVal", nullptr, 0.},
+  {GMSH_FULLRC, "TimeStep", nullptr, 0.},   {GMSH_FULLRC, "Visible", nullptr, 1.},
+  {GMSH_FULLRC, "Dimension", nullptr, -1.}, {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterExtractElementsPlugin()
diff --git a/Plugin/ExtractElements.h b/Plugin/ExtractElements.h
index 1aa9843ad55ff6ac5c28af25d90f9bfd94f9a55f..d87628e86e928e76bbe8a435d6387c480f85676f 100644
--- a/Plugin/ExtractElements.h
+++ b/Plugin/ExtractElements.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/FieldFromAmplitudePhase.cpp b/Plugin/FieldFromAmplitudePhase.cpp
index 664e66b232f7e4d021a09c250c013f59849efad4..4e01ee60640b69e823249e4578523d417980b37b 100644
--- a/Plugin/FieldFromAmplitudePhase.cpp
+++ b/Plugin/FieldFromAmplitudePhase.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,13 +12,13 @@
 #include "FieldFromAmplitudePhase.h"
 
 StringXNumber FieldFromAmplitudePhaseOptions_Number[] = {
-  {GMSH_FULLRC, "Wavenumber", NULL, 5.},
-  {GMSH_FULLRC, "AmplitudeView", NULL, 0.},
-  {GMSH_FULLRC, "PhaseView", NULL, 1.},
+  {GMSH_FULLRC, "Wavenumber", nullptr, 5.},
+  {GMSH_FULLRC, "AmplitudeView", nullptr, 0.},
+  {GMSH_FULLRC, "PhaseView", nullptr, 1.},
 };
 
 StringXString FieldFromAmplitudePhaseOptions_String[] = {
-  {GMSH_FULLRC, "MeshFile", NULL, "fine.msh"}};
+  {GMSH_FULLRC, "MeshFile", nullptr, "fine.msh"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterFieldFromAmplitudePhasePlugin()
@@ -96,7 +96,7 @@ PView *GMSH_FieldFromAmplitudePhasePlugin::execute(PView *v)
     return v;
   }
 
-  OctreePost *oA = 0, *oPhi = 0;
+  OctreePost *oA = nullptr, *oPhi = nullptr;
   oA = new OctreePost(va);
   oPhi = new OctreePost(vphi);
 
@@ -118,7 +118,7 @@ PView *GMSH_FieldFromAmplitudePhasePlugin::execute(PView *v)
         ve.insert(e->getVertex(nod));
     }
 
-  for(std::set<MVertex *>::iterator it = ve.begin(); it != ve.end(); ++it) {
+  for(auto it = ve.begin(); it != ve.end(); ++it) {
     double phi, ar, ai;
     std::vector<double> uR(1);
     std::vector<double> uI(1);
diff --git a/Plugin/FieldFromAmplitudePhase.h b/Plugin/FieldFromAmplitudePhase.h
index ca03b6038c4568409676015e012283f053724860..b66d299e7d41408e07fc187ce86dc42ec8dff145 100644
--- a/Plugin/FieldFromAmplitudePhase.h
+++ b/Plugin/FieldFromAmplitudePhase.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/GaussPoints.cpp b/Plugin/GaussPoints.cpp
index 70113cb1e657ace664d018ed62c36705cf44d166..0aa8f8159d9f760031e2347a348f49aabe578e8b 100644
--- a/Plugin/GaussPoints.cpp
+++ b/Plugin/GaussPoints.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -9,9 +9,9 @@
 #include "PView.h"
 
 StringXNumber GaussPointsOptions_Number[] = {
-  {GMSH_FULLRC, "Order", NULL, 0},
-  {GMSH_FULLRC, "Dimension", NULL, 2},
-  {GMSH_FULLRC, "PhysicalGroup", NULL, 0}};
+  {GMSH_FULLRC, "Order", nullptr, 0},
+  {GMSH_FULLRC, "Dimension", nullptr, 2},
+  {GMSH_FULLRC, "PhysicalGroup", nullptr, 0}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterGaussPointsPlugin()
diff --git a/Plugin/GaussPoints.h b/Plugin/GaussPoints.h
index 5134a70f8f67501161d69a086e5925ce16f50353..f362b513a8c5fdfd9e033248125375aba2b39492 100644
--- a/Plugin/GaussPoints.h
+++ b/Plugin/GaussPoints.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Gradient.cpp b/Plugin/Gradient.cpp
index 1617454f4203e48d242de64f8b4df93bff997d13..de917bd566be46c269242757a79995226fb6a61c 100644
--- a/Plugin/Gradient.cpp
+++ b/Plugin/Gradient.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,7 +7,7 @@
 #include "shapeFunctions.h"
 #include "GmshDefines.h"
 
-StringXNumber GradientOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber GradientOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterGradientPlugin() { return new GMSH_GradientPlugin(); }
diff --git a/Plugin/Gradient.h b/Plugin/Gradient.h
index d387ef900b7ff3a3a46f7e25b4003bac25cdbf92..8d9fc6011ef3c83f702809e63e18de23155c7be9 100644
--- a/Plugin/Gradient.h
+++ b/Plugin/Gradient.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/HarmonicToTime.cpp b/Plugin/HarmonicToTime.cpp
index bd7944d4fc9eaef1d28c69287bcbecb671d91fee..a1de8a7cb4aec5916dee5616eb05ad68fa1da4de 100644
--- a/Plugin/HarmonicToTime.cpp
+++ b/Plugin/HarmonicToTime.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,13 +7,13 @@
 #include "GmshDefines.h"
 
 StringXNumber HarmonicToTimeOptions_Number[] = {
-  {GMSH_FULLRC, "RealPart", NULL, 0.},
-  {GMSH_FULLRC, "ImaginaryPart", NULL, 1.},
-  {GMSH_FULLRC, "NumSteps", NULL, 20.},
-  {GMSH_FULLRC, "TimeSign", NULL, -1.},
-  {GMSH_FULLRC, "Frequency", NULL, 1},
-  {GMSH_FULLRC, "NumPeriods", NULL, 1},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "RealPart", nullptr, 0.},
+  {GMSH_FULLRC, "ImaginaryPart", nullptr, 1.},
+  {GMSH_FULLRC, "NumSteps", nullptr, 20.},
+  {GMSH_FULLRC, "TimeSign", nullptr, -1.},
+  {GMSH_FULLRC, "Frequency", nullptr, 1},
+  {GMSH_FULLRC, "NumPeriods", nullptr, 1},
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterHarmonicToTimePlugin()
diff --git a/Plugin/HarmonicToTime.h b/Plugin/HarmonicToTime.h
index 1eb846fd7dc8db92e0e5611971510331594cb047..06f267b91de01b85fdbbef58f27e012a29cccca4 100644
--- a/Plugin/HarmonicToTime.h
+++ b/Plugin/HarmonicToTime.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/HomologyComputation.cpp b/Plugin/HomologyComputation.cpp
index 07b6ed153d1f201629e34b27ccf0e4543097f695..92d61e0d654d13402c3168a4f02ede6251e4dc88 100644
--- a/Plugin/HomologyComputation.cpp
+++ b/Plugin/HomologyComputation.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -18,22 +18,22 @@
 #if defined(HAVE_KBIPACK)
 
 StringXNumber HomologyComputationOptions_Number[] = {
-  {GMSH_FULLRC, "ComputeHomology", NULL, 1.},
-  {GMSH_FULLRC, "ComputeCohomology", NULL, 0.},
-  {GMSH_FULLRC, "HomologyPhysicalGroupsBegin", NULL, -1.},
-  {GMSH_FULLRC, "CohomologyPhysicalGroupsBegin", NULL, -1.},
-  {GMSH_FULLRC, "CreatePostProcessingViews", NULL, 1.},
-  {GMSH_FULLRC, "ReductionOmit", NULL, 1.},
-  {GMSH_FULLRC, "ReductionCombine", NULL, 3.},
-  {GMSH_FULLRC, "PostProcessSimplify", NULL, 1.},
-  {GMSH_FULLRC, "ReductionHeuristic", NULL, 1.}};
+  {GMSH_FULLRC, "ComputeHomology", nullptr, 1.},
+  {GMSH_FULLRC, "ComputeCohomology", nullptr, 0.},
+  {GMSH_FULLRC, "HomologyPhysicalGroupsBegin", nullptr, -1.},
+  {GMSH_FULLRC, "CohomologyPhysicalGroupsBegin", nullptr, -1.},
+  {GMSH_FULLRC, "CreatePostProcessingViews", nullptr, 1.},
+  {GMSH_FULLRC, "ReductionOmit", nullptr, 1.},
+  {GMSH_FULLRC, "ReductionCombine", nullptr, 3.},
+  {GMSH_FULLRC, "PostProcessSimplify", nullptr, 1.},
+  {GMSH_FULLRC, "ReductionHeuristic", nullptr, 1.}};
 
 StringXString HomologyComputationOptions_String[] = {
-  {GMSH_FULLRC, "DomainPhysicalGroups", NULL, ""},
-  {GMSH_FULLRC, "SubdomainPhysicalGroups", NULL, ""},
-  {GMSH_FULLRC, "ReductionImmunePhysicalGroups", NULL, ""},
-  {GMSH_FULLRC, "DimensionOfChainsToSave", NULL, "0, 1, 2, 3"},
-  {GMSH_FULLRC, "Filename", NULL, "homology.msh"}};
+  {GMSH_FULLRC, "DomainPhysicalGroups", nullptr, ""},
+  {GMSH_FULLRC, "SubdomainPhysicalGroups", nullptr, ""},
+  {GMSH_FULLRC, "ReductionImmunePhysicalGroups", nullptr, ""},
+  {GMSH_FULLRC, "DimensionOfChainsToSave", nullptr, "0, 1, 2, 3"},
+  {GMSH_FULLRC, "Filename", nullptr, "homology.msh"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterHomologyComputationPlugin()
@@ -115,10 +115,10 @@ PView *GMSH_HomologyComputationPlugin::execute(PView *v)
   std::vector<int> subdomain;
   std::vector<int> imdomain;
   std::vector<int> dimsave;
-  if(!parseStringOpt(0, domain)) return 0;
-  if(!parseStringOpt(1, subdomain)) return 0;
-  if(!parseStringOpt(2, imdomain)) return 0;
-  if(!parseStringOpt(3, dimsave)) return 0;
+  if(!parseStringOpt(0, domain)) return nullptr;
+  if(!parseStringOpt(1, subdomain)) return nullptr;
+  if(!parseStringOpt(2, imdomain)) return nullptr;
+  if(!parseStringOpt(3, dimsave)) return nullptr;
 
   GModel *m = GModel::current();
 
@@ -146,7 +146,7 @@ PView *GMSH_HomologyComputationPlugin::execute(PView *v)
 
   delete homology;
 
-  return 0;
+  return nullptr;
 }
 
 #endif
diff --git a/Plugin/HomologyComputation.h b/Plugin/HomologyComputation.h
index 3c2bbd55ad44ae564bedb7e63e031ebd956d80ba..0b9dac158e13232b4b6b193d97f72bc4f2d886a5 100644
--- a/Plugin/HomologyComputation.h
+++ b/Plugin/HomologyComputation.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/HomologyPostProcessing.cpp b/Plugin/HomologyPostProcessing.cpp
index 55a300cc793c3156c8d7797847d8755aef0c52cb..82c1586c38c0793cd04f5245ded45452dd2cc0c9 100644
--- a/Plugin/HomologyPostProcessing.cpp
+++ b/Plugin/HomologyPostProcessing.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -19,15 +19,15 @@
 #if defined(HAVE_KBIPACK)
 
 StringXNumber HomologyPostProcessingOptions_Number[] = {
-  {GMSH_FULLRC, "ApplyBoundaryOperatorToResults", NULL, 0}};
+  {GMSH_FULLRC, "ApplyBoundaryOperatorToResults", nullptr, 0}};
 
 StringXString HomologyPostProcessingOptions_String[] = {
-  {GMSH_FULLRC, "TransformationMatrix", NULL, "1, 0; 0, 1"},
-  {GMSH_FULLRC, "PhysicalGroupsOfOperatedChains", NULL, "1, 2"},
-  {GMSH_FULLRC, "PhysicalGroupsOfOperatedChains2", NULL, ""},
-  {GMSH_FULLRC, "PhysicalGroupsToTraceResults", NULL, ""},
-  {GMSH_FULLRC, "PhysicalGroupsToProjectResults", NULL, ""},
-  {GMSH_FULLRC, "NameForResultChains", NULL, "c"},
+  {GMSH_FULLRC, "TransformationMatrix", nullptr, "1, 0; 0, 1"},
+  {GMSH_FULLRC, "PhysicalGroupsOfOperatedChains", nullptr, "1, 2"},
+  {GMSH_FULLRC, "PhysicalGroupsOfOperatedChains2", nullptr, ""},
+  {GMSH_FULLRC, "PhysicalGroupsToTraceResults", nullptr, ""},
+  {GMSH_FULLRC, "PhysicalGroupsToProjectResults", nullptr, ""},
+  {GMSH_FULLRC, "NameForResultChains", nullptr, "c"},
 };
 
 extern "C" {
@@ -167,12 +167,12 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
         if(a != ',' && a != ';') {
           Msg::Error("Unexpected character \'%c\' while parsing \'%s\'", a,
                      HomologyPostProcessingOptions_String[0].str);
-          return 0;
+          return nullptr;
         }
         if(a == ';') {
           if(cols != 0 && cols != col) {
             Msg::Error("Number of columns must match (%d != %d)", cols, col);
-            return 0;
+            return nullptr;
           }
           cols = col;
           col = 0;
@@ -181,7 +181,7 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
     }
     if(cols != 0 && cols != col && col != 0) {
       Msg::Error("Number of columns must match (%d != %d)", cols, col);
-      return 0;
+      return nullptr;
     }
     if(cols == 0) cols = col;
   }
@@ -193,21 +193,21 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
       Msg::Error(
         "Number of matrix rows and columns aren't compatible (residual: %d)",
         (int)matrix.size() % cols);
-      return 0;
+      return nullptr;
     }
   }
 
   std::vector<int> basisPhysicals;
-  if(!parseStringOpt(1, basisPhysicals)) return 0;
+  if(!parseStringOpt(1, basisPhysicals)) return nullptr;
   std::vector<int> basisPhysicals2;
-  if(!parseStringOpt(2, basisPhysicals2)) return 0;
+  if(!parseStringOpt(2, basisPhysicals2)) return nullptr;
 
   if(matrixString != "I" && (int)basisPhysicals.size() != cols &&
      basisPhysicals2.empty()) {
     Msg::Error(
       "Number of matrix columns and operated chains must match (%d != %d)",
       cols, basisPhysicals.size());
-    return 0;
+    return nullptr;
   }
   else if(matrixString == "I") {
     cols = basisPhysicals.size();
@@ -220,13 +220,13 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
      basisPhysicals.size() != basisPhysicals2.size()) {
     Msg::Error("Number of operated chains must match (%d != %d)",
                basisPhysicals.size(), basisPhysicals2.size());
-    return 0;
+    return nullptr;
   }
 
   std::vector<int> tracePhysicals;
-  if(!parseStringOpt(3, tracePhysicals)) return 0;
+  if(!parseStringOpt(3, tracePhysicals)) return nullptr;
   std::vector<int> projectPhysicals;
-  if(!parseStringOpt(4, projectPhysicals)) return 0;
+  if(!parseStringOpt(4, projectPhysicals)) return nullptr;
 
   std::vector<Chain<int> > curBasis;
   for(std::size_t i = 0; i < basisPhysicals.size(); i++) {
@@ -234,7 +234,7 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
   }
   if(curBasis.empty()) {
     Msg::Error("No operated chains given");
-    return 0;
+    return nullptr;
   }
   int dim = curBasis.at(0).getDim();
 
@@ -268,7 +268,7 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
     int det = detIntegerMatrix(matrix);
     if(det != 1 && det != -1)
       Msg::Warning("Incidence matrix is not unimodular (det = %d)", det);
-    if(!invertIntegerMatrix(matrix)) return 0;
+    if(!invertIntegerMatrix(matrix)) return nullptr;
     for(int i = 0; i < rows; i++)
       for(int j = 0; j < cols; j++)
         newBasis.at(i) += matrix.at(i * cols + j) * curBasis2.at(j);
@@ -315,7 +315,7 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
     newBasis.at(i).addToModel(m);
   }
 
-  return 0;
+  return nullptr;
 }
 
 #endif
diff --git a/Plugin/HomologyPostProcessing.h b/Plugin/HomologyPostProcessing.h
index 1237b2d2855b53224df6bcadde812e4ce72e1ea6..5ef424161418801e34fb80bf5b4e5a1fdb1e7e99 100644
--- a/Plugin/HomologyPostProcessing.h
+++ b/Plugin/HomologyPostProcessing.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Integrate.cpp b/Plugin/Integrate.cpp
index e1114e06ebb6b246cd4bde2bdf0b95e42d6bac74..4ec9419d30e1b3e10c33073f88be4295a0547968 100644
--- a/Plugin/Integrate.cpp
+++ b/Plugin/Integrate.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -8,10 +8,10 @@
 #include "PViewOptions.h"
 
 StringXNumber IntegrateOptions_Number[] = {
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "OverTime", NULL, -1.},
-  {GMSH_FULLRC, "Dimension", NULL, -1.},
-  {GMSH_FULLRC, "Visible", NULL, 1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "OverTime", nullptr, -1.},
+  {GMSH_FULLRC, "Dimension", nullptr, -1.},
+  {GMSH_FULLRC, "Visible", nullptr, 1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterIntegratePlugin()
diff --git a/Plugin/Integrate.h b/Plugin/Integrate.h
index d50889fa95fb6a7296a433ce2abe01c4035376fb..8ac9e0f139275f2cb099b079dea72f06c58aac8c 100644
--- a/Plugin/Integrate.h
+++ b/Plugin/Integrate.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Invisible.cpp b/Plugin/Invisible.cpp
index 3289b4a448a23c3e42165a987ccc67598fb116ed..57e813b04a4bb6d2e0c6724d33f07f9963f0e84a 100644
--- a/Plugin/Invisible.cpp
+++ b/Plugin/Invisible.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,8 +7,8 @@
 #include "Invisible.h"
 
 StringXNumber InvisibleOptions_Number[] = {
-  {GMSH_FULLRC, "DeleteElements", NULL, 1.},
-  {GMSH_FULLRC, "ReverseElements", NULL, 0.},
+  {GMSH_FULLRC, "DeleteElements", nullptr, 1.},
+  {GMSH_FULLRC, "ReverseElements", nullptr, 0.},
 };
 
 extern "C" {
@@ -42,5 +42,5 @@ PView *GMSH_InvisiblePlugin::execute(PView *v)
   if(InvisibleOptions_Number[1].def)
     GModel::current()->reverseInvisibleElements();
 
-  return NULL;
+  return nullptr;
 }
diff --git a/Plugin/Invisible.h b/Plugin/Invisible.h
index dc4cb1f406c1131eb861b82e751669bd1931264f..982beb12fc80430b8cac3a0dfa1f3d7d9cbddc8e 100644
--- a/Plugin/Invisible.h
+++ b/Plugin/Invisible.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Isosurface.cpp b/Plugin/Isosurface.cpp
index 89d070f71fb9d08eec1e0ad53f37c93c09d3b037..378431f62ecc7c0ff8ab05201c4354407c26ea8b 100644
--- a/Plugin/Isosurface.cpp
+++ b/Plugin/Isosurface.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -11,9 +11,9 @@ StringXNumber IsosurfaceOptions_Number[] = {
   {GMSH_FULLRC, "ExtractVolume", GMSH_IsosurfacePlugin::callbackVol, 0.},
   {GMSH_FULLRC, "RecurLevel", GMSH_IsosurfacePlugin::callbackRecur, 4},
   {GMSH_FULLRC, "TargetError", GMSH_IsosurfacePlugin::callbackTarget, 0},
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "OtherTimeStep", NULL, -1.},
-  {GMSH_FULLRC, "OtherView", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "OtherTimeStep", nullptr, -1.},
+  {GMSH_FULLRC, "OtherView", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterIsosurfacePlugin()
diff --git a/Plugin/Isosurface.h b/Plugin/Isosurface.h
index bc78385441d2ee9c03e2595de50cf3a3194239df..6c6e1e1851649bf7509e58f7fabf220aa4e6758e 100644
--- a/Plugin/Isosurface.h
+++ b/Plugin/Isosurface.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Lambda2.cpp b/Plugin/Lambda2.cpp
index 3fa4e43bc9b33371775035c592f1c3c8a6a07476..536e6fa7e230f7b6cdc3efdec523ddf3572d092c 100644
--- a/Plugin/Lambda2.cpp
+++ b/Plugin/Lambda2.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -6,8 +6,8 @@
 #include "Lambda2.h"
 #include "Numeric.h"
 
-StringXNumber Lambda2Options_Number[] = {{GMSH_FULLRC, "Eigenvalue", NULL, 2.},
-                                         {GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber Lambda2Options_Number[] = {{GMSH_FULLRC, "Eigenvalue", nullptr, 2.},
+                                         {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterLambda2Plugin() { return new GMSH_Lambda2Plugin(); }
diff --git a/Plugin/Lambda2.h b/Plugin/Lambda2.h
index c6a6eb6f4a531e3327312105d4b18e35ca849ddb..0b323a3f647288c09ecfd653d14e37eb26fece06 100644
--- a/Plugin/Lambda2.h
+++ b/Plugin/Lambda2.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Levelset.cpp b/Plugin/Levelset.cpp
index 372c395a622ae70b06a64fc0dfceb06c96c7ee16..f0d72761e8396509c51b64cf85217ede24ee42bb 100644
--- a/Plugin/Levelset.cpp
+++ b/Plugin/Levelset.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -620,7 +620,7 @@ PView *GMSH_LevelsetPlugin::execute(PView *v)
     }
   }
 
-  return 0;
+  return nullptr;
 }
 
 // On high order maps, we draw only the elements that have a cut with
diff --git a/Plugin/Levelset.h b/Plugin/Levelset.h
index 31d7374c52f4dba59587171efdaf905d43481f07..be6a6b15e832fa0595db501386e87eecad8803f5 100644
--- a/Plugin/Levelset.h
+++ b/Plugin/Levelset.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/LongitudeLatitude.cpp b/Plugin/LongitudeLatitude.cpp
index 6ae0636c25fa3b171962c424bcccc9b1e6288909..9494923a219a2576c85dc492805611a7fa3e631a 100644
--- a/Plugin/LongitudeLatitude.cpp
+++ b/Plugin/LongitudeLatitude.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -8,7 +8,7 @@
 #include "OpenFile.h"
 
 StringXNumber LongituteLatitudeOptions_Number[] = {
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterLongituteLatitudePlugin()
diff --git a/Plugin/LongitudeLatitude.h b/Plugin/LongitudeLatitude.h
index 32cb74512e751ecea2242772317259725b4c80c6..a2ef68e01444db95727a0d7bdfb5c88a0567ef4d 100644
--- a/Plugin/LongitudeLatitude.h
+++ b/Plugin/LongitudeLatitude.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/MakeSimplex.cpp b/Plugin/MakeSimplex.cpp
index 5078f7cad9e7bc19f0b75063029934911bb1d064..435523cedbe752c4ac8758cc42565976638fba47 100644
--- a/Plugin/MakeSimplex.cpp
+++ b/Plugin/MakeSimplex.cpp
@@ -1,11 +1,11 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
 
 #include "MakeSimplex.h"
 
-StringXNumber MakeSimplexOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber MakeSimplexOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterMakeSimplexPlugin()
diff --git a/Plugin/MakeSimplex.h b/Plugin/MakeSimplex.h
index 65e5465d2a6d847757d620a946c8bc99f4149ad3..6499a10f8c1179fc1a4b9de2e2f86c618edab7e1 100644
--- a/Plugin/MakeSimplex.h
+++ b/Plugin/MakeSimplex.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/MathEval.cpp b/Plugin/MathEval.cpp
index f0754e36b8c475d26741d4e538eb1f865fd92dea..a7583007872fac8c059498f40d6bcee2f63bdce2 100644
--- a/Plugin/MathEval.cpp
+++ b/Plugin/MathEval.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,23 +12,23 @@
 #include <algorithm>
 
 StringXNumber MathEvalOptions_Number[] = {
-  {GMSH_FULLRC, "TimeStep", NULL, -1.},
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "OtherTimeStep", NULL, -1.},
-  {GMSH_FULLRC, "OtherView", NULL, -1.},
-  {GMSH_FULLRC, "ForceInterpolation", NULL, 0.},
-  {GMSH_FULLRC, "PhysicalRegion", NULL, -1.}};
+  {GMSH_FULLRC, "TimeStep", nullptr, -1.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "OtherTimeStep", nullptr, -1.},
+  {GMSH_FULLRC, "OtherView", nullptr, -1.},
+  {GMSH_FULLRC, "ForceInterpolation", nullptr, 0.},
+  {GMSH_FULLRC, "PhysicalRegion", nullptr, -1.}};
 
 StringXString MathEvalOptions_String[] = {
-  {GMSH_FULLRC, "Expression0", NULL, "Sqrt(v0^2+v1^2+v2^2)"},
-  {GMSH_FULLRC, "Expression1", NULL, ""},
-  {GMSH_FULLRC, "Expression2", NULL, ""},
-  {GMSH_FULLRC, "Expression3", NULL, ""},
-  {GMSH_FULLRC, "Expression4", NULL, ""},
-  {GMSH_FULLRC, "Expression5", NULL, ""},
-  {GMSH_FULLRC, "Expression6", NULL, ""},
-  {GMSH_FULLRC, "Expression7", NULL, ""},
-  {GMSH_FULLRC, "Expression8", NULL, ""}};
+  {GMSH_FULLRC, "Expression0", nullptr, "Sqrt(v0^2+v1^2+v2^2)"},
+  {GMSH_FULLRC, "Expression1", nullptr, ""},
+  {GMSH_FULLRC, "Expression2", nullptr, ""},
+  {GMSH_FULLRC, "Expression3", nullptr, ""},
+  {GMSH_FULLRC, "Expression4", nullptr, ""},
+  {GMSH_FULLRC, "Expression5", nullptr, ""},
+  {GMSH_FULLRC, "Expression6", nullptr, ""},
+  {GMSH_FULLRC, "Expression7", nullptr, ""},
+  {GMSH_FULLRC, "Expression8", nullptr, ""}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterMathEvalPlugin() { return new GMSH_MathEvalPlugin(); }
@@ -158,7 +158,7 @@ PView *GMSH_MathEvalPlugin::execute(PView *view)
   if(expr.empty()) return view;
   std::vector<double> values(numVariables), res(numComp2);
 
-  OctreePost *octree = 0;
+  OctreePost *octree = nullptr;
   if(forceInterpolation ||
      (data1->getNumEntities() != otherData->getNumEntities()) ||
      (data1->getNumElements() != otherData->getNumElements())) {
@@ -186,7 +186,7 @@ PView *GMSH_MathEvalPlugin::execute(PView *view)
     if(physicalRegion > 0) {
       GEntity *ge = data1->getEntity(timeBeg, ent);
       if(ge) {
-        std::vector<int>::iterator it =
+        auto it =
           std::find(ge->physicals.begin(), ge->physicals.end(), physicalRegion);
         ok = (it != ge->physicals.end());
       }
@@ -218,11 +218,11 @@ PView *GMSH_MathEvalPlugin::execute(PView *view)
           if(otherData) {
             if(octree) {
               int qn = forceInterpolation ? numNodes : 0;
-              if(!octree->searchScalar(x[nod], y[nod], z[nod], &w[0], step2, 0,
+              if(!octree->searchScalar(x[nod], y[nod], z[nod], &w[0], step2, nullptr,
                                        qn, &x[0], &y[0], &z[0]))
                 if(!octree->searchVector(x[nod], y[nod], z[nod], &w[0], step2,
-                                         0, qn, &x[0], &y[0], &z[0]))
-                  octree->searchTensor(x[nod], y[nod], z[nod], &w[0], step2, 0,
+                                         nullptr, qn, &x[0], &y[0], &z[0]))
+                  octree->searchTensor(x[nod], y[nod], z[nod], &w[0], step2, nullptr,
                                        qn, &x[0], &y[0], &z[0]);
             }
             else
diff --git a/Plugin/MathEval.h b/Plugin/MathEval.h
index 4a8bfae44157ff57402fdc3bc435ffb749703764..1fcbc8ba0ac54d895f3f6b3e166f892324e68595 100644
--- a/Plugin/MathEval.h
+++ b/Plugin/MathEval.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/MeshSizeFieldView.cpp b/Plugin/MeshSizeFieldView.cpp
index 8394e7902975f3adf01ab3ac45b6eefc0f8cb0eb..2387e9ad79d03d80cc107aa8d1e737d1ef9626f2 100644
--- a/Plugin/MeshSizeFieldView.cpp
+++ b/Plugin/MeshSizeFieldView.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,9 +12,9 @@
 #endif
 
 StringXNumber MeshSizeFieldViewOptions_Number[] = {
-  {GMSH_FULLRC, "MeshSizeField", NULL, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "Component", NULL, 0.}
+  {GMSH_FULLRC, "MeshSizeField", nullptr, 0.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "Component", nullptr, 0.}
 };
 
 extern "C" {
diff --git a/Plugin/MeshSizeFieldView.h b/Plugin/MeshSizeFieldView.h
index 27e6b4771cc0ca6c8f6b7b49f8e15550a161a5a5..c23b945e56636af75d7631e22204237d3c4a0eb5 100644
--- a/Plugin/MeshSizeFieldView.h
+++ b/Plugin/MeshSizeFieldView.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/MeshSubEntities.cpp b/Plugin/MeshSubEntities.cpp
index 9abeb5fd2d07c2a88f513aa357feb07c3c4de433..51dd2e19d357bc3a270c583ac8c4814928518d33 100644
--- a/Plugin/MeshSubEntities.cpp
+++ b/Plugin/MeshSubEntities.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -18,10 +18,10 @@
 #include "Context.h"
 
 StringXNumber MeshSubEntitiesOptions_Number[] = {
-  {GMSH_FULLRC, "InputDimension", NULL, 1.},
-  {GMSH_FULLRC, "InputPhysicalGroup", NULL, 1.},
-  {GMSH_FULLRC, "OuputDimension", NULL, 0.},
-  {GMSH_FULLRC, "OuputPhysicalGroup", NULL, 2000.},
+  {GMSH_FULLRC, "InputDimension", nullptr, 1.},
+  {GMSH_FULLRC, "InputPhysicalGroup", nullptr, 1.},
+  {GMSH_FULLRC, "OuputDimension", nullptr, 0.},
+  {GMSH_FULLRC, "OuputPhysicalGroup", nullptr, 2000.},
 };
 
 extern "C" {
@@ -88,10 +88,10 @@ PView *GMSH_MeshSubEntitiesPlugin::execute(PView *view)
         vertices.insert(v);
       }
     }
-    for(std::set<MVertex *>::const_iterator it = vertices.begin();
+    for(auto it = vertices.begin();
         it != vertices.end(); ++it) {
       MVertex *v = *it;
-      GVertex *gv = 0;
+      GVertex *gv = nullptr;
       if(v->onWhat() && v->onWhat()->dim() == 0) {
         gv = (GVertex *)v->onWhat();
       }
@@ -113,10 +113,10 @@ PView *GMSH_MeshSubEntitiesPlugin::execute(PView *view)
         edges.insert(e);
       }
     }
-    for(std::set<MEdge, MEdgeLessThan>::const_iterator it = edges.begin();
+    for(auto it = edges.begin();
         it != edges.end(); ++it) {
       const MEdge &e = *it;
-      GEdge *ge = 0;
+      GEdge *ge = nullptr;
       MVertex *v0 = e.getVertex(0), *v1 = e.getVertex(1);
       if(v0->onWhat() && v1->onWhat()) {
         if(v0->onWhat()->dim() == 1 &&
@@ -129,7 +129,7 @@ PView *GMSH_MeshSubEntitiesPlugin::execute(PView *view)
           ge = (GEdge *)v1->onWhat();
       }
       if(!ge) {
-        ge = new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, 0, 0);
+        ge = new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, nullptr, nullptr);
         v0->setEntity(ge);
         v1->setEntity(ge);
         m->add(ge);
diff --git a/Plugin/MeshSubEntities.h b/Plugin/MeshSubEntities.h
index 2dcaba2108c19db7f770c37036ae65aca3d3b0cc..de58a59dfea8b8905974366de7806c05226a8261 100644
--- a/Plugin/MeshSubEntities.h
+++ b/Plugin/MeshSubEntities.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/MeshVolume.cpp b/Plugin/MeshVolume.cpp
index cde1840570d6eae354a8935336cc88159661ac08..bfd0ee473c465ac482a4458ff483fac0c1fbb604 100644
--- a/Plugin/MeshVolume.cpp
+++ b/Plugin/MeshVolume.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -8,8 +8,8 @@
 #include "PViewOptions.h"
 
 StringXNumber MeshVolumeOptions_Number[] = {
-  {GMSH_FULLRC, "PhysicalGroup", NULL, -1},
-  {GMSH_FULLRC, "Dimension", NULL, 3}
+  {GMSH_FULLRC, "PhysicalGroup", nullptr, -1},
+  {GMSH_FULLRC, "Dimension", nullptr, 3}
 };
 
 extern "C" {
diff --git a/Plugin/MeshVolume.h b/Plugin/MeshVolume.h
index 44e43b939ff54682999613ea96795b5a797fb9cb..5edb04fe0c87da55a67224cbab67a522d5cc7102 100644
--- a/Plugin/MeshVolume.h
+++ b/Plugin/MeshVolume.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/MinMax.cpp b/Plugin/MinMax.cpp
index 7c68339db40d593bc192ec90e48fba15d0312c70..48e7569b72e7169356983048d20fc45ffa999d55 100644
--- a/Plugin/MinMax.cpp
+++ b/Plugin/MinMax.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -6,10 +6,10 @@
 #include "MinMax.h"
 #include "PViewOptions.h"
 
-StringXNumber MinMaxOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.},
-                                        {GMSH_FULLRC, "OverTime", NULL, 0},
-                                        {GMSH_FULLRC, "Argument", NULL, 0},
-                                        {GMSH_FULLRC, "Visible", NULL, 1}};
+StringXNumber MinMaxOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.},
+                                        {GMSH_FULLRC, "OverTime", nullptr, 0},
+                                        {GMSH_FULLRC, "Argument", nullptr, 0},
+                                        {GMSH_FULLRC, "Visible", nullptr, 1}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterMinMaxPlugin() { return new GMSH_MinMaxPlugin(); }
@@ -140,5 +140,5 @@ PView *GMSH_MinMaxPlugin::execute(PView *v)
   dataMax->setFileName(data1->getName() + "_Max.pos");
   dataMax->finalize();
 
-  return 0;
+  return nullptr;
 }
diff --git a/Plugin/MinMax.h b/Plugin/MinMax.h
index bc47d1eb4e2b54b7d74cd950c9e11c5bf6a05785..5ada46f32a12c7b6cb6d993c757226fc667d8c6e 100644
--- a/Plugin/MinMax.h
+++ b/Plugin/MinMax.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/ModifyComponents.cpp b/Plugin/ModifyComponents.cpp
index 7c73442c74ac159ed44bb1d44ec8998c160a98f9..47f21345e87a73583b062c6bf70519cb58813d43 100644
--- a/Plugin/ModifyComponents.cpp
+++ b/Plugin/ModifyComponents.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -11,22 +11,22 @@
 #include "mathEvaluator.h"
 
 StringXNumber ModifyComponentsOptions_Number[] = {
-  {GMSH_FULLRC, "TimeStep", NULL, -1.},
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "OtherTimeStep", NULL, -1.},
-  {GMSH_FULLRC, "OtherView", NULL, -1.},
-  {GMSH_FULLRC, "ForceInterpolation", NULL, 0.}};
+  {GMSH_FULLRC, "TimeStep", nullptr, -1.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "OtherTimeStep", nullptr, -1.},
+  {GMSH_FULLRC, "OtherView", nullptr, -1.},
+  {GMSH_FULLRC, "ForceInterpolation", nullptr, 0.}};
 
 StringXString ModifyComponentsOptions_String[] = {
-  {GMSH_FULLRC, "Expression0", NULL, "v0 * Sin(x)"},
-  {GMSH_FULLRC, "Expression1", NULL, ""},
-  {GMSH_FULLRC, "Expression2", NULL, ""},
-  {GMSH_FULLRC, "Expression3", NULL, ""},
-  {GMSH_FULLRC, "Expression4", NULL, ""},
-  {GMSH_FULLRC, "Expression5", NULL, ""},
-  {GMSH_FULLRC, "Expression6", NULL, ""},
-  {GMSH_FULLRC, "Expression7", NULL, ""},
-  {GMSH_FULLRC, "Expression8", NULL, ""}};
+  {GMSH_FULLRC, "Expression0", nullptr, "v0 * Sin(x)"},
+  {GMSH_FULLRC, "Expression1", nullptr, ""},
+  {GMSH_FULLRC, "Expression2", nullptr, ""},
+  {GMSH_FULLRC, "Expression3", nullptr, ""},
+  {GMSH_FULLRC, "Expression4", nullptr, ""},
+  {GMSH_FULLRC, "Expression5", nullptr, ""},
+  {GMSH_FULLRC, "Expression6", nullptr, ""},
+  {GMSH_FULLRC, "Expression7", nullptr, ""},
+  {GMSH_FULLRC, "Expression8", nullptr, ""}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterModifyComponentsPlugin()
@@ -148,7 +148,7 @@ PView *GMSH_ModifyComponentsPlugin::execute(PView *view)
 
   std::vector<double> values(numVariables), res(9);
 
-  OctreePost *octree = 0;
+  OctreePost *octree = nullptr;
   if(forceInterpolation ||
      (data1->getNumEntities() != data2->getNumEntities()) ||
      (data1->getNumElements() != data2->getNumElements())) {
@@ -193,11 +193,11 @@ PView *GMSH_ModifyComponentsPlugin::execute(PView *view)
           std::vector<double> w(std::max(9, numComp2), 0.);
           if(octree) {
             int qn = forceInterpolation ? numNodes : 0;
-            if(!octree->searchScalar(x[nod], y[nod], z[nod], &w[0], step2, 0,
+            if(!octree->searchScalar(x[nod], y[nod], z[nod], &w[0], step2, nullptr,
                                      qn, &x[0], &y[0], &z[0]))
-              if(!octree->searchVector(x[nod], y[nod], z[nod], &w[0], step2, 0,
+              if(!octree->searchVector(x[nod], y[nod], z[nod], &w[0], step2, nullptr,
                                        qn, &x[0], &y[0], &z[0]))
-                octree->searchTensor(x[nod], y[nod], z[nod], &w[0], step2, 0,
+                octree->searchTensor(x[nod], y[nod], z[nod], &w[0], step2, nullptr,
                                      qn, &x[0], &y[0], &z[0]);
           }
           else {
diff --git a/Plugin/ModifyComponents.h b/Plugin/ModifyComponents.h
index ca6155dd288560504eb143cefbebbaaa58d1423c..7d8b987a91f008851cde2bfd9a94a657010f1f04 100644
--- a/Plugin/ModifyComponents.h
+++ b/Plugin/ModifyComponents.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/ModulusPhase.cpp b/Plugin/ModulusPhase.cpp
index 44d15d74b057a7c34f5390737e5d59459cef8f9b..496f79f0d32af0e0085d1c7b43d8cbd5c3f6949d 100644
--- a/Plugin/ModulusPhase.cpp
+++ b/Plugin/ModulusPhase.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -6,9 +6,9 @@
 #include "ModulusPhase.h"
 
 StringXNumber ModulusPhaseOptions_Number[] = {
-  {GMSH_FULLRC, "RealPart", NULL, 0.},
-  {GMSH_FULLRC, "ImaginaryPart", NULL, 1.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "RealPart", nullptr, 0.},
+  {GMSH_FULLRC, "ImaginaryPart", nullptr, 1.},
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterModulusPhasePlugin()
diff --git a/Plugin/ModulusPhase.h b/Plugin/ModulusPhase.h
index 09a997981cbdc7e30377f0b3f17e717cde5ead5c..937a95518641280e788e8eb2120b35e7bd8d2453 100644
--- a/Plugin/ModulusPhase.h
+++ b/Plugin/ModulusPhase.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/NearToFarField.cpp b/Plugin/NearToFarField.cpp
index 613a05de242e79cd73c43182db3d967bd951bcb9..7fdd786b0778064b1f313ee86eb672612bb861d3 100644
--- a/Plugin/NearToFarField.cpp
+++ b/Plugin/NearToFarField.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,23 +12,23 @@
 #include "OS.h"
 
 StringXNumber NearToFarFieldOptions_Number[] = {
-  {GMSH_FULLRC, "Wavenumber", NULL, 1.},
-  {GMSH_FULLRC, "PhiStart", NULL, 0.},
-  {GMSH_FULLRC, "PhiEnd", NULL, 2. * M_PI},
-  {GMSH_FULLRC, "NumPointsPhi", NULL, 60},
-  {GMSH_FULLRC, "ThetaStart", NULL, 0.},
-  {GMSH_FULLRC, "ThetaEnd", NULL, M_PI},
-  {GMSH_FULLRC, "NumPointsTheta", NULL, 30},
-  {GMSH_FULLRC, "EView", NULL, 0},
-  {GMSH_FULLRC, "HView", NULL, 1},
-  {GMSH_FULLRC, "Normalize", NULL, 1},
-  {GMSH_FULLRC, "dB", NULL, 1},
-  {GMSH_FULLRC, "NegativeTime", NULL, 0.},
-  {GMSH_FULLRC, "RFar", NULL, 0},
+  {GMSH_FULLRC, "Wavenumber", nullptr, 1.},
+  {GMSH_FULLRC, "PhiStart", nullptr, 0.},
+  {GMSH_FULLRC, "PhiEnd", nullptr, 2. * M_PI},
+  {GMSH_FULLRC, "NumPointsPhi", nullptr, 60},
+  {GMSH_FULLRC, "ThetaStart", nullptr, 0.},
+  {GMSH_FULLRC, "ThetaEnd", nullptr, M_PI},
+  {GMSH_FULLRC, "NumPointsTheta", nullptr, 30},
+  {GMSH_FULLRC, "EView", nullptr, 0},
+  {GMSH_FULLRC, "HView", nullptr, 1},
+  {GMSH_FULLRC, "Normalize", nullptr, 1},
+  {GMSH_FULLRC, "dB", nullptr, 1},
+  {GMSH_FULLRC, "NegativeTime", nullptr, 0.},
+  {GMSH_FULLRC, "RFar", nullptr, 0},
 };
 
 StringXString NearToFarFieldOptions_String[] = {
-  {GMSH_FULLRC, "MatlabOutputFile", NULL, "farfield.m"},
+  {GMSH_FULLRC, "MatlabOutputFile", nullptr, "farfield.m"},
 };
 
 extern "C" {
diff --git a/Plugin/NearToFarField.h b/Plugin/NearToFarField.h
index aa0334e4bd69ba276bc4c0e85bffb5746ed78c55..8f20ba17293e6dab911f6f430178f3becc69402d 100644
--- a/Plugin/NearToFarField.h
+++ b/Plugin/NearToFarField.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/NearestNeighbor.cpp b/Plugin/NearestNeighbor.cpp
index a0120272e2e86d8b85009aa4aa4ada39df98f595..6f05c6070eaf3dc5e7df0e5f054bf0e5e0e59e2d 100644
--- a/Plugin/NearestNeighbor.cpp
+++ b/Plugin/NearestNeighbor.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -11,7 +11,7 @@
 #endif
 
 StringXNumber NearestNeighborOptions_Number[] = {
-  {GMSH_FULLRC, "View", NULL, -1.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
 };
 
 extern "C" {
@@ -50,7 +50,7 @@ PView *GMSH_NearestNeighborPlugin::execute(PView *v)
   int totpoints = data1->getNumPoints();
   if(!totpoints) {
     Msg::Error("View[%d] contains no points", iView);
-    return 0;
+    return nullptr;
   }
 
 #if defined(HAVE_ANN)
diff --git a/Plugin/NearestNeighbor.h b/Plugin/NearestNeighbor.h
index 7c5dbfb123171d4d0cb2483e86384aecb7532f1b..f68c0e3bccf8a1a58e14edcc4c8ff80d738b05a9 100644
--- a/Plugin/NearestNeighbor.h
+++ b/Plugin/NearestNeighbor.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/NewView.cpp b/Plugin/NewView.cpp
index 0fa8a50dbd501ab20f666a10f4dd35d28549d90c..58004b616874e96cbfbcf7c49d14d97374821a94 100644
--- a/Plugin/NewView.cpp
+++ b/Plugin/NewView.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,14 +12,14 @@
 #include "MElement.h"
 
 StringXNumber NewViewOptions_Number[] = {
-  {GMSH_FULLRC, "NumComp", NULL, 1.},
-  {GMSH_FULLRC, "Value", NULL, 0.},
-  {GMSH_FULLRC, "ViewTag", NULL, -1.},
-  {GMSH_FULLRC, "PhysicalGroup", NULL, -1.}
+  {GMSH_FULLRC, "NumComp", nullptr, 1.},
+  {GMSH_FULLRC, "Value", nullptr, 0.},
+  {GMSH_FULLRC, "ViewTag", nullptr, -1.},
+  {GMSH_FULLRC, "PhysicalGroup", nullptr, -1.}
 };
 
 StringXString NewViewOptions_String[] = {
-  {GMSH_FULLRC, "Type", NULL, "NodeData"}
+  {GMSH_FULLRC, "Type", nullptr, "NodeData"}
 };
 
 extern "C" {
diff --git a/Plugin/NewView.h b/Plugin/NewView.h
index 797ffe030618ce5cdafda273c677c121c509fa21..e5d65b7907a1a313b599b64471b9f0473aca7e65 100644
--- a/Plugin/NewView.h
+++ b/Plugin/NewView.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Particles.cpp b/Plugin/Particles.cpp
index 4bf42f96d2e60de69e3e81258d5feb45526a0823..d5e6201c3858721d6af507e5f11d65b7b28f961e 100644
--- a/Plugin/Particles.cpp
+++ b/Plugin/Particles.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -26,13 +26,13 @@ StringXNumber ParticlesOptions_Number[] = {
   {GMSH_FULLRC, "Z2", GMSH_ParticlesPlugin::callbackZ2, 0.},
   {GMSH_FULLRC, "NumPointsU", GMSH_ParticlesPlugin::callbackU, 10},
   {GMSH_FULLRC, "NumPointsV", GMSH_ParticlesPlugin::callbackV, 1},
-  {GMSH_FULLRC, "A2", NULL, 1.},
-  {GMSH_FULLRC, "A1", NULL, 0.},
-  {GMSH_FULLRC, "A0", NULL, 0.},
-  {GMSH_FULLRC, "DT", NULL, .1},
-  {GMSH_FULLRC, "MaxIter", NULL, 100},
-  {GMSH_FULLRC, "TimeStep", NULL, 0},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "A2", nullptr, 1.},
+  {GMSH_FULLRC, "A1", nullptr, 0.},
+  {GMSH_FULLRC, "A0", nullptr, 0.},
+  {GMSH_FULLRC, "DT", nullptr, .1},
+  {GMSH_FULLRC, "MaxIter", nullptr, 100},
+  {GMSH_FULLRC, "TimeStep", nullptr, 0},
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterParticlesPlugin()
diff --git a/Plugin/Particles.h b/Plugin/Particles.h
index 8a5db7ee0210b4baba06dcc72df8c359f4d32400..3cfc12735b8b5c1e1b7e492c7d03322bfe2b1f9b 100644
--- a/Plugin/Particles.h
+++ b/Plugin/Particles.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp
index ec22b4022d5bfba5c494c7192d97a2d731cc49b0..02e85bfaaf3e2d28a636c87aa82bfbe64691c2b2 100644
--- a/Plugin/Plugin.cpp
+++ b/Plugin/Plugin.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -16,7 +16,7 @@
 #include "drawContext.h"
 #endif
 
-void (*GMSH_Plugin::draw)(void *) = 0;
+void (*GMSH_Plugin::draw)(void *) = nullptr;
 
 void GMSH_Plugin::setDrawFunction(void (*fct)(void *))
 {
@@ -87,13 +87,13 @@ PView *GMSH_PostPlugin::getView(int index, PView *view)
   }
   else {
     Msg::Error("View[%d] does not exist", index);
-    return 0;
+    return nullptr;
   }
 }
 
 PViewData *GMSH_PostPlugin::getPossiblyAdaptiveData(PView *view)
 {
-  if(!view) return 0;
+  if(!view) return nullptr;
   PViewData *data = view->getData();
   if(data->getAdaptiveData() && data->getNumTimeSteps() > 1)
     Msg::Warning(
@@ -106,7 +106,7 @@ PViewData *GMSH_PostPlugin::getPossiblyAdaptiveData(PView *view)
 
 PViewDataList *GMSH_PostPlugin::getDataList(PView *view, bool showError)
 {
-  if(!view) return 0;
+  if(!view) return nullptr;
 
   PViewDataList *data = dynamic_cast<PViewDataList *>(view->getData());
   if(data)
@@ -114,5 +114,5 @@ PViewDataList *GMSH_PostPlugin::getDataList(PView *view, bool showError)
   else if(showError)
     Msg::Error(
       "This plugin can only be run on list-based views (`.pos' files)");
-  return 0;
+  return nullptr;
 }
diff --git a/Plugin/Plugin.h b/Plugin/Plugin.h
index 8c9d9eef3e4db38fc095d2c21fe2a9c40cbfad0b..1752afa782c651fdcc3bd171ab9391b8394fa103 100644
--- a/Plugin/Plugin.h
+++ b/Plugin/Plugin.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -39,7 +39,7 @@ public:
   // for internal use by PluginManager
   void *hlib;
 
-  GMSH_Plugin() : dialogBox(0), hlib(0) {}
+  GMSH_Plugin() : dialogBox(nullptr), hlib(nullptr) {}
   virtual ~GMSH_Plugin() {}
 
   // return plugin type, name and info
@@ -59,11 +59,11 @@ public:
 
   // gmsh-style numeric options
   virtual int getNbOptions() const { return 0; }
-  virtual StringXNumber *getOption(int iopt) { return 0; };
+  virtual StringXNumber *getOption(int iopt) { return nullptr; };
 
   // gmsh-style string options
   virtual int getNbOptionsStr() const { return 0; }
-  virtual StringXString *getOptionStr(int iopt) { return NULL; }
+  virtual StringXString *getOptionStr(int iopt) { return nullptr; }
 
   // serialize plugin options into a string
   std::string serialize();
@@ -87,7 +87,7 @@ public:
     return GMSH_Plugin::GMSH_POST_PLUGIN;
   }
   // run the plugin
-  virtual void run() { execute(0); }
+  virtual void run() { execute(nullptr); }
   // if the returned pointer is the same as the argument, then the
   // view is simply modified, else, a new view is added in the view
   // list
diff --git a/Plugin/PluginManager.cpp b/Plugin/PluginManager.cpp
index d97380bd2ea6caa5a8f1337b90dc430bba4c49bf..7ad8847e17437628f7cc7cb214aee933f1bc2c38 100644
--- a/Plugin/PluginManager.cpp
+++ b/Plugin/PluginManager.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -86,34 +86,34 @@
 
 const char *GMSH_PluginEntry = "GMSH_RegisterPlugin";
 
-PluginManager *PluginManager::_instance = 0;
+PluginManager *PluginManager::_instance = nullptr;
 
 PluginManager::~PluginManager()
 {
-  for(std::map<std::string, GMSH_Plugin *>::iterator it = allPlugins.begin();
+  for(auto it = allPlugins.begin();
       it != allPlugins.end(); ++it)
     delete it->second;
 }
 
 GMSH_Plugin *PluginManager::find(const std::string &pluginName)
 {
-  std::map<std::string, GMSH_Plugin *>::iterator it =
+  auto it =
     allPlugins.find(pluginName);
-  if(it == allPlugins.end()) return 0;
+  if(it == allPlugins.end()) return nullptr;
   return it->second;
 }
 
 GMSH_SolverPlugin *PluginManager::findSolverPlugin()
 {
-  std::map<std::string, GMSH_Plugin *>::iterator it = allPlugins.begin();
-  std::map<std::string, GMSH_Plugin *>::iterator ite = allPlugins.end();
+  auto it = allPlugins.begin();
+  auto ite = allPlugins.end();
   for(; it != ite; ++it) {
     GMSH_Plugin *p = it->second;
     if(p->getType() == GMSH_Plugin::GMSH_SOLVER_PLUGIN) {
       return (GMSH_SolverPlugin *)(p);
     }
   }
-  return 0;
+  return nullptr;
 }
 
 void PluginManager::action(const std::string &pluginName,
diff --git a/Plugin/PluginManager.h b/Plugin/PluginManager.h
index 14639fe9346c4be677f40a0948db4362de5dbe72..2fdc203be2fd3fd56ee831245c8636d45b3eee16 100644
--- a/Plugin/PluginManager.h
+++ b/Plugin/PluginManager.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Probe.cpp b/Plugin/Probe.cpp
index 0c45d51a3bdbaa0751405847a40412cd359eeafb..b5ecabf6d1c070ea4c14048cee3f25d09e19f154 100644
--- a/Plugin/Probe.cpp
+++ b/Plugin/Probe.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -18,7 +18,7 @@ StringXNumber ProbeOptions_Number[] = {
   {GMSH_FULLRC, "X", GMSH_ProbePlugin::callbackX, 0.},
   {GMSH_FULLRC, "Y", GMSH_ProbePlugin::callbackY, 0.},
   {GMSH_FULLRC, "Z", GMSH_ProbePlugin::callbackZ, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
 };
 
 extern "C" {
diff --git a/Plugin/Probe.h b/Plugin/Probe.h
index 7f9647a01ce4974e5381227a29393f4e046c0ea5..ae9ff5b194f6c0f8b985ee84c83b11fcf0fdb5dc 100644
--- a/Plugin/Probe.h
+++ b/Plugin/Probe.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Remove.cpp b/Plugin/Remove.cpp
index 3753fdea424a1de78417339f1ca72d57057cf628..23ea6b68e8774823175656c0cbf61a79705a88b0 100644
--- a/Plugin/Remove.cpp
+++ b/Plugin/Remove.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -6,13 +6,13 @@
 #include "Remove.h"
 
 StringXNumber RemoveOptions_Number[] = {
-  {GMSH_FULLRC, "Text2D", NULL, 1.},     {GMSH_FULLRC, "Text3D", NULL, 1.},
-  {GMSH_FULLRC, "Points", NULL, 0.},     {GMSH_FULLRC, "Lines", NULL, 0.},
-  {GMSH_FULLRC, "Triangles", NULL, 0.},  {GMSH_FULLRC, "Quadrangles", NULL, 0.},
-  {GMSH_FULLRC, "Tetrahedra", NULL, 0.}, {GMSH_FULLRC, "Hexahedra", NULL, 0.},
-  {GMSH_FULLRC, "Prisms", NULL, 0.},     {GMSH_FULLRC, "Pyramids", NULL, 0.},
-  {GMSH_FULLRC, "Scalar", NULL, 1.},     {GMSH_FULLRC, "Vector", NULL, 1.},
-  {GMSH_FULLRC, "Tensor", NULL, 1.},     {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "Text2D", nullptr, 1.},     {GMSH_FULLRC, "Text3D", nullptr, 1.},
+  {GMSH_FULLRC, "Points", nullptr, 0.},     {GMSH_FULLRC, "Lines", nullptr, 0.},
+  {GMSH_FULLRC, "Triangles", nullptr, 0.},  {GMSH_FULLRC, "Quadrangles", nullptr, 0.},
+  {GMSH_FULLRC, "Tetrahedra", nullptr, 0.}, {GMSH_FULLRC, "Hexahedra", nullptr, 0.},
+  {GMSH_FULLRC, "Prisms", nullptr, 0.},     {GMSH_FULLRC, "Pyramids", nullptr, 0.},
+  {GMSH_FULLRC, "Scalar", nullptr, 1.},     {GMSH_FULLRC, "Vector", nullptr, 1.},
+  {GMSH_FULLRC, "Tensor", nullptr, 1.},     {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterRemovePlugin() { return new GMSH_RemovePlugin(); }
diff --git a/Plugin/Remove.h b/Plugin/Remove.h
index 9f3e27c2800fcba9620f722e691d1f80954dcc21..241d86da14bc7cdc9bb4aa88c19866d5a15c3dac 100644
--- a/Plugin/Remove.h
+++ b/Plugin/Remove.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Scal2Tens.cpp b/Plugin/Scal2Tens.cpp
index 470b466b09e04a9be954445a1b39cd16c5a6e8e8..ed4096188de09fa3dd5d07ffe51d334698bdf10f 100644
--- a/Plugin/Scal2Tens.cpp
+++ b/Plugin/Scal2Tens.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -8,19 +8,19 @@
 #include "shapeFunctions.h"
 
 StringXNumber Scal2TensOptions_Number[] = {
-  {GMSH_FULLRC, "NumberOfComponents", NULL, 9},
-  {GMSH_FULLRC, "View0", NULL, -1},
-  {GMSH_FULLRC, "View1", NULL, -1},
-  {GMSH_FULLRC, "View2", NULL, -1},
-  {GMSH_FULLRC, "View3", NULL, -1},
-  {GMSH_FULLRC, "View4", NULL, -1},
-  {GMSH_FULLRC, "View5", NULL, -1},
-  {GMSH_FULLRC, "View6", NULL, -1},
-  {GMSH_FULLRC, "View7", NULL, -1},
-  {GMSH_FULLRC, "View8", NULL, -1}};
+  {GMSH_FULLRC, "NumberOfComponents", nullptr, 9},
+  {GMSH_FULLRC, "View0", nullptr, -1},
+  {GMSH_FULLRC, "View1", nullptr, -1},
+  {GMSH_FULLRC, "View2", nullptr, -1},
+  {GMSH_FULLRC, "View3", nullptr, -1},
+  {GMSH_FULLRC, "View4", nullptr, -1},
+  {GMSH_FULLRC, "View5", nullptr, -1},
+  {GMSH_FULLRC, "View6", nullptr, -1},
+  {GMSH_FULLRC, "View7", nullptr, -1},
+  {GMSH_FULLRC, "View8", nullptr, -1}};
 
 StringXString Scal2TensOptions_String[] = {
-  {GMSH_FULLRC, "NameNewView", NULL, "NewView"}};
+  {GMSH_FULLRC, "NameNewView", nullptr, "NewView"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterScal2TensPlugin()
@@ -73,10 +73,10 @@ PView *GMSH_Scal2TensPlugin::execute(PView *v)
     iView[comp] = (int)Scal2TensOptions_Number[comp + 1].def;
 
   // Load data
-  PView *vRef = 0, *vComp[9];
+  PView *vRef = nullptr, *vComp[9];
   for(int comp = 0; comp < numComp; comp++) {
     if(iView[comp] < 0)
-      vComp[comp] = 0;
+      vComp[comp] = nullptr;
     else {
       vComp[comp] = getView(iView[comp], v);
       if(!vComp[comp]) {
diff --git a/Plugin/Scal2Tens.h b/Plugin/Scal2Tens.h
index 28a13d0adc690843534538a1a44cbd866925d6a2..c3c0e8d0b79c87e89ed9a53d7de51fc2ee0ee16d 100644
--- a/Plugin/Scal2Tens.h
+++ b/Plugin/Scal2Tens.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Scal2Vec.cpp b/Plugin/Scal2Vec.cpp
index 799b7f777467cd7ca71ee8925e9cd727547df21b..99e4b226d5543c0de1d63614fa45b87120633515 100644
--- a/Plugin/Scal2Vec.cpp
+++ b/Plugin/Scal2Vec.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,12 +7,12 @@
 #include "PViewOptions.h"
 #include "shapeFunctions.h"
 
-StringXNumber Scal2VecOptions_Number[] = {{GMSH_FULLRC, "ViewX", NULL, -1},
-                                          {GMSH_FULLRC, "ViewY", NULL, -1},
-                                          {GMSH_FULLRC, "ViewZ", NULL, -1}};
+StringXNumber Scal2VecOptions_Number[] = {{GMSH_FULLRC, "ViewX", nullptr, -1},
+                                          {GMSH_FULLRC, "ViewY", nullptr, -1},
+                                          {GMSH_FULLRC, "ViewZ", nullptr, -1}};
 
 StringXString Scal2VecOptions_String[] = {
-  {GMSH_FULLRC, "NameNewView", NULL, "NewView"}};
+  {GMSH_FULLRC, "NameNewView", nullptr, "NewView"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterScal2VecPlugin() { return new GMSH_Scal2VecPlugin(); }
@@ -54,10 +54,10 @@ PView *GMSH_Scal2VecPlugin::execute(PView *v)
     iView[comp] = (int)Scal2VecOptions_Number[comp].def;
 
   // Load data
-  PView *vRef = 0, *vComp[3];
+  PView *vRef = nullptr, *vComp[3];
   for(int comp = 0; comp < 3; comp++) {
     if(iView[comp] < 0)
-      vComp[comp] = 0;
+      vComp[comp] = nullptr;
     else {
       vComp[comp] = getView(iView[comp], v);
       if(!vComp[comp]) {
diff --git a/Plugin/Scal2Vec.h b/Plugin/Scal2Vec.h
index 67fed135716888c61e0eaae592abaab7126d1954..885d559d66423002855a330c34ea7cc681d53d01 100644
--- a/Plugin/Scal2Vec.h
+++ b/Plugin/Scal2Vec.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/ShowNeighborElements.cpp b/Plugin/ShowNeighborElements.cpp
index c972ba98b6ba8027755eed88cacea863d991ef30..b98f6159e7d4eb58c6276f634d848cbd3fca5e88 100644
--- a/Plugin/ShowNeighborElements.cpp
+++ b/Plugin/ShowNeighborElements.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -16,12 +16,12 @@
 #endif
 
 StringXNumber ShowNeighborElementsOptions_Number[] = {
-  {GMSH_FULLRC, "NumLayers", NULL, 1},
-  {GMSH_FULLRC, "Element1", NULL, 0},
-  {GMSH_FULLRC, "Element2", NULL, 0},
-  {GMSH_FULLRC, "Element3", NULL, 0},
-  {GMSH_FULLRC, "Element4", NULL, 0},
-  {GMSH_FULLRC, "Element5", NULL, 0}
+  {GMSH_FULLRC, "NumLayers", nullptr, 1},
+  {GMSH_FULLRC, "Element1", nullptr, 0},
+  {GMSH_FULLRC, "Element2", nullptr, 0},
+  {GMSH_FULLRC, "Element3", nullptr, 0},
+  {GMSH_FULLRC, "Element4", nullptr, 0},
+  {GMSH_FULLRC, "Element5", nullptr, 0}
 };
 
 extern "C" {
@@ -57,13 +57,13 @@ PView *GMSH_ShowNeighborElementsPlugin::execute(PView *v)
   _nel4 = static_cast<int>(ShowNeighborElementsOptions_Number[4].def);
   _nel5 = static_cast<int>(ShowNeighborElementsOptions_Number[5].def);
 
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
     GFace *f = *it;
     _init(f);
     _showLayers(f, _nLayers);
   }
 
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+  for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
     GRegion *r = *it;
     _init(r);
     _showLayers(r, _nLayers);
@@ -74,7 +74,7 @@ PView *GMSH_ShowNeighborElementsPlugin::execute(PView *v)
   drawContext::global()->draw();
 #endif
 
-  return NULL;
+  return nullptr;
 }
 
 void GMSH_ShowNeighborElementsPlugin::_init(GEntity *ent)
diff --git a/Plugin/ShowNeighborElements.h b/Plugin/ShowNeighborElements.h
index 4812b3c9235222547c4f5b69a97d2b900295d6a6..f8c147ca1c17f2420762d2b2c816865f6feb12e4 100644
--- a/Plugin/ShowNeighborElements.h
+++ b/Plugin/ShowNeighborElements.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/SimplePartition.cpp b/Plugin/SimplePartition.cpp
index d0885f336f81be2be50e6ea97e139d486215914c..7868244477299eaac480feb77c50711a012063f0 100644
--- a/Plugin/SimplePartition.cpp
+++ b/Plugin/SimplePartition.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,16 +22,16 @@
 #endif
 
 StringXNumber SimplePartitionOptions_Number[] = {
-  {GMSH_FULLRC, "NumSlicesX", NULL, 4.},
-  {GMSH_FULLRC, "NumSlicesY", NULL, 1.},
-  {GMSH_FULLRC, "NumSlicesZ", NULL, 1.},
-  {GMSH_FULLRC, "CreateTopology", NULL, 1.},
+  {GMSH_FULLRC, "NumSlicesX", nullptr, 4.},
+  {GMSH_FULLRC, "NumSlicesY", nullptr, 1.},
+  {GMSH_FULLRC, "NumSlicesZ", nullptr, 1.},
+  {GMSH_FULLRC, "CreateTopology", nullptr, 1.},
 };
 
 StringXString SimplePartitionOptions_String[] = {
-  {GMSH_FULLRC, "MappingX", NULL, "t"},
-  {GMSH_FULLRC, "MappingY", NULL, "t"},
-  {GMSH_FULLRC, "MappingZ", NULL, "t"}};
+  {GMSH_FULLRC, "MappingX", nullptr, "t"},
+  {GMSH_FULLRC, "MappingY", nullptr, "t"},
+  {GMSH_FULLRC, "MappingZ", nullptr, "t"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterSimplePartitionPlugin()
diff --git a/Plugin/SimplePartition.h b/Plugin/SimplePartition.h
index e70d1886afa36b41a42286f589e1cbd82a166e74..993133935ca35d19efc64cef34703b9f2b74ec27 100644
--- a/Plugin/SimplePartition.h
+++ b/Plugin/SimplePartition.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Skin.cpp b/Plugin/Skin.cpp
index 2b135168021975889430ca327ae01ab4d687c7ab..4d0d9a282d75985a892afe8adef9a13cc7455f9c 100644
--- a/Plugin/Skin.cpp
+++ b/Plugin/Skin.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -15,9 +15,9 @@
 #include "discreteFace.h"
 #include "discreteEdge.h"
 
-StringXNumber SkinOptions_Number[] = {{GMSH_FULLRC, "Visible", NULL, 1.},
-                                      {GMSH_FULLRC, "FromMesh", NULL, 0.},
-                                      {GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber SkinOptions_Number[] = {{GMSH_FULLRC, "Visible", nullptr, 1.},
+                                      {GMSH_FULLRC, "FromMesh", nullptr, 0.},
+                                      {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterSkinPlugin() { return new GMSH_SkinPlugin(); }
@@ -65,7 +65,7 @@ public:
   }
   void addInView(PViewDataList *data) const
   {
-    std::vector<double> *vec = 0;
+    std::vector<double> *vec = nullptr;
     switch(x.size()) {
     case 1:
       if(numComp == 1) {
@@ -222,9 +222,9 @@ static void getBoundaryFromMesh(GModel *m, int visible)
 
   if(dim == 2) {
     discreteEdge *e =
-      new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, 0, 0);
+      new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, nullptr, nullptr);
     m->add(e);
-    for(std::set<MEdge, MEdgeLessThan>::iterator it = bndEdges.begin();
+    for(auto it = bndEdges.begin();
         it != bndEdges.end(); it++) {
       e->lines.push_back(new MLine(it->getVertex(0), it->getVertex(1)));
     }
@@ -232,7 +232,7 @@ static void getBoundaryFromMesh(GModel *m, int visible)
   else if(dim == 3) {
     discreteFace *f = new discreteFace(m, m->getMaxElementaryNumber(2) + 1);
     m->add(f);
-    for(std::set<MFace, MFaceLessThan>::iterator it = bndFaces.begin();
+    for(auto it = bndFaces.begin();
         it != bndFaces.end(); it++) {
       if(it->getNumVertices() == 3)
         f->triangles.push_back(
@@ -297,7 +297,7 @@ PView *GMSH_SkinPlugin::execute(PView *v)
           e.y.push_back(y);
           e.z.push_back(z);
         }
-        std::set<ElmData, ElmDataLessThan>::iterator it = skin.find(e);
+        auto it = skin.find(e);
         if(it == skin.end()) {
           for(int step = 0; step < data1->getNumTimeSteps(); step++) {
             if(data1->hasTimeStep(step)) {
@@ -320,7 +320,7 @@ PView *GMSH_SkinPlugin::execute(PView *v)
     }
   }
 
-  for(std::set<ElmData, ElmDataLessThan>::iterator it = skin.begin();
+  for(auto it = skin.begin();
       it != skin.end(); it++)
     it->addInView(data2);
 
diff --git a/Plugin/Skin.h b/Plugin/Skin.h
index 02f088e46a65c6a1ed6a35a671a8ff09d013e7b3..89eb841ceb48a2c8460f406c609ffdbd48586cdb 100644
--- a/Plugin/Skin.h
+++ b/Plugin/Skin.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Smooth.cpp b/Plugin/Smooth.cpp
index e2d59d421fd464d4fdb69977892b2c598eb7856a..5607d98023d61de7b6317366586159337a1f87a3 100644
--- a/Plugin/Smooth.cpp
+++ b/Plugin/Smooth.cpp
@@ -1,11 +1,11 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
 
 #include "Smooth.h"
 
-StringXNumber SmoothOptions_Number[] = {{GMSH_FULLRC, "View", NULL, -1.}};
+StringXNumber SmoothOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterSmoothPlugin() { return new GMSH_SmoothPlugin(); }
diff --git a/Plugin/Smooth.h b/Plugin/Smooth.h
index 968af75773acedf03b5f0a356948bc662192c6e3..846be27d50006a2ebae38799e89a43160fca3b9c 100644
--- a/Plugin/Smooth.h
+++ b/Plugin/Smooth.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/SpanningTree.cpp b/Plugin/SpanningTree.cpp
index c619dee4ac6959dab50f585372900662c0f439d8..49ae06701dfa46888ae00ae101c0ccfcedd8ee25 100644
--- a/Plugin/SpanningTree.cpp
+++ b/Plugin/SpanningTree.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -15,13 +15,13 @@
 using namespace std;
 
 StringXNumber SpanningTreeOptions_Number[] = {
-  {GMSH_FULLRC, "OutputPhysical", NULL, -1},
+  {GMSH_FULLRC, "OutputPhysical", nullptr, -1},
 };
 
 StringXString SpanningTreeOptions_String[] = {
-  {GMSH_FULLRC, "PhysicalVolumes", NULL, ""},
-  {GMSH_FULLRC, "PhysicalSurfaces", NULL, ""},
-  {GMSH_FULLRC, "PhysicalCurves", NULL, ""},
+  {GMSH_FULLRC, "PhysicalVolumes", nullptr, ""},
+  {GMSH_FULLRC, "PhysicalSurfaces", nullptr, ""},
+  {GMSH_FULLRC, "PhysicalCurves", nullptr, ""},
 };
 
 extern "C" {
@@ -110,7 +110,7 @@ void GMSH_SpanningTreePlugin::run(void)
   // Get all elements in physicals for each dimension
   vector<ElementSet> element(3);
   for(int i = 0; i < 3; i++)
-    for(list<int>::iterator j = physical[i].begin(); j != physical[i].end();
+    for(auto j = physical[i].begin(); j != physical[i].end();
         j++)
       getAllMElement(*model, *j, dim[i], element[i]);
 
@@ -148,8 +148,8 @@ void GMSH_SpanningTreePlugin::spanningTree(EdgeSet &edge, DSU &vertex,
   // Kruskal's algorithm, without edge sorting, since we don't weight them
 
   // Iterate on edges
-  EdgeSet::iterator end = edge.end();
-  EdgeSet::iterator it = edge.begin();
+  auto end = edge.end();
+  auto it = edge.begin();
 
   for(; it != end; it++) { // Loop on edges:
     if(vertex.find(it->first) != vertex.find(it->second)) { // if the current
@@ -204,8 +204,8 @@ void GMSH_SpanningTreePlugin::getAllMElement(GModel &model, int physical,
 
 void GMSH_SpanningTreePlugin::getAllMEdge(ElementSet &element, EdgeSet &edge)
 {
-  ElementSet::iterator end = element.end();
-  ElementSet::iterator it = element.begin();
+  auto end = element.end();
+  auto it = element.begin();
 
   for(; it != end; it++)
     for(int i = 0; i < (*it)->getNumEdges(); i++)
@@ -222,8 +222,8 @@ void GMSH_SpanningTreePlugin::addToModel(GModel &model, Tree &tree, int tag)
   std::vector<MElement *> line(tree.size());
 
   // Populate
-  Tree::iterator end = tree.end();
-  Tree::iterator it = tree.begin();
+  auto end = tree.end();
+  auto it = tree.begin();
 
   for(int i = 0; it != end; i++, it++)
     line[i] = new MLine(model.getMeshVertexByTag(it->first + 1),
diff --git a/Plugin/SpanningTree.h b/Plugin/SpanningTree.h
index 246bf84c1b1f98ac5ee0b377e535fad652110689..be74275f28b354cde9548cee0904a995dd5ff6cb 100644
--- a/Plugin/SpanningTree.h
+++ b/Plugin/SpanningTree.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/SphericalRaise.cpp b/Plugin/SphericalRaise.cpp
index 39cca57840e6efa7f0cf748c99f474de5b6fcea7..af962256ad58477f3a1e477a42b2ae4a41ce07e2 100644
--- a/Plugin/SphericalRaise.cpp
+++ b/Plugin/SphericalRaise.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -7,10 +7,10 @@
 #include "Numeric.h"
 
 StringXNumber SphericalRaiseOptions_Number[] = {
-  {GMSH_FULLRC, "Xc", NULL, 0.},     {GMSH_FULLRC, "Yc", NULL, 0.},
-  {GMSH_FULLRC, "Zc", NULL, 0.},     {GMSH_FULLRC, "Raise", NULL, 1.},
-  {GMSH_FULLRC, "Offset", NULL, 0.}, {GMSH_FULLRC, "TimeStep", NULL, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "Xc", nullptr, 0.},     {GMSH_FULLRC, "Yc", nullptr, 0.},
+  {GMSH_FULLRC, "Zc", nullptr, 0.},     {GMSH_FULLRC, "Raise", nullptr, 1.},
+  {GMSH_FULLRC, "Offset", nullptr, 0.}, {GMSH_FULLRC, "TimeStep", nullptr, 0.},
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterSphericalRaisePlugin()
diff --git a/Plugin/SphericalRaise.h b/Plugin/SphericalRaise.h
index 6664c226480726ac560e0d76b62d916a3b364689..98cfd6b2f4b455d9d17809898e6392bba0664285 100644
--- a/Plugin/SphericalRaise.h
+++ b/Plugin/SphericalRaise.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/StreamLines.cpp b/Plugin/StreamLines.cpp
index 098334fbd9c19a73c077c2b6ee123bfac5700ed2..aef4c0264e5c87aa2105f5c176f06ba3338325f2 100644
--- a/Plugin/StreamLines.cpp
+++ b/Plugin/StreamLines.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -26,11 +26,11 @@ StringXNumber StreamLinesOptions_Number[] = {
   {GMSH_FULLRC, "Z2", GMSH_StreamLinesPlugin::callbackZ2, 0.},
   {GMSH_FULLRC, "NumPointsU", GMSH_StreamLinesPlugin::callbackU, 10},
   {GMSH_FULLRC, "NumPointsV", GMSH_StreamLinesPlugin::callbackV, 1},
-  {GMSH_FULLRC, "DT", NULL, .1},
-  {GMSH_FULLRC, "MaxIter", NULL, 100},
-  {GMSH_FULLRC, "TimeStep", NULL, 0},
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "OtherView", NULL, -1.}};
+  {GMSH_FULLRC, "DT", nullptr, .1},
+  {GMSH_FULLRC, "MaxIter", nullptr, 100},
+  {GMSH_FULLRC, "TimeStep", nullptr, 0},
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "OtherView", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterStreamLinesPlugin()
@@ -221,8 +221,8 @@ PView *GMSH_StreamLinesPlugin::execute(PView *v)
   if(!v1) return v;
   PViewData *data1 = getPossiblyAdaptiveData(v1);
 
-  PView *v2 = (otherView < 0) ? 0 : getView(otherView, v);
-  PViewData *data2 = v2 ? getPossiblyAdaptiveData(v2) : 0;
+  PView *v2 = (otherView < 0) ? nullptr : getView(otherView, v);
+  PViewData *data2 = v2 ? getPossiblyAdaptiveData(v2) : nullptr;
 
   // sanity checks
   if(timeStep > data1->getNumTimeSteps() - 1) {
@@ -231,8 +231,8 @@ PView *GMSH_StreamLinesPlugin::execute(PView *v)
   }
 
   OctreePost o1(v1);
-  double *val2 = 0;
-  OctreePost *o2 = 0;
+  double *val2 = nullptr;
+  OctreePost *o2 = nullptr;
   if(data2) {
     val2 = new double[data2->getNumTimeSteps()];
     o2 = new OctreePost(v2);
diff --git a/Plugin/StreamLines.h b/Plugin/StreamLines.h
index 7f79c7e2eb245274923e7eecdb2e4f1829e234df..639bc973ab1e14ec5d2122a61926afdb4d1d53de 100644
--- a/Plugin/StreamLines.h
+++ b/Plugin/StreamLines.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Summation.cpp b/Plugin/Summation.cpp
index 00780fb504965738fa98cc60cea9111933f05cf7..edc3e6b5a241893f6ba3e6644b970349d8e1f486 100644
--- a/Plugin/Summation.cpp
+++ b/Plugin/Summation.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -11,13 +11,13 @@
 #include <algorithm>
 
 StringXNumber SummationOptions_Number[] = {
-  {GMSH_FULLRC, "View 0", NULL, -1.}, {GMSH_FULLRC, "View 1", NULL, -1.},
-  {GMSH_FULLRC, "View 2", NULL, -1.}, {GMSH_FULLRC, "View 3", NULL, -1.},
-  {GMSH_FULLRC, "View 4", NULL, -1.}, {GMSH_FULLRC, "View 5", NULL, -1.},
-  {GMSH_FULLRC, "View 6", NULL, -1.}, {GMSH_FULLRC, "View 7", NULL, -1.}};
+  {GMSH_FULLRC, "View 0", nullptr, -1.}, {GMSH_FULLRC, "View 1", nullptr, -1.},
+  {GMSH_FULLRC, "View 2", nullptr, -1.}, {GMSH_FULLRC, "View 3", nullptr, -1.},
+  {GMSH_FULLRC, "View 4", nullptr, -1.}, {GMSH_FULLRC, "View 5", nullptr, -1.},
+  {GMSH_FULLRC, "View 6", nullptr, -1.}, {GMSH_FULLRC, "View 7", nullptr, -1.}};
 
 StringXString SummationOptions_String[] = {
-  {GMSH_FULLRC, "Resuling View Name", NULL, "default"}};
+  {GMSH_FULLRC, "Resuling View Name", nullptr, "default"}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterSummationPlugin()
diff --git a/Plugin/Summation.h b/Plugin/Summation.h
index 5f20ee8651a4a50509f5fcf7970e3da8dec95a82..93c6811509e321c2f62c9d86d79ca41040535aad 100644
--- a/Plugin/Summation.h
+++ b/Plugin/Summation.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Tetrahedralize.cpp b/Plugin/Tetrahedralize.cpp
index 496d15f83a474e9aca712e9c5115841836fd6ece..87153ddf687a760cd6d0f5390bc9e54d966c847c 100644
--- a/Plugin/Tetrahedralize.cpp
+++ b/Plugin/Tetrahedralize.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -14,7 +14,7 @@
 #endif
 
 StringXNumber TetrahedralizeOptions_Number[] = {
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterTetrahedralizePlugin()
@@ -110,7 +110,7 @@ PView *GMSH_TetrahedralizePlugin::execute(PView *v)
     }
     if(!ok) continue;
     int numComp = 0;
-    std::vector<double> *vec = 0;
+    std::vector<double> *vec = nullptr;
     if((int)p[0]->val.size() == 9 * numSteps &&
        (int)p[1]->val.size() == 9 * numSteps &&
        (int)p[2]->val.size() == 9 * numSteps &&
diff --git a/Plugin/Tetrahedralize.h b/Plugin/Tetrahedralize.h
index 57b0e4d0e775f4016e3e88d160c1967d418baa2d..f051d3ddc206d39b3e57415560f7c876ceca2b65 100644
--- a/Plugin/Tetrahedralize.h
+++ b/Plugin/Tetrahedralize.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Transform.cpp b/Plugin/Transform.cpp
index 07738c971112393019f535f04f224ee866d80826..a9cc4b58abfc97ba1fc8a39648123e45e08171d0 100644
--- a/Plugin/Transform.cpp
+++ b/Plugin/Transform.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -6,20 +6,20 @@
 #include "Transform.h"
 
 StringXNumber TransformOptions_Number[] = {
-  {GMSH_FULLRC, "A11", NULL, 1.},
-  {GMSH_FULLRC, "A12", NULL, 0.},
-  {GMSH_FULLRC, "A13", NULL, 0.},
-  {GMSH_FULLRC, "A21", NULL, 0.},
-  {GMSH_FULLRC, "A22", NULL, 1.},
-  {GMSH_FULLRC, "A23", NULL, 0.},
-  {GMSH_FULLRC, "A31", NULL, 0.},
-  {GMSH_FULLRC, "A32", NULL, 0.},
-  {GMSH_FULLRC, "A33", NULL, 1.},
-  {GMSH_FULLRC, "Tx", NULL, 0.},
-  {GMSH_FULLRC, "Ty", NULL, 0.}, // cannot use T2 (reserved token in parser)
-  {GMSH_FULLRC, "Tz", NULL, 0.}, // cannot use T3 (reserved token in parser)
-  {GMSH_FULLRC, "SwapOrientation", NULL, 0.},
-  {GMSH_FULLRC, "View", NULL, -1.}};
+  {GMSH_FULLRC, "A11", nullptr, 1.},
+  {GMSH_FULLRC, "A12", nullptr, 0.},
+  {GMSH_FULLRC, "A13", nullptr, 0.},
+  {GMSH_FULLRC, "A21", nullptr, 0.},
+  {GMSH_FULLRC, "A22", nullptr, 1.},
+  {GMSH_FULLRC, "A23", nullptr, 0.},
+  {GMSH_FULLRC, "A31", nullptr, 0.},
+  {GMSH_FULLRC, "A32", nullptr, 0.},
+  {GMSH_FULLRC, "A33", nullptr, 1.},
+  {GMSH_FULLRC, "Tx", nullptr, 0.},
+  {GMSH_FULLRC, "Ty", nullptr, 0.}, // cannot use T2 (reserved token in parser)
+  {GMSH_FULLRC, "Tz", nullptr, 0.}, // cannot use T3 (reserved token in parser)
+  {GMSH_FULLRC, "SwapOrientation", nullptr, 0.},
+  {GMSH_FULLRC, "View", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterTransformPlugin()
diff --git a/Plugin/Transform.h b/Plugin/Transform.h
index 3ef938cce954cd0b0dc269ac1d8e8499051aa091..fb2d505099ca631d4596aa8b984d2690b221024b 100644
--- a/Plugin/Transform.h
+++ b/Plugin/Transform.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Triangulate.cpp b/Plugin/Triangulate.cpp
index 132a0f6a8aa6802ac0f536ebb3cbad37ee68e867..9dd80ba738f2f6d67d481c3277806f67d784e049 100644
--- a/Plugin/Triangulate.cpp
+++ b/Plugin/Triangulate.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -19,8 +19,8 @@
 #endif
 
 StringXNumber TriangulateOptions_Number[] = {
-  {GMSH_FULLRC, "Algorithm", NULL, 1.},
-  {GMSH_FULLRC, "View", NULL, -1.}
+  {GMSH_FULLRC, "Algorithm", nullptr, 1.},
+  {GMSH_FULLRC, "View", nullptr, -1.}
 };
 
 extern "C" {
@@ -142,7 +142,7 @@ PView *GMSH_TriangulatePlugin::execute(PView *v)
                   (double)RAND_MAX;
       doc.points[i].where.h = points[i]->x() + XX;
       doc.points[i].where.v = points[i]->y() + YY;
-      doc.points[i].adjacent = NULL;
+      doc.points[i].adjacent = nullptr;
       doc.points[i].data = (void *)points[i];
     }
 
@@ -170,7 +170,7 @@ PView *GMSH_TriangulatePlugin::execute(PView *v)
       p[1] = (PointData *)doc.points[doc.triangles[i].b].data;
       p[2] = (PointData *)doc.points[doc.triangles[i].c].data;
       int numComp = 0;
-      std::vector<double> *vec = 0;
+      std::vector<double> *vec = nullptr;
       if((int)p[0]->v.size() == 3 + 9 * numSteps &&
          (int)p[1]->v.size() == 3 + 9 * numSteps &&
          (int)p[2]->v.size() == 3 + 9 * numSteps) {
@@ -219,7 +219,7 @@ PView *GMSH_TriangulatePlugin::execute(PView *v)
       p[1] = (PointData *)tris[i]->getVertex(1);
       p[2] = (PointData *)tris[i]->getVertex(2);
       int numComp = 0;
-      std::vector<double> *vec = 0;
+      std::vector<double> *vec = nullptr;
       if((int)p[0]->v.size() == 3 + 9 * numSteps &&
          (int)p[1]->v.size() == 3 + 9 * numSteps &&
          (int)p[2]->v.size() == 3 + 9 * numSteps) {
diff --git a/Plugin/Triangulate.h b/Plugin/Triangulate.h
index 78775a66cbb2e5b9dd22b3f88a7a52e78b3a4fe1..2419edebcbc96e84fa661941c1043015e3fce886 100644
--- a/Plugin/Triangulate.h
+++ b/Plugin/Triangulate.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/VoroMetal.cpp b/Plugin/VoroMetal.cpp
index f7b36701678ff082f6a5562e4d13f99839b4ba0a..17cac108a15e2f240b02ac805eac278886c98ae6 100644
--- a/Plugin/VoroMetal.cpp
+++ b/Plugin/VoroMetal.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -16,11 +16,11 @@
 #include "VoroMetal.h"
 
 StringXNumber VoroMetalOptions_Number[] = {
-  {GMSH_FULLRC, "ComputeBestSeeds", NULL, 0.},
-  {GMSH_FULLRC, "ComputeMicrostructure", NULL, 1.}};
+  {GMSH_FULLRC, "ComputeBestSeeds", nullptr, 0.},
+  {GMSH_FULLRC, "ComputeMicrostructure", nullptr, 1.}};
 
 StringXString VoroMetalOptions_String[] = {
-  {GMSH_FULLRC, "SeedsFile", NULL, "seeds.txt"},
+  {GMSH_FULLRC, "SeedsFile", nullptr, "seeds.txt"},
 };
 
 extern "C" {
@@ -809,8 +809,8 @@ void voroMetal3D::correspondance(double e, double xMax, double yMax,
     gf2 = pairs[i].second;
     std::vector<GVertex *> gv1 = gf1->vertices();
     std::vector<GVertex *> gv2 = gf2->vertices();
-    std::vector<GVertex *>::iterator it1 = gv1.begin();
-    std::vector<GVertex *>::iterator it2 = gv2.begin();
+    auto it1 = gv1.begin();
+    auto it2 = gv2.begin();
     SPoint3 cg1(0, 0, 0);
     SPoint3 cg2(0, 0, 0);
     for(; it1 != gv1.end(); it1++, it2++) {
@@ -1123,7 +1123,7 @@ static void computeBestSeeds(const char *filename)
         m->load("MicrostructurePolycrystal3D.geo");
         double distMinTmp = 1000.0;
         // GModel *m = GModel::current();
-        for(GModel::eiter ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
+        for(auto ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
           GEdge *eTmp = (*ite);
           GVertex *vTmp1 = eTmp->getBeginVertex();
           GVertex *vTmp2 = eTmp->getEndVertex();
@@ -1164,7 +1164,7 @@ static void computeBestSeeds(const char *filename)
         m->load("MicrostructurePolycrystal3D.geo");
         double distMinTmp = 1000.0;
         // GModel *m = GModel::current();
-        for(GModel::eiter ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
+        for(auto ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
           GEdge *eTmp = (*ite);
           GVertex *vTmp1 = eTmp->getBeginVertex();
           GVertex *vTmp2 = eTmp->getEndVertex();
@@ -1205,7 +1205,7 @@ static void computeBestSeeds(const char *filename)
         m->load("MicrostructurePolycrystal3D.geo");
         double distMinTmp = 1000.0;
         // GModel *m = GModel::current();
-        for(GModel::eiter ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
+        for(auto ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
           GEdge *eTmp = (*ite);
           GVertex *vTmp1 = eTmp->getBeginVertex();
           GVertex *vTmp2 = eTmp->getEndVertex();
@@ -1246,7 +1246,7 @@ static void computeBestSeeds(const char *filename)
         m->load("MicrostructurePolycrystal3D.geo");
         double distMinTmp = 1000.0;
         // GModel *m = GModel::current();
-        for(GModel::eiter ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
+        for(auto ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
           GEdge *eTmp = (*ite);
           GVertex *vTmp1 = eTmp->getBeginVertex();
           GVertex *vTmp2 = eTmp->getEndVertex();
@@ -1287,7 +1287,7 @@ static void computeBestSeeds(const char *filename)
         m->load("MicrostructurePolycrystal3D.geo");
         double distMinTmp = 1000.0;
         // GModel *m = GModel::current();
-        for(GModel::eiter ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
+        for(auto ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
           GEdge *eTmp = (*ite);
           GVertex *vTmp1 = eTmp->getBeginVertex();
           GVertex *vTmp2 = eTmp->getEndVertex();
@@ -1328,7 +1328,7 @@ static void computeBestSeeds(const char *filename)
         m->load("MicrostructurePolycrystal3D.geo");
         double distMinTmp = 1000.0;
         // GModel *m = GModel::current();
-        for(GModel::eiter ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
+        for(auto ite = m->firstEdge(); ite != m->lastEdge(); ite++) {
           GEdge *eTmp = (*ite);
           GVertex *vTmp1 = eTmp->getBeginVertex();
           GVertex *vTmp2 = eTmp->getEndVertex();
diff --git a/Plugin/VoroMetal.h b/Plugin/VoroMetal.h
index 41415a650719d4a3292b1015eaecb487b8935593..ecd195f3b0a0d4f6c4c2b9d1bd80087e04637675 100644
--- a/Plugin/VoroMetal.h
+++ b/Plugin/VoroMetal.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Plugin/Warp.cpp b/Plugin/Warp.cpp
index 952ac6d731eb1d91e1f7dda35ffcae474e35a4d5..9194d4826492f710f39fb1be842a2048dc381de0 100644
--- a/Plugin/Warp.cpp
+++ b/Plugin/Warp.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -8,11 +8,11 @@
 #include "Numeric.h"
 
 StringXNumber WarpOptions_Number[] = {
-  {GMSH_FULLRC, "Factor", NULL, 1.},
-  {GMSH_FULLRC, "TimeStep", NULL, 0.},
-  {GMSH_FULLRC, "SmoothingAngle", NULL, 180.},
-  {GMSH_FULLRC, "View", NULL, -1.},
-  {GMSH_FULLRC, "OtherView", NULL, -1.}};
+  {GMSH_FULLRC, "Factor", nullptr, 1.},
+  {GMSH_FULLRC, "TimeStep", nullptr, 0.},
+  {GMSH_FULLRC, "SmoothingAngle", nullptr, 180.},
+  {GMSH_FULLRC, "View", nullptr, -1.},
+  {GMSH_FULLRC, "OtherView", nullptr, -1.}};
 
 extern "C" {
 GMSH_Plugin *GMSH_RegisterWarpPlugin() { return new GMSH_WarpPlugin(); }
@@ -72,7 +72,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
   }
 
   // create smooth normal field if we don't have an explicit warp field
-  smooth_normals *normals = 0;
+  smooth_normals *normals = nullptr;
   if(otherView < 0) {
     normals = new smooth_normals(AngleTol);
     for(int ent = 0; ent < data1->getNumEntities(0); ent++) {
diff --git a/Plugin/Warp.h b/Plugin/Warp.h
index 337d5df6106dbb445a352b10cd8255963f005a47..c6872ab4e80199aac3c3f623493955855cc28762 100644
--- a/Plugin/Warp.h
+++ b/Plugin/Warp.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/CMakeLists.txt b/Post/CMakeLists.txt
index c0a52c4e0a85bc2067a765e191b2289a3048a822..9558233b176bad58d3eac9b3d76421a7f32d24c2 100644
--- a/Post/CMakeLists.txt
+++ b/Post/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/ColorTable.cpp b/Post/ColorTable.cpp
index bc2390371793f9606a60e5109ad8e5e97efd1672..49c9d1cd3cca280704c46b59116dd2444e439892 100644
--- a/Post/ColorTable.cpp
+++ b/Post/ColorTable.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/ColorTable.h b/Post/ColorTable.h
index af3c483987dd7d30a1d83fad8881a12c5edfe5a4..a6a6b68bb844f68ea4c41642ba3ac85c9e2c4926 100644
--- a/Post/ColorTable.h
+++ b/Post/ColorTable.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -46,7 +46,7 @@ void ColorTable_Recompute(GmshColorTable *ct);
 void ColorTable_Copy(GmshColorTable *ct);
 void ColorTable_Paste(GmshColorTable *ct);
 void ColorTable_Print(GmshColorTable *ct, FILE *fp,
-                      std::vector<std::string> *vec = 0);
+                      std::vector<std::string> *vec = nullptr);
 int ColorTable_IsAlpha(GmshColorTable *ct);
 int ColorTable_Diff(GmshColorTable *ct1, GmshColorTable *ct2);
 
diff --git a/Post/OctreePost.cpp b/Post/OctreePost.cpp
index bee25e93ba5d49bea022bf2f175dfb60f26c0d74..c50eb9d061b7c4939f15f9415e4456149b724d8f 100644
--- a/Post/OctreePost.cpp
+++ b/Post/OctreePost.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -258,11 +258,11 @@ OctreePost::OctreePost(PViewData *data) { _create(data); }
 
 void OctreePost::_create(PViewData *data)
 {
-  _sp = _vp = _tp = _sl = _vl = _tl = _st = _vt = _tt = 0;
-  _sq = _vq = _tq = _ss = _vs = _ts = _sh = _vh = _th = 0;
-  _si = _vi = _ti = _sy = _vy = _ty = 0;
-  _theViewDataList = 0;
-  _theViewDataGModel = 0;
+  _sp = _vp = _tp = _sl = _vl = _tl = _st = _vt = _tt = nullptr;
+  _sq = _vq = _tq = _ss = _vs = _ts = _sh = _vh = _th = nullptr;
+  _si = _vi = _ti = _sy = _vy = _ty = nullptr;
+  _theViewDataList = nullptr;
+  _theViewDataGModel = nullptr;
 
   _theViewDataGModel = dynamic_cast<PViewDataGModel *>(data);
 
@@ -422,7 +422,7 @@ static void *getElement(double P[3], Octree *octree, int nbNod, int qn,
   else {
     return Octree_Search(P, octree);
   }
-  return 0;
+  return nullptr;
 }
 
 static MElement *getElement(double P[3], GModel *m, int qn, double *qx,
@@ -452,7 +452,7 @@ static MElement *getElement(double P[3], GModel *m, int qn, double *qx,
     SPoint3 uvw;
     return m->getMeshElementByCoord(pt, uvw, dim);
   }
-  return 0;
+  return nullptr;
 }
 
 bool OctreePost::_getValue(void *in, int dim, int nbNod, int nbComp,
diff --git a/Post/OctreePost.h b/Post/OctreePost.h
index 1adfaeaf32b810b918d5b36b151b4eec2b3dcf31..c175df0d3776fe7df5dca87f6c02b217d6226fc6 100644
--- a/Post/OctreePost.h
+++ b/Post/OctreePost.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -45,31 +45,31 @@ public:
   // -1, only return a value if it was found on an element of the
   // prescribed dimension.
   bool searchScalar(double x, double y, double z, double *values, int step = -1,
-                    double *size = 0, int qn = 0, double *qx = 0,
-                    double *qy = 0, double *qz = 0, bool grad = false,
+                    double *size = nullptr, int qn = 0, double *qx = nullptr,
+                    double *qy = nullptr, double *qz = nullptr, bool grad = false,
                     int dim = -1);
   bool searchScalarWithTol(double x, double y, double z, double *values,
-                           int step = -1, double *size = 0, double tol = 1.e-2,
-                           int qn = 0, double *qx = 0, double *qy = 0,
-                           double *qz = 0, bool grad = false,
+                           int step = -1, double *size = nullptr, double tol = 1.e-2,
+                           int qn = 0, double *qx = nullptr, double *qy = nullptr,
+                           double *qz = nullptr, bool grad = false,
                            int dim = -1);
   bool searchVector(double x, double y, double z, double *values, int step = -1,
-                    double *size = 0, int qn = 0, double *qx = 0,
-                    double *qy = 0, double *qz = 0, bool grad = false,
+                    double *size = nullptr, int qn = 0, double *qx = nullptr,
+                    double *qy = nullptr, double *qz = nullptr, bool grad = false,
                     int dim = -1);
   bool searchVectorWithTol(double x, double y, double z, double *values,
-                           int step = -1, double *size = 0, double tol = 1.e-2,
-                           int qn = 0, double *qx = 0, double *qy = 0,
-                           double *qz = 0, bool grad = false,
+                           int step = -1, double *size = nullptr, double tol = 1.e-2,
+                           int qn = 0, double *qx = nullptr, double *qy = nullptr,
+                           double *qz = nullptr, bool grad = false,
                            int dim = -1);
   bool searchTensor(double x, double y, double z, double *values, int step = -1,
-                    double *size = 0, int qn = 0, double *qx = 0,
-                    double *qy = 0, double *qz = 0, bool grad = false,
+                    double *size = nullptr, int qn = 0, double *qx = nullptr,
+                    double *qy = nullptr, double *qz = nullptr, bool grad = false,
                     int dim = -1);
   bool searchTensorWithTol(double x, double y, double z, double *values,
-                           int step = -1, double *size = 0, double tol = 1.e-2,
-                           int qn = 0, double *qx = 0, double *qy = 0,
-                           double *qz = 0, bool grad = false,
+                           int step = -1, double *size = nullptr, double tol = 1.e-2,
+                           int qn = 0, double *qx = nullptr, double *qy = nullptr,
+                           double *qz = nullptr, bool grad = false,
                            int dim = -1);
 };
 
diff --git a/Post/PView.cpp b/Post/PView.cpp
index 3655386b69038cef27a48df8412f1d2c68919e4c..09afcb1483949cb840c8711935413d947e05b570 100644
--- a/Post/PView.cpp
+++ b/Post/PView.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -30,8 +30,8 @@ void PView::_init(int tag)
   _changed = true;
   _aliasOf = -1;
   _eye = SPoint3(0., 0., 0.);
-  va_points = va_lines = va_triangles = va_vectors = va_ellipses = 0;
-  normals = 0;
+  va_points = va_lines = va_triangles = va_vectors = va_ellipses = nullptr;
+  normals = nullptr;
 
   for(std::size_t i = 0; i < list.size(); i++) {
     if(list[i]->getTag() == _tag) {
@@ -180,7 +180,7 @@ PView::~PView()
   if(normals) delete normals;
   if(_options) delete _options;
 
-  std::vector<PView *>::iterator it = std::find(list.begin(), list.end(), this);
+  auto it = std::find(list.begin(), list.end(), this);
   if(it != list.end()) list.erase(it);
   for(std::size_t i = 0; i < list.size(); i++) list[i]->setIndex(i);
 
@@ -208,15 +208,15 @@ void PView::setGlobalTag(int tag) { _globalTag = tag; }
 void PView::deleteVertexArrays()
 {
   if(va_points) delete va_points;
-  va_points = 0;
+  va_points = nullptr;
   if(va_lines) delete va_lines;
-  va_lines = 0;
+  va_lines = nullptr;
   if(va_triangles) delete va_triangles;
-  va_triangles = 0;
+  va_triangles = nullptr;
   if(va_vectors) delete va_vectors;
-  va_vectors = 0;
+  va_vectors = nullptr;
   if(va_ellipses) delete va_ellipses;
-  va_ellipses = 0;
+  va_ellipses = nullptr;
 }
 
 void PView::setOptions(PViewOptions *val)
@@ -294,7 +294,7 @@ void PView::combine(bool time, int how, bool remove, bool copyOptions)
         PViewDataGModel *d2 = dynamic_cast<PViewDataGModel *>(nds[i].data[j]);
         if(!d2) allModelBased = false;
       }
-      PViewData *data = 0;
+      PViewData *data = nullptr;
       if(allListBased) {
         data = new PViewDataList();
       }
@@ -327,7 +327,7 @@ void PView::combine(bool time, int how, bool remove, bool copyOptions)
     }
   }
   if(remove)
-    for(std::set<PView *>::iterator it = rm.begin(); it != rm.end(); it++)
+    for(auto it = rm.begin(); it != rm.end(); it++)
       delete *it;
 }
 
@@ -357,7 +357,7 @@ PView *PView::getViewByName(const std::string &name, int timeStep,
        (fileName.empty() || !list[i]->getData()->hasFileName(fileName)))
       return list[i];
   }
-  return 0;
+  return nullptr;
 }
 
 PView *PView::getViewByFileName(const std::string &fileName, int timeStep,
@@ -371,7 +371,7 @@ PView *PView::getViewByFileName(const std::string &fileName, int timeStep,
          !list[i]->getData()->hasPartition(timeStep, partition))))
       return list[i];
   }
-  return 0;
+  return nullptr;
 }
 
 PView *PView::getViewByTag(int tag, int timeStep, int partition)
@@ -383,7 +383,7 @@ PView *PView::getViewByTag(int tag, int timeStep, int partition)
          !list[i]->getData()->hasPartition(timeStep, partition))))
       return list[i];
   }
-  return 0;
+  return nullptr;
 }
 
 double PView::getMemoryInMb()
diff --git a/Post/PView.h b/Post/PView.h
index 54aa9e4673b207a3f24a9aca2e83edf16b561404..fc1b683a322373b9454846a510b2bfb5468bc659 100644
--- a/Post/PView.h
+++ b/Post/PView.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -79,7 +79,7 @@ public:
 
   // get/set the display options
   PViewOptions *getOptions() { return _options; }
-  void setOptions(PViewOptions *val = 0);
+  void setOptions(PViewOptions *val = nullptr);
 
   // get/set the view data
   PViewData *getData(bool useAdaptiveIfAvailable = false);
diff --git a/Post/PViewAsSimpleFunction.cpp b/Post/PViewAsSimpleFunction.cpp
index d3087e0c88707a014cb4eeae7217933afee1a9cc..931c1c2e42981dd55930647c6b7abb4e6a5a708e 100644
--- a/Post/PViewAsSimpleFunction.cpp
+++ b/Post/PViewAsSimpleFunction.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/PViewAsSimpleFunction.h b/Post/PViewAsSimpleFunction.h
index b4cf31e6437a26875b6e389f4cd0fcf1c42d59bf..c4b6f0e8327b215ac54a084c134651a67a40e7a4 100644
--- a/Post/PViewAsSimpleFunction.h
+++ b/Post/PViewAsSimpleFunction.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/PViewData.cpp b/Post/PViewData.cpp
index 64f9fa52a487e8dc6ec39ce059d6d0149868b91e..87f282f0d7de5cedce0f2a385489e19677f69818 100644
--- a/Post/PViewData.cpp
+++ b/Post/PViewData.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -12,14 +12,14 @@
 
 std::map<std::string, interpolationMatrices> PViewData::_interpolationSchemes;
 
-PViewData::PViewData() : _dirty(true), _fileIndex(0), _octree(0), _adaptive(0)
+PViewData::PViewData() : _dirty(true), _fileIndex(0), _octree(nullptr), _adaptive(nullptr)
 {
 }
 
 PViewData::~PViewData()
 {
   if(_adaptive) delete _adaptive;
-  for(interpolationMatrices::iterator it = _interpolation.begin();
+  for(auto it = _interpolation.begin();
       it != _interpolation.end(); it++)
     for(std::size_t i = 0; i < it->second.size(); i++) delete it->second[i];
   if(_octree) delete _octree;
@@ -77,7 +77,7 @@ void PViewData::saveAdaptedViewForVTK(const std::string &guifileName,
 void PViewData::destroyAdaptiveData()
 {
   if(_adaptive) delete _adaptive;
-  _adaptive = 0;
+  _adaptive = nullptr;
 }
 
 bool PViewData::empty()
@@ -134,19 +134,19 @@ void PViewData::setValue(int step, int ent, int ele, int nod, int comp,
 GModel *PViewData::getModel(int step)
 {
   Msg::Error("Cannot get model from this view");
-  return 0;
+  return nullptr;
 }
 
 GEntity *PViewData::getEntity(int step, int ent)
 {
   Msg::Error("Cannot get entity from this view");
-  return 0;
+  return nullptr;
 }
 
 MElement *PViewData::getElement(int step, int ent, int ele)
 {
   Msg::Error("Cannot get element from this view");
-  return 0;
+  return nullptr;
 }
 
 void PViewData::setInterpolationMatrices(int type,
@@ -196,10 +196,10 @@ void PViewData::deleteInterpolationMatrices(int type)
 
 void PViewData::removeInterpolationScheme(const std::string &name)
 {
-  std::map<std::string, interpolationMatrices>::iterator it =
+  auto it =
     _interpolationSchemes.find(name);
   if(it != _interpolationSchemes.end()) {
-    for(interpolationMatrices::iterator it2 = it->second.begin();
+    for(auto it2 = it->second.begin();
         it2 != it->second.end(); it2++)
       for(std::size_t i = 0; i < it2->second.size(); i++)
         delete it2->second[i];
@@ -209,10 +209,10 @@ void PViewData::removeInterpolationScheme(const std::string &name)
 
 void PViewData::removeAllInterpolationSchemes()
 {
-  std::map<std::string, interpolationMatrices>::iterator it =
+  auto it =
     _interpolationSchemes.begin();
   for(; it != _interpolationSchemes.end(); it++)
-    for(interpolationMatrices::iterator it2 = it->second.begin();
+    for(auto it2 = it->second.begin();
         it2 != it->second.end(); it2++)
       for(std::size_t i = 0; i < it2->second.size(); i++)
         delete it2->second[i];
diff --git a/Post/PViewData.h b/Post/PViewData.h
index 1485e80a3a5334d56c06e3a92d63227ccbb18ef5..fdbcad3e88a592ed100787bb9409958b6107682d 100644
--- a/Post/PViewData.h
+++ b/Post/PViewData.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -92,11 +92,11 @@ public:
   virtual double getMin(int step = -1, bool onlyVisible = false,
                         int tensorRep = 0,
                         int forceNumComponents = 0,
-                        int componentMap[9] = 0) = 0;
+                        int componentMap[9] = nullptr) = 0;
   virtual double getMax(int step = -1, bool onlyVisible = false,
                         int tensorRep = 0,
                         int forceNumComponents = 0,
-                        int componentMap[9] = 0) = 0;
+                        int componentMap[9] = nullptr) = 0;
   virtual void setMin(double min) = 0;
   virtual void setMax(double max) = 0;
 
@@ -170,7 +170,7 @@ public:
   // eigenvalue (if tensorRep == 2) for tensors
   void getScalarValue(int step, int ent, int ele, int nod, double &val,
                       int tensorRep = 0, int forceNumComponents = 0,
-                      int componentMap[9] = 0);
+                      int componentMap[9] = nullptr);
 
   // return the number of edges of the ele-th element in the ent-th
   // entity
@@ -298,31 +298,31 @@ public:
   // time steps are present, they are all interpolated unless time step is set
   // to a different value than -1.
   bool searchScalar(double x, double y, double z, double *values, int step = -1,
-                    double *size = 0, int qn = 0, double *qx = 0,
-                    double *qy = 0, double *qz = 0, bool grad = false,
+                    double *size = nullptr, int qn = 0, double *qx = nullptr,
+                    double *qy = nullptr, double *qz = nullptr, bool grad = false,
                     int dim = -1);
   bool searchScalarWithTol(double x, double y, double z, double *values,
-                           int step = -1, double *size = 0, double tol = 1.e-2,
-                           int qn = 0, double *qx = 0, double *qy = 0,
-                           double *qz = 0, bool grad = false,
+                           int step = -1, double *size = nullptr, double tol = 1.e-2,
+                           int qn = 0, double *qx = nullptr, double *qy = nullptr,
+                           double *qz = nullptr, bool grad = false,
                            int dim = -1);
   bool searchVector(double x, double y, double z, double *values, int step = -1,
-                    double *size = 0, int qn = 0, double *qx = 0,
-                    double *qy = 0, double *qz = 0, bool grad = false,
+                    double *size = nullptr, int qn = 0, double *qx = nullptr,
+                    double *qy = nullptr, double *qz = nullptr, bool grad = false,
                     int dim = -1);
   bool searchVectorWithTol(double x, double y, double z, double *values,
-                           int step = -1, double *size = 0, double tol = 1.e-2,
-                           int qn = 0, double *qx = 0, double *qy = 0,
-                           double *qz = 0, bool grad = false,
+                           int step = -1, double *size = nullptr, double tol = 1.e-2,
+                           int qn = 0, double *qx = nullptr, double *qy = nullptr,
+                           double *qz = nullptr, bool grad = false,
                            int dim = -1);
   bool searchTensor(double x, double y, double z, double *values, int step = -1,
-                    double *size = 0, int qn = 0, double *qx = 0,
-                    double *qy = 0, double *qz = 0, bool grad = false,
+                    double *size = nullptr, int qn = 0, double *qx = nullptr,
+                    double *qy = nullptr, double *qz = nullptr, bool grad = false,
                     int dim = -1);
   bool searchTensorWithTol(double x, double y, double z, double *values,
-                           int step = -1, double *size = 0, double tol = 1.e-2,
-                           int qn = 0, double *qx = 0, double *qy = 0,
-                           double *qz = 0, bool grad = false,
+                           int step = -1, double *size = nullptr, double tol = 1.e-2,
+                           int qn = 0, double *qx = nullptr, double *qy = nullptr,
+                           double *qz = nullptr, bool grad = false,
                            int dim = -1);
 
   // I/O routines
diff --git a/Post/PViewDataGModel.cpp b/Post/PViewDataGModel.cpp
index 2054cce7d1ca872c9e1fa5daf78052af0a237d44..9f12581f2b23d419137dbc06d920816681292f62 100644
--- a/Post/PViewDataGModel.cpp
+++ b/Post/PViewDataGModel.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -32,57 +32,57 @@ static MElement *_getOneElementOfGivenType(GModel *m, int type)
 {
   switch(type) {
   case TYPE_PNT:
-    for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); it++) {
+    for(auto it = m->firstVertex(); it != m->lastVertex(); it++) {
       if((*it)->points.size()) return (*it)->points[0];
     }
     break;
   case TYPE_LIN:
-    for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++) {
+    for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
       if((*it)->lines.size()) return (*it)->lines[0];
     }
     break;
   case TYPE_TRI:
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+    for(auto it = m->firstFace(); it != m->lastFace(); it++) {
       if((*it)->triangles.size()) return (*it)->triangles[0];
     }
     break;
   case TYPE_QUA:
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+    for(auto it = m->firstFace(); it != m->lastFace(); it++) {
       if((*it)->quadrangles.size()) return (*it)->quadrangles[0];
     }
     break;
   case TYPE_POLYG:
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) {
+    for(auto it = m->firstFace(); it != m->lastFace(); it++) {
       if((*it)->polygons.size()) return (*it)->polygons[0];
     }
     break;
   case TYPE_TET:
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       if((*it)->tetrahedra.size()) return (*it)->tetrahedra[0];
     }
     break;
   case TYPE_HEX:
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       if((*it)->hexahedra.size()) return (*it)->hexahedra[0];
     }
     break;
   case TYPE_PRI:
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       if((*it)->prisms.size()) return (*it)->prisms[0];
     }
     break;
   case TYPE_PYR:
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       if((*it)->pyramids.size()) return (*it)->pyramids[0];
     }
     break;
   case TYPE_POLYH:
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); it++) {
       if((*it)->polyhedra.size()) return (*it)->polyhedra[0];
     }
     break;
   }
-  return 0;
+  return nullptr;
 }
 
 bool PViewDataGModel::finalize(bool computeMinMax,
@@ -142,7 +142,7 @@ bool PViewDataGModel::finalize(bool computeMinMax,
       else
         Msg::Error("Could not find interpolation scheme '%s'",
                    interpolationScheme.c_str());
-      for(interpolationMatrices::iterator it = m.begin(); it != m.end(); it++) {
+      for(auto it = m.begin(); it != m.end(); it++) {
         if(it->second.size() == 2) {
           // use provided interpolation matrices for field interpolation and use
           // geometrical interpolation matrices from the mesh if the mesh is
@@ -255,7 +255,7 @@ bool PViewDataGModel::finalize(bool computeMinMax,
 MElement *PViewDataGModel::_getElement(int step, int ent, int ele)
 {
   static int lastStep = -1, lastEnt = -1, lastEle = -1;
-  static MElement *curr = 0;
+  static MElement *curr = nullptr;
   if(step != lastStep || ent != lastEnt || ele != lastEle)
     curr = _steps[step]->getEntity(ent)->getMeshElement(ele);
   return curr;
@@ -376,7 +376,7 @@ int PViewDataGModel::getNumPoints(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it)
+  for(auto it = m->firstVertex(); it != m->lastVertex(); ++it)
     n += (*it)->points.size();
   return n;
 }
@@ -386,7 +386,7 @@ int PViewDataGModel::getNumLines(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it)
+  for(auto it = m->firstEdge(); it != m->lastEdge(); ++it)
     n += (*it)->lines.size();
   return n;
 }
@@ -396,7 +396,7 @@ int PViewDataGModel::getNumTriangles(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it)
     n += (*it)->triangles.size();
   return n;
 }
@@ -406,7 +406,7 @@ int PViewDataGModel::getNumQuadrangles(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it)
     n += (*it)->quadrangles.size();
   return n;
 }
@@ -416,7 +416,7 @@ int PViewDataGModel::getNumPolygons(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it)
     n += (*it)->polygons.size();
   return n;
 }
@@ -426,7 +426,7 @@ int PViewDataGModel::getNumTetrahedra(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     n += (*it)->tetrahedra.size();
   return n;
 }
@@ -436,7 +436,7 @@ int PViewDataGModel::getNumHexahedra(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     n += (*it)->hexahedra.size();
   return n;
 }
@@ -446,7 +446,7 @@ int PViewDataGModel::getNumPrisms(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     n += (*it)->prisms.size();
   return n;
 }
@@ -456,7 +456,7 @@ int PViewDataGModel::getNumPyramids(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     n += (*it)->pyramids.size();
   return n;
 }
@@ -466,7 +466,7 @@ int PViewDataGModel::getNumTrihedra(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     n += (*it)->trihedra.size();
   return n;
 }
@@ -476,7 +476,7 @@ int PViewDataGModel::getNumPolyhedra(int step)
   if(_steps.empty()) return 0;
   GModel *m = _steps[0]->getModel(); // to generalize
   int n = 0;
-  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
+  for(auto it = m->firstRegion(); it != m->lastRegion(); ++it)
     n += (*it)->polyhedra.size();
   return n;
 }
@@ -506,7 +506,7 @@ GEntity *PViewDataGModel::getEntity(int step, int ent)
 
 MElement *PViewDataGModel::getElement(int step, int ent, int element)
 {
-  if(_steps.empty()) return 0;
+  if(_steps.empty()) return nullptr;
   // to generalize
   if(step < 0) return _steps[0]->getEntity(ent)->getMeshElement(element);
   return _steps[step]->getEntity(ent)->getMeshElement(element);
@@ -775,7 +775,7 @@ bool PViewDataGModel::combineTime(nameData &nd)
   }
 
   // copy interpolation matrices
-  for(std::map<int, std::vector<fullMatrix<double> *> >::iterator it =
+  for(auto it =
         data[0]->_interpolation.begin();
       it != data[0]->_interpolation.end(); it++)
     if(_interpolation[it->first].empty())
diff --git a/Post/PViewDataGModel.h b/Post/PViewDataGModel.h
index 44707f2c1867afe6f5fbb6fb6eb710ab29526dc8..8cd26572cf1ff27c3e954055bcdb8a8be3e60aae 100644
--- a/Post/PViewDataGModel.h
+++ b/Post/PViewDataGModel.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -191,9 +191,9 @@ public:
   int getFirstNonEmptyTimeStep(int start = 0);
   double getTime(int step);
   double getMin(int step = -1, bool onlyVisible = false, int tensorRep = 0,
-                int forceNumComponents = 0, int componentMap[9] = 0);
+                int forceNumComponents = 0, int componentMap[9] = nullptr);
   double getMax(int step = -1, bool onlyVisible = false, int tensorRep = 0,
-                int forceNumComponents = 0, int componentMap[9] = 0);
+                int forceNumComponents = 0, int componentMap[9] = nullptr);
   void setMin(double min) { _min = min; }
   void setMax(double max) { _max = max; }
   SBoundingBox3d getBoundingBox(int step = -1);
@@ -292,7 +292,7 @@ public:
   stepData<double> *getStepData(int step)
   {
     if(step >= 0 && step < (int)_steps.size()) return _steps[step];
-    return 0;
+    return nullptr;
   }
   void sendToServer(const std::string &name);
 };
diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp
index da10e26fdf24756a32e1ec693c263123af4a08d8..ea9f5836acb03cccb4ac8eeca812a0d3b409e6a5 100644
--- a/Post/PViewDataGModelIO.cpp
+++ b/Post/PViewDataGModelIO.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -25,7 +25,7 @@ bool PViewDataGModel::addData(GModel *model,
 
   if(numComp < 0) {
     numComp = 9;
-    for(std::map<int, std::vector<double> >::const_iterator it = data.begin();
+    for(auto it = data.begin();
         it != data.end(); it++)
       numComp = std::min(numComp, (int)it->second.size());
   }
@@ -40,7 +40,7 @@ bool PViewDataGModel::addData(GModel *model,
                                      model->getNumMeshElements();
   _steps[step]->resizeData(numEnt);
 
-  for(std::map<int, std::vector<double> >::const_iterator it = data.begin();
+  for(auto it = data.begin();
       it != data.end(); it++) {
     int mult = it->second.size() / numComp;
     double *d = _steps[step]->getData(it->first, true, mult);
@@ -232,7 +232,7 @@ bool PViewDataGModel::writeMSH(const std::string &fileName, double version,
       "Cannot force ElementData for this dataset: saving native data");
   }
 
-  FILE *fp = 0;
+  FILE *fp = nullptr;
   GModel *model0 = _steps[0]->getModel();
   int numFile = 0;
 
@@ -293,7 +293,7 @@ bool PViewDataGModel::writeMSH(const std::string &fileName, double version,
         fprintf(fp, "$InterpolationScheme\n");
         fprintf(fp, "\"INTERPOLATION_SCHEME\"\n");
         fprintf(fp, "%d\n", (int)_interpolation.size());
-        for(interpolationMatrices::iterator it = _interpolation.begin();
+        for(auto it = _interpolation.begin();
             it != _interpolation.end(); it++) {
           if(it->second.size() >= 2) {
             fprintf(fp, "%d\n2\n", it->first);
diff --git a/Post/PViewDataGModelIO_CGNS.cpp b/Post/PViewDataGModelIO_CGNS.cpp
index db8a2a9d765cb778f880e345bc62d835dc69f481..39c6ab38533aa70a343b52286691355a1702f46d 100644
--- a/Post/PViewDataGModelIO_CGNS.cpp
+++ b/Post/PViewDataGModelIO_CGNS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -215,8 +215,8 @@ namespace {
         monoMat = &(fs->monomials);
       }
       else {
-        coeffMat = 0;
-        monoMat = 0;
+        coeffMat = nullptr;
+        monoMat = nullptr;
       }
     }
   }
@@ -247,8 +247,8 @@ namespace {
       const int nbEltNode = ElementType::getNumVertices(mshType);
 
       // element node transformation if specified (CPEX0045)
-      const fullMatrix<double> *transfoMat = 0;
-      if((mshType != MSH_PNT) && (zoneSolTransfo != 0) &&
+      const fullMatrix<double> *transfoMat = nullptr;
+      if((mshType != MSH_PNT) && (zoneSolTransfo != nullptr) &&
          (zoneSolTransfo->size() > 0)) {
         transfoMat = &((*zoneSolTransfo)[mshType]);
       }
@@ -258,7 +258,7 @@ namespace {
       double *stepData = step->getData(eltNum, true, nbEltNode);
 
       // compute values at element nodes in step data
-      if(transfoMat == 0) {
+      if(transfoMat == nullptr) {
         // no basis specified: just reorder values from CGNS to Gmsh ordering
         const std::vector<int> &cgns2Msh = cgns2MshNodeIndex(mshType);
         for(int i = 0; i < nbEltNode; i++) stepData[cgns2Msh[i]] = eltData[i];
@@ -569,7 +569,7 @@ bool PViewDataGModel::readCGNS(
   // loop over zones
   for(int iZone = 1; iZone <= nbZone; iZone++) {
     // read family name and retrieve solution node transformations (CPEX0045)
-    const ZoneSolutionTransfo *zoneSolTransfo = 0;
+    const ZoneSolutionTransfo *zoneSolTransfo = nullptr;
     cgnsErr = cg_goto(fileIndex, baseIndex, "Zone_t", iZone, "end");
     if(cgnsErr != CG_OK) err = cgnsError(__FILE__, __LINE__, fileIndex);
     char famName[CGNS_MAX_STR_LEN];
diff --git a/Post/PViewDataIO.cpp b/Post/PViewDataIO.cpp
index 3afd89ac3005b54e128142c7f58f66f8eec07c56..ab02e203a91f42fda1bf56b2e35e4f25651019c1 100644
--- a/Post/PViewDataIO.cpp
+++ b/Post/PViewDataIO.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -135,7 +135,7 @@ bool PViewData::writePOS(const std::string &fileName, bool binary, bool parsed,
       if(skipElement(firstNonEmptyStep, ent, ele)) continue;
       int type = getType(firstNonEmptyStep, ent, ele);
       int numComp = getNumComponents(firstNonEmptyStep, ent, ele);
-      const char *s = 0;
+      const char *s = nullptr;
       switch(type) {
       case TYPE_PNT:
         s = (numComp == 9) ? "TP" : (numComp == 3) ? "VP" : "SP";
diff --git a/Post/PViewDataList.cpp b/Post/PViewDataList.cpp
index 156ede1f994f0039210ab794e876d7948d71db9c..8dc1461ef904c7cf7537d080a41ee33b9a25a1a5 100644
--- a/Post/PViewDataList.cpp
+++ b/Post/PViewDataList.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,7 +22,7 @@ PViewDataList::PViewDataList(bool isAdapted)
     NbTY(0), NbSR(0), NbVR(0), NbTR(0), NbSD(0), NbVD(0), NbTD(0), NbT2(0),
     NbT3(0), _lastElement(-1), _lastDimension(-1), _lastNumNodes(-1),
     _lastNumComponents(-1), _lastNumValues(-1), _lastNumEdges(-1),
-    _lastType(-1), _lastXYZ(0), _lastVal(0), _isAdapted(isAdapted)
+    _lastType(-1), _lastXYZ(nullptr), _lastVal(nullptr), _isAdapted(isAdapted)
 {
   for(int i = 0; i < 33; i++) _index[i] = 0;
   polyTotNumNodes[0] = 0.;
@@ -532,7 +532,7 @@ void PViewDataList::_getString(int dim, int i, int step, std::string &str,
 
   int index, nbchar;
   double *d1 = &td[i * nbd];
-  double *d2 = ((i + 1) * nbd < (int)td.size()) ? &td[(i + 1) * nbd] : 0;
+  double *d2 = ((i + 1) * nbd < (int)td.size()) ? &td[(i + 1) * nbd] : nullptr;
 
   if(dim == 2) {
     x = d1[0];
@@ -659,8 +659,8 @@ void PViewDataList::smooth()
   xyzv::eps = CTX::instance()->lc * 1.e-8;
   smooth_data data;
 
-  std::vector<double> *list = 0;
-  int *nbe = 0, nbc, nbn;
+  std::vector<double> *list = nullptr;
+  int *nbe = nullptr, nbc, nbn;
   for(int i = 0; i < 27; i++) {
     _getRawData(i, &list, &nbe, &nbc, &nbn);
     if(nbn > 1) generateConnectivities(*list, *nbe, NbTimeStep, nbn, nbc, data);
@@ -717,7 +717,7 @@ bool PViewDataList::combineSpace(nameData &nd)
     }
 
     // copy interpolation matrices
-    for(std::map<int, std::vector<fullMatrix<double> *> >::iterator it =
+    for(auto it =
           l->_interpolation.begin();
         it != l->_interpolation.end(); it++)
       if(_interpolation[it->first].empty())
@@ -845,8 +845,8 @@ bool PViewDataList::combineTime(nameData &nd)
     }
   }
 
-  int *nbe = 0, *nbe2 = 0, nbn, nbn2, nbc, nbc2;
-  std::vector<double> *list = 0, *list2 = 0;
+  int *nbe = nullptr, *nbe2 = nullptr, nbn, nbn2, nbc, nbc2;
+  std::vector<double> *list = nullptr, *list2 = nullptr;
 
   // use the first data set as the reference
   for(int i = 0; i < 27; i++) {
@@ -856,7 +856,7 @@ bool PViewDataList::combineTime(nameData &nd)
   }
   NbT2 = data[0]->NbT2;
   NbT3 = data[0]->NbT3;
-  for(std::map<int, std::vector<fullMatrix<double> *> >::iterator it =
+  for(auto it =
         data[0]->_interpolation.begin();
       it != data[0]->_interpolation.end(); it++)
     if(_interpolation[it->first].empty())
@@ -1412,5 +1412,5 @@ std::vector<double> *PViewDataList::incrementList(int numComp, int type,
     }
     break;
   }
-  return 0;
+  return nullptr;
 }
diff --git a/Post/PViewDataList.h b/Post/PViewDataList.h
index f49ac027d0a65aafd6c6d44efee1a766ac73d300..d62185e48a94b9678c5e980878d7a1134771f94e 100644
--- a/Post/PViewDataList.h
+++ b/Post/PViewDataList.h
@@ -1,5 +1,5 @@
 
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -79,9 +79,9 @@ public:
   int getNumTimeSteps() { return NbTimeStep; }
   double getTime(int step);
   double getMin(int step = -1, bool onlyVisible = false, int tensorRep = 0,
-                int forceNumComponents = 0, int componentMap[9] = 0);
+                int forceNumComponents = 0, int componentMap[9] = nullptr);
   double getMax(int step = -1, bool onlyVisible = false, int tensorRep = 0,
-                int forceNumComponents = 0, int componentMap[9] = 0);
+                int forceNumComponents = 0, int componentMap[9] = nullptr);
   void setMin(double min) { Min = min; }
   void setMax(double max) { Max = max; }
   SBoundingBox3d getBoundingBox(int step = -1) { return BBox; }
diff --git a/Post/PViewDataListIO.cpp b/Post/PViewDataListIO.cpp
index 4d7d634abec8e4516a8fcfa442364e40353097ae..b3ea42d0b2156296414906af988ac32478f9b647 100644
--- a/Post/PViewDataListIO.cpp
+++ b/Post/PViewDataListIO.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -543,7 +543,7 @@ public:
   int nbnod;
   int nod;
   double *data;
-  nodeData() : nbnod(0), nod(0), data(0) {}
+  nodeData() : nbnod(0), nod(0), data(nullptr) {}
   nodeData(int _nbnod, int _nod, double *_data)
     : nbnod(_nbnod), nod(_nod), data(_data)
   {
@@ -654,8 +654,8 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version,
 
   int numComponents = 9;
   for(int i = 0; i < 24; i++) {
-    std::vector<double> *list = 0;
-    int *numEle = 0, numNodes, numComp;
+    std::vector<double> *list = nullptr;
+    int *numEle = nullptr, numNodes, numComp;
     _getRawData(i, &list, &numEle, &numComp, &numNodes);
     if(*numEle) numComponents = std::min(numComponents, numComp);
     createVertices(*list, *numEle, numNodes, vertices);
@@ -670,11 +670,11 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version,
   std::map<MVertex *, nodeData> vertexData;
 
   for(int i = 0; i < 24; i++) {
-    std::vector<double> *list = 0;
-    int *numEle = 0, numComp, numNodes;
+    std::vector<double> *list = nullptr;
+    int *numEle = nullptr, numComp, numNodes;
     int typ = _getRawData(i, &list, &numEle, &numComp, &numNodes);
     createElements(*list, *numEle, numNodes, pos, elements, typ,
-                   forceNodeData ? &vertexData : 0);
+                   forceNodeData ? &vertexData : nullptr);
   }
 
   int num = 0;
@@ -709,7 +709,7 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version,
     fprintf(fp, "$InterpolationScheme\n");
     fprintf(fp, "\"INTERPOLATION_SCHEME\"\n");
     fprintf(fp, "%d\n", (int)_interpolation.size());
-    for(interpolationMatrices::iterator it = _interpolation.begin();
+    for(auto it = _interpolation.begin();
         it != _interpolation.end(); it++) {
       if(it->second.size() >= 2) {
         fprintf(fp, "%d\n2\n", it->first);
@@ -763,8 +763,8 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version,
     else {
       int n = 0;
       for(int i = 0; i < 24; i++) {
-        std::vector<double> *list = 0;
-        int *numEle = 0, numComp, numNodes;
+        std::vector<double> *list = nullptr;
+        int *numEle = nullptr, numComp, numNodes;
         int typ = _getRawData(i, &list, &numEle, &numComp, &numNodes);
         if(*numEle) {
           int mult = numNodes;
@@ -800,8 +800,8 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version,
 void PViewDataList::importLists(int N[24], std::vector<double> *V[24])
 {
   for(int i = 0; i < 24; i++) {
-    std::vector<double> *list = 0;
-    int *nbe = 0, nbc, nbn;
+    std::vector<double> *list = nullptr;
+    int *nbe = nullptr, nbc, nbn;
     _getRawData(i, &list, &nbe, &nbc, &nbn);
     *nbe = N[i];
     *list = *V[i]; // deep copy
@@ -816,8 +816,8 @@ void PViewDataList::importList(int index, int n, const std::vector<double> &v,
     Msg::Error("Wrong list index to import");
     return;
   }
-  std::vector<double> *list = 0;
-  int *nbe = 0, nbc, nbn;
+  std::vector<double> *list = nullptr;
+  int *nbe = nullptr, nbc, nbn;
   _getRawData(index, &list, &nbe, &nbc, &nbn);
   *nbe = n;
   *list = v; // deep copy
@@ -827,8 +827,8 @@ void PViewDataList::importList(int index, int n, const std::vector<double> &v,
 void PViewDataList::getListPointers(int N[24], std::vector<double> *V[24])
 {
   for(int i = 0; i < 24; i++) {
-    std::vector<double> *list = 0;
-    int *nbe = 0, nbc, nbn;
+    std::vector<double> *list = nullptr;
+    int *nbe = nullptr, nbc, nbn;
     _getRawData(i, &list, &nbe, &nbc, &nbn);
     N[i] = *nbe;
     V[i] = list; // copy pointer only
diff --git a/Post/PViewDataRemote.h b/Post/PViewDataRemote.h
index caec750c24b04f5bef0d3bb674b0e90c1582d734..8ad0f5a6fa579553ee12c9faa8b42e57c3813a08 100644
--- a/Post/PViewDataRemote.h
+++ b/Post/PViewDataRemote.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -37,12 +37,12 @@ public:
   }
   int getNumTimeSteps() { return _numTimeSteps; }
   double getMin(int step = -1, bool onlyVisible = false, int tensorRep = 0,
-                int forceNumComponents = 0, int componentMap[9] = 0)
+                int forceNumComponents = 0, int componentMap[9] = nullptr)
   {
     return _min;
   }
   double getMax(int step = -1, bool onlyVisible = false, int tensorRep = 0,
-                int forceNumComponents = 0, int componentMap[9] = 0)
+                int forceNumComponents = 0, int componentMap[9] = nullptr)
   {
     return _max;
   }
diff --git a/Post/PViewFactory.cpp b/Post/PViewFactory.cpp
index 6e5e134c980fcce636809aa5ce4ff1c757ea85b1..fc228c3537004bc4209e515a9b07157247497180 100644
--- a/Post/PViewFactory.cpp
+++ b/Post/PViewFactory.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/PViewFactory.h b/Post/PViewFactory.h
index 2b0d1da8d552c3d4a0ca6eeb3942b1221141b690..dbb605beb499768de8713517c68a463b92fb3f67 100644
--- a/Post/PViewFactory.h
+++ b/Post/PViewFactory.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/PViewIO.cpp b/Post/PViewIO.cpp
index 7d5349d2290c18f914711c337d10bfd63dad0042..b1dddb1ee24e17af370228c76190916c309c52b3 100644
--- a/Post/PViewIO.cpp
+++ b/Post/PViewIO.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -281,7 +281,7 @@ bool PView::readMSH(const std::string &fileName, int fileIndex, int partitionToR
           if(numEnt > 0) {
             // either get existing viewData, or create new one
             PView *p = getViewByName(viewName, timeStep, partition);
-            PViewDataGModel *d = 0;
+            PViewDataGModel *d = nullptr;
             if(p) d = dynamic_cast<PViewDataGModel *>(p->getData());
             bool create = d ? false : true;
             if(create) d = new PViewDataGModel(type);
@@ -328,7 +328,7 @@ bool PView::readMED(const std::string &fileName, int fileIndex)
 
   for(std::size_t index = 0; index < fieldNames.size(); index++) {
     if(fileIndex < 0 || (int)index == fileIndex) {
-      PViewDataGModel *d = 0;
+      PViewDataGModel *d = nullptr;
       // we use the filename as a kind of "partition" indicator, allowing to
       // complete datasets provided in separate files (e.g. coming from DDM)
       PView *p = getViewByName(fieldNames[index], -1, -1, fileName);
diff --git a/Post/PViewIO_CGNS.cpp b/Post/PViewIO_CGNS.cpp
index 64c3dc9b8ddd0caae93c0823b5dde9223694834b..8dc176bb5920008b03f79e0e6afb700036418dd0 100644
--- a/Post/PViewIO_CGNS.cpp
+++ b/Post/PViewIO_CGNS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -91,10 +91,8 @@ namespace {
                 const std::string &fileName, int fileIndex, int baseIndex,
                 const std::map<SolFieldName, PViewDataGModel::DataType> &fields)
   {
-    typedef std::map<SolFieldName, PViewDataGModel::DataType>::const_iterator
-      FieldIter;
     int index = -1;
-    for(FieldIter it = fields.begin(); it != fields.end(); ++it) {
+    for(auto it = fields.begin(); it != fields.end(); ++it) {
       // field name and type
       const SolFieldName &solFieldName = it->first;
       const PViewDataGModel::DataType &fieldType = it->second;
@@ -107,7 +105,7 @@ namespace {
         fullFieldName, -1, -1); // DBGTT: to be checked for multi-file
       PViewDataGModel *d;
       bool create;
-      if(p != 0) {
+      if(p != nullptr) {
         d = dynamic_cast<PViewDataGModel *>(p->getData());
         create = false;
       }
diff --git a/Post/PViewOptions.cpp b/Post/PViewOptions.cpp
index 3f40be995edfe2b424d6d1f211bac60ec62cecad..4545c30a78395badbb2d8b1129fc1196786454e7 100644
--- a/Post/PViewOptions.cpp
+++ b/Post/PViewOptions.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -10,7 +10,7 @@
 #include "PViewOptions.h"
 #include "mathEvaluator.h"
 
-PViewOptions::PViewOptions() : genRaiseEvaluator(0)
+PViewOptions::PViewOptions() : genRaiseEvaluator(nullptr)
 {
   ColorTable_InitParam(2, &colorTable);
   ColorTable_Recompute(&colorTable);
@@ -22,7 +22,7 @@ PViewOptions::~PViewOptions()
   if(genRaiseEvaluator) delete genRaiseEvaluator;
 }
 
-PViewOptions *PViewOptions::_reference = 0;
+PViewOptions *PViewOptions::_reference = nullptr;
 
 PViewOptions *PViewOptions::reference()
 {
@@ -132,7 +132,7 @@ void PViewOptions::createGeneralRaise()
   genRaiseEvaluator = new mathEvaluator(expressions, variables);
   if(expressions.empty()) {
     delete genRaiseEvaluator;
-    genRaiseEvaluator = 0;
+    genRaiseEvaluator = nullptr;
   }
 }
 
diff --git a/Post/PViewOptions.h b/Post/PViewOptions.h
index e1fe61689ea1fd2ee54dd571c2cf5eaf6d53f595..f7a8cc82b51fbd78243d9f1830a32d38ee1b289b 100644
--- a/Post/PViewOptions.h
+++ b/Post/PViewOptions.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/PViewVertexArrays.cpp b/Post/PViewVertexArrays.cpp
index 113765c736d2ab3fe9456cd482939342a4ad0fb7..96611b6b8e1e90ff451728548f96f65f4c4e7d03 100644
--- a/Post/PViewVertexArrays.cpp
+++ b/Post/PViewVertexArrays.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -318,7 +318,7 @@ static void addOutlinePoint(PView *p, double **xyz, unsigned int color,
 {
   if(pre) return;
   SVector3 n = getPointNormal(p, 1.);
-  p->va_points->add(&xyz[i0][0], &xyz[i0][1], &xyz[i0][2], &n, &color, 0, true);
+  p->va_points->add(&xyz[i0][0], &xyz[i0][1], &xyz[i0][2], &n, &color, nullptr, true);
 }
 
 static void addScalarPoint(PView *p, double **xyz, double **val, bool pre,
@@ -336,7 +336,7 @@ static void addScalarPoint(PView *p, double **xyz, double **val, bool pre,
       val[i0][0], vmin, vmax, false,
       (opt->intervalsType == PViewOptions::Discrete) ? opt->nbIso : -1);
     SVector3 n = getPointNormal(p, val[i0][0]);
-    p->va_points->add(&xyz[i0][0], &xyz[i0][1], &xyz[i0][2], &n, &col, 0,
+    p->va_points->add(&xyz[i0][0], &xyz[i0][1], &xyz[i0][2], &n, &col, nullptr,
                       unique);
   }
 }
@@ -356,8 +356,8 @@ static void addOutlineLine(PView *p, double **xyz, unsigned int color, bool pre,
     col[i] = color;
   }
   SVector3 n[2];
-  getLineNormal(p, x, y, z, 0, n, true);
-  p->va_lines->add(x, y, z, n, col, 0, true);
+  getLineNormal(p, x, y, z, nullptr, n, true);
+  p->va_lines->add(x, y, z, n, col, nullptr, true);
 }
 
 static void addScalarLine(PView *p, double **xyz, double **val, bool pre,
@@ -390,7 +390,7 @@ static void addScalarLine(PView *p, double **xyz, double **val, bool pre,
        val[i1][0] <= vmax) {
       unsigned int col[2];
       for(int i = 0; i < 2; i++) col[i] = opt->getColor(v[i], vmin, vmax);
-      p->va_lines->add(x, y, z, n, col, 0, unique);
+      p->va_lines->add(x, y, z, n, col, nullptr, unique);
     }
     else {
       double x2[2], y2[2], z2[2], v2[2];
@@ -398,7 +398,7 @@ static void addScalarLine(PView *p, double **xyz, double **val, bool pre,
       if(nb == 2) {
         unsigned int col[2];
         for(int i = 0; i < 2; i++) col[i] = opt->getColor(v2[i], vmin, vmax);
-        p->va_lines->add(x2, y2, z2, n, col, 0, unique);
+        p->va_lines->add(x2, y2, z2, n, col, nullptr, unique);
       }
     }
   }
@@ -415,7 +415,7 @@ static void addScalarLine(PView *p, double **xyz, double **val, bool pre,
         unsigned int col[2] = {color, color};
         SVector3 n[2];
         getLineNormal(p, x2, y2, z2, v2, n, true);
-        p->va_lines->add(x2, y2, z2, n, col, 0, unique);
+        p->va_lines->add(x2, y2, z2, n, col, nullptr, unique);
       }
       if(vmin == vmax) break;
     }
@@ -430,7 +430,7 @@ static void addScalarLine(PView *p, double **xyz, double **val, bool pre,
       if(nb == 1) {
         unsigned int color = opt->getColor(k, opt->nbIso);
         SVector3 n = getPointNormal(p, iso);
-        p->va_points->add(x2, y2, z2, &n, &color, 0, unique);
+        p->va_points->add(x2, y2, z2, &n, &color, nullptr, unique);
       }
       if(vmin == vmax) break;
     }
@@ -460,8 +460,8 @@ static void addOutlineTriangle(PView *p, double **xyz, unsigned int color,
           p->normals->get(x[j], y[j], z[j], n[j][0], n[j][1], n[j][2]);
       }
     }
-    getLineNormal(p, x, y, z, 0, n, false);
-    if(!pre) p->va_lines->add(x, y, z, n, col, 0, true);
+    getLineNormal(p, x, y, z, nullptr, n, false);
+    if(!pre) p->va_lines->add(x, y, z, n, col, nullptr, true);
   }
 }
 
@@ -505,7 +505,7 @@ static void addScalarTriangle(PView *p, double **xyz, double **val, bool pre,
         }
         col[i] = opt->getColor(v[i], vmin, vmax);
       }
-      if(!pre) p->va_triangles->add(x, y, z, n, col, 0, unique, skin);
+      if(!pre) p->va_triangles->add(x, y, z, n, col, nullptr, unique, skin);
     }
     else {
       double x2[10], y2[10], z2[10], v2[10];
@@ -527,7 +527,7 @@ static void addScalarTriangle(PView *p, double **xyz, double **val, bool pre,
             }
             col[i] = opt->getColor(v3[i], vmin, vmax);
           }
-          if(!pre) p->va_triangles->add(x3, y3, z3, n, col, 0, unique, skin);
+          if(!pre) p->va_triangles->add(x3, y3, z3, n, col, nullptr, unique, skin);
         }
       }
     }
@@ -556,7 +556,7 @@ static void addScalarTriangle(PView *p, double **xyz, double **val, bool pre,
                 p->normals->get(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]);
             }
           }
-          if(!pre) p->va_triangles->add(x3, y3, z3, n, col, 0, unique, skin);
+          if(!pre) p->va_triangles->add(x3, y3, z3, n, col, nullptr, unique, skin);
         }
       }
       if(vmin == vmax) break;
@@ -583,7 +583,7 @@ static void addScalarTriangle(PView *p, double **xyz, double **val, bool pre,
         }
         double v[2] = {iso, iso};
         getLineNormal(p, x, y, z, v, n, false);
-        if(!pre) p->va_lines->add(x2, y2, z2, n, col, 0, unique);
+        if(!pre) p->va_lines->add(x2, y2, z2, n, col, nullptr, unique);
       }
       if(vmin == vmax) break;
     }
@@ -614,8 +614,8 @@ static void addOutlineQuadrangle(PView *p, double **xyz, unsigned int color,
           p->normals->get(x[j], y[j], z[j], n[j][0], n[j][1], n[j][2]);
       }
     }
-    getLineNormal(p, x, y, z, 0, n, false);
-    if(!pre) p->va_lines->add(x, y, z, n, col, 0, true);
+    getLineNormal(p, x, y, z, nullptr, n, false);
+    if(!pre) p->va_lines->add(x, y, z, n, col, nullptr, true);
   }
 }
 
@@ -673,7 +673,7 @@ static void addScalarPolygon(PView *p, double **xyz, double **val, bool pre,
     }
 
     opt->boundary--;
-    for(std::map<MEdge, int, MEdgeLessThan>::iterator ite = edges.begin();
+    for(auto ite = edges.begin();
         ite != edges.end(); ite++) {
       int i = (int)(*ite).second / 100;
       int j = (*ite).second % 100;
@@ -750,7 +750,7 @@ static void addScalarTetrahedron(PView *p, double **xyz, double **val, bool pre,
                 p->normals->get(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]);
             }
           }
-          if(!pre) p->va_triangles->add(x3, y3, z3, n, col, 0, false, false);
+          if(!pre) p->va_triangles->add(x3, y3, z3, n, col, nullptr, false, false);
         }
       }
       if(vmin == vmax) break;
@@ -895,7 +895,7 @@ static void addOutlinePolyhedron(PView *p, double **xyz, unsigned int color,
         triFaces.erase(ite);
     }
   }
-  for(std::map<MFace, int, MFaceLessThan>::iterator ite = triFaces.begin();
+  for(auto ite = triFaces.begin();
       ite != triFaces.end(); ite++) {
     int i = (int)(*ite).second / 100;
     int j = (*ite).second % 100;
@@ -1020,7 +1020,7 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes,
         }
         SVector3 n[2];
         getLineNormal(p, dxyz[0], dxyz[1], dxyz[2], norm, n, true);
-        p->va_lines->add(dxyz[0], dxyz[1], dxyz[2], n, col, 0, false);
+        p->va_lines->add(dxyz[0], dxyz[1], dxyz[2], n, col, nullptr, false);
       }
     }
     for(int i = 0; i < numNodes; i++) delete[] val2[i];
@@ -1050,7 +1050,7 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes,
           dxyz[j][0] = xyz[i][j];
           dxyz[j][1] = val[i][j];
         }
-        p->va_vectors->add(dxyz[0], dxyz[1], dxyz[2], 0, col, 0, false);
+        p->va_vectors->add(dxyz[0], dxyz[1], dxyz[2], nullptr, col, nullptr, false);
       }
     }
   }
@@ -1087,7 +1087,7 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes,
         dxyz[i][0] = pc[i];
         dxyz[i][1] = d[i];
       }
-      p->va_vectors->add(dxyz[0], dxyz[1], dxyz[2], 0, col, 0, false);
+      p->va_vectors->add(dxyz[0], dxyz[1], dxyz[2], nullptr, col, nullptr, false);
     }
   }
   for(int i = 0; i < numNodes; i++) delete[] val2[i];
@@ -1112,14 +1112,14 @@ static void addTriangle(PView *p, PViewOptions *opt, double *x0, double *x1,
     double YY[3] = {x0[1], x1[1], x2[1]};
     double ZZ[3] = {x0[2], x1[2], x2[2]};
     SVector3 NN[3] = {N, N, N};
-    p->va_triangles->add(XX, YY, ZZ, NN, col, 0, false);
+    p->va_triangles->add(XX, YY, ZZ, NN, col, nullptr, false);
   }
   else {
     double XX[3] = {x1[0], x0[0], x2[0]};
     double YY[3] = {x1[1], x0[1], x2[1]};
     double ZZ[3] = {x1[2], x0[2], x2[2]};
     SVector3 NN[3] = {-N, -N, -N};
-    p->va_triangles->add(XX, YY, ZZ, NN, col, 0, false);
+    p->va_triangles->add(XX, YY, ZZ, NN, col, nullptr, false);
   }
 }
 
@@ -1211,7 +1211,7 @@ static void addTensorElement(PView *p, int iEnt, int iEle, int numNodes,
           lmax, opt->tmpMin, opt->tmpMax, false,
           (opt->intervalsType == PViewOptions::Discrete) ? opt->nbIso : -1);
         unsigned int col[4] = {color, color, color, color};
-        p->va_ellipses->add(vval[0], vval[1], vval[2], 0, col, 0, false);
+        p->va_ellipses->add(vval[0], vval[1], vval[2], nullptr, col, nullptr, false);
       }
     }
     else if(opt->glyphLocation == PViewOptions::COG) {
@@ -1237,7 +1237,7 @@ static void addTensorElement(PView *p, int iEnt, int iEle, int numNodes,
         lmax, opt->tmpMin, opt->tmpMax, false,
         (opt->intervalsType == PViewOptions::Discrete) ? opt->nbIso : -1);
       unsigned int col[4] = {color, color, color, color};
-      p->va_ellipses->add(vval[0], vval[1], vval[2], 0, col, 0, false);
+      p->va_ellipses->add(vval[0], vval[1], vval[2], nullptr, col, nullptr, false);
     }
   }
   else {
diff --git a/Post/PViewX3D.cpp b/Post/PViewX3D.cpp
index fad6b56aa39ccff3ada910f54432cd4725c04144..31f3413c4b932e664d73afb189e65b8ae6bbd06d 100644
--- a/Post/PViewX3D.cpp
+++ b/Post/PViewX3D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -240,7 +240,7 @@ bool PView::writeX3D(const std::string &fileName)
   fprintf(fp, "  </head>\n");
   // Viewport
   SBoundingBox3d bb(0., 0., 0., 0., 0., 0.);
-  for(std::vector<PView *>::iterator pvit = PView::list.begin();
+  for(auto pvit = PView::list.begin();
       pvit < PView::list.end(); pvit++) {
     PViewData *data = (*pvit)->getData(true);
     PViewOptions *opt = (*pvit)->getOptions();
diff --git a/Post/PViewX3D.h b/Post/PViewX3D.h
index 0e8cdbb5a4591746fdc34303e19370197f9aaf4d..f92869e72f753085e606404ff80d5089e09fc5f2 100644
--- a/Post/PViewX3D.h
+++ b/Post/PViewX3D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/adaptiveData.cpp b/Post/adaptiveData.cpp
index 69c95ccbabc1f709f5e9b0fb2adef11161529033..caa8269386e4f1dcfd3471e661dc7cfd2d7f664a 100644
--- a/Post/adaptiveData.cpp
+++ b/Post/adaptiveData.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -58,7 +58,7 @@ std::vector<PValues> globalVTKData::vtkGlobalValues;
 
 template <class T> static void cleanElement()
 {
-  for(typename std::list<T *>::iterator it = T::all.begin(); it != T::all.end();
+  for(auto it = T::all.begin(); it != T::all.end();
       ++it)
     delete *it;
   T::all.clear();
@@ -116,7 +116,7 @@ adaptiveVertex *adaptiveVertex::add(double x, double y, double z,
   p.x = x;
   p.y = y;
   p.z = z;
-  std::set<adaptiveVertex>::iterator it = allVertices.find(p);
+  auto it = allVertices.find(p);
   if(it == allVertices.end()) {
     allVertices.insert(p);
     it = allVertices.find(p);
@@ -1086,8 +1086,8 @@ void adaptivePyramid::recurError(adaptivePyramid *p, double AVG, double tol)
 
 template <class T>
 adaptiveElements<T>::adaptiveElements(std::vector<fullMatrix<double> *> &p)
-  : _coeffsVal(0), _eexpsVal(0), _interpolVal(0), _coeffsGeom(0), _eexpsGeom(0),
-    _interpolGeom(0)
+  : _coeffsVal(nullptr), _eexpsVal(nullptr), _interpolVal(nullptr), _coeffsGeom(nullptr), _eexpsGeom(nullptr),
+    _interpolGeom(nullptr)
 {
   if(p.size() >= 2) {
     _coeffsVal = p[0];
@@ -1122,13 +1122,13 @@ template <class T> void adaptiveElements<T>::init(int level)
   if(_interpolGeom) delete _interpolGeom;
   _interpolGeom = new fullMatrix<double>(T::allVertices.size(), numNodes);
 
-  fullVector<double> sfv(numVals), *tmpv = 0;
-  fullVector<double> sfg(numNodes), *tmpg = 0;
+  fullVector<double> sfv(numVals), *tmpv = nullptr;
+  fullVector<double> sfg(numNodes), *tmpg = nullptr;
   if(_eexpsVal) tmpv = new fullVector<double>(_eexpsVal->size1());
   if(_eexpsGeom) tmpg = new fullVector<double>(_eexpsGeom->size1());
 
   int i = 0;
-  for(std::set<adaptiveVertex>::iterator it = T::allVertices.begin();
+  for(auto it = T::allVertices.begin();
       it != T::allVertices.end(); ++it) {
     if(_coeffsVal && _eexpsVal)
       computeShapeFunctions(_coeffsVal, _eexpsVal, it->x, it->y, it->z, &sfv,
@@ -1174,13 +1174,13 @@ template <> void adaptiveElements<adaptivePyramid>::init(int level)
   _interpolGeom =
     new fullMatrix<double>(adaptivePyramid::allVertices.size(), numNodes);
 
-  fullVector<double> sfv(numVals), *tmpv = 0;
-  fullVector<double> sfg(numNodes), *tmpg = 0;
+  fullVector<double> sfv(numVals), *tmpv = nullptr;
+  fullVector<double> sfg(numNodes), *tmpg = nullptr;
   if(_eexpsVal) tmpv = new fullVector<double>(_eexpsVal->size1());
   if(_eexpsGeom) tmpg = new fullVector<double>(_eexpsGeom->size1());
 
   int i = 0;
-  for(std::set<adaptiveVertex>::iterator it =
+  for(auto it =
         adaptivePyramid::allVertices.begin();
       it != adaptivePyramid::allVertices.end(); ++it) {
     if(_coeffsVal && _eexpsVal)
@@ -1267,7 +1267,7 @@ bool adaptiveElements<T>::adapt(double tol, int numComp,
   }
   if(onlyComputeMinMax) return true;
 
-  fullMatrix<double> *resxyz = 0;
+  fullMatrix<double> *resxyz = nullptr;
   if(numComp == 3 || numComp == 9) {
     fullMatrix<double> valxyz(numVals, numComp);
     resxyz = new fullMatrix<double>(numVertices, numComp);
@@ -1301,7 +1301,7 @@ bool adaptiveElements<T>::adapt(double tol, int numComp,
 #endif
 
   int i = 0;
-  for(std::set<adaptiveVertex>::iterator it = T::allVertices.begin();
+  for(auto it = T::allVertices.begin();
       it != T::allVertices.end(); ++it) {
     // ok because we know this will not change the set ordering
     adaptiveVertex *p = (adaptiveVertex *)&(*it);
@@ -1327,7 +1327,7 @@ bool adaptiveElements<T>::adapt(double tol, int numComp,
 
   if(resxyz) delete resxyz;
 
-  for(typename std::list<T *>::iterator it = T::all.begin(); it != T::all.end();
+  for(auto it = T::all.begin(); it != T::all.end();
       it++)
     (*it)->visible = false;
 
@@ -1341,7 +1341,7 @@ bool adaptiveElements<T>::adapt(double tol, int numComp,
 
   coords.clear();
   values.clear();
-  for(typename std::list<T *>::iterator it = T::all.begin(); it != T::all.end();
+  for(auto it = T::all.begin(); it != T::all.end();
       it++) {
     if((*it)->visible) {
       adaptiveVertex **p = (*it)->p;
@@ -1372,8 +1372,8 @@ void adaptiveElements<T>::addInView(double tol, int step, PViewData *in,
   int numComp = in->getNumComponents(0, 0, 0);
   if(numComp != 1 && numComp != 3 && numComp != 9) return;
 
-  int numEle = 0, *outNb = 0;
-  std::vector<double> *outList = 0;
+  int numEle = 0, *outNb = nullptr;
+  std::vector<double> *outList = nullptr;
   switch(T::numEdges) {
   case 0:
     numEle = in->getNumPoints();
@@ -1507,9 +1507,9 @@ void adaptiveElements<T>::addInView(double tol, int step, PViewData *in,
 }
 
 adaptiveData::adaptiveData(PViewData *data, bool outDataInit)
-  : _step(-1), _level(-1), _tol(-1.), _inData(data), _points(0), _lines(0),
-    _triangles(0), _quadrangles(0), _tetrahedra(0), _hexahedra(0), _prisms(0),
-    _pyramids(0)
+  : _step(-1), _level(-1), _tol(-1.), _inData(data), _points(nullptr), _lines(nullptr),
+    _triangles(nullptr), _quadrangles(nullptr), _tetrahedra(nullptr), _hexahedra(nullptr), _prisms(nullptr),
+    _pyramids(nullptr)
 {
   if(outDataInit ==
      true) { // For visualization of the adapted view in GMSH GUI only
@@ -1517,7 +1517,7 @@ adaptiveData::adaptiveData(PViewData *data, bool outDataInit)
     _outData->setName(data->getName() + "_adapted");
   }
   else {
-    _outData = 0; // For external used
+    _outData = nullptr; // For external used
   }
   std::vector<fullMatrix<double> *> p;
   if(_inData->getNumPoints()) {
@@ -1672,7 +1672,7 @@ void VTKData::writeVTKElmData()
       // Node value
       counter = 0;
       darray = new double[vtkNumComp * vtkLocalValues.size()];
-      for(std::vector<PValues>::iterator it = vtkLocalValues.begin();
+      for(auto it = vtkLocalValues.begin();
           it != vtkLocalValues.end(); ++it) {
         for(int i = 0; i < vtkNumComp; i++) {
           darray[counter + i] = it->v[i];
@@ -1689,7 +1689,7 @@ void VTKData::writeVTKElmData()
       int sizeArray = (int)vtkLocalCoords.size();
       darray = new double[3 * sizeArray];
       counter = 0;
-      for(std::vector<PCoords>::iterator it = vtkLocalCoords.begin();
+      for(auto it = vtkLocalCoords.begin();
           it != vtkLocalCoords.end(); ++it) {
         for(int i = 0; i < 3; i++) {
           darray[counter + i] = (*it).c[i];
@@ -1706,7 +1706,7 @@ void VTKData::writeVTKElmData()
       // vtkConnectivity See
       // http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf (page 4)
       int cellSizeData = 0;
-      for(std::vector<vectInt>::iterator it = vtkLocalConnectivity.begin();
+      for(auto it = vtkLocalConnectivity.begin();
           it != vtkLocalConnectivity.end(); ++it) {
         // Contrary to vtk format, no +1 required for the number of nodes in the
         // element
@@ -1718,9 +1718,9 @@ void VTKData::writeVTKElmData()
       int cellcounter = 0;
       i64array = new uint64_t[cellSizeData];
       uint64_t *cellOffset = new uint64_t[vtkLocalConnectivity.size()];
-      for(std::vector<vectInt>::iterator it = vtkLocalConnectivity.begin();
+      for(auto it = vtkLocalConnectivity.begin();
           it != vtkLocalConnectivity.end(); ++it) {
-        for(vectInt::iterator jt = it->begin(); jt != it->end(); ++jt) {
+        for(auto jt = it->begin(); jt != it->end(); ++jt) {
           i64array[counter] = *jt;
           counter++;
           vtkCountTotNodConnect++;
@@ -1739,7 +1739,7 @@ void VTKData::writeVTKElmData()
       // Cell type
       counter = 0;
       i8array = new uint8_t[vtkLocalConnectivity.size()];
-      for(std::vector<int>::iterator it = vtkLocalCellType.begin();
+      for(auto it = vtkLocalCellType.begin();
           it != vtkLocalCellType.end(); it++) {
         i8array[counter] = *it;
         counter++;
@@ -1751,7 +1751,7 @@ void VTKData::writeVTKElmData()
     else { // ascii
 
       // Node values
-      for(std::vector<PValues>::iterator it = vtkLocalValues.begin();
+      for(auto it = vtkLocalValues.begin();
           it != vtkLocalValues.end(); ++it) {
         for(int i = 0; i < vtkNumComp; i++) {
           fprintf(vtkFileNodVal, "%23.16e ", (*it).v[i]);
@@ -1760,7 +1760,7 @@ void VTKData::writeVTKElmData()
         }
       }
 
-      for(std::vector<PCoords>::iterator it = vtkLocalCoords.begin();
+      for(auto it = vtkLocalCoords.begin();
           it != vtkLocalCoords.end(); it++) {
         fprintf(vtkFileCoord, "%23.16e %23.16e %23.16e ", (*it).c[0],
                 (*it).c[1], (*it).c[2]);
@@ -1772,9 +1772,9 @@ void VTKData::writeVTKElmData()
       // Connectivity
       int *cellOffset = new int[vtkLocalConnectivity.size()];
       int cellcounter = 0;
-      for(std::vector<vectInt>::iterator it = vtkLocalConnectivity.begin();
+      for(auto it = vtkLocalConnectivity.begin();
           it != vtkLocalConnectivity.end(); ++it) {
-        for(vectInt::iterator jt = it->begin(); jt != it->end(); ++jt) {
+        for(auto jt = it->begin(); jt != it->end(); ++jt) {
           fprintf(vtkFileConnect, "%d ", *jt);
           vtkCountTotNodConnect++;
           if(vtkCountTotNodConnect % 6 == 0) fprintf(vtkFileConnect, "\n");
@@ -1792,7 +1792,7 @@ void VTKData::writeVTKElmData()
       delete[] cellOffset;
 
       // Cell type
-      for(std::vector<int>::iterator it = vtkLocalCellType.begin();
+      for(auto it = vtkLocalCellType.begin();
           it != vtkLocalCellType.end(); it++) {
         fprintf(vtkFileCellType, "%d ", *it);
         vtkCountCellType++;
@@ -1927,7 +1927,7 @@ void VTKData::finalizeVTKFile()
     if(vtkIsBinary == true) { // Binary or ascii
 
       vtkFile = fopen(filename.c_str(), "wb");
-      if(vtkFile == NULL) {
+      if(vtkFile == nullptr) {
         printf("Could not open file %s\n", filename.c_str());
         return;
       }
@@ -2077,7 +2077,7 @@ void VTKData::finalizeVTKFile()
     else { // ascii
 
       vtkFile = fopen(filename.c_str(), "w");
-      if(vtkFile == NULL) {
+      if(vtkFile == nullptr) {
         printf("Could not open file %s\n", filename.c_str());
         return;
       }
@@ -2310,7 +2310,7 @@ void adaptiveElements<T>::adaptForVTK(double tol, int numComp,
     maxVal = std::max(maxVal, res(i));
   }
 
-  fullMatrix<double> *resxyz = 0;
+  fullMatrix<double> *resxyz = nullptr;
   if(numComp == 3 || numComp == 9) {
     fullMatrix<double> valxyz(numVals, numComp);
     resxyz = new fullMatrix<double>(numVertices, numComp);
@@ -2344,7 +2344,7 @@ void adaptiveElements<T>::adaptForVTK(double tol, int numComp,
 #endif
 
   int i = 0;
-  for(std::set<adaptiveVertex>::iterator it = T::allVertices.begin();
+  for(auto it = T::allVertices.begin();
       it != T::allVertices.end(); ++it) {
     // ok because we know this will not change the set ordering
     adaptiveVertex *p = (adaptiveVertex *)&(*it);
@@ -2370,7 +2370,7 @@ void adaptiveElements<T>::adaptForVTK(double tol, int numComp,
 
   if(resxyz) delete resxyz;
 
-  for(typename std::list<T *>::iterator it = T::all.begin(); it != T::all.end();
+  for(auto it = T::all.begin(); it != T::all.end();
       it++)
     (*it)->visible = false;
 
@@ -2382,7 +2382,7 @@ void adaptiveElements<T>::adaptForVTK(double tol, int numComp,
 
   coords.clear();
   values.clear();
-  for(typename std::list<T *>::iterator it = T::all.begin(); it != T::all.end();
+  for(auto it = T::all.begin(); it != T::all.end();
       it++) {
     if((*it)->visible) {
       adaptiveVertex **p = (*it)->p;
@@ -2416,7 +2416,7 @@ void adaptiveElements<T>::buildMapping(nodMap<T> &myNodMap, double tol,
     myNodMap
       .cleanMapping(); // Required if tol > 0 (local error based adaptation)
 
-    for(typename std::list<T *>::iterator itleaf = T::all.begin();
+    for(auto itleaf = T::all.begin();
         itleaf != T::all.end(); itleaf++) {
       // Visit all the leaves of the refined canonical element
 
@@ -2430,7 +2430,7 @@ void adaptiveElements<T>::buildMapping(nodMap<T> &myNodMap, double tol,
           pquery.x = (*itleaf)->p[i]->x;
           pquery.y = (*itleaf)->p[i]->y;
           pquery.z = (*itleaf)->p[i]->z;
-          std::set<adaptiveVertex>::iterator it = T::allVertices.find(pquery);
+          auto it = T::allVertices.find(pquery);
           if(it == T::allVertices.end()) {
             Msg::Error("Could not find adaptive Vertex in "
                        "adaptiveElements<T>::buildMapping %f %f %f",
@@ -2456,7 +2456,7 @@ void adaptiveElements<T>::buildMapping(nodMap<T> &myNodMap, double tol,
     // Use an ordered set for efficiency
     // This set is also used in case of partiel refinement
     std::set<int> uniqueNod;
-    for(std::vector<int>::iterator it = myNodMap.mapping.begin();
+    for(auto it = myNodMap.mapping.begin();
         it != myNodMap.mapping.end(); it++) {
       uniqueNod.insert(*it);
     }
@@ -2468,7 +2468,7 @@ void adaptiveElements<T>::buildMapping(nodMap<T> &myNodMap, double tol,
     // temporary mapping, based on uniqueNod already generated above
     if(tol > 0.0) {
       std::set<int>::iterator jt;
-      for(std::vector<int>::iterator it = myNodMap.mapping.begin();
+      for(auto it = myNodMap.mapping.begin();
           it != myNodMap.mapping.end(); ++it) {
         jt = uniqueNod.find(*it);
         *it = std::distance(uniqueNod.begin(), jt);
diff --git a/Post/adaptiveData.h b/Post/adaptiveData.h
index 564a00381f1632d926404a9c2dc2f071d04f915b..5c05418583c480f3657b6b66453777c265e958f8 100644
--- a/Post/adaptiveData.h
+++ b/Post/adaptiveData.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -88,7 +88,7 @@ public:
   adaptivePoint(adaptiveVertex *p1) : visible(false)
   {
     p[0] = p1;
-    e[0] = 0;
+    e[0] = nullptr;
   }
   inline double V() const { return p[0]->val; }
   inline static void GSF(double u, double v, double w, fullVector<double> &sf)
@@ -115,7 +115,7 @@ public:
   {
     p[0] = p1;
     p[1] = p2;
-    e[0] = e[1] = 0;
+    e[0] = e[1] = nullptr;
   }
   inline double V() const { return (p[0]->val + p[1]->val) / 2.; }
   inline static void GSF(double u, double v, double w, fullVector<double> &sf)
@@ -145,7 +145,7 @@ public:
     p[0] = p1;
     p[1] = p2;
     p[2] = p3;
-    e[0] = e[1] = e[2] = e[3] = 0;
+    e[0] = e[1] = e[2] = e[3] = nullptr;
   }
   inline double V() const { return (p[0]->val + p[1]->val + p[2]->val) / 3.; }
   inline static void GSF(double u, double v, double w, fullVector<double> &sf)
@@ -178,7 +178,7 @@ public:
     p[1] = p2;
     p[2] = p3;
     p[3] = p4;
-    e[0] = e[1] = e[2] = e[3] = 0;
+    e[0] = e[1] = e[2] = e[3] = nullptr;
   }
   inline double V() const
   {
@@ -217,8 +217,8 @@ public:
     p[3] = p4;
     p[4] = p5;
     p[5] = p6;
-    e[0] = e[1] = e[2] = e[3] = NULL;
-    e[4] = e[5] = e[6] = e[7] = NULL;
+    e[0] = e[1] = e[2] = e[3] = nullptr;
+    e[4] = e[5] = e[6] = e[7] = nullptr;
   }
   inline double V() const
   {
@@ -259,8 +259,8 @@ public:
     p[1] = p2;
     p[2] = p3;
     p[3] = p4;
-    e[0] = e[1] = e[2] = e[3] = 0;
-    e[4] = e[5] = e[6] = e[7] = 0;
+    e[0] = e[1] = e[2] = e[3] = nullptr;
+    e[4] = e[5] = e[6] = e[7] = nullptr;
   }
   inline double V() const
   {
@@ -302,8 +302,8 @@ public:
     p[5] = p6;
     p[6] = p7;
     p[7] = p8;
-    e[0] = e[1] = e[2] = e[3] = 0;
-    e[4] = e[5] = e[6] = e[7] = 0;
+    e[0] = e[1] = e[2] = e[3] = nullptr;
+    e[4] = e[5] = e[6] = e[7] = nullptr;
   }
   inline double V() const
   {
@@ -349,7 +349,7 @@ public:
     p[2] = p3;
     p[3] = p4;
     p[4] = p5;
-    for(int i = 0; i < 10; i++) e[i] = NULL;
+    for(int i = 0; i < 10; i++) e[i] = nullptr;
   }
   inline double V() const
   {
@@ -456,7 +456,7 @@ public:
   globalVTKData();
   static void clearGlobalConnectivity()
   {
-    for(std::vector<vectInt>::iterator it = vtkGlobalConnectivity.begin();
+    for(auto it = vtkGlobalConnectivity.begin();
         it != vtkGlobalConnectivity.end(); ++it) {
       it->clear();
     }
@@ -562,7 +562,7 @@ public:
   }
   void clearLocalData()
   {
-    for(std::vector<vectInt>::iterator it = vtkLocalConnectivity.begin();
+    for(auto it = vtkLocalConnectivity.begin();
         it != vtkLocalConnectivity.end(); ++it) {
       it->clear();
     }
@@ -614,12 +614,12 @@ public:
   // elements in coords/values
   bool adapt(double tol, int numComp, std::vector<PCoords> &coords,
              std::vector<PValues> &values, double &minVal, double &maxVal,
-             GMSH_PostPlugin *plug = 0, bool onlyComputeMinMax = false);
+             GMSH_PostPlugin *plug = nullptr, bool onlyComputeMinMax = false);
   // adapt all the T-type elements in the input view and add the
   // refined elements in the output view (we will remove this when we
   // switch to true on-the-fly local refinement in drawPost())
   void addInView(double tol, int step, PViewData *in, PViewDataList *out,
-                 GMSH_PostPlugin *plug = 0);
+                 GMSH_PostPlugin *plug = nullptr);
 
   // Routines for
   // - export of adapted views to pvtu file format for parallel visualization
@@ -679,7 +679,7 @@ public:
   ~adaptiveData();
   PViewData *getData() { return (PViewData *)_outData; }
   void changeResolution(int step, int level, double tol,
-                        GMSH_PostPlugin *plug = 0);
+                        GMSH_PostPlugin *plug = nullptr);
   int countTotElmLev0(int step, PViewData *in);
   void changeResolutionForVTK(int step, int level, double tol, int npart = 1,
                               bool isBinary = true,
diff --git a/Post/shapeFunctions.cpp b/Post/shapeFunctions.cpp
index 7e89a5bf23c5a9ece627c5579869ca91a2e9f1aa..97c35def36ccfcd407b45a0e4f72c5e12fc40eaf 100644
--- a/Post/shapeFunctions.cpp
+++ b/Post/shapeFunctions.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Post/shapeFunctions.h b/Post/shapeFunctions.h
index 398fa54362e699995fd23d3a2f1b0d893f8d0010..1fca5d802c20ec230909c79b3c65bc287cb59a0f 100644
--- a/Post/shapeFunctions.h
+++ b/Post/shapeFunctions.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -167,7 +167,7 @@ public:
     return sum;
   }
   void interpolateGrad(double val[], double u, double v, double w, double f[3],
-                       int stride = 1, double invjac[3][3] = NULL)
+                       int stride = 1, double invjac[3][3] = nullptr)
   {
     double dfdu[3] = {0., 0., 0.};
     int j = 0;
@@ -1405,7 +1405,7 @@ public:
         return new pyramid(x, y, z, copy ? numNodes : 0);
       else
         return new tetrahedron(x, y, z, copy ? numNodes : 0);
-    default: Msg::Error("Unknown type of element in factory"); return NULL;
+    default: Msg::Error("Unknown type of element in factory"); return nullptr;
     }
   }
 };
diff --git a/README.txt b/README.txt
index 5183f4349da31bee42bd465b9b6fa33e424c5544..d7cab7c26d481112895bb73f58dddcada4c46206 100644
--- a/README.txt
+++ b/README.txt
@@ -1,7 +1,7 @@
 This is Gmsh, an automatic three-dimensional finite element mesh generator with
 built-in pre- and post-processing facilities.
 
-Gmsh is copyright (C) 1997-2020 C. Geuzaine and J.-F. Remacle, and is
+Gmsh is copyright (C) 1997-2021 C. Geuzaine and J.-F. Remacle, and is
 distributed under the terms of the GNU General Public License, Version 2 or
 later, with an exception to allow for easier linking with external
 libraries. See LICENSE.txt and CREDITS.txt for more information.
diff --git a/Solver/CMakeLists.txt b/Solver/CMakeLists.txt
index 318b67dc192112e3bcd3786fb9283409c4ca2906..d8962a92403d25e8d77fe9f159892e35bde47066 100644
--- a/Solver/CMakeLists.txt
+++ b/Solver/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/FuncGradDisc.h b/Solver/FuncGradDisc.h
index cd1b1a51238371d0282701f47aa4ac4bd02232e6..f8aa35d2409e6e80423182776afd22d64752fe4b 100644
--- a/Solver/FuncGradDisc.h
+++ b/Solver/FuncGradDisc.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/FuncHeaviside.h b/Solver/FuncHeaviside.h
index 10bd7bc85c851153d67c02fd8dc8fa5c5f651ae4..ade576d6567882a24e319357aefd0c45ffa34c1d 100644
--- a/Solver/FuncHeaviside.h
+++ b/Solver/FuncHeaviside.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/SElement.cpp b/Solver/SElement.cpp
index 2e3a4f2b74ba698c09b71a3cdcd7a2b8607f73f5..4e3002636b08497d8e835b27d0f170aefc39cf4f 100644
--- a/Solver/SElement.cpp
+++ b/Solver/SElement.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,8 +22,8 @@ etc.
 
  */
 
-simpleFunction<double> *SElement::_enrichement_s = 0,
-                       *SElement::_enrichement_t = 0;
+simpleFunction<double> *SElement::_enrichement_s = nullptr,
+                       *SElement::_enrichement_t = nullptr;
 
 void SElement::gradNodalFunctions(double u, double v, double w,
                                   double invjac[3][3], double Grads[][3],
diff --git a/Solver/SElement.h b/Solver/SElement.h
index 61ba6150147e7d7ef4f435d55e3855ff1b80e5c8..4130bfdfeb77049478b8acefd9afd7c27cd6e9bd 100644
--- a/Solver/SElement.h
+++ b/Solver/SElement.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor33.cpp b/Solver/STensor33.cpp
index 928dfa520e7d25581dc498242d8daea1419d74f9..c6eda28e0ec9a8dfb2e9a9d5f720b19eab4a1d2a 100644
--- a/Solver/STensor33.cpp
+++ b/Solver/STensor33.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor33.h b/Solver/STensor33.h
index f13d33ae1e376031b0ae5483e82ef76b3f9769cb..fa33938838ba9941938ccd9d2d4a376e4f950d76 100644
--- a/Solver/STensor33.h
+++ b/Solver/STensor33.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor43.cpp b/Solver/STensor43.cpp
index 597730ed0171dac15818f2fd7aec3009a11893db..77b6c78e7d42b9f62f09d085b6a8495496bdb0bd 100644
--- a/Solver/STensor43.cpp
+++ b/Solver/STensor43.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor43.h b/Solver/STensor43.h
index 0457d47bb75b2d4cc26ad0b8a745c8441fdfd3ff..290b5468316f0dde6b2d8ebfa27de825d5a90a9b 100644
--- a/Solver/STensor43.h
+++ b/Solver/STensor43.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor53.cpp b/Solver/STensor53.cpp
index 288cd8641cd44c2833fff2e4986429f217bf2174..f605836a2d5d6216d316ba25b0a99214d4de0e69 100644
--- a/Solver/STensor53.cpp
+++ b/Solver/STensor53.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor53.h b/Solver/STensor53.h
index 14c0869816047d0dbf1f9aaf3d7f76a50a34aa82..9d7efef4bbd262adc2b2b6cc8d73d34cd0a7ace7 100644
--- a/Solver/STensor53.h
+++ b/Solver/STensor53.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor63.cpp b/Solver/STensor63.cpp
index 5197c8c833d70a5c9bd9a3dfb3510111cc631742..3837ba479b4c9040fdc4f43ede52c4c2c4725b71 100644
--- a/Solver/STensor63.cpp
+++ b/Solver/STensor63.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/STensor63.h b/Solver/STensor63.h
index acfe8a585e12528c8e46df8a7301769b64fcf4b6..f70e0c499557c5881ff216600a0dd84857b793a2 100644
--- a/Solver/STensor63.h
+++ b/Solver/STensor63.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/distanceTerm.h b/Solver/distanceTerm.h
index ae1d2ba24a4b3cebe30262a82694b9975a6d60f1..8f1177e527cdee4894ba9b13dfba96c4b10c9aed 100644
--- a/Solver/distanceTerm.h
+++ b/Solver/distanceTerm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/dofManager.cpp b/Solver/dofManager.cpp
index d0d8386d44b59729398a43aa2b8ab306b150604b..30ae721f210154aa380ca4179a624a9444a40478 100644
--- a/Solver/dofManager.cpp
+++ b/Solver/dofManager.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/dofManager.h b/Solver/dofManager.h
index 640fdffe87b03a3a02c5cd7fb23b18f19befd35e..24d09ba0c023656fd34e0d1ab3555014c5cd42c5 100644
--- a/Solver/dofManager.h
+++ b/Solver/dofManager.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -217,7 +217,7 @@ public:
     if(constraints.find(key) != constraints.end()) return;
     if(ghostByDof.find(key) != ghostByDof.end()) return;
 
-    std::map<Dof, int>::iterator it = unknown.find(key);
+    auto it = unknown.find(key);
     if(it == unknown.end()) {
       std::size_t size = unknown.size();
       unknown[key] = size;
@@ -236,7 +236,7 @@ public:
                                   std::vector<dataVec> &Vals)
   {
     for(std::size_t i = 0; i < keys.size(); i++) {
-      std::map<Dof, Dof>::iterator it = associatedWith.find(keys[i]);
+      auto it = associatedWith.find(keys[i]);
       if (it != associatedWith.end())keys[i] = it->second;
     }
 
@@ -249,7 +249,7 @@ public:
   virtual inline bool getAnUnknown(Dof key, dataVec &val) const
   {
     if(ghostValue.find(key) == ghostValue.end()) {
-      std::map<Dof, int>::const_iterator it = unknown.find(key);
+      auto it = unknown.find(key);
       if(it != unknown.end()) {
         _current->getFromSolution(it->second, val);
         return true;
@@ -273,10 +273,10 @@ public:
   virtual inline void getDofValue(Dof key, dataVec &val) const
   {
     {      
-      typename std::map<Dof, Dof>::const_iterator it = associatedWith.find(key);
+      auto it = associatedWith.find(key);
       if (it != associatedWith.end()){
 	//	  printf("ass to %d\n",it->second.getEntity());
-	std::map<Dof, int>::const_iterator itx = unknown.find(it->second);
+	auto itx = unknown.find(it->second);
 	if(itx != unknown.end()) {
 	  _current->getFromSolution(itx->second, val);
 	  return;
@@ -292,7 +292,7 @@ public:
       }
     }
     {
-      std::map<Dof, int>::const_iterator it = unknown.find(key);
+      auto it = unknown.find(key);
       if(it != unknown.end()) {
         _current->getFromSolution(it->second, val);
         return;
@@ -335,7 +335,7 @@ public:
   virtual inline void insertInSparsityPatternLinConst(const Dof &R,
                                                       const Dof &C)
   {
-    std::map<Dof, int>::iterator itR = unknown.find(R);
+    auto itR = unknown.find(R);
     if(itR != unknown.end()) {
       typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
         itConstraint;
@@ -362,9 +362,9 @@ public:
   {
     if(_isParallel && !_parallelFinalized) _parallelFinalize();
     if(!_current->isAllocated()) _current->allocate(sizeOfR());
-    std::map<Dof, int>::iterator itR = unknown.find(R);
+    auto itR = unknown.find(R);
     if(itR != unknown.end()) {
-      std::map<Dof, int>::iterator itC = unknown.find(C);
+      auto itC = unknown.find(C);
       if(itC != unknown.end()) {
         _current->insertInSparsityPattern(itR->second, itC->second);
       }
@@ -394,9 +394,9 @@ public:
   {
     if(_isParallel && !_parallelFinalized) _parallelFinalize();
     if(!_current->isAllocated()) _current->allocate(sizeOfR());
-    std::map<Dof, int>::iterator itR = unknown.find(R);
+    auto itR = unknown.find(R);
     if(itR != unknown.end()) {
-      std::map<Dof, int>::iterator itC = unknown.find(C);
+      auto itC = unknown.find(C);
       if(itC != unknown.end()) {
         _current->addToMatrix(itR->second, itC->second, value);
       }
@@ -424,25 +424,25 @@ public:
     printf("coucou\n");
 
     for(std::size_t i = 0; i < R.size(); i++) {
-      std::map<Dof, Dof>::iterator it = associatedWith.find(R[i]);
+      auto it = associatedWith.find(R[i]);
       if (it != associatedWith.end())R[i] = it->second;
     }
     for(std::size_t i = 0; i < C.size(); i++) {
-      std::map<Dof, Dof>::iterator it = associatedWith.find(C[i]);
+      auto it = associatedWith.find(C[i]);
       if (it != associatedWith.end())C[i] = it->second;
     }
     
     std::vector<int> NR(R.size()), NC(C.size());
 
     for(std::size_t i = 0; i < R.size(); i++) {
-      std::map<Dof, int>::iterator itR = unknown.find(R[i]);
+      auto itR = unknown.find(R[i]);
       if(itR != unknown.end())
         NR[i] = itR->second;
       else
         NR[i] = -1;
     }
     for(std::size_t i = 0; i < C.size(); i++) {
-      std::map<Dof, int>::iterator itC = unknown.find(C[i]);
+      auto itC = unknown.find(C[i]);
       if(itC != unknown.end())
         NC[i] = itC->second;
       else
@@ -484,14 +484,14 @@ public:
     printf("coucou RHS\n");
 
     for(std::size_t i = 0; i < R.size(); i++) {
-      std::map<Dof, Dof>::iterator it = associatedWith.find(R[i]);
+      auto it = associatedWith.find(R[i]);
       if (it != associatedWith.end())R[i] = it->second;
     }
 
 
     std::vector<int> NR(R.size());
     for(std::size_t i = 0; i < R.size(); i++) {
-      std::map<Dof, int>::iterator itR = unknown.find(R[i]);
+      auto itR = unknown.find(R[i]);
       if(itR != unknown.end())
         NR[i] = itR->second;
       else
@@ -522,13 +522,13 @@ public:
     if(_isParallel && !_parallelFinalized) _parallelFinalize();
     if(!_current->isAllocated()) _current->allocate(sizeOfR());
     for(std::size_t i = 0; i < R.size(); i++) {
-      std::map<Dof, Dof>::iterator it = associatedWith.find(R[i]);
+      auto it = associatedWith.find(R[i]);
       if (it != associatedWith.end())R[i] = it->second;
     }
 
     std::vector<int> NR(R.size());
     for(std::size_t i = 0; i < R.size(); i++) {
-      std::map<Dof, int>::iterator itR = unknown.find(R[i]);
+      auto itR = unknown.find(R[i]);
       if(itR != unknown.end())
         NR[i] = itR->second;
       else
@@ -576,7 +576,7 @@ public:
   {
     if(_isParallel && !_parallelFinalized) _parallelFinalize();
     if(!_current->isAllocated()) _current->allocate(sizeOfR());
-    std::map<Dof, int>::iterator itR = unknown.find(R);
+    auto itR = unknown.find(R);
     if(itR != unknown.end()) {
       _current->addToRightHandSide(itR->second, value);
     }
@@ -656,7 +656,7 @@ public:
   virtual inline void assembleLinConst(const Dof &R, const Dof &C,
                                        const dataMat &value)
   {
-    std::map<Dof, int>::iterator itR = unknown.find(R);
+    auto itR = unknown.find(R);
     if(itR != unknown.end()) {
       typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
         itConstraint;
@@ -709,11 +709,11 @@ public:
   {
     Dof key = ky;
     {
-      std::map<Dof, Dof>::iterator it = associatedWith.find(ky);
+      auto it = associatedWith.find(ky);
       if (it != associatedWith.end())key = it->second;
     }
     
-    std::map<Dof, int>::iterator it = unknown.find(key);
+    auto it = unknown.find(key);
     if(it == unknown.end()) {
       return -1;
     }
diff --git a/Solver/eigenSolver.cpp b/Solver/eigenSolver.cpp
index 94716ebfd8a1ba4f76196e7e08d6c185cede2b57..1055f763990e5312341d224aacbbbe22c77d2e17 100644
--- a/Solver/eigenSolver.cpp
+++ b/Solver/eigenSolver.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/eigenSolver.h b/Solver/eigenSolver.h
index ba707956f37477ca1fcaa58a4f904d3dabcf402a..c6216dad930f8d4e70c44d2a7db94c2373e0ec4c 100644
--- a/Solver/eigenSolver.h
+++ b/Solver/eigenSolver.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -68,7 +68,7 @@ public:
               bool hermitian = false)
   {
   }
-  eigenSolver(linearSystemPETSc<double> *A, linearSystemPETSc<double> *B = NULL,
+  eigenSolver(linearSystemPETSc<double> *A, linearSystemPETSc<double> *B = nullptr,
               bool hermitian = false)
   {
   }
diff --git a/Solver/elasticitySolver.cpp b/Solver/elasticitySolver.cpp
index 81f0b3385bd38826ef584af179a713f6e0da3026..a2eda10abf9d0113307269ad59dac682f60be208 100644
--- a/Solver/elasticitySolver.cpp
+++ b/Solver/elasticitySolver.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -56,7 +56,7 @@ elasticitySolver::elasticitySolver(GModel *model, int tag)
   pModel = model;
   _dim = pModel->getNumRegions() ? 3 : 2;
   _tag = tag;
-  pAssembler = NULL;
+  pAssembler = nullptr;
   if(_dim == 3) LagSpace = new VectorLagrangeFunctionSpace(_tag);
   if(_dim == 2)
     LagSpace = new VectorLagrangeFunctionSpace(
@@ -174,7 +174,7 @@ void elasticitySolver::readInputFile(const std::string &fn)
     }
     if(what[0] == '#') {
       char buffer[1024];
-      if(fgets(buffer, sizeof(buffer), f) == NULL)
+      if(fgets(buffer, sizeof(buffer), f) == nullptr)
         Msg::Error("Cannot read line.");
     }
     else if(!strcmp(what, "ElasticDomain")) {
@@ -593,7 +593,7 @@ void elasticitySolver::computeEffectiveStiffness(std::vector<double> stiff)
     double E = elasticFields[i]._e;
     double nu = elasticFields[i]._nu;
     SolverField<SVector3> Field(pAssembler, LagSpace);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -650,7 +650,7 @@ void elasticitySolver::computeEffectiveStrain(std::vector<double> strain)
   double volTot = 0.;
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
     SolverField<SVector3> Field(pAssembler, LagSpace);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -701,7 +701,7 @@ double elasticitySolver::computeDisplacementError(simpleFunction<double> *f0,
   std::map<MVertex *, MElement *> vCut;
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
     if(elasticFields[i]._e == 0.) continue;
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -718,7 +718,7 @@ double elasticitySolver::computeDisplacementError(simpleFunction<double> *f0,
     }
   }
   SolverField<SVector3> Field(pAssembler, LagSpace);
-  for(std::set<MVertex *>::iterator it = v.begin(); it != v.end(); ++it) {
+  for(auto it = v.begin(); it != v.end(); ++it) {
     SVector3 val;
     MPoint p(*it);
     Field.f(&p, 0, 0, 0, val);
@@ -728,7 +728,7 @@ double elasticitySolver::computeDisplacementError(simpleFunction<double> *f0,
     double diff = normSq(sol - val);
     err += diff;
   }
-  for(std::map<MVertex *, MElement *>::iterator it = vCut.begin();
+  for(auto it = vCut.begin();
       it != vCut.end(); ++it) {
     SVector3 val;
     double uvw[3];
@@ -751,7 +751,7 @@ double elasticitySolver::computeL2Norm(simpleFunction<double> *f0,
   double val = 0.0;
   SolverField<SVector3> solField(pAssembler, LagSpace);
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -798,7 +798,7 @@ PView *elasticitySolver::buildErrorView(const std::string postFileName,
 
   SolverField<SVector3> solField(pAssembler, LagSpace);
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -840,7 +840,7 @@ PView *elasticitySolver::buildDisplacementView(const std::string postFileName)
   std::map<MVertex *, MElement *> vCut;
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
     if(elasticFields[i]._e == 0.) continue;
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -858,7 +858,7 @@ PView *elasticitySolver::buildDisplacementView(const std::string postFileName)
   }
   std::map<int, std::vector<double> > data;
   SolverField<SVector3> Field(pAssembler, LagSpace);
-  for(std::set<MVertex *>::iterator it = v.begin(); it != v.end(); ++it) {
+  for(auto it = v.begin(); it != v.end(); ++it) {
     SVector3 val;
     MPoint p(*it);
     Field.f(&p, 0, 0, 0, val);
@@ -868,7 +868,7 @@ PView *elasticitySolver::buildDisplacementView(const std::string postFileName)
     vec[2] = val(2);
     data[(*it)->getNum()] = vec;
   }
-  for(std::map<MVertex *, MElement *>::iterator it = vCut.begin();
+  for(auto it = vCut.begin();
       it != vCut.end(); ++it) {
     SVector3 val;
     double uvw[3];
@@ -896,7 +896,7 @@ PView *elasticitySolver::buildStressesView(const std::string postFileName)
     double E = elasticFields[i]._e;
     double nu = elasticFields[i]._nu;
     SolverField<SVector3> Field(pAssembler, LagSpace);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -986,7 +986,7 @@ PView *elasticitySolver::buildStrainView(const std::string postFileName)
   std::map<int, std::vector<double> > data;
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
     SolverField<SVector3> Field(pAssembler, LagSpace);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -1040,7 +1040,7 @@ elasticitySolver::buildLagrangeMultiplierView(const std::string &postFileName,
   if(t == LagrangeMultiplierSpaces.size()) return new PView();
   std::set<MVertex *> v;
   for(std::size_t i = 0; i < LagrangeMultiplierFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           LagrangeMultiplierFields[i].g->begin();
         it != LagrangeMultiplierFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -1050,7 +1050,7 @@ elasticitySolver::buildLagrangeMultiplierView(const std::string &postFileName,
   }
   std::map<int, std::vector<double> > data;
   SolverField<double> Field(pAssembler, LagrangeMultiplierSpaces[t]);
-  for(std::set<MVertex *>::iterator it = v.begin(); it != v.end(); ++it) {
+  for(auto it = v.begin(); it != v.end(); ++it) {
     double val;
     MPoint p(*it);
     Field.f(&p, 0, 0, 0, val);
@@ -1074,7 +1074,7 @@ PView *elasticitySolver::buildElasticEnergyView(const std::string postFileName)
                                elasticFields[i]._nu);
     BilinearTermToScalarTerm Elastic_Energy_Term(Eterm);
     ScalarTermConstant<double> One(1.0);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -1102,7 +1102,7 @@ PView *elasticitySolver::buildVolumeView(const std::string postFileName)
   GaussQuadrature Integ_Vol(GaussQuadrature::Val);
   for(std::size_t i = 0; i < elasticFields.size(); ++i) {
     ScalarTermConstant<double> One(1.0);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -1118,7 +1118,7 @@ PView *elasticitySolver::buildVolumeView(const std::string postFileName)
   }
   for(std::size_t i = 0; i < LagrangeMultiplierFields.size(); ++i) {
     ScalarTermConstant<double> One(1.0);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           LagrangeMultiplierFields[i].g->begin();
         it != LagrangeMultiplierFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -1147,7 +1147,7 @@ PView *elasticitySolver::buildVonMisesView(const std::string postFileName)
     IsotropicElasticTerm Eterm(Field, elasticFields[i]._e,
                                elasticFields[i]._nu);
     BilinearTermToScalarTerm Elastic_Energy_Term(Eterm);
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           elasticFields[i].g->begin();
         it != elasticFields[i].g->end(); ++it) {
       MElement *e = *it;
diff --git a/Solver/elasticitySolver.h b/Solver/elasticitySolver.h
index d7e51076ea4e5436b500c110095f68194a9a4442..e7d8d46012038995099cba467877f1b5ec99520f 100644
--- a/Solver/elasticitySolver.h
+++ b/Solver/elasticitySolver.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -25,14 +25,14 @@ struct LagrangeMultiplierField {
   double _tau;
   SVector3 _d;
   simpleFunction<double> *_f;
-  LagrangeMultiplierField() : _tag(0), g(0) {}
+  LagrangeMultiplierField() : _tag(0), g(nullptr) {}
 };
 
 struct elasticField {
   int _tag; // tag for the dofManager
   groupOfElements *g; // support for this field
   double _e, _nu; // specific elastic datas (should be somewhere else)
-  elasticField() : _tag(0), g(0) {}
+  elasticField() : _tag(0), g(nullptr) {}
 };
 
 struct BoundaryCondition {
@@ -40,18 +40,18 @@ struct BoundaryCondition {
   enum location { UNDEF, ON_VERTEX, ON_EDGE, ON_FACE, ON_VOLUME };
   location onWhat; // on vertices or elements
   groupOfElements *g; // support for this BC
-  BoundaryCondition() : _tag(0), onWhat(UNDEF), g(0) {}
+  BoundaryCondition() : _tag(0), onWhat(UNDEF), g(nullptr) {}
 };
 
 struct dirichletBC : public BoundaryCondition {
   int _comp; // component
   simpleFunction<double> *_f;
-  dirichletBC() : BoundaryCondition(), _comp(0), _f(0) {}
+  dirichletBC() : BoundaryCondition(), _comp(0), _f(nullptr) {}
 };
 
 struct neumannBC : public BoundaryCondition {
   simpleFunction<SVector3> *_f;
-  neumannBC() : BoundaryCondition(), _f(NULL) {}
+  neumannBC() : BoundaryCondition(), _f(nullptr) {}
 };
 // an elastic solver ...
 class elasticitySolver {
@@ -72,7 +72,7 @@ public:
   std::vector<dirichletBC> allDirichlet;
 
 public:
-  elasticitySolver(int tag) : _tag(tag), pAssembler(0), LagSpace(0) {}
+  elasticitySolver(int tag) : _tag(tag), pAssembler(nullptr), LagSpace(nullptr) {}
 
   elasticitySolver(GModel *model, int tag);
 
diff --git a/Solver/elasticityTerm.cpp b/Solver/elasticityTerm.cpp
index 6196d4142558f6bd13cd60301ee0bd0fd7c5a462..8e4200a517602495daec835df038d952f9bdc2f9 100644
--- a/Solver/elasticityTerm.cpp
+++ b/Solver/elasticityTerm.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/elasticityTerm.h b/Solver/elasticityTerm.h
index b45b49be3a0f20c487e9087b2c2f464d45ae2207..c5046e3ae3e9fab1701c95ed6586e2adebf7d1fb 100644
--- a/Solver/elasticityTerm.h
+++ b/Solver/elasticityTerm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/femTerm.h b/Solver/femTerm.h
index dd5d009619aa266b72c3a24d7163cc3e988ba70d..375cc8d1d16a2b4e4f7280f6b8c84eb79f6be373 100644
--- a/Solver/femTerm.h
+++ b/Solver/femTerm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -53,7 +53,7 @@ public:
   void addToMatrix(dofManager<dataVec> &dm, groupOfElements &L,
                    groupOfElements &C) const
   {
-    groupOfElements::elementContainer::const_iterator it = L.begin();
+    auto it = L.begin();
     for(; it != L.end(); ++it) {
       MElement *eL = *it;
       if(&C == &L || C.find(eL)) {
@@ -147,7 +147,7 @@ public:
     std::map<int, std::vector<GEntity *> > groups[4];
     GModel *m = _gm;
     m->getPhysicalGroups(groups);
-    std::map<int, std::vector<GEntity *> >::iterator it =
+    auto it =
       groups[dim].find(physical);
     if(it == groups[dim].end()) return;
     for(std::size_t i = 0; i < it->second.size(); ++i) {
@@ -165,7 +165,7 @@ public:
     std::map<int, std::vector<GEntity *> > groups[4];
     GModel *m = _gm;
     m->getPhysicalGroups(groups);
-    std::map<int, std::vector<GEntity *> >::iterator it =
+    auto it =
       groups[dim].find(physical);
     if(it == groups[dim].end()) return;
     for(std::size_t i = 0; i < it->second.size(); ++i) {
@@ -182,7 +182,7 @@ public:
 
   void addToRightHandSide(dofManager<dataVec> &dm, groupOfElements &C) const
   {
-    groupOfElements::elementContainer::const_iterator it = C.begin();
+    auto it = C.begin();
     for(; it != C.end(); ++it) {
       MElement *eL = *it;
       SElement se(eL);
diff --git a/Solver/filters.cpp b/Solver/filters.cpp
index 2c6271a6d1da3fe8c55e6af348bbd4e6d9f5fda4..e6f984e2d3f74c743789661a65ef0ac534c7a85d 100644
--- a/Solver/filters.cpp
+++ b/Solver/filters.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/filters.h b/Solver/filters.h
index 53926cc83266e6593c3432ab22139c0c045aa35c..085ef5ca617cd144f64ff3b24fab4e547748bc91 100644
--- a/Solver/filters.h
+++ b/Solver/filters.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -80,7 +80,7 @@ public:
     groupOfElements *LevelSetElements =
       new groupOfElements(_levelSetEntity.first, _levelSetEntity.second);
     // tag enriched vertex determination
-    std::set<MElement *>::const_iterator it = LevelSetElements->begin();
+    auto it = LevelSetElements->begin();
     for(; it != LevelSetElements->end(); it++) {
       MElement *e = *it;
       if(e->getParent()) { // if element got parents
diff --git a/Solver/frameSolver.cpp b/Solver/frameSolver.cpp
index 65080927e4538c838f8099abe266aea56fef6d38..ce22b69b40542bc3cf8f2fe2db7f14933c07991a 100644
--- a/Solver/frameSolver.cpp
+++ b/Solver/frameSolver.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -17,7 +17,7 @@
 #include "PViewData.h"
 #endif
 
-frameSolver2d::frameSolver2d(GModel *gm) : pAssembler(0), _myModel(gm) {}
+frameSolver2d::frameSolver2d(GModel *gm) : pAssembler(nullptr), _myModel(gm) {}
 
 void frameSolver2d::addFixations(const std::vector<int> &dirs,
                                  const std::vector<int> &modelVertices,
@@ -180,7 +180,7 @@ void frameSolver2d::solve()
   createDofs();
 
   // force vector
-  std::vector<std::pair<GVertex *, std::vector<double> > >::iterator it =
+  auto it =
     _nodalForces.begin();
   for(; it != _nodalForces.end(); ++it) {
     MVertex *v = it->first->mesh_vertices[0];
@@ -283,7 +283,7 @@ void frameSolver2d::computeRotationTags()
   }
 
   std::multimap<MVertex *, gmshBeam2d *>::iterator s_it;
-  for(std::multimap<MVertex *, gmshBeam2d *>::iterator it = v2b.begin();
+  for(auto it = v2b.begin();
       it != v2b.end(); it = s_it) {
     MVertex *theKey = it->first;
 
diff --git a/Solver/frameSolver.h b/Solver/frameSolver.h
index 0c2851b024ab80ff87554b82ee8fc0ca1cdf7f48..1819d6444bdb83f46308d77cc28400c902e26816 100644
--- a/Solver/frameSolver.h
+++ b/Solver/frameSolver.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/functionSpace.cpp b/Solver/functionSpace.cpp
index df55723363ed448fcbbbe15f326924059d647c88..7ef46584473e5001be8fa9e6809f62082d641832 100644
--- a/Solver/functionSpace.cpp
+++ b/Solver/functionSpace.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/functionSpace.h b/Solver/functionSpace.h
index 2b778b27cce12ce228c7a4f86b8d41280944af10..0007d1805bd03641b9e9f89c1a2de8936b7939a3 100644
--- a/Solver/functionSpace.h
+++ b/Solver/functionSpace.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -75,7 +75,7 @@ public:
   }
   virtual FunctionSpaceBase *clone(const int id) const
   {
-    return NULL;
+    return nullptr;
   }; // copy space with new Id
 };
 
diff --git a/Solver/groupOfElements.cpp b/Solver/groupOfElements.cpp
index 5bfa760b328b2e5df9b3cce21c40861153baee2a..36947de0a08d10ce748210496f7d363adb5d91fc 100644
--- a/Solver/groupOfElements.cpp
+++ b/Solver/groupOfElements.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,7 +22,7 @@ groupOfElements::groupOfElements(GRegion *gr)
 groupOfElements::groupOfElements(std::vector<MElement *> &elems)
 {
   elementFilterTrivial filter;
-  for(std::vector<MElement *>::iterator it = elems.begin(); it != elems.end();
+  for(auto it = elems.begin(); it != elems.end();
       it++) {
     MElement *e = *it;
     if(filter(e)) {
diff --git a/Solver/groupOfElements.h b/Solver/groupOfElements.h
index f5c0cb2545da89511ec39e16528f2b7d2f705097..3aa402fbeb1c2216dccb33ba2027429462d6c37c 100644
--- a/Solver/groupOfElements.h
+++ b/Solver/groupOfElements.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -99,7 +99,7 @@ class groupOfLagMultElements : public groupOfElements {
 private:
   void fillElementContainer(groupOfElements &pElem, groupOfElements &sElem)
   {
-    groupOfElements::elementContainer::const_iterator itp = pElem.begin();
+    auto itp = pElem.begin();
     for(; itp != pElem.end(); itp++) {
       if((*itp)->getParent()) {
         if(sElem.find(*itp))
diff --git a/Solver/helmholtzTerm.h b/Solver/helmholtzTerm.h
index efb5d00182275393c312df92a9cc2aabe6b924dd..2927299874e708b7b3f3fe2eb133a783ae9a654b 100644
--- a/Solver/helmholtzTerm.h
+++ b/Solver/helmholtzTerm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/laplaceTerm.h b/Solver/laplaceTerm.h
index 192a96c31ae820ba7519f9c950c1aa82b9710970..8ec0ca6f3ac52ea8d9a20bc1959c102a9235ac67 100644
--- a/Solver/laplaceTerm.h
+++ b/Solver/laplaceTerm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -16,8 +16,8 @@ protected:
 
 public:
   laplaceTerm(GModel *gm, int iField, simpleFunction<double> *k,
-              std::map<MVertex *, SPoint3> *coord = NULL)
-    : helmholtzTerm<double>(gm, iField, iField, k, 0), _iField(iField),
+              std::map<MVertex *, SPoint3> *coord = nullptr)
+    : helmholtzTerm<double>(gm, iField, iField, k, nullptr), _iField(iField),
       _coordView(coord)
   {
   }
@@ -33,7 +33,7 @@ public:
     fullVector<double> val(nbSF);
     val.scale(0.);
     for(int i = 0; i < nbSF; i++) {
-      std::map<MVertex *, SPoint3>::iterator it =
+      auto it =
         _coordView->find(e->getShapeFunctionNode(i));
       SPoint3 UV = it->second;
       if(_iField == 1)
@@ -52,7 +52,7 @@ public:
 class massTerm : public helmholtzTerm<double> {
 public:
   massTerm(GModel *gm, int iField, simpleFunction<double> *a)
-    : helmholtzTerm<double>(gm, iField, iField, 0, a)
+    : helmholtzTerm<double>(gm, iField, iField, nullptr, a)
   {
   }
 };
diff --git a/Solver/linearSystem.cpp b/Solver/linearSystem.cpp
index 6d59fa410e2448c3c225e8775fedf635fee554b6..530edbe671ec601ec1a1dea2aa7b525ddf9744a8 100644
--- a/Solver/linearSystem.cpp
+++ b/Solver/linearSystem.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystem.h b/Solver/linearSystem.h
index 6f4645eb86b2fa4cdaa1a55f17bd1679d613272d..2c2c1e27f3644ff04ee9a329a93917870188911e 100644
--- a/Solver/linearSystem.h
+++ b/Solver/linearSystem.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemCSR.cpp b/Solver/linearSystemCSR.cpp
index 8901880f0f0e53b529ab615345fa57b40e661cf5..0f2318932c1c68aa23d01de91d5c41dddc9fecec 100644
--- a/Solver/linearSystemCSR.cpp
+++ b/Solver/linearSystemCSR.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -24,7 +24,7 @@
 static void *CSRMalloc(size_t size)
 {
   void *ptr;
-  if(!size) return (NULL);
+  if(!size) return (nullptr);
   ptr = malloc(size);
   return (ptr);
 }
@@ -35,7 +35,7 @@ static void CSRList_Realloc(CSRList_T *liste, int n)
 {
   char *temp;
   if(n <= 0) return;
-  if(liste->array == NULL) {
+  if(liste->array == nullptr) {
     liste->nmax = ((n - 1) / liste->incr + 1) * liste->incr;
     liste->array = (char *)CSRMalloc(liste->nmax * liste->size);
   }
@@ -69,7 +69,7 @@ static CSRList_T *CSRList_Create(int n, int incr, int size)
   liste->size = size;
   liste->n = 0;
   liste->isorder = 0;
-  liste->array = NULL;
+  liste->array = nullptr;
 
   CSRList_Realloc(liste, n);
   return (liste);
@@ -77,7 +77,7 @@ static CSRList_T *CSRList_Create(int n, int incr, int size)
 
 static void CSRList_Delete(CSRList_T *liste)
 {
-  if(liste != 0) {
+  if(liste != nullptr) {
     free(liste->array);
     free(liste);
   }
@@ -188,14 +188,14 @@ template <> void linearSystemCSR<double>::allocate(int nbRows)
   }
 
   if(nbRows == 0) {
-    _a = 0;
-    _ai = 0;
-    _ptr = 0;
-    _jptr = 0;
-    _b = 0;
-    _x = 0;
+    _a = nullptr;
+    _ai = nullptr;
+    _ptr = nullptr;
+    _jptr = nullptr;
+    _b = nullptr;
+    _x = nullptr;
     sorted = false;
-    something = 0;
+    something = nullptr;
     return;
   }
 
@@ -225,14 +225,14 @@ template <> void linearSystemCSR<std::complex<double> >::allocate(int nbRows)
   }
 
   if(nbRows == 0) {
-    _a = 0;
-    _ai = 0;
-    _ptr = 0;
-    _jptr = 0;
-    _b = 0;
-    _x = 0;
+    _a = nullptr;
+    _ai = nullptr;
+    _ptr = nullptr;
+    _jptr = nullptr;
+    _b = nullptr;
+    _x = nullptr;
     sorted = false;
-    something = 0;
+    something = nullptr;
     return;
   }
 
diff --git a/Solver/linearSystemCSR.h b/Solver/linearSystemCSR.h
index f24f525a8d497901a0a24c8492200e8a08900bf7..b616968e34b34118d28094714ab90aef72b6518c 100644
--- a/Solver/linearSystemCSR.h
+++ b/Solver/linearSystemCSR.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -39,10 +39,10 @@ public:
   int getNNZ() { return CSRList_Nbr(linearSystemCSR<scalar>::_a); }
   int getNbUnk() { return linearSystemCSR<scalar>::_b->size(); }
   linearSystemCSR()
-    : sorted(false), _entriesPreAllocated(false), _a(0), _b(0), _x(0)
+    : sorted(false), _entriesPreAllocated(false), _a(nullptr), _b(0), _x(0)
   {
   }
-  virtual bool isAllocated() const { return _a != 0; }
+  virtual bool isAllocated() const { return _a != nullptr; }
   virtual void allocate(int);
   virtual void clear() { allocate(0); }
   virtual ~linearSystemCSR() { allocate(0); }
diff --git a/Solver/linearSystemFull.h b/Solver/linearSystemFull.h
index 83c20513a5b6d6e7ce65dd319af8eb76b8dc3bd7..38c4adf073102bf54c8b12b93c66b52e0f7f33b8 100644
--- a/Solver/linearSystemFull.h
+++ b/Solver/linearSystemFull.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemGmm.h b/Solver/linearSystemGmm.h
index db5c67c7bde45fd2160b1a9d9a5d0c824289fa77..c83908503d78e0ea553550573007ed510ed2e8b0 100644
--- a/Solver/linearSystemGmm.h
+++ b/Solver/linearSystemGmm.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemMUMPS.cpp b/Solver/linearSystemMUMPS.cpp
index cc174ca92c5d8be171d309dd784b6376ed064a68..5ece3ccb38d02de92c04b2c562285fd5807d8404 100644
--- a/Solver/linearSystemMUMPS.cpp
+++ b/Solver/linearSystemMUMPS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemMUMPS.h b/Solver/linearSystemMUMPS.h
index 19c7f11da905fed2c483d444d45e0b3fb7419ed7..0af8e05538982fe76836a3ad714586650bf50c28 100644
--- a/Solver/linearSystemMUMPS.h
+++ b/Solver/linearSystemMUMPS.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemPETSc.cpp b/Solver/linearSystemPETSc.cpp
index 2d0c89075a8a9ca50f867d721f8d6a0d5f584db9..bb58b373ae160309b9aded70167a0d3941ae8c27 100644
--- a/Solver/linearSystemPETSc.cpp
+++ b/Solver/linearSystemPETSc.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemPETSc.h b/Solver/linearSystemPETSc.h
index 39580985c030c67796f2dd2d04226b46df59dda7..cabd6dee0f1b97438079c0afa51d0b86eb0cc2cb 100644
--- a/Solver/linearSystemPETSc.h
+++ b/Solver/linearSystemPETSc.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/linearSystemPETSc.hpp b/Solver/linearSystemPETSc.hpp
index 1bbc297dd6db083d5280dd9f31c0d4f08b7964b1..b8fffd3096c643c3c6804c3c4a6cef0a34695a29 100644
--- a/Solver/linearSystemPETSc.hpp
+++ b/Solver/linearSystemPETSc.hpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/materialLaw.h b/Solver/materialLaw.h
index 9be5f44521155457bcd06f90eb63ef02e53f0649..1cc4e280ed3e81b97fec8a94bc18fdddfd042930 100644
--- a/Solver/materialLaw.h
+++ b/Solver/materialLaw.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/quadratureRules.h b/Solver/quadratureRules.h
index 05c66edeb2ecc19af6dfe97c3461c253bcb2d7c9..53cdc6f5428b2e1b6525af254b7da0646cb79b12 100644
--- a/Solver/quadratureRules.h
+++ b/Solver/quadratureRules.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -28,7 +28,7 @@ public:
   ~QuadratureVoid() {}
   int getIntPoints(MElement *e, IntPt **GP)
   {
-    GP = NULL;
+    GP = nullptr;
     return 0;
   }
 };
diff --git a/Solver/solverAlgorithms.h b/Solver/solverAlgorithms.h
index fe863722f31b19ae42838568c5ab197aa5dca341..2c0f6e14628417c9bc09fc1adbbab6beb36f4051 100644
--- a/Solver/solverAlgorithms.h
+++ b/Solver/solverAlgorithms.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -253,7 +253,7 @@ public:
   virtual ~FilterDofSet() {}
   virtual bool operator()(Dof key)
   {
-    std::set<Dof>::iterator itR = _dofset.find(key);
+    auto itR = _dofset.find(key);
     if(itR == _dofset.end()) {
       return false;
     }
@@ -278,7 +278,7 @@ void FixNodalDofs(FunctionSpaceBase &space, MElement *e, Assembler &assembler,
   tabV.reserve(nv);
   for(int i = 0; i < nv; ++i) tabV.push_back(e->getVertex(i));
 
-  for(std::vector<Dof>::iterator itd = R.begin(); itd != R.end(); ++itd) {
+  for(auto itd = R.begin(); itd != R.end(); ++itd) {
     Dof key = *itd;
     if(filter(key)) {
       for(int i = 0; i < nv; ++i) {
diff --git a/Solver/solverField.h b/Solver/solverField.h
index 891a7b4a2f7dcb2172a1d54a90e8ea324644c0d1..ffad264e499a25e4f3d6f805b1e9c48e84fb67db 100644
--- a/Solver/solverField.h
+++ b/Solver/solverField.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/sparsityPattern.cpp b/Solver/sparsityPattern.cpp
index f5b3e4679e74a060fce754784248e3f2750c3e5b..2adaf4edb0e4ee40c8ccebcc51d0a2802e62dc79 100644
--- a/Solver/sparsityPattern.cpp
+++ b/Solver/sparsityPattern.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -26,9 +26,9 @@ void sparsityPattern::clear()
   if(_nByRow) free(_nByRow);
   if(_nAllocByRow) free(_nAllocByRow);
   if(_rowsj) free(_rowsj);
-  _nByRow = NULL;
-  _rowsj = NULL;
-  _nAllocByRow = NULL;
+  _nByRow = nullptr;
+  _rowsj = nullptr;
+  _nAllocByRow = nullptr;
   _nRows = 0;
   _nRowsAlloc = 0;
 }
@@ -45,7 +45,7 @@ void sparsityPattern::insertEntry(int i, int j)
     for(int k = _nRows; k <= i; k++) {
       _nByRow[k] = 0;
       _nAllocByRow[k] = 0;
-      _rowsj[k] = NULL;
+      _rowsj[k] = nullptr;
     }
     _nRows = i + 1;
   }
@@ -94,16 +94,16 @@ sparsityPattern::sparsityPattern()
 {
   _nRows = 0;
   _nRowsAlloc = 0;
-  _rowsj = NULL;
-  _nByRow = NULL;
-  _nAllocByRow = NULL;
+  _rowsj = nullptr;
+  _nByRow = nullptr;
+  _nAllocByRow = nullptr;
 }
 
 const int *sparsityPattern::getRow(int i, int &size) const
 {
   if(i >= _nRows) {
     size = 0;
-    return NULL;
+    return nullptr;
   }
   size = _nByRow[i];
   return _rowsj[i];
diff --git a/Solver/sparsityPattern.h b/Solver/sparsityPattern.h
index c47058534f4405e9d8b67032327b667b392a6591..08dda55a3c52c458c20c0fbc7d6002603719f50a 100644
--- a/Solver/sparsityPattern.h
+++ b/Solver/sparsityPattern.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/terms.cpp b/Solver/terms.cpp
index 1df1e337d4e2f35fa2ab72cf20fac78a70fd9e20..18c9821eafdb4524cf5acada13435909bfd53602 100644
--- a/Solver/terms.cpp
+++ b/Solver/terms.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/terms.h b/Solver/terms.h
index 8dc279a56151eedaa8f7ce3bb52c23212142369a..74a0954a486dc8046dd2668e7e6b8fd413261390 100644
--- a/Solver/terms.h
+++ b/Solver/terms.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/terms.hpp b/Solver/terms.hpp
index 19658d3cd2eaa77419fb6bfc4a77a9a3203dccd9..cbfd8e85a22e9889de4146557174d0270185aebd 100644
--- a/Solver/terms.hpp
+++ b/Solver/terms.hpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/Solver/thermicSolver.cpp b/Solver/thermicSolver.cpp
index f8e5499a2337e6e8937ba2d574b7a471f6e81efc..9835ab3ac43a03d1031eaaed6df20441e0f2a330 100644
--- a/Solver/thermicSolver.cpp
+++ b/Solver/thermicSolver.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -193,7 +193,7 @@ double thermicSolver::computeL2Norm(simpleFunction<double> *sol)
   double val = 0.0;
   SolverField<double> solField(pAssembler, LagSpace);
   for(std::size_t i = 0; i < thermicFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           thermicFields[i].g->begin();
         it != thermicFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -232,7 +232,7 @@ double thermicSolver::computeLagNorm(int tag, simpleFunction<double> *sol)
   SolverField<double> solField(pAssembler, LagrangeMultiplierSpace);
   for(std::size_t i = 0; i < LagrangeMultiplierFields.size(); ++i) {
     if(tag != LagrangeMultiplierFields[i]._tag) continue;
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           LagrangeMultiplierFields[i].g->begin();
         it != LagrangeMultiplierFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -275,7 +275,7 @@ PView *thermicSolver::buildTemperatureView(const std::string postFileName)
   std::set<MVertex *> v;
   std::map<MVertex *, MElement *> vCut;
   for(std::size_t i = 0; i < thermicFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           thermicFields[i].g->begin();
         it != thermicFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -293,7 +293,7 @@ PView *thermicSolver::buildTemperatureView(const std::string postFileName)
   }
   std::map<int, std::vector<double> > data;
   SolverField<double> Field(pAssembler, LagSpace);
-  for(std::set<MVertex *>::iterator it = v.begin(); it != v.end(); ++it) {
+  for(auto it = v.begin(); it != v.end(); ++it) {
     double val;
     MPoint p(*it);
     Field.f(&p, 0, 0, 0, val); // printf("valv=%g\n",val);
@@ -301,7 +301,7 @@ PView *thermicSolver::buildTemperatureView(const std::string postFileName)
     vec.push_back(val);
     data[(*it)->getNum()] = vec;
   }
-  for(std::map<MVertex *, MElement *>::iterator it = vCut.begin();
+  for(auto it = vCut.begin();
       it != vCut.end(); ++it) {
     double val;
     double uvw[3];
@@ -324,7 +324,7 @@ thermicSolver::buildLagrangeMultiplierView(const std::string &postFileName)
   if(!LagrangeMultiplierSpace) return new PView();
   std::set<MVertex *> v;
   for(std::size_t i = 0; i < LagrangeMultiplierFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           LagrangeMultiplierFields[i].g->begin();
         it != LagrangeMultiplierFields[i].g->end(); ++it) {
       MElement *e = *it;
@@ -334,7 +334,7 @@ thermicSolver::buildLagrangeMultiplierView(const std::string &postFileName)
   }
   std::map<int, std::vector<double> > data;
   SolverField<double> Field(pAssembler, LagrangeMultiplierSpace);
-  for(std::set<MVertex *>::iterator it = v.begin(); it != v.end(); ++it) {
+  for(auto it = v.begin(); it != v.end(); ++it) {
     double val;
     MPoint p(*it);
     Field.f(&p, 0, 0, 0, val);
@@ -354,7 +354,7 @@ PView *thermicSolver::buildErrorEstimateView(const std::string &errorFileName,
 
   SolverField<double> solField(pAssembler, LagSpace);
   for(std::size_t i = 0; i < thermicFields.size(); ++i) {
-    for(groupOfElements::elementContainer::const_iterator it =
+    for(auto it =
           thermicFields[i].g->begin();
         it != thermicFields[i].g->end(); ++it) {
       MElement *e = *it;
diff --git a/Solver/thermicSolver.h b/Solver/thermicSolver.h
index df51a59645d0b964dbe6963ee0dbd8a498650108..ed8ee32b98bc49f9ce9b5b69bf206c52e37e826c 100644
--- a/Solver/thermicSolver.h
+++ b/Solver/thermicSolver.h
@@ -24,14 +24,14 @@ struct LagrangeMultiplierFieldT {
   groupOfElements *g;
   double _tau;
   simpleFunction<double> *_f;
-  LagrangeMultiplierFieldT() : _tag(0), g(0) {}
+  LagrangeMultiplierFieldT() : _tag(0), g(nullptr) {}
 };
 
 struct thermicField {
   int _tag; // tag for the dofManager
   groupOfElements *g; // support for this field
   double _k; // diffusivity
-  thermicField() : _tag(0), g(0) {}
+  thermicField() : _tag(0), g(nullptr) {}
 };
 
 struct BoundaryConditionT {
@@ -39,17 +39,17 @@ struct BoundaryConditionT {
   enum location { UNDEF, ON_VERTEX, ON_EDGE, ON_FACE, ON_VOLUME };
   location onWhat; // on vertices or elements
   groupOfElements *g; // support for this BC
-  BoundaryConditionT() : _tag(0), onWhat(UNDEF), g(0) {}
+  BoundaryConditionT() : _tag(0), onWhat(UNDEF), g(nullptr) {}
 };
 
 struct dirichletBCT : public BoundaryConditionT {
   simpleFunction<double> *_f;
-  dirichletBCT() : BoundaryConditionT(), _f(0) {}
+  dirichletBCT() : BoundaryConditionT(), _f(nullptr) {}
 };
 
 struct neumannBCT : public BoundaryConditionT {
   simpleFunction<double> *_f;
-  neumannBCT() : BoundaryConditionT(), _f(0) {}
+  neumannBCT() : BoundaryConditionT(), _f(nullptr) {}
 };
 // a thermic solver ...
 class thermicSolver {
@@ -70,7 +70,7 @@ protected:
 
 public:
   thermicSolver(int tag)
-    : _tag(tag), pAssembler(0), LagSpace(0), LagrangeMultiplierSpace(0)
+    : _tag(tag), pAssembler(nullptr), LagSpace(nullptr), LagrangeMultiplierSpace(nullptr)
   {
   }
 
diff --git a/api/GenApi.py b/api/GenApi.py
index 8f042b3948544ab7d2a6ce474de15e1680da2b24..f3cf8350ae3564d92bcb2c7d1ae1839daae096e7 100644
--- a/api/GenApi.py
+++ b/api/GenApi.py
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -1259,7 +1259,7 @@ class API:
         version_patch,
         namespace="gmsh",
         code="Gmsh",
-        copyright="Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle",
+        copyright="Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle",
         issues="https://gitlab.onelab.info/gmsh/gmsh/issues."):
         self.version_major = version_major
         self.version_minor = version_minor
diff --git a/api/gen.py b/api/gen.py
index bc7687b41fe25ba5046cd86fbc708608990b0904..b8ce25e7fc576beec370b0afad0cc85b568e48cc 100644
--- a/api/gen.py
+++ b/api/gen.py
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/api/gmsh.h b/api/gmsh.h
index b9021d4418536283c0483a8f4a9f9b6b0f4ffabf..b1a6544fda39868c17dbcaa8af5912c123dab290 100644
--- a/api/gmsh.h
+++ b/api/gmsh.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/api/gmsh.h_cwrap b/api/gmsh.h_cwrap
index 5d1d6bd93f58db368d8c9593b39d34d923af64fd..24fb1a228a87b73835bc209a3dc007b25f166f55 100644
--- a/api/gmsh.h_cwrap
+++ b/api/gmsh.h_cwrap
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/api/gmsh.jl b/api/gmsh.jl
index cf80feeae27feed831ea831def80373d04fe34a3..63dce76180195247e0fff9d50fa5d5ea05e52df1 100644
--- a/api/gmsh.jl
+++ b/api/gmsh.jl
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/api/gmsh.py b/api/gmsh.py
index 1983646e0118985669bd067495dea113082c94fc..0074db45545e085eedad87b133cc93ce253f7c4e 100644
--- a/api/gmsh.py
+++ b/api/gmsh.py
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/api/gmshc.cpp b/api/gmshc.cpp
index 817373757123ca02cff8fad786fe264935bf9572..878d8f93d1a65e75a7fc04065074f2a988a09fe2 100644
--- a/api/gmshc.cpp
+++ b/api/gmshc.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/api/gmshc.h b/api/gmshc.h
index 2aa393010e9578a7f293df23e8c2f42088a9854c..9f17b0f7edac068c1bb278a8683ed6bfb4d655c8 100644
--- a/api/gmshc.h
+++ b/api/gmshc.h
@@ -1,5 +1,5 @@
 /*
- * Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+ * Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
  *
  * See the LICENSE.txt file for license information. Please report all
  * issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/ANN/CMakeLists.txt b/contrib/ANN/CMakeLists.txt
index 386e594e09edd4f715be6d90557210877f4a9313..022efd22e54fac87b54d2696c8482f619f12da28 100644
--- a/contrib/ANN/CMakeLists.txt
+++ b/contrib/ANN/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/DiscreteIntegration/CMakeLists.txt b/contrib/DiscreteIntegration/CMakeLists.txt
index e9939879a132f8f57a0b91cf1dc034add8e61df8..534e7fcbae9b7fb101f31e1f84fab7e7f8cd8326 100644
--- a/contrib/DiscreteIntegration/CMakeLists.txt
+++ b/contrib/DiscreteIntegration/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver.h b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver.h
index f707f8ce6dc9b53ba470e208fc90cea61f451192..569700e2b116cfab24e930721d6c15c2b746e76e 100644
--- a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver.h
+++ b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver.h
@@ -201,7 +201,7 @@ namespace BoundaryLayerCurver {
 
 // BL in planar surface (always prefer this one if possible)
 void curve2DBoundaryLayer(VecPairMElemVecMElem &bndEl2column, SVector3 normal,
-                          const GEdge *edge = NULL);
+                          const GEdge *edge = nullptr);
 
 // BL on CAD surface
 void curve2DBoundaryLayer(VecPairMElemVecMElem &bndEl2column, const GFace *,
diff --git a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver2D.cpp b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver2D.cpp
index f401139146de26358b47c8f4373abc7bd52066dd..c8d2c02dc97b7dc3367c94787e059a871080606f 100644
--- a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver2D.cpp
+++ b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver2D.cpp
@@ -75,7 +75,7 @@ namespace {
   {
     const int nVert = controlPoints.getNumCoeff();
 
-    MVertex *previous = NULL;
+    MVertex *previous = nullptr;
     for(int i = 0; i < nVert; ++i) {
       MVertex *v = new MVertex(controlPoints(i, 0), controlPoints(i, 1),
                                controlPoints(i, 2), gedge);
@@ -89,7 +89,7 @@ namespace {
   }
 
   void drawBezierControlPolygon(const std::vector<MVertex *> &vertices,
-                                GEdge *gedge = NULL)
+                                GEdge *gedge = nullptr)
   {
     if(!gedge) {
       gedge = *GModel::current()->firstEdge();
@@ -124,7 +124,7 @@ namespace {
   }
 
   void draw3DFrame(SPoint3 &p, SVector3 &t, SVector3 &n, SVector3 &w,
-                   double unitDimension, GFace *gFace = NULL)
+                   double unitDimension, GFace *gFace = nullptr)
   {
     return;
     if(!gFace) gFace = *GModel::current()->firstFace();
@@ -353,7 +353,7 @@ namespace BoundaryLayerCurver {
                                 double coeffs[2][3], GEdge *gedge)
     {
       int N = 100;
-      MVertex *previous = NULL;
+      MVertex *previous = nullptr;
 
       for(int i = 0; i < N + 1; ++i) {
         const double u = (double)i / N * 2 - 1;
@@ -1190,7 +1190,7 @@ namespace BoundaryLayerCurver {
     const std::vector<MElement *> &stackElements = column.second;
     int numVertexPerLayer = 2;
     unsigned long numLayers = stackElements.size();
-    stack.assign(numVertexPerLayer * numLayers, NULL);
+    stack.assign(numVertexPerLayer * numLayers, nullptr);
 
     int k = 0;
     for(int i = 0; i < numVertexPerLayer; ++i) {
@@ -1231,7 +1231,7 @@ namespace BoundaryLayerCurver {
       // If there remains NULL values, it is because the vertex is the same
       // on bottom face and top face.
       for(int l = k; l < k + numVertexPerLayer; ++l) {
-        if(stack[l] == NULL) {
+        if(stack[l] == nullptr) {
           stack[l] = stack[l - numVertexPerLayer];
         }
       }
@@ -1504,7 +1504,7 @@ void curve2DBoundaryLayer(VecPairMElemVecMElem &bndEl2column, SVector3 normal,
     //    symetric of concave if (bndEl2column[i].first->getNum() != 1156)
     //    continue; // Strange if (bndEl2column[i].first->getNum() != 1157)
     //    continue; // next to Strange
-    BoundaryLayerCurver::curve2Dcolumn(bndEl2column[i], NULL, gedge, normal);
+    BoundaryLayerCurver::curve2Dcolumn(bndEl2column[i], nullptr, gedge, normal);
   }
 }
 
diff --git a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp
index 298d492724fc93a28f727243cf2c0869d026e98b..63af1cc52197f07a8353a0f1831de5fbe74ddb22 100644
--- a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp
+++ b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp
@@ -98,7 +98,7 @@ namespace {
   {
     int N = 40;
 
-    MVertex *previous = NULL;
+    MVertex *previous = nullptr;
 
     for(int i = 0; i < N + 1; ++i) {
       const double u = (double)i / N * 2 - 1;
@@ -163,38 +163,38 @@ namespace {
 
 namespace BoundaryLayerCurver {
   namespace InnerVertPlacementMatrices {
-    fullMatrix<double> *_triangle[10] = {NULL, NULL, NULL, NULL, NULL,
-                                         NULL, NULL, NULL, NULL, NULL};
-    fullMatrix<double> *_quadrangle[10] = {NULL, NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL, NULL, NULL};
-    fullMatrix<double> *_linearTriangle0[10] = {NULL, NULL, NULL, NULL, NULL,
-                                                NULL, NULL, NULL, NULL, NULL};
-    fullMatrix<double> *_linearTriangle2[10] = {NULL, NULL, NULL, NULL, NULL,
-                                                NULL, NULL, NULL, NULL, NULL};
-    fullMatrix<double> *_linearQuadrangle[10] = {NULL, NULL, NULL, NULL, NULL,
-                                                 NULL, NULL, NULL, NULL, NULL};
-    fullMatrix<double> *_hexahedron[10] = {NULL, NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL, NULL, NULL};
+    fullMatrix<double> *_triangle[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                         nullptr, nullptr, nullptr, nullptr, nullptr};
+    fullMatrix<double> *_quadrangle[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                           nullptr, nullptr, nullptr, nullptr, nullptr};
+    fullMatrix<double> *_linearTriangle0[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                                nullptr, nullptr, nullptr, nullptr, nullptr};
+    fullMatrix<double> *_linearTriangle2[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                                nullptr, nullptr, nullptr, nullptr, nullptr};
+    fullMatrix<double> *_linearQuadrangle[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                                 nullptr, nullptr, nullptr, nullptr, nullptr};
+    fullMatrix<double> *_hexahedron[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                           nullptr, nullptr, nullptr, nullptr, nullptr};
     fullMatrix<double> *_linearHexahedron[3][10] = {
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
-    fullMatrix<double> *_prism[10] = {NULL, NULL, NULL, NULL, NULL,
-                                      NULL, NULL, NULL, NULL, NULL};
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}};
+    fullMatrix<double> *_prism[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                      nullptr, nullptr, nullptr, nullptr, nullptr};
     fullMatrix<double> *_linearPrism[4][10] = {
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
-    fullMatrix<double> *_tetrahedron[10] = {NULL, NULL, NULL, NULL, NULL,
-                                            NULL, NULL, NULL, NULL, NULL};
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}};
+    fullMatrix<double> *_tetrahedron[10] = {nullptr, nullptr, nullptr, nullptr, nullptr,
+                                            nullptr, nullptr, nullptr, nullptr, nullptr};
     fullMatrix<double> *_linearTet[6][10] = {
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-      {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr},
+      {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}};
 
     const fullMatrix<double> *triangle(int order, bool linear, int edge)
     {
@@ -440,7 +440,7 @@ namespace BoundaryLayerCurver {
       MElement *el = bndEl2column[i].first;
       for(std::size_t j = 0; j < el->getNumEdges(); ++j) {
         MEdge e = el->getEdge(j);
-        std::map<MEdge, int, MEdgeLessThan>::iterator it = edge2element.find(e);
+        auto it = edge2element.find(e);
         if(it != edge2element.end()) {
           adjacencies.push_back(std::make_pair(i, it->second));
           // This is for debug purpose, we expect that two elements at most
@@ -527,7 +527,7 @@ namespace BoundaryLayerCurver {
   {
     int numVertexPerLayer = c1.first->getNumPrimaryVertices();
     std::size_t numLayers = c1.second.size();
-    stack.assign(numVertexPerLayer * numLayers, NULL);
+    stack.assign(numVertexPerLayer * numLayers, nullptr);
 
     int k = 0;
     for(int i = 0; i < numVertexPerLayer; ++i) {
@@ -570,7 +570,7 @@ namespace BoundaryLayerCurver {
       // If there remains NULL values, it is because the vertex is the same
       // on bottom face and top face.
       for(int l = k; l < k + numVertexPerLayer; ++l) {
-        if(stack[l] == NULL) stack[l] = stack[l - numVertexPerLayer];
+        if(stack[l] == nullptr) stack[l] = stack[l - numVertexPerLayer];
       }
 
       k += numVertexPerLayer;
@@ -659,10 +659,10 @@ namespace BoundaryLayerCurver {
       }
       if(v2 == v1) {
         v2 = v3;
-        v3 = NULL;
+        v3 = nullptr;
       }
       else if(v3 == v0) {
-        v3 = NULL;
+        v3 = nullptr;
       }
       interface.push_back(
         stackElements[i]->getHighOrderFace(MFace(v0, v1, v2, v3)));
@@ -757,7 +757,7 @@ namespace BoundaryLayerCurver {
                          const MEdgeN &baseEdge,
                          const Parameters3DCurve &parameters, int nbPoints,
                          const IntPt *points, fullMatrix<double> &xyz,
-                         int triDirection = 0, const GFace *gFace = NULL)
+                         int triDirection = 0, const GFace *gFace = nullptr)
   {
     //  static int ITER = 0;
     //  ++ITER;
@@ -971,7 +971,7 @@ namespace BoundaryLayerCurver {
   {
     for(std::size_t i = 0; i < column.size(); ++i) {
       MFaceN &f = column[i];
-      const fullMatrix<double> *placement = NULL;
+      const fullMatrix<double> *placement = nullptr;
       if(f.isTriangular()) {
         // TODO Determine if edge 0 or 2
       }
@@ -1182,7 +1182,7 @@ namespace BoundaryLayerCurver {
     // TODO: reposition last elements
     for(std::size_t i = 0; i < column.size() - 1; ++i) {
       MElement *el = column[i];
-      const fullMatrix<double> *placement = NULL;
+      const fullMatrix<double> *placement = nullptr;
       const int order = el->getPolynomialOrder();
       int nFace, nOtherFace, sign, rot;
       switch(el->getType()) {
diff --git a/contrib/HighOrderMeshOptimizer/CMakeLists.txt b/contrib/HighOrderMeshOptimizer/CMakeLists.txt
index e54aba169cc6b924a75006524d7ec487c9a864dd..948f8b96c65cd3e36d8b6c21cc196c2cb59388e5 100644
--- a/contrib/HighOrderMeshOptimizer/CMakeLists.txt
+++ b/contrib/HighOrderMeshOptimizer/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.cpp b/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.cpp
index 39a684d0cd1570b8cc8f272f43683e531d2c3079..a9703398d564584035ed21a77da1dd63967ea43c 100644
--- a/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.cpp
+++ b/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.cpp
@@ -63,7 +63,7 @@ void HighOrderMeshElasticAnalogy(GModel *m, bool onlyVisible)
   double worst;
   checkHighOrderTriangles("Surface mesh", m, bad, worst);
   {
-    for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+    for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
       if(onlyVisible && !(*it)->getVisibility()) continue;
       std::vector<MElement *> v;
       v.insert(v.begin(), (*it)->triangles.begin(), (*it)->triangles.end());
@@ -78,7 +78,7 @@ void HighOrderMeshElasticAnalogy(GModel *m, bool onlyVisible)
 
   checkHighOrderTetrahedron("Volume mesh", m, bad, worst);
   {
-    for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) {
+    for(auto it = m->firstRegion(); it != m->lastRegion(); ++it) {
       if(onlyVisible && !(*it)->getVisibility()) continue;
       std::vector<MElement *> v;
       v.insert(v.begin(), (*it)->tetrahedra.begin(), (*it)->tetrahedra.end());
@@ -100,7 +100,7 @@ void highOrderTools::_moveToStraightSidedLocation(MElement *e) const
 {
   for(int i = 0; i < e->getNumVertices(); i++) {
     MVertex *v = e->getVertex(i);
-    std::map<MVertex *, SVector3>::const_iterator it =
+    auto it =
       _straightSidedLocation.find(v);
     if(it != _straightSidedLocation.end()) {
       v->x() = it->second.x();
@@ -218,14 +218,14 @@ void highOrderTools::ensureMinimumDistorsion(double threshold)
 {
   std::vector<MElement *> v;
   if(_dim == 2) {
-    for(GModel::fiter fit = _gm->firstFace(); fit != _gm->lastFace(); ++fit) {
+    for(auto fit = _gm->firstFace(); fit != _gm->lastFace(); ++fit) {
       v.insert(v.begin(), (*fit)->triangles.begin(), (*fit)->triangles.end());
       v.insert(v.begin(), (*fit)->quadrangles.begin(),
                (*fit)->quadrangles.end());
     }
   }
   else if(_dim == 3) {
-    for(GModel::riter rit = _gm->firstRegion(); rit != _gm->lastRegion();
+    for(auto rit = _gm->firstRegion(); rit != _gm->lastRegion();
         ++rit) {
       v.insert(v.begin(), (*rit)->hexahedra.begin(), (*rit)->hexahedra.end());
       v.insert(v.begin(), (*rit)->tetrahedra.begin(), (*rit)->tetrahedra.end());
@@ -285,7 +285,7 @@ void highOrderTools::applySmoothingTo(std::vector<MElement *> &all, GFace *gf)
   // compute the straight sided positions of high order nodes that are
   // on the edges of the face in the UV plane
   dofManager<double> myAssembler(lsys);
-  elasticityTerm El(0, 1.0, CTX::instance()->mesh.hoPoissonRatio, _tag);
+  elasticityTerm El(nullptr, 1.0, CTX::instance()->mesh.hoPoissonRatio, _tag);
   std::vector<MElement *> layer, v;
   double minD;
   getDistordedElements(all, CTX::instance()->mesh.hoThresholdMin, v, minD);
@@ -454,7 +454,7 @@ void highOrderTools::_computeStraightSidedPositions()
   // that are NOT always on curves and surfaces
 
   // points classified on model vertices shall not move !
-  for(GModel::viter it = _gm->firstVertex(); it != _gm->lastVertex(); ++it) {
+  for(auto it = _gm->firstVertex(); it != _gm->lastVertex(); ++it) {
     if((*it)->points.size()) {
       MPoint *p = (*it)->points[0];
       MVertex *v = p->getVertex(0);
@@ -465,7 +465,7 @@ void highOrderTools::_computeStraightSidedPositions()
 
   // compute stright sided positions of vertices that are classified on model
   // edges
-  for(GModel::eiter it = _gm->firstEdge(); it != _gm->lastEdge(); ++it) {
+  for(auto it = _gm->firstEdge(); it != _gm->lastEdge(); ++it) {
     for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
       MLine *l = (*it)->lines[i];
       int N = l->getNumVertices() - 2;
@@ -491,7 +491,7 @@ void highOrderTools::_computeStraightSidedPositions()
 
   // compute stright sided positions of vertices that are classified on model
   // faces
-  for(GModel::fiter it = _gm->firstFace(); it != _gm->lastFace(); ++it) {
+  for(auto it = _gm->firstFace(); it != _gm->lastFace(); ++it) {
     for(std::size_t i = 0; i < (*it)->mesh_vertices.size(); i++) {
       MVertex *v = (*it)->mesh_vertices[i];
       _targetLocation[v] = SVector3(v->x(), v->y(), v->z());
@@ -527,7 +527,7 @@ void highOrderTools::_computeStraightSidedPositions()
     }
   }
 
-  for(GModel::riter it = _gm->firstRegion(); it != _gm->lastRegion(); ++it) {
+  for(auto it = _gm->firstRegion(); it != _gm->lastRegion(); ++it) {
     for(std::size_t i = 0; i < (*it)->mesh_vertices.size(); i++) {
       MVertex *v = (*it)->mesh_vertices[i];
       _targetLocation[v] = SVector3(v->x(), v->y(), v->z());
@@ -617,8 +617,8 @@ double highOrderTools::_applyIncrementalDisplacement(
   // assume that the mesh is OK, yet already curved
   Msg::Info("Generating elastic system...");
   dofManager<double> myAssembler(lsys);
-  elasticityMixedTerm El_mixed(0, 1.0, .333, _tag);
-  elasticityTerm El(0, 1.0, .333, _tag);
+  elasticityMixedTerm El_mixed(nullptr, 1.0, .333, _tag);
+  elasticityTerm El(nullptr, 1.0, .333, _tag);
 
   std::set<MVertex *, MVertexPtrLessThan> _vertices;
 
@@ -642,10 +642,10 @@ double highOrderTools::_applyIncrementalDisplacement(
     }
   }
 
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = _vertices.begin();
+  for(auto it = _vertices.begin();
       it != _vertices.end(); ++it) {
     MVertex *vert = *it;
-    std::map<MVertex *, SVector3>::iterator itt = _targetLocation.find(vert);
+    auto itt = _targetLocation.find(vert);
     // impose displacement @ boundary
     if(itt != _targetLocation.end() && vert->onWhat()->dim() < _dim) {
       myAssembler.fixVertex(vert, 0, _tag, itt->second.x() - vert->x());
@@ -688,7 +688,7 @@ double highOrderTools::_applyIncrementalDisplacement(
   //fprintf(fd, "$MeshFormat\n2 0 8\n$EndMeshFormat\n$NodeData\n1\n"
   //            "\"tr(sigma)\"\n1\n0.0\n3\n1\n3\n%d\n",
   //            (int)_vertices.size());
-  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = _vertices.begin();
+  for(auto it = _vertices.begin();
       it != _vertices.end(); ++it) {
     double ax, ay, az;
     myAssembler.getDofValue(*it, 0, _tag, ax);
@@ -713,7 +713,7 @@ double highOrderTools::_applyIncrementalDisplacement(
     getDistordedElements(v, 0.5, disto, minD);
     if(minD < thres) {
       percentage -= 10.;
-      for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = _vertices.begin();
+      for(auto it = _vertices.begin();
           it != _vertices.end(); ++it) {
         double ax, ay, az;
         myAssembler.getDofValue(*it, 0, _tag, ax);
@@ -800,7 +800,7 @@ void printJacobians(GModel *m, const char *nm)
 
   FILE *f = Fopen(nm, "w");
   fprintf(f, "View \"\"{\n");
-  for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) {
+  for(auto it = m->firstFace(); it != m->lastFace(); ++it) {
     for(std::size_t j = 0; j < (*it)->triangles.size(); j++) {
       MTriangle *t = (*it)->triangles[j];
       for(int i = 0; i < n; i++) {
diff --git a/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.h b/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.h
index f7d5d368b2385a8264c3aa19aaee71624f20799a..461a7ff0d2113723311418b905901219e694e610 100644
--- a/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.h
+++ b/contrib/HighOrderMeshOptimizer/HighOrderMeshElasticAnalogy.h
@@ -83,7 +83,7 @@ public:
                           bool mixed);
   inline SVector3 getSSL(MVertex *v) const
   {
-    std::map<MVertex *, SVector3>::const_iterator it =
+    auto it =
       _straightSidedLocation.find(v);
     if(it != _straightSidedLocation.end())
       return it->second;
@@ -92,7 +92,7 @@ public:
   }
   inline SVector3 getTL(MVertex *v) const
   {
-    std::map<MVertex *, SVector3>::const_iterator it = _targetLocation.find(v);
+    auto it = _targetLocation.find(v);
     if(it != _targetLocation.end())
       return it->second;
     else
diff --git a/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp b/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp
index 4a61d1fa6e52c68e66a825706f98396d432aa8c5..cd06ca8a8395a138c491e4d49eb6769167d5157e 100644
--- a/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp
+++ b/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp
@@ -225,12 +225,12 @@ namespace {
   {
     const double maxDP = std::cos(p.maxAngle);
 
-    MElement *el = 0;
+    MElement *el = nullptr;
 
     for(int iLayer = 0; iLayer < p.maxNumLayers; iLayer++) {
       std::vector<MElement *> newElts = ed2el[elBaseEd];
       if((iLayer > 0) && (newElts.size() < 2)) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el = (newElts[0] == el) ? newElts[1] : newElts[0];
@@ -256,13 +256,13 @@ namespace {
     const double maxDP = std::cos(p.maxAngle);
     const double maxDPIn = std::cos(p.maxAngleInner);
 
-    MElement *el0 = 0, *el1 = 0;
+    MElement *el0 = nullptr, *el1 = nullptr;
 
     for(int iLayer = 0; iLayer < p.maxNumLayers; iLayer++) {
       // Get first element in layer
       std::vector<MElement *> newElts0 = ed2el[elBaseEd];
       if((iLayer > 0) && (newElts0.size() < 2)) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el0 = (newElts0[0] == el1) ? newElts0[1] : newElts0[0];
@@ -278,7 +278,7 @@ namespace {
       // Get second element in layer
       std::vector<MElement *> newElts1 = ed2el[elTopEd0];
       if(newElts1.size() < 2) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el1 = (newElts1[0] == el0) ? newElts1[1] : newElts1[0];
@@ -455,22 +455,22 @@ namespace {
     // Build top face from max face (with right correspondance)
     MVertex *maxVert[3] = {elMaxFace.getVertex(0), elMaxFace.getVertex(1),
                            elMaxFace.getVertex(2)};
-    std::vector<MVertex *> topVert(3, static_cast<MVertex *>(0));
+    std::vector<MVertex *> topVert(3, static_cast<MVertex *>(nullptr));
     // Two vertices of elTopFace are those of elMaxFace coinciding with
     // elBaseFace
     for(int iBaseV = 0; iBaseV < 3; iBaseV++)
       for(int iMaxV = 0; iMaxV < 3; iMaxV++)
         if(elBaseFace.getVertex(iBaseV) == maxVert[iMaxV]) {
           topVert[iBaseV] = maxVert[iMaxV];
-          maxVert[iMaxV] = 0;
+          maxVert[iMaxV] = nullptr;
         }
     // Set last vertex of elTopFace as remaining vertex in elMaxFace
-    MVertex *thirdMaxVert = (maxVert[0] != 0) ?
+    MVertex *thirdMaxVert = (maxVert[0] != nullptr) ?
                               maxVert[0] :
-                              (maxVert[1] != 0) ? maxVert[1] : maxVert[2];
-    if(topVert[0] == 0)
+                              (maxVert[1] != nullptr) ? maxVert[1] : maxVert[2];
+    if(topVert[0] == nullptr)
       topVert[0] = thirdMaxVert;
-    else if(topVert[1] == 0)
+    else if(topVert[1] == nullptr)
       topVert[1] = thirdMaxVert;
     else
       topVert[2] = thirdMaxVert;
@@ -485,13 +485,13 @@ namespace {
     const double maxDP = std::cos(p.maxAngle);
     const double maxDPIn = std::cos(p.maxAngleInner);
 
-    MElement *el0 = 0, *el1 = 0, *el2 = 0;
+    MElement *el0 = nullptr, *el1 = nullptr, *el2 = nullptr;
 
     for(int iLayer = 0; iLayer < p.maxNumLayers; iLayer++) {
       // Get first element in layer
       std::vector<MElement *> newElts0 = face2el[elBaseFace];
       if((iLayer > 0) && (newElts0.size() < 2)) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el0 = (newElts0[0] == el2) ? newElts0[1] : newElts0[0];
@@ -508,7 +508,7 @@ namespace {
       // Get second element in layer
       std::vector<MElement *> newElts1 = face2el[elTopFace0];
       if(newElts1.size() < 2) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el1 = (newElts1[0] == el0) ? newElts1[1] : newElts1[0];
@@ -523,7 +523,7 @@ namespace {
       // Get third element in layer
       std::vector<MElement *> newElts2 = face2el[elTopFace1];
       if(newElts2.size() < 2) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el2 = (newElts2[0] == el1) ? newElts2[1] : newElts2[0];
@@ -557,12 +557,12 @@ namespace {
   {
     const double maxDP = std::cos(p.maxAngle);
 
-    MElement *el = 0;
+    MElement *el = nullptr;
 
     for(int iLayer = 0; iLayer < p.maxNumLayers; iLayer++) {
       std::vector<MElement *> newElts = face2el[elBaseFace];
       if((iLayer > 0) && (newElts.size() < 2)) {
-        aboveElt = 0;
+        aboveElt = nullptr;
         break;
       }
       el = (newElts[0] == el) ? newElts[1] : newElts[0];
@@ -599,7 +599,7 @@ namespace {
     el->getFaceInfo(baseFace, iFirstElFace, iDum, iDum);
     el->getFaceVertices(iFirstElFace, baseVert);
     MFace elBaseFace(baseVert[0], baseVert[1], baseVert[2],
-                     (nbBaseFaceVert == 3) ? 0 : baseVert[3]);
+                     (nbBaseFaceVert == 3) ? nullptr : baseVert[3]);
 
     // Sweep column upwards by choosing largest faces in each element
     if(nbBaseFaceVert == 3) {
@@ -690,7 +690,7 @@ namespace {
       fprintf(fp, "$MeshFormat\n2.2 0 8\n$EndMeshFormat\n");
       fprintf(fp, "$Nodes\n");
       fprintf(fp, "%d\n", vert_.size());
-      for(std::set<MVertex *>::iterator itV = vert_.begin(); itV != vert_.end();
+      for(auto itV = vert_.begin(); itV != vert_.end();
           ++itV) {
         SPoint3 p = (*itV)->point();
         fprintf(fp, "%i %g %g %g\n", (*itV)->getNum(), p.x(), p.y(), p.z());
@@ -977,7 +977,7 @@ namespace {
     metaElt.setCurvedTop(deformFact);
     std::set<MVertex *> movedVertDum;
     curveElement(metaElt, movedVertDum, lastElt);
-    if(aboveElt == 0) return 1.;
+    if(aboveElt == nullptr) return 1.;
     double minJacDet, maxJacDet;
     jacobianBasedQuality::minMaxJacobianDeterminant(aboveElt, minJacDet,
                                                     maxJacDet);
@@ -1054,7 +1054,7 @@ namespace {
     bool foundCol;
     std::vector<MVertex *> baseVert, topPrimVert;
     std::vector<MElement *> blob;
-    MElement *aboveElt = 0;
+    MElement *aboveElt = nullptr;
     if(bndType == TYPE_LIN) { // 1D boundary
       MVertex *vb0 = bndElt->getVertex(0);
       MVertex *vb1 = bndElt->getVertex(1);
@@ -1073,7 +1073,7 @@ namespace {
         metaElType = TYPE_HEX;
       }
       else {
-        vb3 = 0;
+        vb3 = nullptr;
         metaElType = TYPE_PRI;
       }
       MFace baseFace(vb0, vb1, vb2, vb3);
@@ -1085,7 +1085,7 @@ namespace {
     // DbgOutputCol dbgOutCol;
     // dbgOutCol.addBlob(blob);
     // dbgOutCol.write("col_KO", bndElt->getNum());
-    if(aboveElt == 0)
+    if(aboveElt == nullptr)
       std::cout << "DBGTT: aboveElt = 0 for bnd. elt. " << bndElt->getNum()
                 << std::endl;
     curveColumn(p, ent, bndEnt, metaElType, baseVert, topPrimVert, aboveElt,
@@ -1105,13 +1105,13 @@ namespace {
     std::vector<std::pair<MElement *, std::vector<MElement *> > > bndEl2column;
     std::vector<MElement *> aboveElements;
 
-    std::list<MElement *>::iterator it = bndElts.begin();
+    auto it = bndElts.begin();
     while(it != bndElts.end()) {
       MElement *bndEl = *it;
       const int bndType = bndEl->getType();
       bool foundCol;
       std::vector<MVertex *> baseVert, topPrimVert;
-      MElement *aboveElt = 0;
+      MElement *aboveElt = nullptr;
 
       if(bndType == TYPE_LIN) { // 1D boundary
         MVertex *vb0 = bndEl->getVertex(0);
@@ -1120,7 +1120,7 @@ namespace {
 
         // Check if baseEd is adjacent to an element of the face
         // (the contrary can happen with degenerate edge, see fix b91a1b822)
-        MEdgeVecMEltMap::iterator myit = ed2el.find(baseEd);
+        auto myit = ed2el.find(baseEd);
         if(myit == ed2el.end()) {
           ++it;
           continue;
@@ -1129,7 +1129,7 @@ namespace {
         std::vector<MElement *> vec;
         bndEl2column.push_back(
           std::make_pair(bndEl, std::vector<MElement *>()));
-        aboveElements.push_back(NULL);
+        aboveElements.push_back(nullptr);
         foundCol =
           getColumn2D(ed2el, p, baseEd, baseVert, topPrimVert,
                       bndEl2column.back().second, aboveElements.back());
@@ -1138,12 +1138,12 @@ namespace {
         MVertex *vb0 = bndEl->getVertex(0);
         MVertex *vb1 = bndEl->getVertex(1);
         MVertex *vb2 = bndEl->getVertex(2);
-        MVertex *vb3 = NULL;
+        MVertex *vb3 = nullptr;
         if(bndType == TYPE_QUA) vb3 = bndEl->getVertex(3);
         MFace baseFace(vb0, vb1, vb2, vb3);
         bndEl2column.push_back(
           std::make_pair(bndEl, std::vector<MElement *>()));
-        aboveElements.push_back(NULL);
+        aboveElements.push_back(nullptr);
         foundCol =
           getColumn3D(face2el, p, baseFace, baseVert, topPrimVert,
                       bndEl2column.back().second, aboveElements.back());
@@ -1216,7 +1216,7 @@ namespace {
     // Loop over boundary elements to curve them by columns
     DbgOutputMeta dbgOut;
     std::set<MVertex *> movedVert;
-    for(std::list<MElement *>::iterator itBE = bndEl.begin();
+    for(auto itBE = bndEl.begin();
         itBE != bndEl.end(); itBE++) // Loop over bnd. elements
       curveMeshFromBndElt(ed2el, face2el, ent, bndEnt, *itBE, movedVert, p,
                           dbgOut);
@@ -1243,7 +1243,7 @@ namespace {
     for(std::size_t i = 0; i < gFace->quadrangles.size(); i++)
       bndElts.push_back(gFace->quadrangles[i]);
 
-    std::list<MElement *>::iterator it = bndElts.begin();
+    auto it = bndElts.begin();
     while(it != bndElts.end()) {
       MElement *bndEl = *it;
       const int bndType = bndEl->getType();
@@ -1253,7 +1253,7 @@ namespace {
       MVertex *vb0 = bndEl->getVertex(0);
       MVertex *vb1 = bndEl->getVertex(1);
       MVertex *vb2 = bndEl->getVertex(2);
-      MVertex *vb3 = NULL;
+      MVertex *vb3 = nullptr;
       if(bndType == TYPE_QUA) vb3 = bndEl->getVertex(3);
       MFace baseFace(vb0, vb1, vb2, vb3);
       bndEl2column.push_back(std::make_pair(bndEl, std::vector<MElement *>()));
@@ -1289,7 +1289,7 @@ void HighOrderMeshFastCurving(GModel *gm, FastCurvingParameters &p,
     int n = fields->getNumBoundaryLayerFields();
     for(int i = 0; i < n; ++i) {
       Field *bl_field = fields->get(fields->getBoundaryLayerField(i));
-      if(bl_field == NULL) continue;
+      if(bl_field == nullptr) continue;
       blFields.push_back(dynamic_cast<BoundaryLayerField *>(bl_field));
     }
   }
diff --git a/contrib/HighOrderMeshOptimizer/HighOrderMeshOptimizer.cpp b/contrib/HighOrderMeshOptimizer/HighOrderMeshOptimizer.cpp
index 5e967e854f3526820b100a8d65c74a4bbcfae309..be193f9a67b7cf1c6aed1dcc7f75f4e563fee4b7 100644
--- a/contrib/HighOrderMeshOptimizer/HighOrderMeshOptimizer.cpp
+++ b/contrib/HighOrderMeshOptimizer/HighOrderMeshOptimizer.cpp
@@ -70,14 +70,14 @@ void exportMeshToDassault(GModel *gm, const std::string &fn, int dim)
   if(dim == 2) {
     int nt = 0;
     int order = 0;
-    for(GModel::fiter itf = gm->firstFace(); itf != gm->lastFace(); ++itf) {
+    for(auto itf = gm->firstFace(); itf != gm->lastFace(); ++itf) {
       std::vector<MTriangle *> &tris = (*itf)->triangles;
       nt += tris.size();
       if(tris.size()) order = tris[0]->getPolynomialOrder();
     }
     fprintf(f, "%d %d\n", nt, (order + 1) * (order + 2) / 2);
     int count = 1;
-    for(GModel::fiter itf = gm->firstFace(); itf != gm->lastFace(); ++itf) {
+    for(auto itf = gm->firstFace(); itf != gm->lastFace(); ++itf) {
       std::vector<MTriangle *> &tris = (*itf)->triangles;
       for(size_t i = 0; i < tris.size(); i++) {
         MTriangle *t = tris[i];
@@ -89,13 +89,13 @@ void exportMeshToDassault(GModel *gm, const std::string &fn, int dim)
       }
     }
     int ne = 0;
-    for(GModel::eiter ite = gm->firstEdge(); ite != gm->lastEdge(); ++ite) {
+    for(auto ite = gm->firstEdge(); ite != gm->lastEdge(); ++ite) {
       std::vector<MLine *> &l = (*ite)->lines;
       ne += l.size();
     }
     fprintf(f, "%d %d\n", ne, (order + 1));
     count = 1;
-    for(GModel::eiter ite = gm->firstEdge(); ite != gm->lastEdge(); ++ite) {
+    for(auto ite = gm->firstEdge(); ite != gm->lastEdge(); ++ite) {
       std::vector<MLine *> &l = (*ite)->lines;
       for(size_t i = 0; i < l.size(); i++) {
         MLine *t = l[i];
@@ -295,7 +295,7 @@ double HOPatchDefParameters::maxDistance(MElement *el) const
 int HOPatchDefParameters::inPatch(const SPoint3 &badBary, double limDist,
                                   MElement *el, GEntity *gEnt) const
 {
-  if(lockCurvedBLElts && (gEnt != 0)) {
+  if(lockCurvedBLElts && (gEnt != nullptr)) {
     const std::set<MElement *> &lockedElts = gEnt->curvedBLElements;
     if(lockedElts.find(el) != lockedElts.end()) return -1;
   }
diff --git a/contrib/HighOrderMeshOptimizer/MetaEl.cpp b/contrib/HighOrderMeshOptimizer/MetaEl.cpp
index 172fa50f63cbea2ca4ef1f5484c975bc9c800c75..e4b70ea16c821dd17afe784917ac39126c278880 100644
--- a/contrib/HighOrderMeshOptimizer/MetaEl.cpp
+++ b/contrib/HighOrderMeshOptimizer/MetaEl.cpp
@@ -183,7 +183,7 @@ MetaEl::metaInfoType::metaInfoType(int type, int order)
 
 const MetaEl::metaInfoType &MetaEl::getMetaInfo(int elType, int order)
 {
-  std::map<int, MetaEl::metaInfoType>::iterator itMInfo =
+  auto itMInfo =
     _metaInfo.find(elType);
   if(itMInfo == _metaInfo.end()) {
     const metaInfoType mInfo(elType, order);
@@ -232,7 +232,7 @@ void MetaEl::computeBaseNorm(const SVector3 &metaNorm,
 
 MetaEl::MetaEl(int type, int order, const std::vector<MVertex *> &baseVert,
                const std::vector<MVertex *> &topPrimVert)
-  : _mInfo(getMetaInfo(type, order)), _metaEl(0), _metaEl0(0)
+  : _mInfo(getMetaInfo(type, order)), _metaEl(nullptr), _metaEl0(nullptr)
 {
   // Get info on meta-element type
   if(_mInfo.nbVert == 0) return;
diff --git a/contrib/HighOrderMeshOptimizer/ObjContribMetricMin.h b/contrib/HighOrderMeshOptimizer/ObjContribMetricMin.h
index a8ab6b3ddaf42727d05335b99a703459a983f575..5e28ee3e79dde078713f3392e75a284c3e4b9f21 100644
--- a/contrib/HighOrderMeshOptimizer/ObjContribMetricMin.h
+++ b/contrib/HighOrderMeshOptimizer/ObjContribMetricMin.h
@@ -53,7 +53,7 @@ protected:
 
 template <class FuncType>
 ObjContribMetricMin<FuncType>::ObjContribMetricMin(double weight)
-  : ObjContrib("MetricMin", FuncType::getNamePrefix() + "MetricMin"), _mesh(0),
+  : ObjContrib("MetricMin", FuncType::getNamePrefix() + "MetricMin"), _mesh(nullptr),
     _weight(weight)
 {
 }
diff --git a/contrib/HighOrderMeshOptimizer/ObjContribScaledJac.h b/contrib/HighOrderMeshOptimizer/ObjContribScaledJac.h
index d1a5c879f5a6c9b4f465e4a10725070ddaefbd8a..c62a3273e2031957345019d0cb1cfa6a8901a2c3 100644
--- a/contrib/HighOrderMeshOptimizer/ObjContribScaledJac.h
+++ b/contrib/HighOrderMeshOptimizer/ObjContribScaledJac.h
@@ -53,7 +53,7 @@ protected:
 
 template <class FuncType>
 ObjContribScaledJac<FuncType>::ObjContribScaledJac(double weight)
-  : ObjContrib("ScaledJac", FuncType::getNamePrefix() + "ScaledJac"), _mesh(0),
+  : ObjContrib("ScaledJac", FuncType::getNamePrefix() + "ScaledJac"), _mesh(nullptr),
     _weight(weight)
 {
 }
diff --git a/contrib/MathEx/CMakeLists.txt b/contrib/MathEx/CMakeLists.txt
index f6a07da0ab10b857248b37195218c6f3cdc0ae16..55aadafcf059392514e2de3aaf1658a69e52a40a 100644
--- a/contrib/MathEx/CMakeLists.txt
+++ b/contrib/MathEx/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/MeshOptimizer/CADDistances.cpp b/contrib/MeshOptimizer/CADDistances.cpp
index 566933a887bbaece7229fe1d8d19c7c9cf7c2e6f..577f1d57f172d3090cfcd4770ea673369f6f9e8c 100644
--- a/contrib/MeshOptimizer/CADDistances.cpp
+++ b/contrib/MeshOptimizer/CADDistances.cpp
@@ -428,7 +428,7 @@ double taylorDistanceSq1D(const GradientBasis *gb,
 {
   const int nV = nodesXYZ.size1();
   fullMatrix<double> dxyzdX(nV, 3);
-  gb->getGradientsFromNodes(nodesXYZ, &dxyzdX, 0, 0);
+  gb->getGradientsFromNodes(nodesXYZ, &dxyzdX, nullptr, nullptr);
   //  const double dx = nodesXYZ(1, 0) - nodesXYZ(0, 0), dy = nodesXYZ(1, 1) -
   //  nodesXYZ(0, 1),
   //               dz = nodesXYZ(1, 2) - nodesXYZ(0, 2), h =
@@ -450,7 +450,7 @@ double taylorDistanceSq2D(const GradientBasis *gb,
 {
   const int nV = nodesXYZ.size1();
   fullMatrix<double> dxyzdX(nV, 3), dxyzdY(nV, 3);
-  gb->getGradientsFromNodes(nodesXYZ, &dxyzdX, &dxyzdY, 0);
+  gb->getGradientsFromNodes(nodesXYZ, &dxyzdX, &dxyzdY, nullptr);
   double distSq = 0.;
   for(int i = 0; i < nV; i++) {
     const double nz = dxyzdX(i, 0) * dxyzdY(i, 1) - dxyzdX(i, 1) * dxyzdY(i, 0);
@@ -521,7 +521,7 @@ void distanceFromElementsToGeometry(GModel *gm, int dim,
                                     std::map<MElement *, double> &distances)
 {
   std::map<MEdge, double, MEdgeLessThan> dist2Edge;
-  for(GModel::eiter it = gm->firstEdge(); it != gm->lastEdge(); ++it) {
+  for(auto it = gm->firstEdge(); it != gm->lastEdge(); ++it) {
     if((*it)->geomType() == GEntity::Line) continue;
     for(unsigned int i = 0; i < (*it)->lines.size(); i++) {
       double d = taylorDistanceEdge((*it)->lines[i], *it);
@@ -531,7 +531,7 @@ void distanceFromElementsToGeometry(GModel *gm, int dim,
   }
 
   std::map<MFace, double, MFaceLessThan> dist2Face;
-  for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); ++it) {
+  for(auto it = gm->firstFace(); it != gm->lastFace(); ++it) {
     if((*it)->geomType() == GEntity::Plane) continue;
     for(unsigned int i = 0; i < (*it)->triangles.size(); i++) {
       double d = taylorDistanceFace((*it)->triangles[i], *it);
@@ -551,12 +551,12 @@ void distanceFromElementsToGeometry(GModel *gm, int dim,
       double d = 0.;
       for(int iEdge = 0; iEdge < element->getNumEdges(); ++iEdge) {
         MEdge e = element->getEdge(iEdge);
-        std::map<MEdge, double, MEdgeLessThan>::iterator it = dist2Edge.find(e);
+        auto it = dist2Edge.find(e);
         if(it != dist2Edge.end()) d += it->second;
       }
       for(int iFace = 0; iFace < element->getNumFaces(); ++iFace) {
         MFace f = element->getFace(iFace);
-        std::map<MFace, double, MFaceLessThan>::iterator it = dist2Face.find(f);
+        auto it = dist2Face.find(f);
         if(it != dist2Face.end()) d += it->second;
       }
       distances[element] = d;
@@ -571,7 +571,7 @@ double distanceToGeometry(GModel *gm, int distType, double tol, int meshDiscr,
   double maxDist = 0.;
 
   if(dim == 2) {
-    for(GModel::eiter it = gm->firstEdge(); it != gm->lastEdge(); ++it) {
+    for(auto it = gm->firstEdge(); it != gm->lastEdge(); ++it) {
       if((*it)->geomType() == GEntity::Line) continue;
       for(unsigned int i = 0; i < (*it)->lines.size(); i++) {
         double dist;
@@ -601,7 +601,7 @@ double distanceToGeometry(GModel *gm, int distType, double tol, int meshDiscr,
   }
   else if(dim == 3) {
     if(distType == CADDIST_TAYLOR) {
-      for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); ++it) {
+      for(auto it = gm->firstFace(); it != gm->lastFace(); ++it) {
         if((*it)->geomType() == GEntity::Plane) continue;
         for(unsigned int i = 0; i < (*it)->triangles.size(); i++) {
           maxDist =
diff --git a/contrib/MeshOptimizer/CMakeLists.txt b/contrib/MeshOptimizer/CMakeLists.txt
index 84b579ecccb018b5dd1d0b439412d19065705088..6a9a33f2122104b6b7de6ea6202a773aed8f40d1 100644
--- a/contrib/MeshOptimizer/CMakeLists.txt
+++ b/contrib/MeshOptimizer/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/MeshOptimizer/IntegralBoundaryDist.cpp b/contrib/MeshOptimizer/IntegralBoundaryDist.cpp
index ab4d0ca6531fb08e4da5ad3f9d5f78185caf3c46..4f192b979872c0cd5cc6831e5f6ceeee5f4474ef 100644
--- a/contrib/MeshOptimizer/IntegralBoundaryDist.cpp
+++ b/contrib/MeshOptimizer/IntegralBoundaryDist.cpp
@@ -513,7 +513,7 @@ double computeBndDist(MElement *element, int distanceDefinition,
     int clId = elbasis.getClosureId(iEdge, 1);
     const std::vector<int> &closure = elbasis.closures[clId];
     std::vector<SPoint3> xyz;
-    GEdge *edge = NULL;
+    GEdge *edge = nullptr;
     std::vector<MVertex *> vertices(closure.size());
     for(size_t i = 0; i < closure.size(); ++i) {
       MVertex *v = element->getVertex(closure[i]);
diff --git a/contrib/MeshOptimizer/MeshOptimizer.cpp b/contrib/MeshOptimizer/MeshOptimizer.cpp
index e79db6e907018d025b7a49ec9ee2f857a052a6cb..cccac18e97cda0f4ad7d286e7701c16d1fc67caf 100644
--- a/contrib/MeshOptimizer/MeshOptimizer.cpp
+++ b/contrib/MeshOptimizer/MeshOptimizer.cpp
@@ -59,7 +59,7 @@ namespace {
                             const vertElVecMap &vertex2elements)
   {
     vertSet bnd;
-    for(elSetIter itE = elements.begin(); itE != elements.end(); ++itE) {
+    for(auto itE = elements.begin(); itE != elements.end(); ++itE) {
       for(int i = 0; i < (*itE)->getNumPrimaryVertices(); ++i) {
         const elVec &neighbours =
           vertex2elements.find((*itE)->getVertex(i))->second;
@@ -79,12 +79,12 @@ namespace {
   void getElementNeighbours(MElement *el, const vertElVecMap &v2e,
                             elElSetMap &e2e, elSet &neighbours)
   {
-    elElSetMap::iterator it = e2e.find(el);
+    auto it = e2e.find(el);
     if(it == e2e.end()) { // If not in e2e, compute and store
       neighbours.clear();
       for(int i = 0; i < el->getNumPrimaryVertices(); ++i) {
         const elVec &adjEl = v2e.find(el->getVertex(i))->second;
-        for(elVecConstIter itA = adjEl.begin(); itA != adjEl.end(); itA++)
+        for(auto itA = adjEl.begin(); itA != adjEl.end(); itA++)
           if(*itA != el) neighbours.insert(*itA);
       }
       e2e.insert(std::pair<MElement *, elSet>(el, neighbours));
@@ -107,20 +107,20 @@ namespace {
     lastLayer.insert(el);
     for(int d = 0; d < maxLayers; ++d) {
       currentLayer.clear();
-      for(elSetIter it = lastLayer.begin(); it != lastLayer.end();
+      for(auto it = lastLayer.begin(); it != lastLayer.end();
           ++it) { // Loop over elements in last layer
         elSet neighbours;
         getElementNeighbours(*it, vertex2elements, element2elements,
                              neighbours);
-        for(elSetIter itN = neighbours.begin(); itN != neighbours.end();
+        for(auto itN = neighbours.begin(); itN != neighbours.end();
             ++itN) { // Loop over neighbours
           if((lastLayer.find(*itN) ==
               lastLayer.end()) && // If neighbour already in last layer...
              (excluded.find(*itN) ==
               excluded.end())) { // ... or marked as excluded, skip
-            GEntity *gEnt = 0;
+            GEntity *gEnt = nullptr;
             if(!element2entity.empty()) {
-              elEntMap::const_iterator itEl2Ent = element2entity.find(el);
+              auto itEl2Ent = element2entity.find(el);
               if(itEl2Ent != element2entity.end()) gEnt = itEl2Ent->second;
             }
             const int elIn = patchDef->inPatch(
@@ -150,7 +150,7 @@ namespace {
       todoPB[iB] = false;
       group.insert(iB);
       const std::set<int> &connect = groupConnect[iB];
-      for(std::set<int>::const_iterator itBC = connect.begin();
+      for(auto itBC = connect.begin();
           itBC != connect.end(); ++itBC)
         addPatchChaintoGroup(group, groupConnect, todoPB, *itBC);
     }
@@ -178,7 +178,7 @@ namespace {
   MElement *getFaceInBndElements(const MFace &f,
                                  std::vector<GFace *> const &gFaces)
   {
-    for(std::vector<GFace *>::const_iterator itGF = gFaces.begin();
+    for(auto itGF = gFaces.begin();
         itGF != gFaces.end(); itGF++) {
       if(f.getNumVertices() == 3) {
         std::vector<MTriangle *> &tris = (*itGF)->triangles;
@@ -191,19 +191,19 @@ namespace {
           if(quads[iEl]->getFace(0) == f) return quads[iEl];
       }
     }
-    return 0;
+    return nullptr;
   }
 
   MElement *getEdgeInBndElements(const MEdge &e,
                                  std::vector<GEdge *> const &gEdges)
   {
-    for(std::vector<GEdge *>::const_iterator itGE = gEdges.begin();
+    for(auto itGE = gEdges.begin();
         itGE != gEdges.end(); itGE++) {
       std::vector<MLine *> &lines = (*itGE)->lines;
       for(int iEl = 0; iEl < lines.size(); iEl++)
         if(lines[iEl]->getEdge(0) == e) return lines[iEl];
     }
-    return 0;
+    return nullptr;
   }
 
   void calcBndInfo(GEntity *entity, elElMap &el2BndEl, elEntMap &bndEl2Ent)
@@ -215,7 +215,7 @@ namespace {
 
       // Fill boundary element -> GEntity connectivity
       GFaceList gFaces = entity->faces();
-      for(GFaceList::iterator itGF = gFaces.begin(); itGF != gFaces.end();
+      for(auto itGF = gFaces.begin(); itGF != gFaces.end();
           itGF++) {
         std::vector<MTriangle *> &tris = (*itGF)->triangles;
         for(int i = 0; i < tris.size(); i++)
@@ -235,7 +235,7 @@ namespace {
            3) // If more than 3 primary vert. on bnd., look for bnd. face(s)
           for(int iF = 0; iF < el->getNumFaces(); iF++) {
             MElement *bndEl = getFaceInBndElements(el->getFace(iF), gFaces);
-            if(bndEl != 0)
+            if(bndEl != nullptr)
               el2BndEl.insert(std::pair<MElement *, MElement *>(el, bndEl));
           }
       }
@@ -244,7 +244,7 @@ namespace {
 
       // Fill boundary element -> GEntity connectivity
       GEdgeList gEdges = entity->edges();
-      for(GEdgeList::iterator itGE = gEdges.begin(); itGE != gEdges.end();
+      for(auto itGE = gEdges.begin(); itGE != gEdges.end();
           itGE++) {
         std::vector<MLine *> &lines = (*itGE)->lines;
         for(int i = 0; i < lines.size(); i++)
@@ -261,7 +261,7 @@ namespace {
            2) // If more than 2 primary vert. on bnd., look for bnd. edge(s)
           for(int iE = 0; iE < el->getNumEdges(); iE++) {
             MElement *bndEl = getEdgeInBndElements(el->getEdge(iE), gEdges);
-            if(bndEl != 0)
+            if(bndEl != nullptr)
               el2BndEl.insert(std::pair<MElement *, MElement *>(el, bndEl));
           }
       }
@@ -287,7 +287,7 @@ namespace {
     Msg::Info("Constructing %i primary patches", badElements.size());
     std::vector<elSet> primPatches;
     primPatches.reserve(badElements.size());
-    for(elSet::const_iterator it = badElements.begin(); it != badElements.end();
+    for(auto it = badElements.begin(); it != badElements.end();
         ++it) {
       const double limDist = par.patchDef->maxDistance(*it);
       primPatches.push_back(
@@ -301,11 +301,11 @@ namespace {
     std::vector<std::set<int> > patchConnect(primPatches.size());
     for(int iB = 0; iB < primPatches.size(); ++iB) {
       elSet &patch = primPatches[iB];
-      for(elSetIter itEl = patch.begin(); itEl != patch.end(); ++itEl) {
+      for(auto itEl = patch.begin(); itEl != patch.end(); ++itEl) {
         std::set<int> &patchInd = tags[*itEl];
         if(!patchInd.empty() && (badElements.find(*itEl) != badElements.end() ||
                                  !par.patchDef->weakMerge)) {
-          for(std::set<int>::iterator itBS = patchInd.begin();
+          for(auto itBS = patchInd.begin();
               itBS != patchInd.end(); ++itBS)
             patchConnect[*itBS].insert(iB);
           patchConnect[iB].insert(patchInd.begin(), patchInd.end());
@@ -328,10 +328,10 @@ namespace {
     // Merge primary patches according to groups
     Msg::Info("Merging primary patches into %i patches...", groups.size());
     std::list<elSet> patches;
-    for(std::list<std::set<int> >::iterator itG = groups.begin();
+    for(auto itG = groups.begin();
         itG != groups.end(); ++itG) {
       patches.push_back(elSet());
-      for(std::set<int>::iterator itB = itG->begin(); itB != itG->end();
+      for(auto itB = itG->begin(); itB != itG->end();
           ++itB) {
         elSet primPatch = primPatches[*itB];
         patches.back().insert(primPatch.begin(), primPatch.end());
@@ -341,7 +341,7 @@ namespace {
     // Store and compute patch boundaries
     Msg::Info("Computing boundaries for %i patches...", patches.size());
     std::vector<elSetVertSetPair> result;
-    for(std::list<elSet>::iterator itB = patches.begin(); itB != patches.end();
+    for(auto itB = patches.begin(); itB != patches.end();
         ++itB)
       result.push_back(
         elSetVertSetPair(*itB, getAllBndVertices(*itB, vertex2elements)));
@@ -356,11 +356,11 @@ namespace {
                           const elSet &elts, elSet &bndElts,
                           MeshOptParameters &par)
   {
-    for(elSet::const_iterator itEl = elts.begin(); itEl != elts.end(); itEl++) {
-      elElMap::const_iterator itBndEl = el2BndEl.find(*itEl);
+    for(auto itEl = elts.begin(); itEl != elts.end(); itEl++) {
+      auto itBndEl = el2BndEl.find(*itEl);
       if(itBndEl != el2BndEl.end()) {
         MElement *bndEl = itBndEl->second;
-        elEntMap::const_iterator itEnt = bndEl2Ent.find(bndEl);
+        auto itEnt = bndEl2Ent.find(bndEl);
         if(par.patchDef->bndElBadness(bndEl, itEnt->second) < 0.)
           bndElts.insert(bndEl);
       }
@@ -553,12 +553,12 @@ namespace {
                             const MeshOptParameters &par)
   {
     double worst = 1.e300;
-    MElement *worstEl = 0;
+    MElement *worstEl = nullptr;
 
-    for(elSetIter it = badElts.begin(); it != badElts.end(); it++) {
-      GEntity *gEnt = 0;
+    for(auto it = badElts.begin(); it != badElts.end(); it++) {
+      GEntity *gEnt = nullptr;
       if(!element2entity.empty()) {
-        elEntMap::const_iterator itEl2Ent = element2entity.find(*it);
+        auto itEl2Ent = element2entity.find(*it);
         if(itEl2Ent != element2entity.end()) gEnt = itEl2Ent->second;
       }
       const double val = par.patchDef->elBadness(*it, gEnt);
@@ -770,7 +770,7 @@ void MeshOptimizer(std::vector<GEntity *> &entities, MeshOptParameters &par)
         if(par.patchDef->elBadness(el, entity) < 0.)
           badElts.insert(el);
         else if(par.useBoundaries) {
-          elElMap::iterator bndElIt = el2BndEl.find(el);
+          auto bndElIt = el2BndEl.find(el);
           if(bndElIt != el2BndEl.end()) {
             MElement *&bndEl = bndElIt->second;
             if(par.patchDef->bndElBadness(bndEl, bndEl2Ent[bndEl]) < 0.)
@@ -845,5 +845,5 @@ void MeshOptimizer(std::vector<GEntity *> &entities, MeshOptParameters &par)
     mvpause();
     mvterminate();
   }
-  if(par.logFileName.compare("") != 0 || par.nCurses) Msg::SetCallback(NULL);
+  if(par.logFileName.compare("") != 0 || par.nCurses) Msg::SetCallback(nullptr);
 }
diff --git a/contrib/MeshOptimizer/ObjContribScaledNodeDispSq.h b/contrib/MeshOptimizer/ObjContribScaledNodeDispSq.h
index 6a349b6a6d7b67b234d844664f948c91e3e9015b..8533bb7363e18ab93b43b50beefd09b7f0d208c7 100644
--- a/contrib/MeshOptimizer/ObjContribScaledNodeDispSq.h
+++ b/contrib/MeshOptimizer/ObjContribScaledNodeDispSq.h
@@ -55,7 +55,7 @@ ObjContribScaledNodeDispSq<FuncType>::ObjContribScaledNodeDispSq(
   double weight, Patch::LengthScaling scaling)
   : ObjContrib("ScaledNodeDispSq",
                FuncType::getNamePrefix() + "ScaledNodeDispSq"),
-    _mesh(0), _weight(weight), _scaling(scaling)
+    _mesh(nullptr), _weight(weight), _scaling(scaling)
 {
 }
 
diff --git a/contrib/MeshOptimizer/ObjectiveFunction.cpp b/contrib/MeshOptimizer/ObjectiveFunction.cpp
index dc86dde31253a4386ab155e6b90f96ef8636d76d..da286b5eca2dcbbbd1f6c75ffb1f612f17c7ff81 100644
--- a/contrib/MeshOptimizer/ObjectiveFunction.cpp
+++ b/contrib/MeshOptimizer/ObjectiveFunction.cpp
@@ -30,13 +30,13 @@
 
 void ObjectiveFunction::initialize(Patch *mesh)
 {
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     (*it)->initialize(mesh);
 }
 
 std::string ObjectiveFunction::contribNames()
 {
-  std::vector<ObjContrib *>::iterator it = begin();
+  auto it = begin();
   std::string str = (*it)->getName();
   for(it++; it != end(); it++) str += " " + (*it)->getName();
   return str;
@@ -45,7 +45,7 @@ std::string ObjectiveFunction::contribNames()
 std::string ObjectiveFunction::minMaxStr()
 {
   std::string str;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++) {
+  for(auto it = begin(); it != end(); it++) {
     std::ostringstream oss;
     if(it != begin()) oss << "  |  ";
     oss << std::scientific << std::setw(13) << (*it)->getMin()
@@ -59,7 +59,7 @@ std::string ObjectiveFunction::minMaxStr()
 std::vector<std::pair<double, double> > ObjectiveFunction::minMax()
 {
   std::vector<std::pair<double, double> > range;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++) {
+  for(auto it = begin(); it != end(); it++) {
     std::pair<double, double> oneRange =
       std::make_pair((*it)->getMin(), (*it)->getMax());
     range.push_back(oneRange);
@@ -70,7 +70,7 @@ std::vector<std::pair<double, double> > ObjectiveFunction::minMax()
 std::vector<std::string> ObjectiveFunction::names()
 {
   std::vector<std::string> namesStr;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++) {
+  for(auto it = begin(); it != end(); it++) {
     std::string name = (*it)->getMeasureName();
     namesStr.push_back(name);
   }
@@ -79,26 +79,26 @@ std::vector<std::string> ObjectiveFunction::names()
 
 void ObjectiveFunction::updateMinMax()
 {
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     (*it)->updateMinMax();
 }
 
 void ObjectiveFunction::updateParameters()
 {
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     (*it)->updateParameters();
 }
 
 void ObjectiveFunction::updateResults()
 {
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     (*it)->updateResults();
 }
 
 bool ObjectiveFunction::stagnated()
 {
   bool stagnated = true;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     stagnated &= (*it)->stagnated();
   return stagnated;
 }
@@ -106,7 +106,7 @@ bool ObjectiveFunction::stagnated()
 bool ObjectiveFunction::targetReached()
 {
   bool targetReached = true;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     targetReached &= (*it)->targetReached();
   return targetReached;
 }
@@ -114,7 +114,7 @@ bool ObjectiveFunction::targetReached()
 std::string ObjectiveFunction::failMeasures()
 {
   std::string fail;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     if((*it)->fail()) {
       if(fail.empty())
         fail = (*it)->getMeasureName();
@@ -127,7 +127,7 @@ std::string ObjectiveFunction::failMeasures()
 std::string ObjectiveFunction::targetsNotReached()
 {
   std::string fail;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     if((*it)->fail()) {
       if(fail.empty())
         fail = (*it)->getName();
@@ -142,7 +142,7 @@ bool ObjectiveFunction::compute(double &obj, std::vector<double> &gradObj)
   obj = 0.;
   for(std::size_t i = 0; i < gradObj.size(); i++) gradObj[i] = 0.;
   bool ok = true;
-  for(std::vector<ObjContrib *>::iterator it = begin(); it != end(); it++)
+  for(auto it = begin(); it != end(); it++)
     ok &= (*it)->addContrib(obj, gradObj);
   return ok;
 }
diff --git a/contrib/MeshOptimizer/Patch.cpp b/contrib/MeshOptimizer/Patch.cpp
index de7ccac7ef0483986104605db560c2b59b0eb9f2..c58d08cf4f24198876b2112b784173a75bbf4be8 100644
--- a/contrib/MeshOptimizer/Patch.cpp
+++ b/contrib/MeshOptimizer/Patch.cpp
@@ -55,11 +55,11 @@ Patch::Patch(const std::map<MElement *, GEntity *> &element2entity,
   if(!element2entity.empty()) _gEnt.resize(nElements);
   int iEl = 0;
   bool nonGeoMove = false;
-  for(std::set<MElement *>::const_iterator it = els.begin(); it != els.end();
+  for(auto it = els.begin(); it != els.end();
       ++it, ++iEl) {
     _el[iEl] = *it;
     if(!element2entity.empty()) {
-      std::map<MElement *, GEntity *>::const_iterator itEl2Ent =
+      auto itEl2Ent =
         element2entity.find(*it);
       _gEnt[iEl] = (itEl2Ent == element2entity.end()) ? 0 : itEl2Ent->second;
     }
@@ -108,11 +108,11 @@ Patch::Patch(const std::map<MElement *, GEntity *> &element2entity,
     _bndEl2FV.resize(nBndElts);
     int iBndEl = 0;
     bool unknownVert = false;
-    for(std::set<MElement *>::iterator it = bndEls.begin(); it != bndEls.end();
+    for(auto it = bndEls.begin(); it != bndEls.end();
         ++it, ++iBndEl) {
       MElement *bndEl = *it;
       _bndEl[iBndEl] = bndEl;
-      std::map<MElement *, GEntity *>::const_iterator itBndEl2Ent =
+      auto itBndEl2Ent =
         bndEl2Ent.find(bndEl);
       _bndEl2Ent[iBndEl] =
         (itBndEl2Ent == bndEl2Ent.end()) ? 0 : itBndEl2Ent->second;
@@ -121,13 +121,13 @@ Patch::Patch(const std::map<MElement *, GEntity *> &element2entity,
       _bndEl2FV[iBndEl].resize(nBndElVerts);
       for(int iVBndEl = 0; iVBndEl < nBndElVerts; iVBndEl++) {
         MVertex *vert = bndEl->getVertex(iVBndEl);
-        std::vector<MVertex *>::iterator itV =
+        auto itV =
           std::find(_vert.begin(), _vert.end(), vert);
         if(itV == _vert.end())
           unknownVert = true;
         else
           _bndEl2V[iBndEl][iVBndEl] = std::distance(_vert.begin(), itV);
-        std::vector<MVertex *>::iterator itFV =
+        auto itFV =
           std::find(_freeVert.begin(), _freeVert.end(), vert);
         if(itFV == _freeVert.end())
           _bndEl2FV[iBndEl][iVBndEl] = -1;
@@ -153,7 +153,7 @@ Patch::Patch(const std::map<MElement *, GEntity *> &element2entity,
 
 int Patch::addVert(MVertex *vert)
 {
-  std::vector<MVertex *>::iterator itVert =
+  auto itVert =
     find(_vert.begin(), _vert.end(), vert);
   if(itVert == _vert.end()) {
     _vert.push_back(vert);
@@ -166,7 +166,7 @@ int Patch::addVert(MVertex *vert)
 int Patch::addFreeVert(MVertex *vert, const int iV, const int nPCV,
                        VertexCoord *param, std::set<MVertex *> &toFix)
 {
-  std::vector<MVertex *>::iterator itVert =
+  auto itVert =
     find(_freeVert.begin(), _freeVert.end(), vert);
   if(itVert == _freeVert.end()) {
     const int iStart =
@@ -372,7 +372,7 @@ void Patch::calcNormalEl2D(int iEl, NormalScaling scaling,
 
   fullMatrix<double> primNodesXYZ(jac->getNumPrimMapNodes(), 3);
   SVector3 geoNorm(0., 0., 0.);
-  GEntity *ge = (_gEnt.empty()) ? 0 : _gEnt[iEl];
+  GEntity *ge = (_gEnt.empty()) ? nullptr : _gEnt[iEl];
   const bool hasGeoNorm = ge && (ge->dim() == 2) && ge->haveParametrization();
   for(int i = 0; i < jac->getNumPrimMapNodes(); i++) {
     const int &iV = _el2V[iEl][i];
@@ -545,7 +545,7 @@ bool Patch::bndDistAndGradients(int iEl, double &f, std::vector<double> &gradF,
     int clId = elbasis.getClosureId(iEdge, 1);
     const std::vector<int> &closure = elbasis.closures[clId];
     std::vector<MVertex *> vertices;
-    GEdge *edge = NULL;
+    GEdge *edge = nullptr;
     for(size_t i = 0; i < closure.size(); ++i) {
       MVertex *v = element->getVertex(closure[i]);
       vertices.push_back(v);
diff --git a/contrib/MeshOptimizer/VertexCoord.cpp b/contrib/MeshOptimizer/VertexCoord.cpp
index b6b5f0fe66d8bdedaecd46511a25e2e77b2b5550..2f436ba168f49a1f9fd1b5e448e2d22a3abe1087 100644
--- a/contrib/MeshOptimizer/VertexCoord.cpp
+++ b/contrib/MeshOptimizer/VertexCoord.cpp
@@ -93,8 +93,8 @@ void VertexCoordParent::gXyz2gUvw(const SPoint3 &uvw,
 
   if(ge->dim() == 1) {
     SVector3 der = static_cast<GEdge *>(ge)->firstDer(uvw[0]);
-    std::vector<SPoint3>::iterator itUvw = gUvw.begin();
-    for(std::vector<SPoint3>::const_iterator itXyz = gXyz.begin();
+    auto itUvw = gUvw.begin();
+    for(auto itXyz = gXyz.begin();
         itXyz != gXyz.end(); itXyz++) {
       (*itUvw)[0] =
         itXyz->x() * der.x() + itXyz->y() * der.y() + itXyz->z() * der.z();
@@ -104,8 +104,8 @@ void VertexCoordParent::gXyz2gUvw(const SPoint3 &uvw,
   else {
     Pair<SVector3, SVector3> der =
       static_cast<GFace *>(ge)->firstDer(SPoint2(uvw[0], uvw[1]));
-    std::vector<SPoint3>::iterator itUvw = gUvw.begin();
-    for(std::vector<SPoint3>::const_iterator itXyz = gXyz.begin();
+    auto itUvw = gUvw.begin();
+    for(auto itXyz = gXyz.begin();
         itXyz != gXyz.end(); itXyz++) {
       (*itUvw)[0] = itXyz->x() * der.first().x() +
                     itXyz->y() * der.first().y() + itXyz->z() * der.first().z();
@@ -177,7 +177,7 @@ VertexCoordLocalLine::VertexCoordLocalLine(MVertex *v)
     MElement *el = ge->getMeshElement(iEl);
     std::vector<MVertex *> lVerts;
     el->getVertices(lVerts);
-    std::vector<MVertex *>::iterator itV =
+    auto itV =
       std::find(lVerts.begin(), lVerts.end(), v);
     if(itV != lVerts.end()) {
       const int iNode = std::distance(lVerts.begin(), itV);
@@ -198,7 +198,7 @@ VertexCoordLocalSurf::VertexCoordLocalSurf(MVertex *v)
     MElement *el = ge->getMeshElement(iEl);
     std::vector<MVertex *> lVerts;
     el->getVertices(lVerts);
-    std::vector<MVertex *>::iterator itV =
+    auto itV =
       std::find(lVerts.begin(), lVerts.end(), v);
     if(itV != lVerts.end()) {
       const int iNode = std::distance(lVerts.begin(), itV);
diff --git a/contrib/MeshOptimizer/VertexCoord.h b/contrib/MeshOptimizer/VertexCoord.h
index 513d7da26f4d006af06369159ffee2d883947b67..0762ea0bae5afe2257c81fad19709fffa7dac8d9 100644
--- a/contrib/MeshOptimizer/VertexCoord.h
+++ b/contrib/MeshOptimizer/VertexCoord.h
@@ -59,8 +59,8 @@ public:
   void gXyz2gUvw(const SPoint3 &uvw, const std::vector<SPoint3> &gXyz,
                  std::vector<SPoint3> &gUvw) const
   {
-    std::vector<SPoint3>::iterator itUvw = gUvw.begin();
-    for(std::vector<SPoint3>::const_iterator itXyz = gXyz.begin();
+    auto itUvw = gUvw.begin();
+    for(auto itXyz = gXyz.begin();
         itXyz != gXyz.end(); itXyz++) {
       *itUvw = *itXyz;
       itUvw++;
@@ -102,8 +102,8 @@ public:
   void gXyz2gUvw(const SPoint3 &uvw, const std::vector<SPoint3> &gXyz,
                  std::vector<SPoint3> &gUvw) const
   {
-    std::vector<SPoint3>::iterator itUvw = gUvw.begin();
-    for(std::vector<SPoint3>::const_iterator itXyz = gXyz.begin();
+    auto itUvw = gUvw.begin();
+    for(auto itXyz = gXyz.begin();
         itXyz != gXyz.end(); itXyz++) {
       (*itUvw)[0] =
         itXyz->x() * dir[0] + itXyz->y() * dir[1] + itXyz->z() * dir[2];
@@ -134,8 +134,8 @@ public:
   void gXyz2gUvw(const SPoint3 &uvw, const std::vector<SPoint3> &gXyz,
                  std::vector<SPoint3> &gUvw) const
   {
-    std::vector<SPoint3>::iterator itUvw = gUvw.begin();
-    for(std::vector<SPoint3>::const_iterator itXyz = gXyz.begin();
+    auto itUvw = gUvw.begin();
+    for(auto itXyz = gXyz.begin();
         itXyz != gXyz.end(); itXyz++) {
       (*itUvw)[0] =
         itXyz->x() * dir0[0] + itXyz->y() * dir0[1] + itXyz->z() * dir0[2];
diff --git a/contrib/MeshQualityOptimizer/CMakeLists.txt b/contrib/MeshQualityOptimizer/CMakeLists.txt
index 5812926bf2a721ca7a4ef7443d15ff3e323ab6d2..f31b25f419d3b33d435f807bd9ff7396ac6cba95 100644
--- a/contrib/MeshQualityOptimizer/CMakeLists.txt
+++ b/contrib/MeshQualityOptimizer/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp
index 7fd1d74b40985f106faf3718e9f61bd843376943..908e88b81ccba4fbfbde2e9b93bdde25c4dfb93f 100644
--- a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp
+++ b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp
@@ -85,13 +85,13 @@ double QualPatchDefParameters::elBadness(MElement *el, GEntity *gEnt) const
   if(_excludeHex && (typ == TYPE_HEX)) return 1.;
   if(_excludePrism && (typ == TYPE_PRI)) return 1.;
   if(_excludeBL) {
-    BoundaryLayerColumns *blc = 0;
+    BoundaryLayerColumns *blc = nullptr;
     if(gEnt->dim() == 2)
       blc = static_cast<GFace *>(gEnt)->getColumns();
     else if(gEnt->dim() == 3)
       blc = static_cast<GRegion *>(gEnt)->getColumns();
     if(blc) {
-      std::map<MElement *, MElement *>::iterator itBLEl =
+      auto itBLEl =
         blc->_toFirst.find(el);
       if(itBLEl != blc->_toFirst.end()) return 1.;
     }
@@ -121,13 +121,13 @@ int QualPatchDefParameters::inPatch(const SPoint3 &badBary, double limDist,
   if(_excludeHex && (typ == TYPE_HEX)) return -1;
   if(_excludePrism && (typ == TYPE_PRI)) return -1;
   if(_excludeBL) {
-    BoundaryLayerColumns *blc = 0;
+    BoundaryLayerColumns *blc = nullptr;
     if(gEnt->dim() == 2)
       blc = static_cast<GFace *>(gEnt)->getColumns();
     else if(gEnt->dim() == 3)
       blc = static_cast<GRegion *>(gEnt)->getColumns();
     if(blc) {
-      std::map<MElement *, MElement *>::iterator itBLEl =
+      auto itBLEl =
         blc->_toFirst.find(el);
       if(itBLEl != blc->_toFirst.end()) return -1;
     }
diff --git a/contrib/MeshQualityOptimizer/ObjContribIdealJac.h b/contrib/MeshQualityOptimizer/ObjContribIdealJac.h
index 71127e457cf40c4cff0b721cfd0e050438bb43a7..efa45cf8fe04a19881797621bdbf59e47905dfcb 100644
--- a/contrib/MeshQualityOptimizer/ObjContribIdealJac.h
+++ b/contrib/MeshQualityOptimizer/ObjContribIdealJac.h
@@ -53,7 +53,7 @@ protected:
 
 template <class FuncType>
 ObjContribIdealJac<FuncType>::ObjContribIdealJac(double weight)
-  : ObjContrib("IdealJac", FuncType::getNamePrefix() + "IdealJac"), _mesh(0),
+  : ObjContrib("IdealJac", FuncType::getNamePrefix() + "IdealJac"), _mesh(nullptr),
     _weight(weight)
 {
 }
diff --git a/contrib/MeshQualityOptimizer/ObjContribInvCond.h b/contrib/MeshQualityOptimizer/ObjContribInvCond.h
index f6d60306303ad93ddedba6d283ac8c1f221f9566..56bc80c7e6af419e6a76b3025f2db57aa5ed27cd 100644
--- a/contrib/MeshQualityOptimizer/ObjContribInvCond.h
+++ b/contrib/MeshQualityOptimizer/ObjContribInvCond.h
@@ -54,7 +54,7 @@ protected:
 template <class FuncType>
 ObjContribInvCondNum<FuncType>::ObjContribInvCondNum(double weight)
   : ObjContrib("InvCondNum", FuncType::getNamePrefix() + "InvCondNum"),
-    _mesh(0), _weight(weight)
+    _mesh(nullptr), _weight(weight)
 {
 }
 
diff --git a/contrib/Netgen/CMakeLists.txt b/contrib/Netgen/CMakeLists.txt
index ba8910724d371804232aede02d3f5890073e4ba6..122055f22a02c9d8f0352ecf43fe342c4b6a43d2 100644
--- a/contrib/Netgen/CMakeLists.txt
+++ b/contrib/Netgen/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/QuadTri/CMakeLists.txt b/contrib/QuadTri/CMakeLists.txt
index a0e963b450001ac8536999c07ae67e8c10ed4cde..7be59f5f3a8eafbc7019051bdf8c9171f0737296 100644
--- a/contrib/QuadTri/CMakeLists.txt
+++ b/contrib/QuadTri/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/bamg/CMakeLists.txt b/contrib/bamg/CMakeLists.txt
index d8bd511d98fa850118a9558de41e774fe880175d..028b53fb42dd69b0d789b42eb489733d47aab36d 100644
--- a/contrib/bamg/CMakeLists.txt
+++ b/contrib/bamg/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/blossom/CMakeLists.txt b/contrib/blossom/CMakeLists.txt
index 751db7d1f000ba37db34ab0e35c8b0c809d9655e..462ee6f4de20c3e8f2ad0fb9bc247d8105b8414f 100644
--- a/contrib/blossom/CMakeLists.txt
+++ b/contrib/blossom/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/BGMBase.cpp b/contrib/domhex/BGMBase.cpp
index ab1fe842a851ddab58861b647069ee0e2d43a99b..df71464302c675915be5b1778bb52a6876d3ddbb 100644
--- a/contrib/domhex/BGMBase.cpp
+++ b/contrib/domhex/BGMBase.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -31,7 +31,7 @@ void BGMBase::export_scalar(const std::string &filename,
     elem = getElement(i);
     nvertex = elem->getNumVertices();
     type = elem->getType();
-    const char *s = 0;
+    const char *s = nullptr;
     switch(type) {
     case TYPE_PNT: s = "SP"; break;
     case TYPE_LIN: s = "SL"; break;
@@ -89,7 +89,7 @@ void BGMBase::export_vector(const std::string &filename,
     elem = getElement(i);
     nvertex = elem->getNumVertices();
     type = elem->getType();
-    const char *s = 0;
+    const char *s = nullptr;
     switch(type) {
     case TYPE_PNT: s = "VP"; break;
     case TYPE_LIN: s = "VL"; break;
@@ -141,7 +141,7 @@ void BGMBase::export_tensor_as_vectors(
 
   fprintf(f, "View \"Background Mesh\"{\n");
 
-  TensorStorageType::const_iterator it = _whatToPrint.begin();
+  auto it = _whatToPrint.begin();
   const char *s = "VP";
 
   for(; it != _whatToPrint.end(); it++) { // for all vertices
@@ -158,7 +158,7 @@ void BGMBase::export_tensor_as_vectors(
 }
 
 BGMBase::BGMBase(int dim, GEntity *_gf)
-  : octree(NULL), gf(_gf), DIM(dim), order(1)
+  : octree(nullptr), gf(_gf), DIM(dim), order(1)
 {
 }
 
@@ -166,7 +166,7 @@ BGMBase::~BGMBase() {}
 
 bool BGMBase::inDomain(double u, double v, double w)
 {
-  return (findElement(u, v, w) != NULL);
+  return (findElement(u, v, w) != nullptr);
 }
 
 const MElement *BGMBase::findElement(double u, double v, double w, bool strict)
@@ -224,7 +224,7 @@ double BGMBase::size(const MVertex *v) { return get_nodal_value(v, sizeField); }
 std::vector<double>
 BGMBase::get_nodal_value(const MVertex *v, const VectorStorageType &data) const
 {
-  VectorStorageType::const_iterator itfind = data.find(v);
+  auto itfind = data.find(v);
   if(itfind == data.end()) {
     Msg::Error("Unknown vertex %d in BGMBase::get_nodal_value", v->getNum());
     return std::vector<double>(3, 0.);
@@ -235,7 +235,7 @@ BGMBase::get_nodal_value(const MVertex *v, const VectorStorageType &data) const
 double BGMBase::get_nodal_value(const MVertex *v,
                                 const DoubleStorageType &data) const
 {
-  DoubleStorageType::const_iterator itfind = data.find(v);
+  auto itfind = data.find(v);
   if(itfind == data.end()) {
     Msg::Error("Unknown vertex %d in BGMBase::get_nodal_value", v->getNum());
     return 0.;
@@ -250,7 +250,7 @@ BGMBase::get_nodal_values(const MElement *e,
   std::vector<std::vector<double> > res(e->getNumVertices());
 
   for(std::size_t i = 0; i < e->getNumVertices(); i++) {
-    VectorStorageType::const_iterator itfind =
+    auto itfind =
       data.find(const_cast<MVertex *>(e->getVertex(i)));
     for(int j = 0; j < 3; j++) res[i].push_back((itfind->second)[j]);
   }
diff --git a/contrib/domhex/BackgroundMesh2D.cpp b/contrib/domhex/BackgroundMesh2D.cpp
index b9933e6a11b5d8359ab3e417f19ea3badad4198d..0f62caf32f996eb61a99828794ba721eb4b794ba 100644
--- a/contrib/domhex/BackgroundMesh2D.cpp
+++ b/contrib/domhex/BackgroundMesh2D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -115,7 +115,7 @@ void backgroundMesh2D::reset(bool erase_2D3D)
     computeSizeField();
   }
   else
-    for(std::map<MVertex const *const, MVertex *>::iterator itv2 =
+    for(auto itv2 =
           _2Dto3D.begin();
         itv2 != _2Dto3D.end(); ++itv2)
       sizeField[itv2->first] = CTX::instance()->mesh.lcMax;
@@ -134,7 +134,7 @@ void backgroundMesh2D::unset()
   for(unsigned int i = 0; i < vertices.size(); i++) delete vertices[i];
   for(unsigned int i = 0; i < getNumMeshElements(); i++) delete elements[i];
   if(octree) delete octree;
-  octree = NULL;
+  octree = nullptr;
 }
 
 void backgroundMesh2D::create_mesh_copy()
@@ -151,8 +151,8 @@ void backgroundMesh2D::create_mesh_copy()
     MVertex *news[3];
     for(int j = 0; j < 3; j++) {
       MVertex *v = e->getVertex(j);
-      std::map<MVertex const *const, MVertex *>::iterator it = _3Dto2D.find(v);
-      MVertex *newv = 0;
+      auto it = _3Dto2D.find(v);
+      MVertex *newv = nullptr;
       if(it == _3Dto2D.end()) {
         SPoint2 p;
         reparamMeshVertexOnFace(v, face, p);
@@ -217,7 +217,7 @@ void backgroundMesh2D::propagateValues(DoubleStorageType &dirichlet,
   dofManager<double> myAssembler(_lsys);
 
   // fix boundary conditions
-  for(DoubleStorageType::iterator itv = dirichlet.begin();
+  for(auto itv = dirichlet.begin();
       itv != dirichlet.end(); ++itv) {
     myAssembler.fixVertex(itv->first, 0, 1, itv->second);
   }
@@ -237,7 +237,7 @@ void backgroundMesh2D::propagateValues(DoubleStorageType &dirichlet,
 
   std::map<MVertex *, SPoint3> theMap;
   if(in_parametric_plane) {
-    for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it) {
+    for(auto it = vs.begin(); it != vs.end(); ++it) {
       SPoint2 p;
       reparamMeshVertexOnFace(*it, face, p);
       theMap[*it] = SPoint3((*it)->x(), (*it)->y(), (*it)->z());
@@ -245,11 +245,11 @@ void backgroundMesh2D::propagateValues(DoubleStorageType &dirichlet,
     }
   }
 
-  for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it)
+  for(auto it = vs.begin(); it != vs.end(); ++it)
     myAssembler.numberVertex(*it, 0, 1);
 
   // Assemble
-  laplaceTerm l(0, 1, &eval_diffusivity);
+  laplaceTerm l(nullptr, 1, &eval_diffusivity);
   for(unsigned int k = 0; k < face->triangles.size(); k++) {
     MTriangle *t = face->triangles[k];
     SElement se(t);
@@ -262,12 +262,12 @@ void backgroundMesh2D::propagateValues(DoubleStorageType &dirichlet,
   }
 
   // save solution
-  for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it) {
+  for(auto it = vs.begin(); it != vs.end(); ++it) {
     myAssembler.getDofValue(*it, 0, 1, dirichlet[*it]);
   }
 
   if(in_parametric_plane) {
-    for(std::set<MVertex *>::iterator it = vs.begin(); it != vs.end(); ++it) {
+    for(auto it = vs.begin(); it != vs.end(); ++it) {
       SPoint3 p = theMap[(*it)];
       (*it)->setXYZ(p.x(), p.y(), p.z());
     }
@@ -285,7 +285,7 @@ void backgroundMesh2D::computeSizeField()
   }
 
   std::vector<GEdge *> const &e = face->edges();
-  std::vector<GEdge *>::const_iterator it = e.begin();
+  auto it = e.begin();
   DoubleStorageType sizes;
 
   for(; it != e.end(); ++it) {
@@ -299,7 +299,7 @@ void backgroundMesh2D::computeSizeField()
                                (v1->z() - v2->z()) * (v1->z() - v2->z()));
           for(int k = 0; k < 2; k++) {
             MVertex *v = (*it)->lines[i]->getVertex(k);
-            DoubleStorageType::iterator itv = sizes.find(v);
+            auto itv = sizes.find(v);
             if(itv == sizes.end())
               sizes[v] = std::log(d);
             else
@@ -313,7 +313,7 @@ void backgroundMesh2D::computeSizeField()
   simpleFunction<double> ONE(1.0);
   propagateValues(sizes, ONE);
 
-  std::map<MVertex const *const, MVertex *>::iterator itv2 = _2Dto3D.begin();
+  auto itv2 = _2Dto3D.begin();
   for(; itv2 != _2Dto3D.end(); ++itv2) {
     MVertex const *const v_2D = itv2->first;
     MVertex *v_3D = itv2->second;
@@ -330,7 +330,7 @@ inline double myAngle(const SVector3 &a, const SVector3 &b, const SVector3 &d)
 
 void backgroundMesh2D::updateSizes()
 {
-  DoubleStorageType::iterator itv = sizeField.begin();
+  auto itv = sizeField.begin();
   for(; itv != sizeField.end(); ++itv) {
     SPoint2 p;
     MVertex const *const v = _2Dto3D[itv->first];
@@ -371,14 +371,14 @@ void backgroundMesh2D::updateSizes()
   }
   const double _beta = 1.3;
   for(int i = 0; i < 0; i++) {
-    std::set<MEdge, MEdgeLessThan>::iterator it = edges.begin();
+    auto it = edges.begin();
     for(; it != edges.end(); ++it) {
       MVertex *v0 = it->getVertex(0);
       MVertex *v1 = it->getVertex(1);
       MVertex *V0 = _2Dto3D[v0];
       MVertex *V1 = _2Dto3D[v1];
-      DoubleStorageType::iterator s0 = sizeField.find(V0);
-      DoubleStorageType::iterator s1 = sizeField.find(V1);
+      auto s0 = sizeField.find(V0);
+      auto s1 = sizeField.find(V1);
       if(s0->second < s1->second)
         s1->second = std::min(s1->second, _beta * s0->second);
       else
@@ -480,7 +480,7 @@ void frameFieldBackgroundMesh2D::computeCrossField(
     return;
   }
   std::vector<GEdge *> const &e = face->edges();
-  std::vector<GEdge *>::const_iterator it = e.begin();
+  auto it = e.begin();
 
   for(; it != e.end(); ++it) {
     if(!(*it)->isSeam(face)) {
@@ -502,8 +502,8 @@ void frameFieldBackgroundMesh2D::computeCrossField(
         double _angle = myAngle(t1, d1, n);
         normalizeAngle(_angle);
         for(int i = 0; i < 2; i++) {
-          DoubleStorageType::iterator itc = _cosines4.find(v[i]);
-          DoubleStorageType::iterator its = _sines4.find(v[i]);
+          auto itc = _cosines4.find(v[i]);
+          auto its = _sines4.find(v[i]);
           if(itc != _cosines4.end()) {
             itc->second = 0.5 * (itc->second + std::cos(4 * _angle));
             its->second = 0.5 * (its->second + std::sin(4 * _angle));
@@ -520,7 +520,7 @@ void frameFieldBackgroundMesh2D::computeCrossField(
   propagateValues(_cosines4, eval_diffusivity, false);
   propagateValues(_sines4, eval_diffusivity, false);
 
-  std::map<MVertex const *const, MVertex *>::iterator itv2 = _2Dto3D.begin();
+  auto itv2 = _2Dto3D.begin();
   for(; itv2 != _2Dto3D.end(); ++itv2) {
     MVertex const *const v_2D = itv2->first;
     MVertex *v_3D = itv2->second;
@@ -581,7 +581,7 @@ void frameFieldBackgroundMesh2D::computeSmoothness()
 
   // build vertex -> neighbors table
   std::multimap<MVertex *, MVertex *> vertex2vertex;
-  for(std::vector<MElement *>::iterator it = beginelements();
+  for(auto it = beginelements();
       it != endelements(); it++) {
     MElement *e = *it;
     for(std::size_t i = 0; i < e->getNumVertices(); i++) {
@@ -595,7 +595,7 @@ void frameFieldBackgroundMesh2D::computeSmoothness()
   }
 
   // compute smoothness
-  for(std::vector<MVertex *>::iterator it = beginvertices();
+  for(auto it = beginvertices();
       it != endvertices(); it++) {
     MVertex *v = *it;
     double angle_current = angle(v);
@@ -605,7 +605,7 @@ void frameFieldBackgroundMesh2D::computeSmoothness()
       range = vertex2vertex.equal_range(v);
     double minangle, totalangle = 0.;
     int N = 0;
-    for(std::multimap<MVertex *, MVertex *>::iterator itneighbor = range.first;
+    for(auto itneighbor = range.first;
         itneighbor != range.second; itneighbor++) {
       N++;
       minangle = M_PI / 2;
@@ -636,7 +636,7 @@ void frameFieldBackgroundMesh2D::exportCrossField(const std::string &filename)
   deltas[0] = 0.;
   deltas[1] = M_PI;
 
-  for(std::vector<MVertex *>::iterator it = beginvertices();
+  for(auto it = beginvertices();
       it != endvertices(); it++) {
     MVertex *v = *it;
     double angle_current = angle(v);
diff --git a/contrib/domhex/BackgroundMesh2D.h b/contrib/domhex/BackgroundMesh2D.h
index db26ec1a49f76928863f7e00f2da7c901801e220..be68e1706775e3c6984d4454a9c52362053d5b67 100644
--- a/contrib/domhex/BackgroundMesh2D.h
+++ b/contrib/domhex/BackgroundMesh2D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/BackgroundMesh3D.cpp b/contrib/domhex/BackgroundMesh3D.cpp
index a26fe88b4b6e62031f56242229fbeadd792443c1..48acd511c5132b332c63232d774f8ba80ffe288e 100644
--- a/contrib/domhex/BackgroundMesh3D.cpp
+++ b/contrib/domhex/BackgroundMesh3D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -69,7 +69,7 @@ void backgroundMesh3D::computeSizeField()
   MVertex *v;
   MElement *e;
 
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++) { // for all GFace
     GFace *face = *it;
     frameFieldBackgroundMesh2D *bgm2d =
@@ -160,7 +160,7 @@ void backgroundMesh3D::propagateValues(DoubleStorageType &dirichlet,
 
   count2 = 0;
   volume = 0.0;
-  laplaceTerm term(0, 1, &eval_diffusivity);
+  laplaceTerm term(nullptr, 1, &eval_diffusivity);
   for(i = 0; i < gr->tetrahedra.size(); i++) {
     SElement se(gr->tetrahedra[i]);
     term.addToMatrix(assembler, &se);
@@ -219,7 +219,7 @@ MElementOctree *backgroundMesh3D::getOctree()
     GRegion *gr = dynamic_cast<GRegion *>(gf);
     if(!gr) {
       Msg::Error("Entity is not a region in background mesh");
-      return 0;
+      return nullptr;
     }
     Msg::Debug("Rebuilding BackgroundMesh element octree");
     std::vector<MElement *> copy(gr->tetrahedra.begin(), gr->tetrahedra.end());
@@ -234,7 +234,7 @@ MVertex *backgroundMesh3D::get_nearest_neighbor(const double *xyz,
   // using the octree instead of ANN, faster.
   MElement *elem = const_cast<MElement *>(findElement(xyz[0], xyz[1], xyz[2]));
 
-  if(!elem) return NULL;
+  if(!elem) return nullptr;
 
   std::vector<MVertex *> candidates(elem->getNumVertices());
   std::vector<double> distances(elem->getNumVertices());
@@ -244,7 +244,7 @@ MVertex *backgroundMesh3D::get_nearest_neighbor(const double *xyz,
     candidates[i] = v;
     distances[i] = p.distance(v->point());
   }
-  std::vector<double>::iterator itmax =
+  auto itmax =
     std::max_element(distances.begin(), distances.end());
   return candidates[std::distance(distances.begin(), itmax)];
 
@@ -313,7 +313,7 @@ void frameFieldBackgroundMesh3D::initiate_ANN_research()
   dataPtsBnd = annAllocPts(maxPts, 3);
   int i = 0;
   MVertex *v;
-  for(std::set<MVertex *>::iterator it = listOfBndVertices.begin();
+  for(auto it = listOfBndVertices.begin();
       it != listOfBndVertices.end(); it++) {
     v = *it;
     for(int k = 0; k < 3; ++k) dataPtsBnd[i][k] = (v->point())[k];
@@ -337,23 +337,23 @@ void frameFieldBackgroundMesh3D::computeSmoothnessOnlyFromBoundaries()
   double mean_angle = 0.;
   std::vector<double> vectorial_smoothness(3);
 
-  for(vert2elemtype::iterator it_vertex = vert2elem.begin();
+  for(auto it_vertex = vert2elem.begin();
       it_vertex != vert2elem.end(); it_vertex++) { // for all vertices
     themap.clear();
     neighbors.clear();
     MVertex const *current = it_vertex->first;
     std::pair<graphtype::const_iterator, graphtype::iterator> range =
       graph.equal_range(current);
-    graphtype::const_iterator itgraph = range.first;
+    auto itgraph = range.first;
     for(; itgraph != range.second; itgraph++) { // for all neighbors
       neighbors.insert(itgraph->second.second);
     }
-    for(std::set<MVertex const *>::iterator it = neighbors.begin();
+    for(auto it = neighbors.begin();
         it != neighbors.end(); it++) {
       themap.insert(std::make_pair(1., *it));
     }
 
-    TensorStorageType::iterator itcurrent = crossField.find(current);
+    auto itcurrent = crossField.find(current);
     STensor3 &ref = itcurrent->second;
 
     crossFieldSmoothness[current] =
@@ -386,7 +386,7 @@ void frameFieldBackgroundMesh3D::computeCrossField()
   std::map<MVertex const *const, bool> vertex_is_still;
   std::map<MVertex const *const, double> vertex_movement;
 
-  for(vert2elemtype::iterator it_vertex = vert2elem.begin();
+  for(auto it_vertex = vert2elem.begin();
       it_vertex != vert2elem.end(); it_vertex++) {
     MVertex const *const current = it_vertex->first;
 
@@ -397,7 +397,7 @@ void frameFieldBackgroundMesh3D::computeCrossField()
 
   // OLD - NEW COMPARISON
   std::map<MVertex const *, double> vertex_to_rank;
-  for(vert2elemtype::iterator it_vertex = vert2elem.begin();
+  for(auto it_vertex = vert2elem.begin();
       it_vertex != vert2elem.end(); it_vertex++) { // for all vertices
     // vertex_to_rank[it_vertex->first] = 0.;
     vertex_to_rank[it_vertex->first] = 1.;
@@ -443,7 +443,7 @@ void frameFieldBackgroundMesh3D::computeCrossField()
         continue;
       }
 
-      TensorStorageType::iterator itcurrent = crossField.find(current);
+      auto itcurrent = crossField.find(current);
       STensor3 &ref = itcurrent->second;
       if(verbose)
         std::cout << "-------------------- working on point "
@@ -454,7 +454,7 @@ void frameFieldBackgroundMesh3D::computeCrossField()
 
       std::pair<graphtype::iterator, graphtype::iterator> range =
         graph.equal_range(current);
-      graphtype::iterator itgraph = range.first;
+      auto itgraph = range.first;
       bool all_neighbors_still = true; // if nothing has changed since previous
                                        // iteration: nothing to do !
       for(; itgraph != range.second; itgraph++) { // for all neighbors
@@ -503,7 +503,7 @@ void frameFieldBackgroundMesh3D::computeCrossField()
 
       // iterations, convergence of the local cavity...
       for(; Nlocaliter < 20; Nlocaliter++) {
-        std::multimap<double, MVertex const *>::iterator it_neighbors_to_trust =
+        auto it_neighbors_to_trust =
           neighbors_to_trust.begin();
         crossFieldSmoothness[current] =
           compare_to_neighbors(current->point(), ref, it_neighbors_to_trust,
@@ -577,15 +577,15 @@ void frameFieldBackgroundMesh3D::computeCrossField()
   } // end Niter iterations
 
   // also computes smoothness for boundary points
-  for(vert2elemtype::iterator it_vertex = vert2elem.begin();
+  for(auto it_vertex = vert2elem.begin();
       it_vertex != vert2elem.end(); it_vertex++) {
     MVertex const *const current = it_vertex->first;
     if(current->onWhat()->dim() <= 2) {
-      TensorStorageType::iterator itcurrent = crossField.find(current);
+      auto itcurrent = crossField.find(current);
       STensor3 &ref = itcurrent->second;
       std::pair<graphtype::iterator, graphtype::iterator> range =
         graph.equal_range(current);
-      graphtype::iterator itgraph = range.first;
+      auto itgraph = range.first;
 
       std::multimap<double, MVertex const *> neighbors_to_trust;
       itgraph = range.first;
@@ -632,7 +632,7 @@ void frameFieldBackgroundMesh3D::initiate_crossfield()
   std::vector<GFace *> faces = gr->faces();
   // here, not using the gm2D since we are interested by the new 2D vertices,
   // not the old (now erased) ones... alternative would be to reset the 2DBGM...
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++) { // for all GFace
     GFace *face = *it;
     frameFieldBackgroundMesh2D *bgm2d =
@@ -651,7 +651,7 @@ void frameFieldBackgroundMesh3D::initiate_crossfield()
         v = e->getVertex(iv);
 
         // if already done: continue
-        TensorStorageType::iterator itfind = crossField.find(v);
+        auto itfind = crossField.find(v);
         if(itfind != crossField.end()) continue;
 
         STensor3 cf;
@@ -673,7 +673,7 @@ void frameFieldBackgroundMesh3D::initiate_crossfield()
       // if not in volume: continue
       if(v->onWhat()->dim() <= 2) continue;
       // if already done: continue
-      TensorStorageType::iterator itfind = crossField.find(v);
+      auto itfind = crossField.find(v);
       if(itfind != crossField.end()) continue;
       MVertex *closer_on_bnd = get_nearest_neighbor_on_boundary(v);
       crossField[v] =
@@ -705,7 +705,7 @@ frameFieldBackgroundMesh3D::get_nearest_neighbor_on_boundary(MVertex *v,
   delete[] dists;
   annDeallocPt(q);
 
-  std::set<MVertex *>::iterator it = listOfBndVertices.begin();
+  auto it = listOfBndVertices.begin();
   std::advance(it, i);
   return (*it);
 #else
@@ -822,7 +822,7 @@ const MElement *backgroundMesh3D::getElement(unsigned int i) const
   GRegion *gr = dynamic_cast<GRegion *>(gf);
   if(!gr) {
     Msg::Error("Entity is not a region in background mesh");
-    return 0;
+    return nullptr;
   }
   return gr->getMeshElement(i);
 }
@@ -846,7 +846,7 @@ void frameFieldBackgroundMesh3D::build_neighbors(const int &max_recursion_level)
   std::multimap<int, MVertex const *> proximity;
   // int counter=0;
 
-  for(vert2elemtype::iterator it_vertex = vert2elem.begin();
+  for(auto it_vertex = vert2elem.begin();
       it_vertex != vert2elem.end(); it_vertex++) { // for all vertices
     MVertex const *const current_vertex = it_vertex->first;
     visited.clear();
@@ -859,7 +859,7 @@ void frameFieldBackgroundMesh3D::build_neighbors(const int &max_recursion_level)
     get_recursive_neighbors(start, visited, visited_elements, proximity,
                             max_recursion_level);
 
-    for(std::multimap<int, MVertex const *>::iterator it1 = proximity.begin();
+    for(auto it1 = proximity.begin();
         it1 != proximity.end(); it1++) {
       graph.insert(std::make_pair(current_vertex,
                                   std::make_pair(it1->first, it1->second)));
@@ -899,16 +899,16 @@ void frameFieldBackgroundMesh3D::get_recursive_neighbors(
 
   std::set<MVertex const *> new_vertices;
 
-  for(std::set<MVertex const *>::iterator it_start = start.begin();
+  for(auto it_start = start.begin();
       it_start != start.end(); it_start++) { // for all initial vertices
     MVertex const *current = *it_start;
     //      std::cout << "get_recursive_neighbors : on vertex " <<
     //      current->getNum()
     //      << " (" << current << ")" << std::endl;
-    vert2elemtype::iterator itfind = vert2elem.find(current);
+    auto itfind = vert2elem.find(current);
     if(itfind == vert2elem.end()) continue;
 
-    std::set<MElement *>::iterator it_elem = itfind->second.begin();
+    auto it_elem = itfind->second.begin();
 
     for(; it_elem != itfind->second.end();
         it_elem++) { // for all connected elements
@@ -943,7 +943,7 @@ double frameFieldBackgroundMesh3D::compare_to_neighbors(
 {
   for(int i = 0; i < 3; i++) mean_axis(i) = 0.;
 
-  std::multimap<double, MVertex const *>::iterator it = itbegin;
+  auto it = itbegin;
   SVector3 rotation_axis;
   double minimum_angle;
 
@@ -1013,10 +1013,10 @@ double frameFieldBackgroundMesh3D::compare_to_neighbors(
            M_PI * 4.; // APPROXIMATELY between 0 (not smooth) and 1 (smooth),
                       // (sometimes <0, always > 1).
 
-  std::vector<double>::iterator itan = all_angle.begin();
-  std::vector<double>::iterator itpond = ponderations_vec.begin();
+  auto itan = all_angle.begin();
+  auto itpond = ponderations_vec.begin();
 
-  for(std::vector<SVector3>::iterator ita = all_axis.begin();
+  for(auto ita = all_axis.begin();
       ita != all_axis.end(); ita++, itan++, itpond++) {
     // mean_axis += ((*ita)*(*itan));
     mean_axis += ((*ita) * (*itan)) * (*itpond);
@@ -1276,7 +1276,7 @@ void frameFieldBackgroundMesh3D::exportVectorialSmoothness(
     const MElement *e = getElement(ie);
     for(std::size_t iv = 0; iv < e->getNumVertices(); iv++) {
       const MVertex *v = e->getVertex(iv);
-      std::set<const MVertex *>::iterator itfind = done.find(v);
+      auto itfind = done.find(v);
       if(itfind != done.end()) continue;
       done.insert(v);
       STensor3 cf;
diff --git a/contrib/domhex/BackgroundMesh3D.h b/contrib/domhex/BackgroundMesh3D.h
index d3b6a7f4f1094fb37ba703768662c3cc16346363..8fbe6a64bf864a5671d268fb5156ea2eb0552e1f 100644
--- a/contrib/domhex/BackgroundMesh3D.h
+++ b/contrib/domhex/BackgroundMesh3D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/BackgroundMeshManager.cpp b/contrib/domhex/BackgroundMeshManager.cpp
index c59bae0dd911a4bc4ca6fa6c9c74e04669b54dd3..fec613218a52cf1128a16bdb59ea65ec55d89732 100644
--- a/contrib/domhex/BackgroundMeshManager.cpp
+++ b/contrib/domhex/BackgroundMeshManager.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -13,7 +13,7 @@
 
 std::map<GEntity *, BGMBase *> BGMManager::data =
   std::map<GEntity *, BGMBase *>();
-BGMBase *BGMManager::latest2Dbgm = NULL;
+BGMBase *BGMManager::latest2Dbgm = nullptr;
 bool BGMManager::use_cross_field = true;
 
 void BGMManager::set_use_cross_field(bool b)
@@ -26,7 +26,7 @@ void BGMManager::set_use_cross_field(bool b)
 
 BGMBase *BGMManager::get(GRegion *gf)
 {
-  std::map<GEntity *, BGMBase *>::iterator itfind = data.find(gf);
+  auto itfind = data.find(gf);
   if(itfind != data.end()) {
     return itfind->second;
   }
@@ -40,7 +40,7 @@ BGMBase *BGMManager::get(GRegion *gf)
 
 BGMBase *BGMManager::get(GFace *gf)
 {
-  std::map<GEntity *, BGMBase *>::iterator itfind = data.find(gf);
+  auto itfind = data.find(gf);
   if(itfind != data.end()) {
     latest2Dbgm = itfind->second;
     return itfind->second;
diff --git a/contrib/domhex/BackgroundMeshManager.h b/contrib/domhex/BackgroundMeshManager.h
index eb95ae3c1e9f8f4de3b85243cdf4cf2b7fd079d7..6dcabb59c4e7aed72d58d093c32c90a7a7636d92 100644
--- a/contrib/domhex/BackgroundMeshManager.h
+++ b/contrib/domhex/BackgroundMeshManager.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/CMakeLists.txt b/contrib/domhex/CMakeLists.txt
index 958c2c932d8fd85d0c3ecd8fe8e1bd69d84d101f..611213c0cae367690afc834bd3db0c0b0e423cf9 100644
--- a/contrib/domhex/CMakeLists.txt
+++ b/contrib/domhex/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/ThinLayer.cpp b/contrib/domhex/ThinLayer.cpp
index f578f44d1609175ede868847cfe1005b6a7c3336..1f4c391abf12cf73029ddf9103f32ee9c9399921 100644
--- a/contrib/domhex/ThinLayer.cpp
+++ b/contrib/domhex/ThinLayer.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -66,7 +66,7 @@ void ThinLayer::perform()
 void ThinLayer::checkOppositeTriangles()
 {
   // all endTriangle will be set to active or not
-  for(std::map<MVertex *, std::vector<CorrespVertices *> >::iterator it1 =
+  for(auto it1 =
         VertexToCorresp.begin();
       it1 != VertexToCorresp.end(); it1++) {
     std::vector<CorrespVertices *> vecCorr = (*it1).second;
@@ -76,11 +76,11 @@ void ThinLayer::checkOppositeTriangles()
       MVertex *endP0 = currentEndTri.v[0];
       MVertex *endP1 = currentEndTri.v[1];
       MVertex *endP2 = currentEndTri.v[2];
-      std::map<MVertex *, std::vector<CorrespVertices *> >::iterator it2 =
+      auto it2 =
         VertexToCorresp.find(endP0);
-      std::map<MVertex *, std::vector<CorrespVertices *> >::iterator it3 =
+      auto it3 =
         VertexToCorresp.find(endP1);
-      std::map<MVertex *, std::vector<CorrespVertices *> >::iterator it4 =
+      auto it4 =
         VertexToCorresp.find(endP2);
       (*it1).second[i]->setEndTriangleActive(false);
       if(it2 != VertexToCorresp.end()) {
@@ -102,7 +102,7 @@ void ThinLayer::checkOppositeTriangles()
 
 void ThinLayer::fillvecOfThinSheets()
 {
-  for(std::map<MVertex *, std::vector<CorrespVertices *> >::iterator it1 =
+  for(auto it1 =
         VertexToCorresp.begin();
       it1 != VertexToCorresp.end(); it1++) {
     std::vector<CorrespVertices *> vecCorr = (*it1).second;
@@ -117,7 +117,7 @@ void ThinLayer::fillvecOfThinSheets()
         (*it1).second[i]->setTagMaster(-1);
         faceXtet faceEndSlave = (*it1).second[i]->getEndTriangle();
         for(unsigned int j = 0; j < 3; j++) {
-          std::map<MVertex *, std::vector<CorrespVertices *> >::iterator it2 =
+          auto it2 =
             VertexToCorresp.find(faceEndSlave.v[j]);
           if(it2 != VertexToCorresp.end()) {
             if(faceEndSlave.v[j]->onWhat()->dim() == 2) {
@@ -137,7 +137,7 @@ void ThinLayer::fillvecOfThinSheets()
             for(std::size_t k = 0; k < surroundingTet[j]->getNumVertices();
                 k++) {
               MVertex *ToInsertTmp = surroundingTet[j]->getVertex(k);
-              std::map<MVertex *, std::vector<CorrespVertices *> >::iterator
+              auto
                 it2 = VertexToCorresp.find(ToInsertTmp);
               if(ToInsertTmp->onWhat()->tag() == VToDo->onWhat()->tag()) {
                 // TODO: OR that onwhat -> dim <, for edges
@@ -151,8 +151,7 @@ void ThinLayer::fillvecOfThinSheets()
                     (*it2).second[0]->setTagMaster(-1);
                     faceXtet faceEndSlave2 = (*it2).second[0]->getEndTriangle();
                     for(unsigned int j = 0; j < 3; j++) {
-                      std::map<MVertex *,
-                               std::vector<CorrespVertices *> >::iterator it3 =
+                      auto it3 =
                         VertexToCorresp.find(faceEndSlave2.v[j]);
                       if(it3 != VertexToCorresp.end()) {
                         if(faceEndSlave2.v[j]->onWhat()->dim() == 2) {
@@ -182,12 +181,12 @@ std::map<MVertex *, double> ThinLayer::computeAllDistToOppSide()
   // std::vector<MElement*> crackElements;
   std::set<MVertex *> BoundaryVertices;
 
-  for(GModel::riter itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
+  for(auto itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
     GRegion *rTmp = (*itr);
     for(unsigned int i = 0; i < rTmp->tetrahedra.size(); i++) {
       MTet4 *tet4Tmp = TetToTet4[rTmp->tetrahedra[i]];
       for(unsigned int j = 0; j < 4; j++) {
-        if(tet4Tmp->getNeigh(j) == 0) {
+        if(tet4Tmp->getNeigh(j) == nullptr) {
           // find the 4th point,and fill the two vector of the boundary triangle
           faceXtet fxtTmp(tet4Tmp, j);
           for(int k = 0; k < 3; k++) {
@@ -203,7 +202,7 @@ std::map<MVertex *, double> ThinLayer::computeAllDistToOppSide()
       }
     }
   }
-  for(std::set<MVertex *>::iterator it = BoundaryVertices.begin();
+  for(auto it = BoundaryVertices.begin();
       it != BoundaryVertices.end(); it++) {
     MVertex *toCompute = (*it);
     double resultTmp = computeDistToOppSide(toCompute);
@@ -225,14 +224,14 @@ double ThinLayer::computeDistToOppSide(MVertex *v)
   MTet4 *PastTet = FirstTet;
   SPoint3 CurrentPos = SPoint3(v->x(), v->y(), v->z());
   SPoint3 LastPos = CurrentPos;
-  int *CurrentTri = 0;
+  int *CurrentTri = nullptr;
   CorrespVertices CVTemp;
   CVTemp.setStartPoint(v);
   CVTemp.setStartNormal(InteriorNormal);
   FindNewPoint((&CurrentPos), CurrentTri, CurrentTet, InteriorNormal);
   faceXtet fxtCV(CurrentTet, (*CurrentTri));
   //	while(CurrentTet->getNeigh((*CurrentTri)) != 0){
-  while(CurrentTet != 0) {
+  while(CurrentTet != nullptr) {
     PastTet = CurrentTet;
     faceXtet fxtCVtmp(PastTet, (*CurrentTri));
     FindNewPoint((&CurrentPos), CurrentTri, CurrentTet, InteriorNormal);
@@ -279,7 +278,7 @@ SVector3 ThinLayer::computeInteriorNormal(MVertex *v)
   for(unsigned int i = 0; i < currentVecTet.size(); i++) {
     MTet4 *tet4Tmp = TetToTet4[currentVecTet[i]];
     for(int j = 0; j < 4; j++) {
-      if(tet4Tmp->getNeigh(j) == 0) {
+      if(tet4Tmp->getNeigh(j) == nullptr) {
         // find the 4th point,and fill the two vector of the boundary triangle
         faceXtet fxtTmp(tet4Tmp, j);
         for(int k = 0; k < 4; k++) {
@@ -388,7 +387,7 @@ SVector3 ThinLayer::computeInteriorNormal(MVertex *v)
 
 MTet4 *ThinLayer::getTetFromPoint(MVertex *v, const SVector3 &InteriorNormal)
 {
-  MTet4 *TetToGet = 0;
+  MTet4 *TetToGet = nullptr;
   std::vector<MTetrahedron *> currentVecTet = VertexToTets[v];
   for(unsigned int i = 0; i < currentVecTet.size(); i++) {
     std::vector<SVector3> vecDir;
@@ -547,7 +546,7 @@ void ThinLayer::FindNewPoint(SPoint3 *CurrentPoint, int *CurrentTri,
 void ThinLayer::fillVertexToTets()
 {
   GModel *m = GModel::current();
-  for(GModel::riter itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
+  for(auto itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
     GRegion *rTmp = (*itr);
     for(unsigned int i = 0; i < rTmp->tetrahedra.size(); i++) {
       MTetrahedron *elem = rTmp->tetrahedra[i];
@@ -561,7 +560,7 @@ void ThinLayer::fillVertexToTets()
       }
     }
   }
-  for(GModel::riter itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
+  for(auto itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
     GRegion *rTmp = (*itr);
     for(unsigned int i = 0; i < rTmp->tetrahedra.size(); i++) {
       MTetrahedron *elem = rTmp->tetrahedra[i];
@@ -577,7 +576,7 @@ void ThinLayer::fillTetToTet4()
   GModel *m = GModel::current();
   std::vector<MTet4 *> vecAllTet4;
   vecAllTet4.clear();
-  for(GModel::riter itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
+  for(auto itr = m->firstRegion(); itr != m->lastRegion(); itr++) {
     GRegion *rTmp = (*itr);
     for(unsigned int i = 0; i < rTmp->tetrahedra.size(); i++) {
       MTetrahedron *elem = rTmp->tetrahedra[i];
diff --git a/contrib/domhex/ThinLayer.h b/contrib/domhex/ThinLayer.h
index 487e6ef33b52ef4bc3b6a5ed6f71ef108699be32..631d4fa44ef49f9169430ad47bb5f1e144d32a8c 100644
--- a/contrib/domhex/ThinLayer.h
+++ b/contrib/domhex/ThinLayer.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -18,7 +18,7 @@ struct faceXtet {
   MVertex *v[3], *unsorted[3];
   MTet4 *t1;
   int i1;
-  faceXtet(MTet4 *_t = 0, int iFac = 0) : t1(_t), i1(iFac)
+  faceXtet(MTet4 *_t = nullptr, int iFac = 0) : t1(_t), i1(iFac)
   {
     MVertex *v0 = t1->tet()->getVertex(faces[iFac][0]);
     MVertex *v1 = t1->tet()->getVertex(faces[iFac][1]);
diff --git a/contrib/domhex/cross3D.h b/contrib/domhex/cross3D.h
index a8efcd4459098bdad353e18320606fc6fe95ece9..a0a8fb4f76c19ec30bd68a5a8908dd5efe7ae995 100644
--- a/contrib/domhex/cross3D.h
+++ b/contrib/domhex/cross3D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/directions3D.cpp b/contrib/domhex/directions3D.cpp
index df2de3a073579c408ed63e0eee73d17523627f2c..cc15a5558e79554c5c9ea0e005b92da38a1f28a6 100644
--- a/contrib/domhex/directions3D.cpp
+++ b/contrib/domhex/directions3D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -346,7 +346,7 @@ int Frame_field::build_vertex_to_vertices(GEntity *gr, int onWhat,
       MVertex *pVertex = pElem->getVertex(j);
       if(onWhat > 0 && pVertex->onWhat()->dim() != onWhat) continue;
 
-      std::map<MVertex *, std::set<MVertex *> >::iterator it =
+      auto it =
         vertex_to_vertices.find(pVertex);
       if(it != vertex_to_vertices.end()) {
         for(unsigned int k = 1; k < n; k++)
@@ -373,7 +373,7 @@ int Frame_field::build_vertex_to_elements(GEntity *gr, bool initialize)
     unsigned int n = pElem->getNumVertices();
     for(unsigned int j = 0; j < n; j++) {
       MVertex *pVertex = pElem->getVertex(j);
-      std::map<MVertex *, std::set<MElement *> >::iterator it =
+      auto it =
         vertex_to_elements.find(pVertex);
       if(it != vertex_to_elements.end())
         it->second.insert(pElem);
@@ -400,7 +400,7 @@ void Frame_field::build_listVertices(GEntity *gr, int dim, bool initialize)
   }
   if(initialize) listVertices.clear();
 
-  for(std::set<MVertex *>::const_iterator it = list.begin(); it != list.end();
+  for(auto it = list.begin(); it != list.end();
       it++) {
     listVertices.push_back(*it);
   }
@@ -430,7 +430,7 @@ void Frame_field::deleteAnnData()
 #if defined(HAVE_ANN)
   if(annTree && annTree->thePoints()) delete annTree->thePoints();
   if(annTree) delete annTree;
-  annTree = NULL;
+  annTree = nullptr;
 #endif
 }
 
@@ -464,7 +464,7 @@ void Frame_field::initFace(GFace *gf)
       it != vertex_to_elements.end(); it++) {
     std::set<MElement *> elements = it->second;
     SVector3 Area = SVector3(0, 0, 0);
-    for(std::set<MElement *>::const_iterator iter = elements.begin();
+    for(auto iter = elements.begin();
         iter != elements.end(); iter++) {
       MElement *pElem = *iter;
       int n = pElem->getNumVertices();
@@ -484,7 +484,7 @@ void Frame_field::initFace(GFace *gf)
     }
     Area.normalize(); // average normal over neighbour face elements
     STensor3 m = convert(cross3D(Area));
-    std::map<MVertex *, STensor3>::iterator iter = crossField.find(it->first);
+    auto iter = crossField.find(it->first);
     if(iter == crossField.end())
       crossField.insert(std::pair<MVertex *, STensor3>(it->first, m));
     else
@@ -497,7 +497,7 @@ void Frame_field::initFace(GFace *gf)
   // of gf
   std::vector<GEdge *> const &edges = gf->edges();
   vertex_to_elements.clear();
-  for(std::vector<GEdge *>::const_iterator it = edges.begin();
+  for(auto it = edges.begin();
       it != edges.end(); it++) {
     build_vertex_to_elements(*it, false);
   }
@@ -517,7 +517,7 @@ void Frame_field::initFace(GFace *gf)
     SVector3 tangent = edg1.scaledTangent() + edg2.scaledTangent();
     tangent.normalize();
 
-    std::map<MVertex *, STensor3>::iterator iter = crossField.find(pVertex);
+    auto iter = crossField.find(pVertex);
     if(iter == crossField.end()) {
       std::cout << "This should not happen: cross not found 1" << std::endl;
       exit(1);
@@ -549,7 +549,7 @@ void Frame_field::initFace(GFace *gf)
     MVertex *pVertex0 = it->first;
     if(pVertex0->onWhat()->dim() != 2) continue;
 
-    std::map<MVertex *, STensor3>::iterator iter = crossField.find(pVertex0);
+    auto iter = crossField.find(pVertex0);
     cross3D y;
     if(iter == crossField.end()) {
       std::cout << "This should not happen: cross not found 2" << std::endl;
@@ -639,7 +639,7 @@ double Frame_field::findBarycenter(
   SVector3 T = SVector3(0.), dT;
   double temp = 0.;
   energy = 0;
-  for(std::set<MVertex *>::const_iterator it = list.begin(); it != list.end();
+  for(auto it = list.begin(); it != list.end();
       ++it) {
     MVertex *pVertex = *it;
     if(pVertex->getNum() == pVertex0->getNum())
@@ -716,7 +716,7 @@ void Frame_field::buildSmoothness()
       for(unsigned int k = 0; k < v0vec.size(); k++) {
         V1.insert(v0vec[k]);
       }
-      for(std::set<MVertex *>::iterator itSet = V1.begin(); itSet != V1.end();
+      for(auto itSet = V1.begin(); itSet != V1.end();
           itSet++) {
         MVertex *vTmp = (*itSet);
         V2.insert(vTmp);
@@ -725,7 +725,7 @@ void Frame_field::buildSmoothness()
           V2.insert(v0vec[k]);
         }
       }
-      for(std::set<MVertex *>::iterator itSet = V2.begin(); itSet != V2.end();
+      for(auto itSet = V2.begin(); itSet != V2.end();
           itSet++) {
         MVertex *vTmp = (*itSet);
         V3.insert(vTmp);
@@ -742,21 +742,21 @@ void Frame_field::buildSmoothness()
       double S1 = 0.0;
       double S2 = 0.0;
       double S3 = 0.0;
-      for(std::set<MVertex *>::iterator itSet = V1.begin(); itSet != V1.end();
+      for(auto itSet = V1.begin(); itSet != V1.end();
           itSet++) {
         MVertex *vTmp = (*itSet);
         STensor3 tTmp = crossField[vTmp];
         cross3D cTmp = cross3D(tTmp);
         C1.push_back(cTmp);
       }
-      for(std::set<MVertex *>::iterator itSet = V2.begin(); itSet != V2.end();
+      for(auto itSet = V2.begin(); itSet != V2.end();
           itSet++) {
         MVertex *vTmp = (*itSet);
         STensor3 tTmp = crossField[vTmp];
         cross3D cTmp = cross3D(tTmp);
         C2.push_back(cTmp);
       }
-      for(std::set<MVertex *>::iterator itSet = V3.begin(); itSet != V3.end();
+      for(auto itSet = V3.begin(); itSet != V3.end();
           itSet++) {
         MVertex *vTmp = (*itSet);
         STensor3 tTmp = crossField[vTmp];
@@ -808,7 +808,7 @@ double Frame_field::smooth()
       iter != vertex_to_vertices.end(); ++iter) {
     // MVertex* pVertex0 = iter->first;
     SVector3 T(0, 0, 0);
-    std::map<MVertex *, STensor3>::iterator itA = crossField.find(iter->first);
+    auto itA = crossField.find(iter->first);
     if(itA == crossField.end()) {
       std::cout << "This should not happen" << std::endl;
       exit(1);
@@ -874,13 +874,13 @@ void Frame_field::recur_connect_vert(FILE *fi, int count, MVertex *v,
 
   count++;
 
-  for(std::multimap<MVertex *, MVertex *>::iterator it = v2v.lower_bound(v);
+  for(auto it = v2v.lower_bound(v);
       it != v2v.upper_bound(v); ++it) {
     MVertex *nextV = it->second;
     if(touched.find(nextV) == touched.end()) {
       // compute dot product (N0,R0,A0) dot (Ni,Ri,Ai)^T
       // where N,R,A are the 3 directions
-      std::map<MVertex *, STensor3>::iterator iter = crossField.find(nextV);
+      auto iter = crossField.find(nextV);
       STensor3 nextCross = iter->second;
       STensor3 nextCrossT = nextCross.transpose();
       STensor3 prod = cross.operator*=(nextCrossT);
@@ -971,7 +971,7 @@ void Frame_field::continuousCrossField(GRegion *gr, GFace *gf)
       iter != vertex_to_vertices.end(); ++iter) {
     MVertex *v = iter->first;
     std::set<MVertex *> mySet = iter->second;
-    for(std::set<MVertex *>::iterator it = mySet.begin(); it != mySet.end();
+    for(auto it = mySet.begin(); it != mySet.end();
         ++it) {
       v2v.insert(std::make_pair(v, *it));
     }
@@ -980,7 +980,7 @@ void Frame_field::continuousCrossField(GRegion *gr, GFace *gf)
   // recursive loop
   MVertex *beginV = gf->getMeshVertex(0);
   std::set<MVertex *> touched;
-  std::map<MVertex *, STensor3>::iterator iter = crossField.find(beginV);
+  auto iter = crossField.find(beginV);
   STensor3 bCross = iter->second;
 
   FILE *fi = Fopen("cross_recur.pos", "w");
@@ -1046,7 +1046,7 @@ void Frame_field::save_dist(const std::string &filename)
   std::ofstream file(filename.c_str());
   file << "View \"Distance\" {\n";
 
-  for(std::map<MEdge, double, MEdgeLessThan>::iterator it = crossDist.begin();
+  for(auto it = crossDist.begin();
       it != crossDist.end(); it++) {
     MVertex *pVerta = it->first.getVertex(0);
     MVertex *pVertb = it->first.getVertex(1);
@@ -1118,7 +1118,7 @@ void Frame_field::save_energy(GRegion *gr, const std::string &filename)
         matvec(inv, gsf[nod1], grd1);
         matvec(inv, gsf[nod2], grd2);
         SVector3 esf = sf[nod1] * SVector3(grd2) - sf[nod2] * SVector3(grd1);
-        std::map<MEdge, double, MEdgeLessThan>::iterator it =
+        auto it =
           crossDist.find(pTet->getEdge(k));
         sum += it->second * esf;
         // sum += (pTet->getVertex(nod2)->z() - pTet->getVertex(nod1)->z()) *
@@ -1266,7 +1266,7 @@ void Size_field::solve(GRegion *gr)
   count2 = 0;
   volume = 0.0;
   simpleFunction<double> ONE(1.0);
-  laplaceTerm term(0, 1, &ONE);
+  laplaceTerm term(nullptr, 1, &ONE);
   for(i = 0; i < gr->tetrahedra.size(); i++) {
     SElement se(gr->tetrahedra[i]);
     term.addToMatrix(assembler, &se);
@@ -1305,7 +1305,7 @@ double Size_field::search(double x, double y, double z)
 
   element = (MElement *)octree->find(x, y, z, 3, true);
 
-  if(element != NULL) {
+  if(element != nullptr) {
     temp1[0] = x;
     temp1[1] = y;
     temp1[2] = z;
@@ -1549,7 +1549,7 @@ bool Nearest_point::search(double x, double y, double z, SVector3 &vec)
   delete[] indices;
   delete[] distances;
 
-  if(vicinity[index] != NULL) {
+  if(vicinity[index] != nullptr) {
     found = closest(vicinity[index], SPoint3(x, y, z));
   }
   else {
diff --git a/contrib/domhex/directions3D.h b/contrib/domhex/directions3D.h
index 3e692e17412ca5157be7b56560e10c792f2d732b..7ffdc4eac2f9960306248a0b4324cb95a4660236 100644
--- a/contrib/domhex/directions3D.h
+++ b/contrib/domhex/directions3D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/meshGFaceQuadrilateralize.cpp b/contrib/domhex/meshGFaceQuadrilateralize.cpp
index ddd0928283f2e736b310f74633ac06d2b73b6698..3e772d15496584443a103738dd9f08249d721459 100644
--- a/contrib/domhex/meshGFaceQuadrilateralize.cpp
+++ b/contrib/domhex/meshGFaceQuadrilateralize.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/meshGFaceQuadrilateralize.h b/contrib/domhex/meshGFaceQuadrilateralize.h
index c00642d5dd4158378e4c651bf4f33a6af16e6643..2d831af9da2892e3b24149a31f1a62df6dc30ee1 100644
--- a/contrib/domhex/meshGFaceQuadrilateralize.h
+++ b/contrib/domhex/meshGFaceQuadrilateralize.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/pointInsertion.cpp b/contrib/domhex/pointInsertion.cpp
index 291bb03ada5ef10ee3f8f87be95f5843defa5cef..92ddbde97f55000e8a7678e5216285e551fb1f7f 100644
--- a/contrib/domhex/pointInsertion.cpp
+++ b/contrib/domhex/pointInsertion.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -33,7 +33,7 @@ void print_nodal_info(const std::string &filename,
   std::ofstream out(filename.c_str());
 
   out << "View \"\"{" << std::endl;
-  for(typename std::map<MVertex *, T>::const_iterator it = map.begin();
+  for(auto it = map.begin();
       it != map.end(); it++) {
     MVertex *v = it->first;
     out << "SP( " << v->x() << "," << v->y() << "," << v->z() << "){"
@@ -345,7 +345,7 @@ void Filler2D::pointInsertion2D(GFace *gf, std::vector<MVertex *> &packed,
   RTree<surfacePointWithExclusionRegion *, double, 2, double> rtree;
   SMetric3 metricField(1.0);
   SPoint2 newp[4][NUMDIR];
-  std::set<MVertex *>::iterator it = bnd_vertices.begin();
+  auto it = bnd_vertices.begin();
 
   for(; it != bnd_vertices.end(); ++it) {
     SPoint2 midpoint;
@@ -536,7 +536,7 @@ bool Filler3D::treat_region(GRegion *gr)
   MElement *element;
   MVertex *vertex;
   std::vector<GFace *> faces = gr->faces();
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++) {
     GFace *gf = *it;
     // int limit = code_kesskessai(gf->tag());
@@ -552,7 +552,7 @@ bool Filler3D::treat_region(GRegion *gr)
   }
 
   int geodim;
-  for(std::set<MVertex *>::iterator it = temp.begin(); it != temp.end(); it++) {
+  for(auto it = temp.begin(); it != temp.end(); it++) {
     geodim = (*it)->onWhat()->dim();
     if((geodim == 0) || (geodim == 1) || (geodim == 2))
       boundary_vertices.push_back(*it);
diff --git a/contrib/domhex/pointInsertion.h b/contrib/domhex/pointInsertion.h
index 70a8b20f174e32a9c0fae3b487727da3189f6c0f..2b99ca620213c6389cde1c8a5152e2e2b1a47eb5 100644
--- a/contrib/domhex/pointInsertion.h
+++ b/contrib/domhex/pointInsertion.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/pointInsertionRTreeTools.cpp b/contrib/domhex/pointInsertionRTreeTools.cpp
index 4d1e9c6830dbbb7c20b18b926202334173f472d9..3c62d1adf5f3a464aefc14bf76abc782f4fcdf3c 100644
--- a/contrib/domhex/pointInsertionRTreeTools.cpp
+++ b/contrib/domhex/pointInsertionRTreeTools.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -128,7 +128,7 @@ bool inExclusionZone(
   return false;
 }
 
-frameFieldBackgroundMesh3D *Wrapper3D::bgmesh = NULL;
+frameFieldBackgroundMesh3D *Wrapper3D::bgmesh = nullptr;
 
 double infinity_distance_3D(const MVertex *v1, const MVertex *v2, STensor3 &cf)
 {
diff --git a/contrib/domhex/pointInsertionRTreeTools.h b/contrib/domhex/pointInsertionRTreeTools.h
index d0ee835739a6821bb1fab50a1eef084e579971d3..7c22eb870a158cc8f1e1be14ec3d8da48c76318d 100644
--- a/contrib/domhex/pointInsertionRTreeTools.h
+++ b/contrib/domhex/pointInsertionRTreeTools.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -45,7 +45,7 @@ public:
    */
   surfacePointWithExclusionRegion(MVertex *v, SPoint2 p[4][NUMDIR],
                                   SPoint2 &_mp, SMetric3 &meshMetric,
-                                  surfacePointWithExclusionRegion *father = 0);
+                                  surfacePointWithExclusionRegion *father = nullptr);
 
   bool inExclusionZone(const SPoint2 &p);
   void minmax(double _min[2], double _max[2]) const;
@@ -107,9 +107,9 @@ private:
   bool ok;
 
 public:
-  Wrapper3D() : individual(0), parent(0), size(0), cf(0), vec(0), ok(true) {}
+  Wrapper3D() : individual(nullptr), parent(nullptr), size(nullptr), cf(nullptr), vec(nullptr), ok(true) {}
   Wrapper3D(MVertex *_i, MVertex *_p)
-    : individual(_i), parent(_p), size(0), cf(0), vec(0), ok(true)
+    : individual(_i), parent(_p), size(nullptr), cf(nullptr), vec(nullptr), ok(true)
   {
   }
   ~Wrapper3D() {}
@@ -141,7 +141,7 @@ extern void fill_min_max(double x, double y, double z, double h, double *min,
 // listOfPoints AND in RTree: larger memory footprint but less CPU time...
 class smoothness_vertex_pair {
 public:
-  smoothness_vertex_pair() : rank(0.), size(0.), v(0), dir(0), layer(0) {}
+  smoothness_vertex_pair() : rank(0.), size(0.), v(nullptr), dir(0), layer(0) {}
   ~smoothness_vertex_pair() {}
   STensor3 cf;
   SVector3 direction;
diff --git a/contrib/domhex/simple3D.cpp b/contrib/domhex/simple3D.cpp
index 9161546102349c2d87e2a9d715b45a191752c156..16086c1d5aae4dc7d146e5571eba6b9d08424161 100644
--- a/contrib/domhex/simple3D.cpp
+++ b/contrib/domhex/simple3D.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -548,7 +548,7 @@ bool Filler::inside_domain(MElementOctree *octree, double x, double y, double z)
 {
   MElement *element;
   element = (MElement *)octree->find(x, y, z, 3, true);
-  if(element != NULL)
+  if(element != nullptr)
     return 1;
   else
     return 0;
@@ -574,8 +574,8 @@ bool Filler::far_from_boundary(MElementOctree *octree, Node *node)
   e5 = (MElement *)octree->find(x, y, z + k2 * h, 3, true);
   e6 = (MElement *)octree->find(x, y, z - k2 * h, 3, true);
 
-  if(e1 != NULL && e2 != NULL && e3 != NULL && e4 != NULL && e5 != NULL &&
-     e6 != NULL)
+  if(e1 != nullptr && e2 != nullptr && e3 != nullptr && e4 != nullptr && e5 != nullptr &&
+     e6 != nullptr)
     return 1;
   else
     return 0;
diff --git a/contrib/domhex/simple3D.h b/contrib/domhex/simple3D.h
index 0e244e61ba5a3526445e186e91f502442d6a10e5..f5e703d88d33f38d0a52a9ac3613aa9f3ba43694 100644
--- a/contrib/domhex/simple3D.h
+++ b/contrib/domhex/simple3D.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/surfaceFiller.cpp b/contrib/domhex/surfaceFiller.cpp
index cc9cff8727dd9fa9136c1041b6090ef6e516fdb9..c5da3cb993d2a3ca605809adc14998dd18dc73f4 100644
--- a/contrib/domhex/surfaceFiller.cpp
+++ b/contrib/domhex/surfaceFiller.cpp
@@ -45,7 +45,7 @@ bool compute4neighbors(
   bool goNonLinear, // do we compute the position in the real surface which is
                     // nonlinear
   SPoint2 newP[4][NUMDIR], // look into other directions
-  SMetric3 &metricField, FILE *crossf = 0) // the mesh metric
+  SMetric3 &metricField, FILE *crossf = nullptr) // the mesh metric
 {
   // we assume that v is on surface gf
 
@@ -266,10 +266,10 @@ double get_smoothness(MVertex *v, GFace *gf,
   // interpolate :
   double val[3];
   int i = 0;
-  for(std::vector<MVertex *>::iterator it = localvertices.begin();
+  for(auto it = localvertices.begin();
       it != localvertices.end(); it++) {
     MVertex *localv = *it;
-    std::map<MVertex *, double>::const_iterator itfind =
+    auto itfind =
       vertices2smoothness.find(localv);
     if(itfind == vertices2smoothness.end()) {
       Msg::Warning("Background vertex not found");
@@ -286,7 +286,7 @@ void print_nodal_info_int(const std::string &filename, std::map<MVertex *, int>
   std::ofstream out(filename.c_str());
 
   out << "View \"\"{" << std::endl;
-  for(std::map<MVertex *, int>::iterator it = mapp.begin(); it != mapp.end(); it++) {
+  for(auto it = mapp.begin(); it != mapp.end(); it++) {
     MVertex *v = it->first;
     out << "SP( " << v->x() << "," << v->y() << "," << v->z() << "){"
         << it->second << "};" << std::endl;
@@ -303,7 +303,7 @@ void print_nodal_info_double(const std::string &filename,
   std::ofstream out(filename.c_str());
 
   out << "View \"\"{" << std::endl;
-  for(std::map<MVertex *, double>::iterator it = mapp.begin(); it != mapp.end();
+  for(auto it = mapp.begin(); it != mapp.end();
       it++) {
     MVertex *v = it->first;
     out << "SP( " << v->x() << "," << v->y() << "," << v->z() << "){"
@@ -378,7 +378,7 @@ bool get_local_sizes_and_directions(const MVertex *v_center,
                                     double (&covar2)[2], double &size_param_1,
                                     double &size_param_2, double &L,
                                     SVector3 &t1, SVector3 &t2, SVector3 &n,
-                                    FILE *crossf = NULL)
+                                    FILE *crossf = nullptr)
 {
   // bool get_RK_stuff(const MVertex *v_center, const SPoint2 &midpoint, const
   // int DIR, GFace* gf, double (&covar1)[2], double (&covar2)[2], double
@@ -521,7 +521,7 @@ void packingOfParallelogramsSmoothness(GFace *gf,
 
   // build vertex -> neighbors table
   std::multimap<MVertex *, MVertex *> vertex2vertex;
-  for(std::vector<MElement *>::iterator it =
+  for(auto it =
         backgroundMesh::current()->begin_triangles();
       it != backgroundMesh::current()->end_triangles(); it++) {
     MElement *e = *it;
@@ -538,7 +538,7 @@ void packingOfParallelogramsSmoothness(GFace *gf,
   // build table vertex->smoothness
   std::map<MVertex *, double> vertices2smoothness;
   std::map<MVertex *, double> smoothness_essai;
-  for(std::vector<MVertex *>::iterator it =
+  for(auto it =
         backgroundMesh::current()->begin_vertices();
       it != backgroundMesh::current()->end_vertices(); it++) {
     MVertex *v = *it;
@@ -559,7 +559,7 @@ void packingOfParallelogramsSmoothness(GFace *gf,
     double covar1_nb[2], covar2_nb[2], L_nb, size_param_1_nb, size_param_2_nb;
     double maxprod, angle = 0.;
     int N = 0;
-    for(std::multimap<MVertex *, MVertex *>::iterator itneighbor = range.first;
+    for(auto itneighbor = range.first;
         itneighbor != range.second; itneighbor++) {
       N++;
       maxprod = 0.;
@@ -586,7 +586,7 @@ void packingOfParallelogramsSmoothness(GFace *gf,
     ss << "backgroundmesh_element_smoothness_" << gf->tag() << ".pos";
     std::ofstream out(ss.str().c_str());
     out << "View \"directions\" {" << std::endl;
-    for(std::vector<MElement *>::iterator it =
+    for(auto it =
           backgroundMesh::current()->begin_triangles();
         it != backgroundMesh::current()->end_triangles(); it++) {
       MElement *e = *it;
@@ -638,11 +638,11 @@ void packingOfParallelogramsSmoothness(GFace *gf,
   RTree<surfacePointWithExclusionRegion *, double, 2, double> rtree;
   SMetric3 metricField(1.0);
   SPoint2 newp[4][NUMDIR];
-  std::set<MVertex *>::iterator it = bnd_vertices.begin();
+  auto it = bnd_vertices.begin();
 
   char NAME[345];
   sprintf(NAME, "crossReal%d.pos", gf->tag());
-  FILE *crossf = NULL;
+  FILE *crossf = nullptr;
   if(debug) {
     crossf = Fopen(NAME, "w");
   }
@@ -726,7 +726,7 @@ void packingOfParallelogramsSmoothness(GFace *gf,
 
   // add the vertices as additional vertices in the surface mesh
   char ccc[256]; sprintf(ccc,"points%d.pos",gf->tag());
-  FILE *f = NULL;
+  FILE *f = nullptr;
   if(debug){
     f = Fopen(ccc,"w");
   }
@@ -785,11 +785,11 @@ void packingOfParallelograms(GFace *gf, std::vector<MVertex *> &packed,
   RTree<surfacePointWithExclusionRegion *, double, 2, double> rtree;
   SMetric3 metricField(1.0);
   SPoint2 newp[4][NUMDIR];
-  std::set<MVertex *>::iterator it = bnd_vertices.begin();
+  auto it = bnd_vertices.begin();
 
   char NAME[345];
   sprintf(NAME, "crossReal%d.pos", gf->tag());
-  FILE *crossf = NULL;
+  FILE *crossf = nullptr;
   if(debug) {
     crossf = Fopen(NAME, "w");
   }
@@ -843,7 +843,7 @@ void packingOfParallelograms(GFace *gf, std::vector<MVertex *> &packed,
   // add the vertices as additional vertices in the surface mesh
   char ccc[256];
   sprintf(ccc, "points%d.pos", gf->tag());
-  FILE *f = NULL;
+  FILE *f = nullptr;
   if(debug){
     f = Fopen(ccc, "w");
   }
diff --git a/contrib/domhex/surfaceFiller.h b/contrib/domhex/surfaceFiller.h
index c47d59b143630bcdb1ff15c56d06342572c0f3d1..48e4ec7946ae8d9fb4e668023f3d1adcfb0c1deb 100644
--- a/contrib/domhex/surfaceFiller.h
+++ b/contrib/domhex/surfaceFiller.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/domhex/yamakawa.cpp b/contrib/domhex/yamakawa.cpp
index 984700b7b14f85ec4dfda49b4b24ae6fb9f128ba..b1e74958b51125cf3f4f1a348e64abf1f24d6d8d 100644
--- a/contrib/domhex/yamakawa.cpp
+++ b/contrib/domhex/yamakawa.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -93,7 +93,7 @@ namespace {
   bool inclusion(MVertex *v1, MVertex *v2, MVertex *v3,
                  const std::set<MElement *> &tets)
   {
-    for(std::set<MElement *>::const_iterator it = tets.begin();
+    for(auto it = tets.begin();
         it != tets.end(); it++) {
       if(tet_contains_vertex(*it, v1) && tet_contains_vertex(*it, v2) &&
          tet_contains_vertex(*it, v3)) {
@@ -393,7 +393,7 @@ namespace {
   {
     TetMeshConnectivity::TetSet tets_around_v =
       tet_mesh.tets_around_vertex(vertex);
-    for(TetMeshConnectivity::TetSet::const_iterator tet = tets_around_v.begin();
+    for(auto tet = tets_around_v.begin();
         tet != tets_around_v.end(); ++tet) {
       if(hex_contains_tet(hex, *tet)) { result.insert(*tet); }
     }
@@ -413,7 +413,7 @@ namespace {
       MVertex *v = tet->getVertex(i);
       if(v != v1 && v != v2 && v != v3) { return v; }
     }
-    return NULL;
+    return nullptr;
   }
 
   // Among the input tetrahedra find the first tet that contains v1, v2, and v3
@@ -424,7 +424,7 @@ namespace {
   MVertex *find(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4,
                 const std::set<MElement *> &tets)
   {
-    for(std::set<MElement *>::const_iterator it = tets.begin();
+    for(auto it = tets.begin();
         it != tets.end(); it++) {
       MElement *tet = *it;
       if(tet_contains_vertex(tet, v1) && tet_contains_vertex(tet, v2) &&
@@ -432,14 +432,14 @@ namespace {
         return last_tet_vertex(tet, v1, v2, v3);
       }
     }
-    return NULL;
+    return nullptr;
   }
 
   template <class T>
   bool find_value_in_multiset(const std::multiset<T> &set, const T &value,
                               T &value_in_set)
   {
-    typename std::multiset<T>::const_iterator it = set.find(value);
+    auto it = set.find(value);
     for(; it != set.end() && it->get_hash() == value.get_hash(); ++it) {
       if(value.same_vertices(*it)) {
         value_in_set = *it;
@@ -453,7 +453,7 @@ namespace {
   template <class T>
   bool find_value_in_multiset(const std::multiset<T> &set, const T &value)
   {
-    typename std::multiset<T>::const_iterator it = set.find(value);
+    auto it = set.find(value);
     for(; it != set.end() && it->get_hash() == value.get_hash(); ++it) {
       if(value.same_vertices(*it)) { return true; }
     }
@@ -494,28 +494,28 @@ void export_gregion_mesh(GRegion *gr, const string &filename)
   map<MVertex *, int> vertices;
   int counterv = 1;
 
-  for(vector<MTetrahedron *>::iterator it = gr->tetrahedra.begin();
+  for(auto it = gr->tetrahedra.begin();
       it != gr->tetrahedra.end(); it++) {
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
       vertices.insert(make_pair((*it)->getVertex(i), counterv));
       counterv++;
     }
   }
-  for(vector<MHexahedron *>::iterator it = gr->hexahedra.begin();
+  for(auto it = gr->hexahedra.begin();
       it != gr->hexahedra.end(); it++) {
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
       vertices.insert(make_pair((*it)->getVertex(i), counterv));
       counterv++;
     }
   }
-  for(vector<MPrism *>::iterator it = gr->prisms.begin();
+  for(auto it = gr->prisms.begin();
       it != gr->prisms.end(); it++) {
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
       vertices.insert(make_pair((*it)->getVertex(i), counterv));
       counterv++;
     }
   }
-  for(vector<MPyramid *>::iterator it = gr->pyramids.begin();
+  for(auto it = gr->pyramids.begin();
       it != gr->pyramids.end(); it++) {
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
       vertices.insert(make_pair((*it)->getVertex(i), counterv));
@@ -531,7 +531,7 @@ void export_gregion_mesh(GRegion *gr, const string &filename)
       << "$Nodes" << endl
       << vertices.size() << endl;
   // write vertices
-  for(map<MVertex *, int>::iterator it = vertices.begin(); it != vertices.end();
+  for(auto it = vertices.begin(); it != vertices.end();
       it++)
     out << it->second << " " << it->first->x() << " " << it->first->y() << " "
         << it->first->z() << endl;
@@ -543,7 +543,7 @@ void export_gregion_mesh(GRegion *gr, const string &filename)
 
   // write elems
   int counter = 1;
-  for(vector<MTetrahedron *>::iterator it = gr->tetrahedra.begin();
+  for(auto it = gr->tetrahedra.begin();
       it != gr->tetrahedra.end(); it++) {
     out << counter << " 4 2 0 26";
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
@@ -553,7 +553,7 @@ void export_gregion_mesh(GRegion *gr, const string &filename)
     out << endl;
     counter++;
   }
-  for(vector<MHexahedron *>::iterator it = gr->hexahedra.begin();
+  for(auto it = gr->hexahedra.begin();
       it != gr->hexahedra.end(); it++) {
     out << counter << " 5 2 0 26";
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
@@ -563,7 +563,7 @@ void export_gregion_mesh(GRegion *gr, const string &filename)
     out << endl;
     counter++;
   }
-  for(vector<MPrism *>::iterator it = gr->prisms.begin();
+  for(auto it = gr->prisms.begin();
       it != gr->prisms.end(); it++) {
     out << counter << " 6 2 0 26";
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
@@ -573,7 +573,7 @@ void export_gregion_mesh(GRegion *gr, const string &filename)
     out << endl;
     counter++;
   }
-  for(vector<MPyramid *>::iterator it = gr->pyramids.begin();
+  for(auto it = gr->pyramids.begin();
       it != gr->pyramids.end(); it++) {
     out << counter << " 7 2 0 26";
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
@@ -605,7 +605,7 @@ bool compare_hex_ptr_by_quality(Hex *a, Hex *b)
 
 Recombinator::~Recombinator()
 {
-  for(std::vector<Hex *>::iterator it = potential.begin();
+  for(auto it = potential.begin();
       it != potential.end(); it++) {
     delete *it;
   }
@@ -617,7 +617,7 @@ void Recombinator::execute()
   // Backup the current mesh
   model->writeMSH("beforeyamakawa.msh");
 
-  for(GModel::riter region_itr = model->firstRegion();
+  for(auto region_itr = model->firstRegion();
       region_itr != model->lastRegion(); region_itr++) {
     GRegion *region = *region_itr;
 
@@ -647,7 +647,7 @@ void Recombinator::print_all_potential_hex() const
   std::cout
     << "__________________________ START POT HEX LISTING ____________________ "
     << endl;
-  for(std::vector<Hex *>::const_iterator it = potential.begin();
+  for(auto it = potential.begin();
       it != potential.end(); it++) {
     cout << "--- Potential hex : " << *(*it) << "   " << (*it)->get_quality()
          << endl;
@@ -722,13 +722,13 @@ void Recombinator::pattern1()
       remove_values_from_set(bin3, added);
 
       added.resize(7);
-      for(vertex_set_itr it1 = bin1.begin(); it1 != bin1.end(); it1++) {
+      for(auto it1 = bin1.begin(); it1 != bin1.end(); it1++) {
         MVertex *p = *it1;
         added[4] = p;
-        for(vertex_set_itr it2 = bin2.begin(); it2 != bin2.end(); it2++) {
+        for(auto it2 = bin2.begin(); it2 != bin2.end(); it2++) {
           MVertex *q = *it2;
           added[5] = q;
-          for(vertex_set_itr it3 = bin3.begin(); it3 != bin3.end(); it3++) {
+          for(auto it3 = bin3.begin(); it3 != bin3.end(); it3++) {
             MVertex *r = *it3;
             added[6] = r;
             if(p != q && p != r && q != r) {
@@ -737,7 +737,7 @@ void Recombinator::pattern1()
               tet_mesh.vertices_around_vertices(p, q, r, bin4);
               remove_values_from_set(bin4, added);
 
-              for(std::set<MVertex *>::iterator it4 = bin4.begin();
+              for(auto it4 = bin4.begin();
                   it4 != bin4.end(); it4++) {
                 MVertex *s = *it4;
                 Hex *hex = new Hex(a, b, q, c, d, p, s, r);
@@ -785,10 +785,10 @@ void Recombinator::pattern2()
       MVertex *s = find(a, b, d, c, verif);
       MVertex *p = find(b, c, d, a, verif);
 
-      if(s != NULL && p != NULL) {
+      if(s != nullptr && p != nullptr) {
         MVertex *r = find(s, b, d, a, verif);
         MVertex *q = find(p, b, d, c, verif);
-        if(r != 0 && q != 0) {
+        if(r != nullptr && q != nullptr) {
           // 2 possible hexes
           Hex *hex = new Hex(a, s, b, c, d, r, q, p);
           add_or_free_potential_hex(hex);
@@ -832,11 +832,11 @@ void Recombinator::pattern3()
       MVertex *bA = find(a, c, b, d, verif2);
       MVertex *bB = find(a, c, d, b, verif2);
 
-      if(fA != 0 && fB != 0 && bA != 0 && bB != 0 && fA != fB && bA != bB) {
+      if(fA != nullptr && fB != nullptr && bA != nullptr && bB != nullptr && fA != fB && bA != bB) {
         if(scalar(fA, fB, a, b) > scalar(fA, fB, b, c) &&
            scalar(bA, bB, a, b) > scalar(bA, bB, b, c)) {
-          MVertex *p = NULL;
-          MVertex *q = NULL;
+          MVertex *p = nullptr;
+          MVertex *q = nullptr;
           if(distance(fA, b, c) < distance(fB, b, c)) {
             p = fA;
             q = fB;
@@ -846,8 +846,8 @@ void Recombinator::pattern3()
             q = fA;
           }
 
-          MVertex *r = NULL;
-          MVertex *s = NULL;
+          MVertex *r = nullptr;
+          MVertex *s = nullptr;
           if(distance(bA, b, c) < distance(bB, b, c)) {
             r = bA;
             s = bB;
@@ -876,8 +876,8 @@ void Recombinator::pattern3()
         } // copy paste alert
         else if(scalar(fA, fB, a, b) <= scalar(fA, fB, b, c) &&
                 scalar(bA, bB, a, b) <= scalar(bA, bB, b, c)) {
-          MVertex *p = NULL;
-          MVertex *q = NULL;
+          MVertex *p = nullptr;
+          MVertex *q = nullptr;
           if(distance(fA, a, b) < distance(fB, a, b)) {
             p = fA;
             q = fB;
@@ -886,8 +886,8 @@ void Recombinator::pattern3()
             p = fB;
             q = fA;
           }
-          MVertex *r = NULL;
-          MVertex *s = NULL;
+          MVertex *r = nullptr;
+          MVertex *s = nullptr;
           if(distance(bA, a, b) < distance(bB, a, b)) {
             r = bA;
             s = bB;
@@ -935,10 +935,10 @@ void add_hex_to_region(GRegion *region, const Hex &hex)
 
 bool Recombinator::are_all_tets_free(const std::set<MElement *> &tets) const
 {
-  for(std::set<MElement *>::const_iterator it = tets.begin(); it != tets.end();
+  for(auto it = tets.begin(); it != tets.end();
       it++) {
     MElement *tet = *it;
-    std::map<MElement *, bool>::const_iterator it2 = markings.find(tet);
+    auto it2 = markings.find(tet);
     if(it2->second == true) { return false; }
   }
   return true;
@@ -946,9 +946,9 @@ bool Recombinator::are_all_tets_free(const std::set<MElement *> &tets) const
 
 void Recombinator::mark_tets(const std::set<MElement *> &tets)
 {
-  for(std::set<MElement *>::const_iterator it = tets.begin(); it != tets.end();
+  for(auto it = tets.begin(); it != tets.end();
       ++it) {
-    std::map<MElement *, bool>::iterator it2 = markings.find(*it);
+    auto it2 = markings.find(*it);
     it2->second = true;
   }
 }
@@ -956,7 +956,7 @@ void Recombinator::mark_tets(const std::set<MElement *> &tets)
 void remove_slivers(std::set<MElement *> &tets, const Hex &hex,
                     std::set<MElement *> &slivers)
 {
-  for(std::set<MElement *>::iterator it = tets.begin(); it != tets.end();
+  for(auto it = tets.begin(); it != tets.end();
       ++it) {
     if(is_combinatorially_sliver(*it, hex)) {
       slivers.insert(*it);
@@ -974,7 +974,7 @@ void Recombinator::delete_marked_tets_in_region() const
   current_region->tetrahedra.clear();
   for(unsigned int i = 0; i < copy_tets.size(); i++) {
     MElement *element = (MElement *)(copy_tets[i]);
-    std::map<MElement *, bool>::const_iterator it2 = markings.find(element);
+    auto it2 = markings.find(element);
     if(it2->second == false) {
       current_region->tetrahedra.push_back(copy_tets[i]);
     }
@@ -1077,7 +1077,7 @@ void Recombinator::build_tuples()
 
   std::vector<GFace *> faces = current_region->faces();
 
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++) {
     GFace *gf = *it;
 
@@ -1124,7 +1124,7 @@ void Recombinator::create_quads_on_boundary()
 void Recombinator::delete_quad_triangles_in_boundary() const
 {
   std::vector<GFace *> faces = current_region->faces();
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++) {
     GFace *gf = *it;
     std::vector<MElement *> triangles_to_keep;
@@ -1288,11 +1288,11 @@ bool Recombinator::faces_statuquo(MVertex *a, MVertex *b, MVertex *c,
     Tuple tuple1(a, b, c);
     Tuple tuple2(c, d, a);
 
-    std::multiset<Tuple>::iterator it1 = tuples.find(tuple1);
-    std::multiset<Tuple>::iterator it2 = tuples.find(tuple2);
+    auto it1 = tuples.find(tuple1);
+    auto it2 = tuples.find(tuple2);
 
-    GFace *gf1 = NULL;
-    GFace *gf2 = NULL;
+    GFace *gf1 = nullptr;
+    GFace *gf2 = nullptr;
 
     while(it1 != tuples.end() && it1->get_hash() == tuple1.get_hash()) {
       if(tuple1.same_vertices(*it1)) { gf1 = it1->get_gf(); }
@@ -1307,7 +1307,7 @@ bool Recombinator::faces_statuquo(MVertex *a, MVertex *b, MVertex *c,
 
     assert((gf1 == NULL && gf2 == NULL) || (gf1 != NULL && gf2 != NULL));
 
-    if(gf1 != NULL && gf2 != NULL) {
+    if(gf1 != nullptr && gf2 != nullptr) {
       if(gf1 != gf2) { return false; }
       else
         return true;
@@ -1319,11 +1319,11 @@ bool Recombinator::faces_statuquo(MVertex *a, MVertex *b, MVertex *c,
     Tuple tuple1(a, b, d);
     Tuple tuple2(b, c, d);
 
-    std::multiset<Tuple>::iterator it1 = tuples.find(tuple1);
-    std::multiset<Tuple>::iterator it2 = tuples.find(tuple2);
+    auto it1 = tuples.find(tuple1);
+    auto it2 = tuples.find(tuple2);
 
-    GFace *gf1 = NULL;
-    GFace *gf2 = NULL;
+    GFace *gf1 = nullptr;
+    GFace *gf2 = nullptr;
 
     while(it1 != tuples.end() && it1->get_hash() == tuple1.get_hash()) {
       if(tuple1.same_vertices(*it1)) { gf1 = it1->get_gf(); }
@@ -1335,7 +1335,7 @@ bool Recombinator::faces_statuquo(MVertex *a, MVertex *b, MVertex *c,
       it2++;
     }
 
-    if(gf1 != NULL && gf2 != NULL) {
+    if(gf1 != nullptr && gf2 != nullptr) {
       if(gf1 != gf2) { return false; }
       else
         return true;
@@ -1981,7 +1981,7 @@ void Supplementary::create_quads_on_boundary(MVertex *a, MVertex *b, MVertex *c,
   std::multiset<Tuple>::iterator it1;
   std::multiset<Tuple>::iterator it2;
 
-  gf1 = NULL;
+  gf1 = nullptr;
   // gf2 = NULL;
 
   tuple1 = Tuple(a, b, c);
@@ -2675,8 +2675,8 @@ bool Supplementary::faces_statuquo(MVertex *a, MVertex *b, MVertex *c,
 
   bool ok = 1;
 
-  gf1 = NULL;
-  gf2 = NULL;
+  gf1 = nullptr;
+  gf2 = nullptr;
 
   Tuple tuple1(a, b, c);
   Tuple tuple2(c, d, a);
@@ -2765,7 +2765,7 @@ void Supplementary::build_vertex_to_vertices(GRegion *gr)
         MVertex *c = element->getVertex((j + 2) % 4);
         MVertex *d = element->getVertex((j + 3) % 4);
 
-        Vertex2Vertices::iterator it = vertex_to_vertices.find(a);
+        auto it = vertex_to_vertices.find(a);
         if(it != vertex_to_vertices.end()) {
           it->second.insert(b);
           it->second.insert(c);
@@ -2795,7 +2795,7 @@ void Supplementary::build_vertex_to_tetrahedra(GRegion *gr)
       for(std::size_t j = 0; j < element->getNumVertices(); j++) {
         MVertex *getVertex = element->getVertex(j);
 
-        Vertex2Elements::iterator it = vertex_to_tetrahedra.find(getVertex);
+        auto it = vertex_to_tetrahedra.find(getVertex);
         if(it != vertex_to_tetrahedra.end()) { it->second.insert(element); }
         else {
           bin.clear();
@@ -3082,7 +3082,7 @@ void PostOp::executeNew(GRegion *gr)
       std::set<MElement *> potential;
       find_tetrahedra(f.get_a(), f.get_b(), f.get_c(), potential);
 
-      element_set_itr it = potential.begin();
+      auto it = potential.begin();
       while(it != potential.end()) {
         if(tetrahedra.find(*it) == tetrahedra.end())
           potential.erase(it++);
@@ -3247,7 +3247,7 @@ MVertex *PostOp::otherVertexQuadFace(MFace &f, MVertex *v1, MVertex *v2,
                                      MVertex *v3)
 {
   int n = 0;
-  MVertex *v = 0;
+  MVertex *v = nullptr;
   for(int i = 0; i < 4; ++i) {
     if(f.getVertex(i) != v1 && f.getVertex(i) != v2 && f.getVertex(i) != v3) {
       ++n;
@@ -3255,7 +3255,7 @@ MVertex *PostOp::otherVertexQuadFace(MFace &f, MVertex *v1, MVertex *v2,
     }
   }
   if(n == 1) return v;
-  return NULL;
+  return nullptr;
 }
 
 void PostOp::matchQuadFace(MFace &f, MVertex *v1, MVertex *v2, MVertex *v3)
@@ -3584,7 +3584,7 @@ void PostOp::split_pyramids(GRegion *gr)
     std::set<MElement *> otherPyr;
     find_pyramids_from_quad(a, b, c, d, otherPyr);
     if(otherPyr.size() == 2) {
-      element_set_itr myit = otherPyr.begin();
+      auto myit = otherPyr.begin();
       MElement *other = *myit;
       if(other == element) { other = *(++myit); }
       // TODO test also quality of tet after split of other pyr ?
@@ -4115,7 +4115,7 @@ void PostOp::pyramids2(MVertex *a, MVertex *b, MVertex *c, MVertex *d,
   // y = (diagA->y() + diagB->y())/2.0;
   // z = (diagA->z() + diagB->z())/2.0;
 
-  mid = 0;
+  mid = nullptr;
   movables.clear();
 
   if(tetrahedra.size() > 0 || pyramids.size() > 0) {
@@ -4197,7 +4197,7 @@ void PostOp::pyramids2(MVertex *a, MVertex *b, MVertex *c, MVertex *d,
         MVertex *Nin = other(*it, diagA, diagB, Nout);
         //        N1 = other(*it,diagA,diagB);
 
-        if(Nout != 0 && Nin != 0) {
+        if(Nout != nullptr && Nin != nullptr) {
           Ns.insert(N1);
           Ns.insert(N2);
 
@@ -4242,7 +4242,7 @@ void PostOp::pyramids2(MVertex *a, MVertex *b, MVertex *c, MVertex *d,
         build_vertex_to_pyramids(temp2);
 
         MVertex *NoutDiag = findInTriFace(diagA, diagB, nDiagA, nDiagB, *it);
-        MVertex *NoutNDiag = NULL;
+        MVertex *NoutNDiag = nullptr;
         for(int iV = 0; iV < 5; iV++) {
           MVertex *v = (*it)->getVertex(iV);
           if(v != a && v != b && v != c && v != d && v != NoutDiag) {
@@ -4506,7 +4506,7 @@ void PostOp::create_quads_on_boundary(MVertex *a, MVertex *b, MVertex *c,
   std::multiset<Tuple>::iterator it1;
   std::multiset<Tuple>::iterator it2;
 
-  gf1 = NULL;
+  gf1 = nullptr;
   // gf2 = NULL;
 
   tuple1 = Tuple(a, b, c);
@@ -4682,7 +4682,7 @@ bool PostOp::different(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4)
 
 MVertex *PostOp::other(MElement *element, MVertex *v1, MVertex *v2)
 {
-  MVertex *pointer = NULL;
+  MVertex *pointer = nullptr;
 
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
@@ -4697,7 +4697,7 @@ MVertex *PostOp::other(MElement *element, MVertex *v1, MVertex *v2)
 
 MVertex *PostOp::other(MElement *element, MVertex *v1, MVertex *v2, MVertex *v3)
 {
-  MVertex *pointer = NULL;
+  MVertex *pointer = nullptr;
 
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
@@ -4821,13 +4821,13 @@ MVertex *PostOp::findInTriFace(MVertex *in0, MVertex *in1, MVertex *out0,
         if(face.getVertex(iV) != in0 && face.getVertex(iV) != in1)
           return face.getVertex(iV);
   }
-  return NULL;
+  return nullptr;
 }
 
 MVertex *PostOp::find(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4,
                       MElement *element)
 {
-  MVertex *pointer = NULL;
+  MVertex *pointer = nullptr;
 
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
@@ -5054,7 +5054,7 @@ void PostOp::build_vertex_to_tetrahedra(MElement *element)
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
 
-    Vertex2Elements::iterator it = vertex_to_tetrahedra.find(getVertex);
+    auto it = vertex_to_tetrahedra.find(getVertex);
     if(it != vertex_to_tetrahedra.end()) { it->second.insert(element); }
     else {
       bin.clear();
@@ -5070,7 +5070,7 @@ void PostOp::erase_vertex_to_tetrahedra(MElement *element)
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
 
-    Vertex2Elements::iterator it = vertex_to_tetrahedra.find(getVertex);
+    auto it = vertex_to_tetrahedra.find(getVertex);
     if(it != vertex_to_tetrahedra.end()) { it->second.erase(element); }
   }
 }
@@ -5092,7 +5092,7 @@ void PostOp::build_vertex_to_pyramids(MElement *element)
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
 
-    Vertex2Elements::iterator it = vertex_to_pyramids.find(getVertex);
+    auto it = vertex_to_pyramids.find(getVertex);
     if(it != vertex_to_pyramids.end()) { it->second.insert(element); }
     else {
       bin.clear();
@@ -5108,7 +5108,7 @@ void PostOp::erase_vertex_to_pyramids(MElement *element)
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
 
-    Vertex2Elements::iterator it = vertex_to_pyramids.find(getVertex);
+    auto it = vertex_to_pyramids.find(getVertex);
     if(it != vertex_to_pyramids.end()) { it->second.erase(element); }
   }
 }
@@ -5130,7 +5130,7 @@ void PostOp::build_vertex_to_hexPrism(MElement *element)
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
 
-    Vertex2Elements::iterator it = vertex_to_hexPrism.find(getVertex);
+    auto it = vertex_to_hexPrism.find(getVertex);
     if(it != vertex_to_hexPrism.end()) { it->second.insert(element); }
     else {
       bin.clear();
@@ -5146,7 +5146,7 @@ void PostOp::erase_vertex_to_hexPrism(MElement *element)
   for(std::size_t i = 0; i < element->getNumVertices(); i++) {
     MVertex *getVertex = element->getVertex(i);
 
-    Vertex2Elements::iterator it = vertex_to_hexPrism.find(getVertex);
+    auto it = vertex_to_hexPrism.find(getVertex);
     if(it != vertex_to_hexPrism.end()) { it->second.erase(element); }
   }
 }
@@ -5197,19 +5197,19 @@ void export_the_clique_graphviz_format(cliques_compatibility_graph<T> &cl,
 {
   ofstream out(filename.c_str());
   out << "Graph G {" << endl;
-  typename multimap<int, set<T> >::reverse_iterator it_all = cl.allQ.rbegin();
+  auto it_all = cl.allQ.rbegin();
 
   for(int i = 0; i < clique_number; i++) { it_all++; }
   //  int clique_size = it_all->second.size();
-  typename set<T>::iterator ithex = it_all->second.begin();
-  typename set<T>::iterator ithexen = it_all->second.end();
+  auto ithex = it_all->second.begin();
+  auto ithexen = it_all->second.end();
 
   int counter = 1;
   map<T, int> visited_hex;
   multimap<int, int> done;
 
   // export all hex
-  typename cliques_compatibility_graph<T>::graph::const_iterator itgraph =
+  auto itgraph =
     cl.begin_graph();
   typename cliques_compatibility_graph<T>::graph_data::const_iterator
     itgraphdata;
@@ -5218,7 +5218,7 @@ void export_the_clique_graphviz_format(cliques_compatibility_graph<T> &cl,
     T firsthex = itgraph->second.first;
     //    if (!post_check_validation(firsthex)) continue;
 
-    typename map<T, int>::iterator itfind = visited_hex.find(firsthex);
+    auto itfind = visited_hex.find(firsthex);
     int num1 = 0;
     if(itfind == visited_hex.end()) {
       num1 = counter;
@@ -5244,7 +5244,7 @@ void export_the_clique_graphviz_format(cliques_compatibility_graph<T> &cl,
       bool found = false;
       pair<multimap<int, int>::iterator, multimap<int, int>::iterator> range =
         done.equal_range(num1);
-      for(multimap<int, int>::iterator it = range.first; it != range.second;
+      for(auto it = range.first; it != range.second;
           it++) {
         if(it->second == num2) {
           found = true;
@@ -5261,7 +5261,7 @@ void export_the_clique_graphviz_format(cliques_compatibility_graph<T> &cl,
   // export chosen hex with different color
   for(; ithex != ithexen;
       ithex++) { // brutal post-check: random pickup of hexahedra in clique
-    typename map<T, int>::iterator itfind = visited_hex.find(*ithex);
+    auto itfind = visited_hex.find(*ithex);
     if(itfind == visited_hex.end()) {
       cout << "graph export: should not happen ! " << endl;
       throw;
@@ -5301,10 +5301,10 @@ void clique_stop_criteria<T>::export_corresponding_mesh(
   set<MElement *> hexs;
   map<MVertex *, int> vertices;
   int counterv = 1;
-  typename map<T, std::set<MElement *> >::const_iterator it =
+  auto it =
     hex_to_tet.begin();
   for(; it != hex_to_tet.end(); it++) {
-    std::set<MElement *>::const_iterator itt = it->second.begin();
+    auto itt = it->second.begin();
     for(; itt != it->second.end(); itt++) {
       tets.insert(*itt);
       for(int i = 0; i < 4; i++) {
@@ -5315,9 +5315,9 @@ void clique_stop_criteria<T>::export_corresponding_mesh(
   }
 
   // create MHexahedron, remove included tets from set "tets"
-  for(typename graph_data_no_hash::const_iterator it = clique.begin();
+  for(auto it = clique.begin();
       it != clique.end(); it++) {
-    typename map<T, std::set<MElement *> >::const_iterator itfind =
+    auto itfind =
       hex_to_tet.find(*it);
     if(itfind == hex_to_tet.end()) {
       cout << "clique_stop_criteria::void export_corresponding_mesh : not "
@@ -5326,7 +5326,7 @@ void clique_stop_criteria<T>::export_corresponding_mesh(
       throw;
     }
     // remove tets
-    for(set<MElement *>::const_iterator ittet = itfind->second.begin();
+    for(auto ittet = itfind->second.begin();
         ittet != itfind->second.end(); ittet++) {
       tets.erase(*ittet);
     }
@@ -5357,7 +5357,7 @@ void clique_stop_criteria<T>::export_corresponding_mesh(
           << "$Nodes" << endl
           << vertices.size() << endl;
   // write vertices
-  for(map<MVertex *, int>::iterator it = vertices.begin(); it != vertices.end();
+  for(auto it = vertices.begin(); it != vertices.end();
       it++) {
     out << it->second << " " << it->first->x() << " " << it->first->y() << " "
         << it->first->z() << endl;
@@ -5373,7 +5373,7 @@ void clique_stop_criteria<T>::export_corresponding_mesh(
   // write hexs
   int counter = 1;
   int countertets = 1;
-  for(set<MElement *>::iterator it = hexs.begin(); it != hexs.end(); it++) {
+  for(auto it = hexs.begin(); it != hexs.end(); it++) {
     out << counter << " 5 2 0 26";
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
       MVertex *v = (*it)->getVertex(i);
@@ -5383,7 +5383,7 @@ void clique_stop_criteria<T>::export_corresponding_mesh(
     counter++;
   }
   // write tets
-  for(set<MElement *>::iterator it = tets.begin(); it != tets.end(); it++) {
+  for(auto it = tets.begin(); it != tets.end(); it++) {
     out << counter << " 4 2 0 26";
     outtets << counter << " 4 2 0 26";
     for(std::size_t i = 0; i < (*it)->getNumVertices(); i++) {
@@ -5415,9 +5415,9 @@ bool clique_stop_criteria<T>::stop(const graph_data_no_hash &clique) const
 
   set<MElement *> thetets;
   //  set<MElement*> slivers;
-  for(typename graph_data_no_hash::const_iterator it = clique.begin();
+  for(auto it = clique.begin();
       it != clique.end(); it++) {
-    typename map<T, std::set<MElement *> >::const_iterator itfind =
+    auto itfind =
       hex_to_tet.find(*it);
     if(itfind == hex_to_tet.end()) {
       cout << "clique_stop_criteria::bool stop : not found !!!" << endl;
@@ -5425,7 +5425,7 @@ bool clique_stop_criteria<T>::stop(const graph_data_no_hash &clique) const
     }
     //    total += (itfind->second.size());
     //    cout << "volumes=" << endl;
-    for(set<MElement *>::const_iterator ittet = itfind->second.begin();
+    for(auto ittet = itfind->second.begin();
         ittet != itfind->second.end(); ittet++) {
       //      set<MElement*>::iterator itfindtet = thetets.find(*ittet);
       //      if (itfindtet!=thetets.end()){
@@ -5439,7 +5439,7 @@ bool clique_stop_criteria<T>::stop(const graph_data_no_hash &clique) const
 
   // to be sure, adding volume criteria...
   vector<double> volumes;
-  for(set<MElement *>::iterator it = thetets.begin(); it != thetets.end();
+  for(auto it = thetets.begin(); it != thetets.end();
       it++) {
     volumes.push_back((*it)->getVolume());
   }
@@ -5447,7 +5447,7 @@ bool clique_stop_criteria<T>::stop(const graph_data_no_hash &clique) const
     (std::accumulate(volumes.begin(), volumes.end(), 0)) / volumes.size();
   int nb_slivers = 0;
   double threshold = 1.e-3 * meanvolume;
-  for(set<MElement *>::iterator it = thetets.begin(); it != thetets.end();
+  for(auto it = thetets.begin(); it != thetets.end();
       it++) {
     if((*it)->getVolume() < threshold) { nb_slivers++; }
   }
@@ -5486,7 +5486,7 @@ template <class T> void cliques_compatibility_graph<T>::find_cliques()
 {
   // init
   graph_data s;
-  for(typename graph::iterator it = G.begin(); it != G.end(); it++) {
+  for(auto it = G.begin(); it != G.end(); it++) {
     s.insert(make_pair(it->first, it->second.first));
   }
   find_cliques(s, 0);
@@ -5545,7 +5545,7 @@ template <class T> void cliques_compatibility_graph<T>::store_clique(int n)
     }
   }
   if(store_it) {
-    typename multimap<int, set<T> >::iterator itstore =
+    auto itstore =
       allQ.insert(make_pair(Q.size(), set<T>()));
     itstore->second.insert(Q.begin(), Q.end());
     // for (typename graph_data_no_hash::iterator it = Q.begin(); it != Q.end();
@@ -5615,7 +5615,7 @@ void cliques_compatibility_graph<T>::find_cliques(graph_data &subgraph, int n)
     return;
   }
   if(subgraph.size() == 1) {
-    typename graph_data::iterator ittemp = subgraph.begin();
+    auto ittemp = subgraph.begin();
     T u = ittemp->second;
     Q.insert(u);
     store_clique(n);
@@ -5654,7 +5654,7 @@ void cliques_compatibility_graph<T>::find_cliques(graph_data &subgraph, int n)
 
     black.clear();
     if(white.size() > 0) {
-      typename graph_data::iterator ittemp = white.begin();
+      auto ittemp = white.begin();
       u = ittemp->second;
       u_key = ittemp->first;
       fill_black_set(u, u_key, subgraph, black); // building the black set only
@@ -5669,7 +5669,7 @@ void cliques_compatibility_graph<T>::erase_entry(graph_data &subgraph, T &u,
   pair<typename graph_data::iterator, typename graph_data::iterator> range =
     subgraph.equal_range(key);
 
-  typename graph_data::iterator it = range.first;
+  auto it = range.first;
   for(; it != range.second; it++) {
     if(it->second == u) {
       subgraph.erase(it);
@@ -5687,7 +5687,7 @@ void cliques_compatibility_graph<T>::choose_u(const graph_data &subgraph, T &u,
                                               hash_key &u_key)
 {
   double valuemax = -DBL_MAX;
-  for(typename graph_data::const_iterator it = subgraph.begin();
+  for(auto it = subgraph.begin();
       it != subgraph.end(); it++) {
     double value = function_to_maximize_for_u(it->second, it->first, subgraph);
     if(value > valuemax) {
@@ -5707,7 +5707,7 @@ void cliques_compatibility_graph<T>::split_set_BW(const T &u,
 {
   // splitting set subgraph into white and black nodes
   white.insert(make_pair(u_key, u));
-  typename graph_data::const_iterator it = subgraph.begin();
+  auto it = subgraph.begin();
   for(; it != subgraph.end(); it++) {
     if(u == (it->second)) continue;
     if(!compatibility(u, u_key, it->second, it->first))
@@ -5724,7 +5724,7 @@ void cliques_compatibility_graph<T>::fill_black_set(const T &u,
                                                     graph_data &black)
 {
   // filling black set
-  typename graph_data::const_iterator it = subgraph.begin();
+  auto it = subgraph.begin();
   for(; it != subgraph.end(); it++) {
     if(u == (it->second)) continue;
     if(compatibility(u, u_key, it->second, it->first))
@@ -5740,7 +5740,7 @@ double cliques_compatibility_graph<T>::function_to_maximize_for_u(
   const T &u, const hash_key &u_key, const graph_data &subgraph)
 {
   int counter = 0;
-  for(typename graph_data::const_iterator it = subgraph.begin();
+  for(auto it = subgraph.begin();
       it != subgraph.end(); it++) {
     if((it->second) == u) continue;
     if(compatibility(u, u_key, it->second, it->first)) counter++;
@@ -5758,14 +5758,14 @@ bool cliques_compatibility_graph<T>::compatibility(const T &u,
   // Find u data
   pair<typename graph::const_iterator, typename graph::const_iterator>
     range_ukey = G.equal_range(u_key);
-  typename graph::const_iterator itfind_u = range_ukey.first;
+  auto itfind_u = range_ukey.first;
   for(; itfind_u != range_ukey.second; itfind_u++) {
     if(itfind_u->second.first == u) break;
   }
   // Check if v is in u data
   pair<typename graph_data::const_iterator, typename graph_data::const_iterator>
     range_vkey = itfind_u->second.second.equal_range(v_key);
-  for(typename graph_data::const_iterator itfind_v = range_vkey.first;
+  for(auto itfind_v = range_vkey.first;
       itfind_v != range_vkey.second; itfind_v++) {
     if(itfind_v->second == v) { return true; }
   }
@@ -5830,7 +5830,7 @@ bool PEEntity::hasVertex(MVertex *v) const
 
 bool PEEntity::same_vertices(const PEEntity *t) const
 {
-  for(vector<MVertex *>::const_iterator it = vertices.begin();
+  for(auto it = vertices.begin();
       it != vertices.end(); it++) {
     if(!(t->hasVertex(*it))) return false;
   }
@@ -5938,7 +5938,7 @@ void Recombinator_Graph::fill_tet_to_hex_table(Hex *hex)
   // non, c'est pas toujours le cas !!! ???
 
   set<MVertex *> vertices;
-  for(element_set_itr it = parts.begin(); it != parts.end(); it++) {
+  for(auto it = parts.begin(); it != parts.end(); it++) {
     element = *it;
     for(int i = 0; i < 4; i++) { vertices.insert(element->getVertex(i)); }
   }
@@ -5967,7 +5967,7 @@ void Recombinator_Graph::fill_tet_to_hex_table(Hex *hex)
   // deviennent b c d a, on a une rotation et un hex tout pourri... mais qui a
   // même hash et mêmes noeuds ?!?! now, check if the hex already exists...
   if(!bypass) {
-    graph_data::const_iterator itfind =
+    auto itfind =
       find_the_created_potential_hex(hex, created_potential_hex);
     if(itfind != created_potential_hex.end()) {
       delete hex;
@@ -5990,7 +5990,7 @@ void Recombinator_Graph::fill_tet_to_hex_table(Hex *hex)
   // counting the number of triangular external faces. If different from 12,
   // discard the hex ! if not, build the face/hex table
   std::multimap<unsigned long long, pair<PETriangle *, int> > faces_temp;
-  for(element_set_itr it_tet = parts.begin(); it_tet != parts.end();
+  for(auto it_tet = parts.begin(); it_tet != parts.end();
       it_tet++) { // for all tets
     for(int i = 0; i < 4; i++) { // for all faces
       MFace f = (*it_tet)->getFace(i);
@@ -5999,9 +5999,9 @@ void Recombinator_Graph::fill_tet_to_hex_table(Hex *hex)
   }
 
   int count = 0;
-  std::multimap<unsigned long long, pair<PETriangle *, int> >::iterator
+  auto
     it_face = faces_temp.begin();
-  std::multimap<unsigned long long, pair<PETriangle *, int> >::iterator
+  auto
     it_faceen = faces_temp.end();
   for(; it_face != it_faceen; it_face++) // counting
     if(it_face->second.second == 1) count++;
@@ -6031,7 +6031,7 @@ void Recombinator_Graph::fill_tet_to_hex_table(Hex *hex)
   // might be a source of the above problem... but I am quite unsure. JP.
   created_potential_hex.insert(make_pair(hex->get_hash(), hex));
   add_edges(hex);
-  for(element_set_itr it = parts.begin(); it != parts.end(); it++) {
+  for(auto it = parts.begin(); it != parts.end(); it++) {
     element = *it;
     tet_to_hex[element].insert(hex);
     hex_to_tet[hex].insert(element);
@@ -6094,10 +6094,10 @@ void Recombinator_Graph::execute_blossom(unsigned int max_nb_cliques,
 
 Recombinator_Graph::~Recombinator_Graph()
 {
-  for(iter it = triangular_faces.begin(); it != triangular_faces.end(); it++) {
+  for(auto it = triangular_faces.begin(); it != triangular_faces.end(); it++) {
     delete it->second;
   }
-  for(linemap::iterator it = edges_and_diagonals.begin();
+  for(auto it = edges_and_diagonals.begin();
       it != edges_and_diagonals.end(); it++) {
     delete it->second;
   }
@@ -6135,11 +6135,11 @@ void Recombinator_Graph::createBlossomInfo(GRegion *gr)
 
   cout << "recover blossom info" << endl;
 
-  for(std::vector<GFace *>::iterator it = faces.begin(); it != faces.end();
+  for(auto it = faces.begin(); it != faces.end();
       it++) {
     gf = *it;
 
-    std::vector<MQuadrangle *>::iterator it_quad = gf->quadrangles.begin();
+    auto it_quad = gf->quadrangles.begin();
 
     for(; it_quad != gf->quadrangles.end(); it_quad++) {
       element = *it_quad;
@@ -6323,7 +6323,7 @@ PETriangle *Recombinator_Graph::get_triangle(MElement *element, int i, int j,
   v.push_back(element->getVertex(j));
   v.push_back(element->getVertex(k));
   t = new PETriangle(v);
-  citer itfind = find_the_triangle(t, triangular_faces);
+  auto itfind = find_the_triangle(t, triangular_faces);
   if(itfind == triangular_faces.end()) {
     itfind = triangular_faces.insert(make_pair(t->get_hash(), t));
   }
@@ -6440,8 +6440,8 @@ void Recombinator_Graph::merge_clique(GRegion *gr,
                                       cliques_losses_graph<Hex *> &cl,
                                       int clique_number)
 {
-  multimap<int, set<Hex *> >::reverse_iterator it_all = cl.allQ.rbegin();
-  multimap<int, set<Hex *> >::reverse_iterator it_allen = cl.allQ.rend();
+  auto it_all = cl.allQ.rbegin();
+  auto it_allen = cl.allQ.rend();
   int clique_counter = 0;
   std::set<MElement *> parts;
   // int clique_size = 0;
@@ -6453,8 +6453,8 @@ void Recombinator_Graph::merge_clique(GRegion *gr,
 
     // cout << "--------------------- clique " << clique_counter << " made of ";
     // clique_size = it_all->second.size();
-    set<Hex *>::iterator ithex = it_all->second.begin();
-    set<Hex *>::iterator ithexen = it_all->second.end();
+    auto ithex = it_all->second.begin();
+    auto ithexen = it_all->second.end();
     double quality = 0.;
     int count = 0;
 
@@ -6480,7 +6480,7 @@ bool Recombinator_Graph::merge_hex(GRegion *gr, Hex *hex)
   MHexahedron *h = new MHexahedron(hex->vertices());
   gr->addHexahedron(h);
 
-  std::set<MElement *>::iterator it_tet_to_remove = hex_to_tet[hex].begin();
+  auto it_tet_to_remove = hex_to_tet[hex].begin();
   std::vector<MTetrahedron *>::iterator itfind_tet_region;
   for(; it_tet_to_remove != hex_to_tet[hex].end(); it_tet_to_remove++) {
     itfind_tet_region = std::find(gr->tetrahedra.begin(), gr->tetrahedra.end(),
@@ -6513,8 +6513,8 @@ void Recombinator_Graph::export_tets(set<MElement *> &tetset, Hex *hex,
   ofstream out(ss.str().c_str());
 
   out << "View \"hex tets parts\" {" << endl;
-  element_set_itr it = tetset.begin();
-  element_set_itr iten = tetset.end();
+  auto it = tetset.begin();
+  auto iten = tetset.end();
   int count = 0;
   for(; it != iten; it++, count++) {
     out << "SS(";
@@ -6544,8 +6544,8 @@ void Recombinator_Graph::export_single_hex_tet(Hex *hex, const string &s)
   ofstream out(ss.str().c_str());
 
   out << "View \"hex tets\" {" << endl;
-  element_set_itr it = hex_to_tet[hex].begin();
-  element_set_itr iten = hex_to_tet[hex].end();
+  auto it = hex_to_tet[hex].begin();
+  auto iten = hex_to_tet[hex].end();
   int count = 0;
   for(; it != iten; it++, count++) {
     out << "SS(";
@@ -6609,8 +6609,8 @@ void Recombinator_Graph::export_single_hex_faces(Hex *hex, const string &s)
   ofstream out(ss.str().c_str());
 
   out << "View \"hex faces\" {" << endl;
-  std::set<PETriangle *>::iterator it = hex_to_faces[hex].begin();
-  std::set<PETriangle *>::iterator iten = hex_to_faces[hex].end();
+  auto it = hex_to_faces[hex].begin();
+  auto iten = hex_to_faces[hex].end();
   int count = 0;
   for(; it != iten; it++, count++) {
     out << "ST(";
@@ -6639,7 +6639,7 @@ void Recombinator_Graph::export_hex_init_degree(
   ss << ".pos";
   ofstream out(ss.str().c_str());
 
-  std::vector<Hex *>::const_iterator it = chosen_hex.begin();
+  auto it = chosen_hex.begin();
   out << "View \"hex\" {" << endl;
   for(; it != chosen_hex.end(); it++) {
     out << "SH(";
@@ -6648,7 +6648,7 @@ void Recombinator_Graph::export_hex_init_degree(
       out << v->x() << "," << v->y() << "," << v->z();
       if(n != 7) out << ",";
     }
-    map<Hex *, int>::const_iterator itfind = init_degree.find(*it);
+    auto itfind = init_degree.find(*it);
     out << "){";
     for(int n = 0; n < 8; n++) {
       out << itfind->second;
@@ -6693,7 +6693,7 @@ void Recombinator_Graph::export_all_hex(int &file, GRegion *gr)
   ssinit << ".pos";
   ofstream out(ss.str().c_str());
 
-  std::vector<MHexahedron *>::iterator it = gr->hexahedra.begin();
+  auto it = gr->hexahedra.begin();
   int i = 1;
   out << "View \"hex\" {" << endl;
   for(; it != gr->hexahedra.end(); it++, i++) {
@@ -6727,9 +6727,9 @@ bool Recombinator_Graph::is_not_good_enough(Hex *hex)
 // tetrahedra For the entry to be added the hex also have to be good_enough
 void Recombinator_Graph::create_indirect_neighbors_graph()
 {
-  std::map<MElement *, std::set<Hex *> >::iterator it_tet = tet_to_hex.begin();
+  auto it_tet = tet_to_hex.begin();
   for(; it_tet != tet_to_hex.end(); it_tet++) {
-    std::set<Hex *>::iterator it_hex1 = it_tet->second.begin();
+    auto it_hex1 = it_tet->second.begin();
     for(; it_hex1 != it_tet->second.end(); it_hex1++) {
       Hex *hex = *it_hex1;
 
@@ -6739,7 +6739,7 @@ void Recombinator_Graph::create_indirect_neighbors_graph()
         continue;
       }
       if(is_not_good_enough(hex)) { continue; }
-      graph::iterator itfind_graph = find_hex_in_graph(hex);
+      auto itfind_graph = find_hex_in_graph(hex);
       if(itfind_graph == incompatibility_graph.end()) {
         // Add the hex to the graph
         itfind_graph = incompatibility_graph.insert(
@@ -6748,7 +6748,7 @@ void Recombinator_Graph::create_indirect_neighbors_graph()
       }
       // Link the hex as incompatible to all the good enough hex
       // that share the current tet
-      for(std::set<Hex *>::iterator it_hex2 = it_tet->second.begin();
+      for(auto it_hex2 = it_tet->second.begin();
           it_hex2 != it_tet->second.end(); it_hex2++) {
         Hex *hex2 = *it_hex2;
         if(hex != hex2 && !is_not_good_enough(hex2)) {
@@ -6766,7 +6766,7 @@ Recombinator_Graph::find_the_created_potential_hex(
 {
   std::pair<graph_data::const_iterator, graph_data::const_iterator> range =
     list.equal_range(hex->get_hash());
-  for(graph_data::const_iterator it = range.first; it != range.second; it++) {
+  for(auto it = range.first; it != range.second; it++) {
     Hex *candidate = it->second;
     if(candidate->same_vertices(hex)) { return it; }
   }
@@ -6782,7 +6782,7 @@ Recombinator_Graph::find_the_triangle(
     std::multimap<unsigned long long, pair<PETriangle *, int> >::iterator,
     std::multimap<unsigned long long, pair<PETriangle *, int> >::iterator>
     range = list.equal_range(t->get_hash());
-  for(std::multimap<unsigned long long, pair<PETriangle *, int> >::iterator it =
+  for(auto it =
         range.first;
       it != range.second; it++) {
     PETriangle *candidate = it->second.first;
@@ -6798,7 +6798,7 @@ Recombinator_Graph::citer
 Recombinator_Graph::find_the_triangle(PETriangle *t, const trimap &list)
 {
   std::pair<citer, citer> range = list.equal_range(t->get_hash());
-  for(citer it = range.first; it != range.second; it++) {
+  for(auto it = range.first; it != range.second; it++) {
     if(it->second->same_vertices(t)) return it;
   }
   return list.end();
@@ -6809,7 +6809,7 @@ Recombinator_Graph::find_the_line(PELine *t, const linemap &list)
 {
   std::pair<linemap::const_iterator, linemap::const_iterator> range =
     list.equal_range(t->get_hash());
-  for(linemap::const_iterator it = range.first; it != range.second; it++) {
+  for(auto it = range.first; it != range.second; it++) {
     if(it->second->same_vertices(t)) return it;
   }
   return list.end();
@@ -6821,7 +6821,7 @@ void Recombinator_Graph::export_direct_neighbor_table(int max)
   ss << "neighbors_table";
   ofstream out(ss.str().c_str());
 
-  std::multimap<int, Hex *>::iterator it = ndegree.begin();
+  auto it = ndegree.begin();
 
   int counter = 0;
   out << " n  neighbors_rank hex* quality" << endl;
@@ -6859,7 +6859,7 @@ void Recombinator_Graph::export_direct_neighbor_table(int max)
 void print_stats_graph(const Recombinator_Graph::graph &in)
 {
   int total = 0;
-  for(Recombinator_Graph::graph::const_iterator it = in.begin(); it != in.end();
+  for(auto it = in.begin(); it != in.end();
       it++) {
     total += it->second.second.size();
   }
@@ -6885,7 +6885,7 @@ void Recombinator_Graph::create_losses_graph(GRegion *gr)
 // common) but DO NOT pass the compatibility tests)
 void Recombinator_Graph::create_direct_neighbors_incompatibility_graph()
 {
-  for(std::map<Hex *, std::set<MElement *> >::iterator it_hex =
+  for(auto it_hex =
         hex_to_tet.begin();
       it_hex != hex_to_tet.end(); it_hex++) {
     Hex *hex = it_hex->first;
@@ -6895,7 +6895,7 @@ void Recombinator_Graph::create_direct_neighbors_incompatibility_graph()
     }
 
     // Find or create the hex data in the incompatibility graph
-    graph::iterator itfind_graph = find_hex_in_graph(hex);
+    auto itfind_graph = find_hex_in_graph(hex);
     if(itfind_graph == incompatibility_graph.end()) {
       incompatibility_graph.insert(
         make_pair(hex->get_hash(), make_pair(hex, graph_data())));
@@ -6908,12 +6908,12 @@ void Recombinator_Graph::create_direct_neighbors_incompatibility_graph()
     std::vector<Hex *> visited_hex;
     // Check compatibility with the that share an facet with hex
     const std::set<PETriangle *> &hex_faces = hex_to_faces[hex];
-    for(std::set<PETriangle *>::const_iterator it_faces = hex_faces.begin();
+    for(auto it_faces = hex_faces.begin();
         it_faces != hex_faces.end(); it_faces++) {
       PETriangle *face = *it_faces;
 
       const std::set<Hex *> &hex_sharing_triangle = faces_to_hex[face];
-      for(std::set<Hex *>::const_iterator it_neighbors =
+      for(auto it_neighbors =
             hex_sharing_triangle.begin();
           it_neighbors != hex_sharing_triangle.end(); it_neighbors++) {
         Hex *other_hex = *it_neighbors;
@@ -6933,11 +6933,11 @@ void Recombinator_Graph::create_direct_neighbors_incompatibility_graph()
     // change following...
 
     const std::set<PELine *> &hex_edges = hex_to_edges[hex];
-    for(std::set<PELine *>::const_iterator it_line = hex_edges.begin();
+    for(auto it_line = hex_edges.begin();
         it_line != hex_edges.end(); it_line++) {
       PELine *line = *it_line;
       const std::set<Hex *> &hex_sharing_edge = edges_to_hex[line];
-      for(std::set<Hex *>::const_iterator it_neighbors =
+      for(auto it_neighbors =
             hex_sharing_edge.begin();
           it_neighbors != hex_sharing_edge.end(); it_neighbors++) {
         Hex *other_hex = *it_neighbors;
@@ -7007,7 +7007,7 @@ void Recombinator_Graph::add_face(
   v.push_back(b);
   v.push_back(c);
   PETriangle *q = new PETriangle(v);
-  std::multimap<unsigned long long, pair<PETriangle *, int> >::iterator itfind =
+  auto itfind =
     find_the_triangle(q, f);
   if(itfind == f.end()) { f.insert(make_pair(q->get_hash(), make_pair(q, 1))); }
   else {
@@ -7022,7 +7022,7 @@ void Recombinator_Graph::add_face(MVertex *a, MVertex *b, MVertex *c, Hex *hex)
   v.push_back(b);
   v.push_back(c);
   PETriangle *q = new PETriangle(v);
-  citer itfind = find_the_triangle(q, triangular_faces);
+  auto itfind = find_the_triangle(q, triangular_faces);
   if(itfind == triangular_faces.end()) {
     itfind = triangular_faces.insert(make_pair(q->get_hash(), q));
   }
@@ -7059,7 +7059,7 @@ void Recombinator_Graph::fill_edges_table(
 
       // see if already exists or not...
       PELine *l = new PELine(edge);
-      linemap::const_iterator itfind = find_the_line(l, edges_and_diagonals);
+      auto itfind = find_the_line(l, edges_and_diagonals);
       if(itfind == edges_and_diagonals.end()) {
         itfind = edges_and_diagonals.insert(make_pair(l->get_hash(), l));
       }
@@ -7081,7 +7081,7 @@ Recombinator_Graph::find_hex_in_graph(Hex *hex)
     incompatibility_graph.equal_range(hex->get_hash());
   if(range.first == range.second) return incompatibility_graph.end();
 
-  graph::iterator it = range.first;
+  auto it = range.first;
   for(; it != range.second; it++) {
     if(it->second.first == hex) { return it; }
   }
@@ -7095,7 +7095,7 @@ Recombinator_Graph::find_hex_in_graphrow(Hex *hex, graph_data &row)
     row.equal_range(hex->get_hash());
   if(range.first == range.second) return row.end();
 
-  graph_data::iterator it = range.first;
+  auto it = range.first;
   for(; it != range.second; it++) {
     if(it->second == hex) { return it; }
   }
@@ -7104,17 +7104,17 @@ Recombinator_Graph::find_hex_in_graphrow(Hex *hex, graph_data &row)
 
 bool Recombinator_Graph::find_hex_couple_in_graph(Hex *hex, Hex *other_hex)
 {
-  graph::iterator it = find_hex_in_graph(hex);
+  auto it = find_hex_in_graph(hex);
   if(it == incompatibility_graph.end()) return false;
 
-  graph_data::iterator itt = find_hex_in_graphrow(other_hex, it->second.second);
+  auto itt = find_hex_in_graphrow(other_hex, it->second.second);
   if(itt == it->second.second.end()) return false;
   return true;
 }
 
 void Recombinator_Graph::add_graph_entry(Hex *hex, Hex *other_hex)
 {
-  graph::iterator itfind_graph = find_hex_in_graph(hex);
+  auto itfind_graph = find_hex_in_graph(hex);
 
   if(itfind_graph == incompatibility_graph.end()) {
     itfind_graph = incompatibility_graph.insert(
@@ -7133,12 +7133,12 @@ void Recombinator_Graph::compute_hex_ranks()
 {
   create_faces_connectivity();
 
-  for(std::map<Hex *, set<PETriangle *> >::iterator it = hex_to_faces.begin();
+  for(auto it = hex_to_faces.begin();
       it != hex_to_faces.end(); it++) {
     Hex *hex = it->first;
     // Count the number of facets on boundary for the hex
     int boundary_count = 0.;
-    for(set<PETriangle *>::iterator itf = it->second.begin();
+    for(auto itf = it->second.begin();
         itf != it->second.end(); itf++) {
       PETriangle *face = *itf;
       if(faces_connectivity[face] == 1) boundary_count += 1.;
@@ -7154,7 +7154,7 @@ void Recombinator_Graph::compute_hex_ranks()
 // Complex way to get the number of tets around a triangular facet
 void Recombinator_Graph::create_faces_connectivity()
 {
-  for(std::map<MElement *, std::set<Hex *> >::iterator it_tet =
+  for(auto it_tet =
         tet_to_hex.begin();
       it_tet != tet_to_hex.end(); it_tet++) {
     add_face_connectivity(it_tet->first, 0, 1, 2);
@@ -7174,7 +7174,7 @@ void Recombinator_Graph::add_face_connectivity(MElement *tet, int i, int j,
   v.push_back(tet->getVertex(j));
   v.push_back(tet->getVertex(k));
   t = new PETriangle(v);
-  citer itfind = find_the_triangle(t, triangular_faces);
+  auto itfind = find_the_triangle(t, triangular_faces);
   if(itfind != triangular_faces.end()) { faces_connectivity[itfind->second]++; }
   delete t;
 }
@@ -7183,15 +7183,15 @@ void Recombinator_Graph::compute_hex_ranks_blossom()
 {
   create_faces_connectivity();
 
-  for(map<Hex *, set<PETriangle *> >::iterator it = hex_to_faces.begin();
+  for(auto it = hex_to_faces.begin();
       it != hex_to_faces.end(); it++) {
     Hex *hex = it->first;
     double nb_faces_on_boundary = 0.;
-    for(set<PETriangle *>::iterator face = it->second.begin();
+    for(auto face = it->second.begin();
         face != it->second.end(); face++) {
       if(faces_connectivity[*face] == 1) nb_faces_on_boundary += 1.;
     }
-    map<Hex *, vector<double> >::iterator itfind = hex_ranks.find(hex);
+    auto itfind = hex_ranks.find(hex);
     if(itfind == hex_ranks.end())
       hex_ranks.insert(make_pair(hex, vector<double>(3)));
     hex_ranks[hex][0] = nb_faces_on_boundary;
@@ -7232,14 +7232,14 @@ PETriangle *Recombinator_Graph::get_triangle(MVertex *a, MVertex *b, MVertex *c)
   v.push_back(b);
   v.push_back(c);
   PETriangle *t = new PETriangle(v);
-  citer it_find_tri = find_the_triangle(t, triangular_faces);
+  auto it_find_tri = find_the_triangle(t, triangular_faces);
   delete t;
   return (it_find_tri->second);
 }
 
 bool Recombinator_Graph::is_blossom_pair(PETriangle *t1, PETriangle *t2)
 {
-  tripair::iterator itfind = blossom_info.find(t1);
+  auto itfind = blossom_info.find(t1);
   if(itfind != blossom_info.end()) {
     if(t2 == itfind->second) return true;
   }
diff --git a/contrib/domhex/yamakawa.h b/contrib/domhex/yamakawa.h
index 71be39101d39ae6a66d260b26e1f007f31d4277c..f0c6a369f115eb385d95ef0565c2b7e66b0b7f76 100644
--- a/contrib/domhex/yamakawa.h
+++ b/contrib/domhex/yamakawa.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -75,7 +75,7 @@ public:
     else {
       cout << "Hex: unknown vertex number " << i << endl;
       throw;
-      return NULL;
+      return nullptr;
     }
   }
   const std::vector<MVertex *> &vertices() const { return vertices_; }
@@ -104,7 +104,7 @@ public:
   bool contains(MVertex *v) const { return vertex_index(v) != -1; }
   unsigned long long get_hash()
   {
-    if(hash == 0. && vertices_[0] != NULL) { set_hash(); }
+    if(hash == 0. && vertices_[0] != nullptr) { set_hash(); }
     return hash;
   }
   bool operator<(const Hex &hex) const
@@ -121,7 +121,7 @@ private:
   unsigned long long hash;
 
 public:
-  Facet() : a(NULL), b(NULL), c(NULL), hash(0.)
+  Facet() : a(nullptr), b(nullptr), c(nullptr), hash(0.)
   {
     num[0] = -1;
     num[1] = -1;
@@ -176,7 +176,7 @@ private:
   void compute_hash() { hash = a->getNum() + b->getNum(); }
 
 public:
-  Diagonal() : a(NULL), b(NULL), hash(){};
+  Diagonal() : a(nullptr), b(nullptr), hash(){};
   Diagonal(MVertex *a2, MVertex *b2) : a(a2), b(b2) { compute_hash(); }
   ~Diagonal(){};
   MVertex *get_a() const { return a; }
@@ -206,14 +206,14 @@ private:
 
 public:
   Tuple()
-    : vertex1(NULL), vertex2(NULL), vertex3(NULL), element(NULL), gf(NULL),
+    : vertex1(nullptr), vertex2(nullptr), vertex3(nullptr), element(nullptr), gf(nullptr),
       hash(0)
   {
   }
 
   Tuple(MVertex *const a, MVertex *const b, MVertex *const c,
         MElement *const element2, GFace *const gf2)
-    : vertex1(NULL), vertex2(NULL), vertex3(NULL), element(element2), gf(gf2),
+    : vertex1(nullptr), vertex2(nullptr), vertex3(nullptr), element(element2), gf(gf2),
       hash(a->getNum() + b->getNum() + c->getNum())
   {
     MVertex *tmp[3] = {a, b, c};
@@ -224,7 +224,7 @@ public:
   }
 
   Tuple(MVertex *const a, MVertex *const b, MVertex *const c)
-    : vertex1(NULL), vertex2(NULL), vertex3(NULL), element(NULL), gf(NULL),
+    : vertex1(nullptr), vertex2(nullptr), vertex3(nullptr), element(nullptr), gf(nullptr),
       hash(a->getNum() + b->getNum() + c->getNum())
   {
     MVertex *tmp[3] = {a, b, c};
@@ -331,7 +331,7 @@ private:
         MVertex *b = tet->getVertex((j + 1) % 4);
         MVertex *c = tet->getVertex((j + 2) % 4);
         MVertex *d = tet->getVertex((j + 3) % 4);
-        std::map<MVertex *, std::set<MVertex *> >::iterator it =
+        auto it =
           vertex_to_vertices_.find(a);
         if(it != vertex_to_vertices_.end()) {
           it->second.insert(b);
@@ -357,7 +357,7 @@ private:
       MElement *tet = region->getMeshElement(i);
       for(unsigned int j = 0; j < 4; j++) {
         MVertex *getVertex = tet->getVertex(j);
-        std::map<MVertex *, std::set<MElement *> >::iterator it =
+        auto it =
           vertex_to_elements_.find(getVertex);
         if(it != vertex_to_elements_.end()) { it->second.insert(tet); }
         else {
@@ -383,7 +383,7 @@ public:
   typedef std::map<MVertex *, std::set<MVertex *> > Vertex2Vertices;
   typedef std::map<MVertex *, std::set<MElement *> > Vertex2Elements;
 
-  Recombinator() : current_region(NULL), hex_threshold_quality(0.6){};
+  Recombinator() : current_region(nullptr), hex_threshold_quality(0.6){};
   virtual ~Recombinator();
 
   virtual void execute();
diff --git a/contrib/hxt/CMakeLists.txt b/contrib/hxt/CMakeLists.txt
index bc8de0e6297b8e890d6f4641683073345b9a8912..e3dc3fe89a0bec950b43ef7f272cdccb401a6a16 100644
--- a/contrib/hxt/CMakeLists.txt
+++ b/contrib/hxt/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/kbipack/CMakeLists.txt b/contrib/kbipack/CMakeLists.txt
index a7b2e47f17aff1c105fd9c059d97dcc4d9d530dc..e93490dc461c6b7316aac4c3e28ce78070e5c9e5 100644
--- a/contrib/kbipack/CMakeLists.txt
+++ b/contrib/kbipack/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/metis/CMakeLists.txt b/contrib/metis/CMakeLists.txt
index a7f5746acd92a67b9617d4419c6c8e24f86075ea..51d911e54e6194c7d4fb8d0fd90847373c6c6d97 100755
--- a/contrib/metis/CMakeLists.txt
+++ b/contrib/metis/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/mobile/Android/app/src/main/java/org/geuz/onelab/AboutActivity.java b/contrib/mobile/Android/app/src/main/java/org/geuz/onelab/AboutActivity.java
index faa4d50985694e1feeee6e6d5738546fefdde840..44913c3a5b3d0e7c2f2e3104d460cddd8ef466c0 100644
--- a/contrib/mobile/Android/app/src/main/java/org/geuz/onelab/AboutActivity.java
+++ b/contrib/mobile/Android/app/src/main/java/org/geuz/onelab/AboutActivity.java
@@ -102,7 +102,7 @@ public class AboutActivity extends Activity {
       } catch(android.content.pm.PackageManager.NameNotFoundException e) {
       }
       aboutOnelab +=
-        "<p>Copyright (C) 2014-2020 Christophe Geuzaine and Maxime Graulich, ";
+        "<p>Copyright (C) 2014-2021 Christophe Geuzaine and Maxime Graulich, ";
       aboutOnelab += "University of Li&egrave;ge</p>";
       aboutOnelab +=
         "<p>Visit <a href=\"http://onelab.info/\">http://onelab.info/</a> ";
diff --git a/contrib/mobile/README.txt b/contrib/mobile/README.txt
index 0900fa4c56342534b8f5a6388bdf64f8efe81750..22e6760027d0bf219d4b743f4e4c78ccf1f9864f 100644
--- a/contrib/mobile/README.txt
+++ b/contrib/mobile/README.txt
@@ -1,7 +1,7 @@
 This directory contains the source code for the ONELAB app, the mobile version
 of ONELAB for iOS and Android devices.
 
-Copyright (C) 2014-2020 Christophe Geuzaine and Maxime Graulich, University of Liege
+Copyright (C) 2014-2021 Christophe Geuzaine and Maxime Graulich, University of Liege
 
 The ONELAB (http://onelab.info) mobile app is a finite element package based on
 the open source mesh generator Gmsh (https://gmsh.info) and the solver GetDP
diff --git a/contrib/mobile/androidUtils.cpp b/contrib/mobile/androidUtils.cpp
index 736e6bc737a4d74ae0d241d8ecd0ef22110bb90d..042d6f017660fea88d3b0b2c14170b4801d6311d 100644
--- a/contrib/mobile/androidUtils.cpp
+++ b/contrib/mobile/androidUtils.cpp
@@ -329,7 +329,7 @@ JNIEXPORT jstring JNICALL Java_org_geuz_onelab_Gmsh_getAboutGmsh(JNIEnv *env,
   sstream << "<center><h3>Gmsh</h3>"
           << "Version " << GMSH_VERSION << " "
           << "(<i>Build date:</i> " << GMSH_DATE << ")"
-          << "<p>Copyright (C) 1997-2020 Christophe Geuzaine and "
+          << "<p>Copyright (C) 1997-2021 Christophe Geuzaine and "
              "Jean-Fran&ccedil;ois Remacle</p>"
           << "<p><a href=\"https://gmsh.info/CREDITS.txt\">Credits</a> "
           << "and <a href=\"https://gmsh.info/LICENSE.txt\">licensing "
@@ -346,7 +346,7 @@ JNIEXPORT jstring JNICALL Java_org_geuz_onelab_Gmsh_getAboutGetDP(JNIEnv *env,
   sstream << "<center><h3>GetDP</h3>"
           << "Version " << GETDP_VERSION << " "
           << "(<i>Build date:</i> " << GETDP_DATE << ")"
-          << "<p>Copyright (C) 1997-2020 Patrick Dular and Christophe "
+          << "<p>Copyright (C) 1997-2021 Patrick Dular and Christophe "
              "Geuzaine, University of Li&egrave;ge</p>"
           << "<p><a href=\"https://getdp.info/CREDITS.txt\">Credits</a> "
           << "and <a href=\"https://getdp.info/LICENSE.txt\">licensing "
diff --git a/contrib/mobile/iOS/Onelab/AboutViewController.mm b/contrib/mobile/iOS/Onelab/AboutViewController.mm
index 7332412702ae980cf298b2bb08686458ae3c3790..aea6fba0fc6b57232664bc32548e12659f2bdf90 100644
--- a/contrib/mobile/iOS/Onelab/AboutViewController.mm
+++ b/contrib/mobile/iOS/Onelab/AboutViewController.mm
@@ -75,14 +75,14 @@
                     @"type=\"text/css\">%@</style></head><body><center><p><!-- "
                     @"img width=32 "
                     @"src=\"icon_onelab.png\"--></p><h3>Onelab/Mobile</"
-                    @"h3>Version %@<p>Copyright (C) 2014-2020 Christophe "
+                    @"h3>Version %@<p>Copyright (C) 2014-2021 Christophe "
                     @"Geuzaine and Maxime Graulich, University of "
                     @"Li&egrave;ge</p><p>Visit <a "
                     @"href=\"http://onelab.info/\">http://onelab.info/</a> for "
                     @"more information</p><p style=\"padding-top: 35px;\">This "
                     @"version of Onelab/Mobile "
                     @"contains:</p><h3>Gmsh</h3>Version %s (<i>Build date:</i> "
-                    @"%s)<p>Copyright (C) 1997-2020 Christophe Geuzaine and "
+                    @"%s)<p>Copyright (C) 1997-2021 Christophe Geuzaine and "
                     @"Jean-Fran&ccedil;ois Remacle</p><p><a "
                     @"href=\"http://geuz.org/gmsh/CREDITS.txt\">Credits</"
                     @"a> and <a "
@@ -91,7 +91,7 @@
                     @"%s</p><p>Visit <a "
                     @"href=\"https://gmsh.info/\">https://gmsh.info</a> for more "
                     @"information</p><h3>GetDP</h3>Version %s (<i>Build "
-                    @"date:</i> %s)<p>Copyright (C) 1997-2020 Patrick Dular "
+                    @"date:</i> %s)<p>Copyright (C) 1997-2021 Patrick Dular "
                     @"and Christophe Geuzaine, University of "
                     @"Li&egrave;ge</p><p><a "
                     @"href=\"http://geuz.org/getdp/CREDITS.txt\">Credits</"
diff --git a/contrib/mpeg_encode/CMakeLists.txt b/contrib/mpeg_encode/CMakeLists.txt
index 2595655f330d11db989d998dd88f7f9e7b6c5d8d..071f23d2a4552c05fe3964df713244567f58c0df 100644
--- a/contrib/mpeg_encode/CMakeLists.txt
+++ b/contrib/mpeg_encode/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/onelab/CMakeLists.txt b/contrib/onelab/CMakeLists.txt
index 020afa5e243c6d84ecbbed740b6ad831d187aae7..a8fd15514632be13f392ef3f8c079c635cab613c 100644
--- a/contrib/onelab/CMakeLists.txt
+++ b/contrib/onelab/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/onelab/OnelabMessage.cpp b/contrib/onelab/OnelabMessage.cpp
index f30d5ca19cf75a655f9d8f82fb0326bcc280b61b..c8cfe681ccfae3077acd8cb3009c24b3c5db89b8 100644
--- a/contrib/onelab/OnelabMessage.cpp
+++ b/contrib/onelab/OnelabMessage.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/onelab/README.txt b/contrib/onelab/README.txt
index 576eb47b360f8a17dd1984da013e723552870355..f4b5944ee3368141f532b0f9d7ded8141502dad7 100644
--- a/contrib/onelab/README.txt
+++ b/contrib/onelab/README.txt
@@ -1,4 +1,4 @@
-// ONELAB - Copyright (C) 2011-2020 Universite de Liege - Universite catholique
+// ONELAB - Copyright (C) 2011-2021 Universite de Liege - Universite catholique
 // de Louvain
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/contrib/onelab/myOS.cpp b/contrib/onelab/myOS.cpp
index 61d42279499b083a84f96e34cf8c422f79816e34..0c6c185f824667977930b070dc814890ed48e20f 100644
--- a/contrib/onelab/myOS.cpp
+++ b/contrib/onelab/myOS.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/onelab/myOS.h b/contrib/onelab/myOS.h
index 3e495a4cdbe2126f2ef807beb750ec7b43fbf067..26d49f2fd405bb1d93502aaf79abc6636850d63c 100644
--- a/contrib/onelab/myOS.h
+++ b/contrib/onelab/myOS.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/contrib/onelab/python/onelab.py b/contrib/onelab/python/onelab.py
index 47f39ce40ed24ccd44c463149d16576b06464063..fdf5c7d45d12753b79a4da8f700b23f441e3f4a0 100755
--- a/contrib/onelab/python/onelab.py
+++ b/contrib/onelab/python/onelab.py
@@ -1,5 +1,5 @@
 """
-ONELAB - Copyright (C) 2011-2020 Universite de Liege - Universite catholique
+ONELAB - Copyright (C) 2011-2021 Universite de Liege - Universite catholique
 de Louvain
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
diff --git a/contrib/zipper/CMakeLists.txt b/contrib/zipper/CMakeLists.txt
index f00885507669a7bb66ec3eddba8f76e14d9fa59a..364adc5769605a7156410c3564e6ed75d5635b0b 100644
--- a/contrib/zipper/CMakeLists.txt
+++ b/contrib/zipper/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/doc/gmsh.html b/doc/gmsh.html
index d92071992def8c439fb3d6b6e7303673e6501c4c..4080045859e130313f5c7d992a43f5077081e11d 100644
--- a/doc/gmsh.html
+++ b/doc/gmsh.html
@@ -229,7 +229,7 @@ on <a href="https://gitlab.onelab.info/gmsh/gmsh/issues"
 <h2><a name="Licensing"></a>Licensing</h2>
 
 <p>
-Gmsh is copyright (C) 1997-2020 by
+Gmsh is copyright (C) 1997-2021 by
 <a href="http://www.montefiore.ulg.ac.be/~geuzaine">C. Geuzaine</a> and
 <a href="http://perso.uclouvain.be/jean-francois.remacle/">J.-F. Remacle</a>
 (see the <a href="CREDITS.txt">CREDITS</a> file for more information) and
diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi
index a098673a0f26c4312b9db4614349ba856d305f5d..7b71ae1e1a4eed67d078bb2898f61f87fcfcccdc 100644
--- a/doc/texinfo/gmsh.texi
+++ b/doc/texinfo/gmsh.texi
@@ -1,5 +1,5 @@
 \input texinfo.tex @c -*-texinfo-*-
-@c Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+@c Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 @c
 @c See the LICENSE.txt file for license information. Please report all
 @c issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
@@ -22,7 +22,7 @@
 @c %**starts of header
 @setfilename gmsh.info
 @include version.texi
-@set COPYRIGHT @copyright{} 1997-2020 Christophe Geuzaine, Jean-Fran@,{c}ois Remacle
+@set COPYRIGHT @copyright{} 1997-2021 Christophe Geuzaine, Jean-Fran@,{c}ois Remacle
 @set SYN a synchronization of the CAD model with the internal Gmsh model.
 @set SYNC This operation triggers @value{SYN}
 @set SYNCS These operations all trigger @value{SYN}
diff --git a/utils/misc/gmsh_app.plist b/utils/misc/gmsh_app.plist
index 24942fe324c9dbe68d640cb623345dc340c6fc98..c4e6ee98c51ff790bca6305964a3db8e4b66e8d3 100644
--- a/utils/misc/gmsh_app.plist
+++ b/utils/misc/gmsh_app.plist
@@ -9,7 +9,7 @@
     <key>CFBundleShortVersionString</key><string>GMSH_VERSION</string>
     <key>CFBundleIconFile</key><string>Gmsh.icns</string>
     <key>CFBundleSignature</key><string>GMSH</string>
-    <key>CFBundleGetInfoString</key><string>Gmsh GMSH_VERSION, Copyright (C) 1997-2020 C. Geuzaine and J.-F. Remacle</string>
+    <key>CFBundleGetInfoString</key><string>Gmsh GMSH_VERSION, Copyright (C) 1997-2021 C. Geuzaine and J.-F. Remacle</string>
     <key>CFBundleIdentifier</key><string>org.geuz.Gmsh</string>
     <key>NSHighResolutionCapable</key><true/>
     <key>CFBundleDocumentTypes</key>
diff --git a/utils/misc/gmsh_dev.plist b/utils/misc/gmsh_dev.plist
index 7f8f91e6ae31bc601650325db2bdd3a3ce530e6c..0ab8a9cc36b772bf0a827d580486304350fdb1a2 100644
--- a/utils/misc/gmsh_dev.plist
+++ b/utils/misc/gmsh_dev.plist
@@ -8,7 +8,7 @@
     <key>CFBundleVersion</key><string></string>
     <key>CFBundleShortVersionString</key><string>dev</string>
     <key>CFBundleSignature</key><string>GMSH</string>
-    <key>CFBundleGetInfoString</key><string>Gmsh, Copyright (C) 1997-2020 C. Geuzaine and J.-F. Remacle</string>
+    <key>CFBundleGetInfoString</key><string>Gmsh, Copyright (C) 1997-2021 C. Geuzaine and J.-F. Remacle</string>
     <key>CFBundleIdentifier</key><string></string>
     <key>NSHighResolutionCapable</key><true/>
   </dict>
diff --git a/utils/misc/update_copyright.sh b/utils/misc/update_copyright.sh
index b84426f98acbbcaf2715a775658426e94a105618..849e3642fec99dd3da0778e24b48450a814b48f0 100755
--- a/utils/misc/update_copyright.sh
+++ b/utils/misc/update_copyright.sh
@@ -1,6 +1,6 @@
 #!/bin/sh -
 
-files=`git grep -l '(C) 1997-2020 C. Geuzaine'`
+files=`git grep -l '(C) 1997-2021 C. Geuzaine'`
 
 for file in $files; do
   echo "modifying $file"
diff --git a/utils/qt/GLWidget.cpp b/utils/qt/GLWidget.cpp
index 1933146e9042b935b8f8db22142bc4139c90a20b..ea27afbdc9fe9d383110ae546c550b5d5f6fa166 100644
--- a/utils/qt/GLWidget.cpp
+++ b/utils/qt/GLWidget.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/qt/GLWidget.h b/utils/qt/GLWidget.h
index 3ded3b3b8107f1b72209d0ef5aa406a33ca362c7..469a68c74c838f0a1900e89d8ec277311d4a2f4d 100644
--- a/utils/qt/GLWidget.h
+++ b/utils/qt/GLWidget.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/qt/Main.cpp b/utils/qt/Main.cpp
index 0ba24cc6aa8d933f59e1ed3b53c0505852d0c35f..f3531fdf57598cadf3f135528ebb1f20487f0d51 100644
--- a/utils/qt/Main.cpp
+++ b/utils/qt/Main.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/qt/QGui.cpp b/utils/qt/QGui.cpp
index 7b0d057b9e52738d324814f32172558c33d5b007..8c0721d0d4c7159efd510646fdb292d7dd782e02 100644
--- a/utils/qt/QGui.cpp
+++ b/utils/qt/QGui.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/qt/QGui.h b/utils/qt/QGui.h
index 6c0db346f5c702fcc6d534196c6369b834063142..a370de97249fc504dfcd3da7e86ead890a2089e0 100644
--- a/utils/qt/QGui.h
+++ b/utils/qt/QGui.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/qt/graphicWindow.cpp b/utils/qt/graphicWindow.cpp
index c32c98bae905a7377b620a05ccbf763a6f6b7b03..c198c5b0d612111f77f9e0bcf6ac9cee97ced034 100644
--- a/utils/qt/graphicWindow.cpp
+++ b/utils/qt/graphicWindow.cpp
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/qt/graphicWindow.h b/utils/qt/graphicWindow.h
index a4592ad6791404c4746c039838f10ce747acceba..42dbd1ef437b9493a20a1918dcd57748a211999e 100644
--- a/utils/qt/graphicWindow.h
+++ b/utils/qt/graphicWindow.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // See the LICENSE.txt file for license information. Please report all
 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
diff --git a/utils/solvers/c++/GmshSocket.h b/utils/solvers/c++/GmshSocket.h
index 3b7436620aa028eb0fdb33005e04c19812457e6e..f464c55186f696bf98cc4740a732d01d7a68698c 100644
--- a/utils/solvers/c++/GmshSocket.h
+++ b/utils/solvers/c++/GmshSocket.h
@@ -1,4 +1,4 @@
-// Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+// Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 //
 // Permission is hereby granted, free of charge, to any person
 // obtaining a copy of this software and associated documentation
diff --git a/utils/wrappers/gmshpy/CMakeLists.txt b/utils/wrappers/gmshpy/CMakeLists.txt
index 7e2088df7a83280b2842c08cbc82a3f72e329796..30deda5fddc8bcad998dd1bc8739ddfca5164511 100644
--- a/utils/wrappers/gmshpy/CMakeLists.txt
+++ b/utils/wrappers/gmshpy/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+# Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
 #
 # See the LICENSE.txt file for license information. Please report all
 # issues on https://gitlab.onelab.info/gmsh/gmsh/issues.