diff --git a/DiffractionGratings/grating2D_data_AnisotropicGrating.geo b/DiffractionGratings/grating2D_data_AnisotropicGrating.geo
index d3a7d670bf15758884f54b4280cf3c8444669f7a..c0187c1bc706fde85f569202ebd61b05b614dc05 100644
--- a/DiffractionGratings/grating2D_data_AnisotropicGrating.geo
+++ b/DiffractionGratings/grating2D_data_AnisotropicGrating.geo
@@ -80,13 +80,15 @@ DefineConstant[
 
   h_pmltop                    = {lambda_max, Name StrCat[pp3, "0top PML size [nm]"] ,  ReadOnly 1, Highlight Str[colorro]},
   h_pmlbot                    = {lambda_max, Name StrCat[pp3, "1bottom PML size [nm]"] ,  ReadOnly 1, Highlight Str[colorro]}  
-  paramaille                  = {15 , Name StrCat[pp3, "2nb of mesh elements per wavelength [-]"   ] , ReadOnly 0, Highlight Str[colorpp]},
-  paramaille_scale_sub        = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine substrate [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_layer_dep  = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine deposit layer [-]"] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_rod_out    = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine embedding [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_rods       = {1.5, Name StrCat[pp3, "3Custom mesh parameters/refine rods [-]"       ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_layer_cov  = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine cover layer [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_sup        = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine superstrate [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  Flag_o2_interp              = {1         , Name StrCat[pp3, "2Second order interpolation?"] , Choices {0,1}},
+  Flag_o2_geom                = {0         , Name StrCat[pp3, "3Second order mesh?"] , Choices {0,1}, Visible 0},
+  paramaille                  = {15 , Name StrCat[pp3, "4nb of mesh elements per wavelength [-]"   ] , ReadOnly 0, Highlight Str[colorpp]},
+  paramaille_scale_sub        = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine substrate [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_layer_dep  = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine deposit layer [-]"] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_rod_out    = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine embedding [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_rods       = {1.5, Name StrCat[pp3, "6Custom mesh parameters/refine rods [-]"       ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_layer_cov  = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine cover layer [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_sup        = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine superstrate [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
 
   multiplot    = {1, Choices{0,1}, Name StrCat[pp4, "Plot solution on multiple periods"]},
   plotRTgraphs = {0, Choices{0,1}, Name StrCat[pp4, "Plot R and T"]}
diff --git a/DiffractionGratings/grating2D_data_LamellarGrating.geo b/DiffractionGratings/grating2D_data_LamellarGrating.geo
index 6fd26d6b639a23ea7c6222736bf692876115eb5a..5afe6cf6c5809fe72dda1b3e57f41364ae037a5e 100644
--- a/DiffractionGratings/grating2D_data_LamellarGrating.geo
+++ b/DiffractionGratings/grating2D_data_LamellarGrating.geo
@@ -80,13 +80,15 @@ DefineConstant[
 
   h_pmltop                    = {1.*lambda_max, Name StrCat[pp3, "0top PML size [nm]"] ,  ReadOnly 1, Highlight Str[colorro]},
   h_pmlbot                    = {1.*lambda_max, Name StrCat[pp3, "1bottom PML size [nm]"] ,  ReadOnly 1, Highlight Str[colorro]}  
-  paramaille                  = {15, Name StrCat[pp3, "2nb of mesh elements per wavelength [-]"   ] , ReadOnly 0, Highlight Str[colorpp]},
-  paramaille_scale_sub        = {1 , Name StrCat[pp3, "3Custom mesh parameters/refine substrate [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_layer_dep  = {1 , Name StrCat[pp3, "3Custom mesh parameters/refine deposit layer [-]"] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_rod_out    = {1 , Name StrCat[pp3, "3Custom mesh parameters/refine embedding [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_rods       = {2 , Name StrCat[pp3, "3Custom mesh parameters/refine rods [-]"       ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_layer_cov  = {1 , Name StrCat[pp3, "3Custom mesh parameters/refine cover layer [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_sup        = {1 , Name StrCat[pp3, "3Custom mesh parameters/refine superstrate [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  Flag_o2_interp              = {1         , Name StrCat[pp3, "2Second order interpolation?"] , Choices {0,1}},
+  Flag_o2_geom                = {0         , Name StrCat[pp3, "3Second order mesh?"] , Choices {0,1}, Visible 0},
+  paramaille                  = {15 , Name StrCat[pp3, "4nb of mesh elements per wavelength [-]"   ] , ReadOnly 0, Highlight Str[colorpp]},
+  paramaille_scale_sub        = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine substrate [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_layer_dep  = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine deposit layer [-]"] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_rod_out    = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine embedding [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_rods       = {2, Name StrCat[pp3, "6Custom mesh parameters/refine rods [-]"       ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_layer_cov  = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine cover layer [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_sup        = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine superstrate [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
 
   multiplot    = {1, Choices{0,1}, Name StrCat[pp4, "Plot solution on multiple periods"]},
   plotRTgraphs = {0, Choices{0,1}, Name StrCat[pp4, "Plot R and T"]}
diff --git a/DiffractionGratings/grating2D_data_PhotonicCrystalSlab.geo b/DiffractionGratings/grating2D_data_PhotonicCrystalSlab.geo
index 8906366dd529579c18318e3ea310f1862f7f3439..4e597679f002d19174a3c07501c7b12df9146a3a 100644
--- a/DiffractionGratings/grating2D_data_PhotonicCrystalSlab.geo
+++ b/DiffractionGratings/grating2D_data_PhotonicCrystalSlab.geo
@@ -79,14 +79,16 @@ DefineConstant[
 
   h_pmltop                    = {lambda_max, Name StrCat[pp3, "0top PML size [nm]"] ,  ReadOnly 1, Highlight Str[colorro]},
   h_pmlbot                    = {lambda_max, Name StrCat[pp3, "1bottom PML size [nm]"] ,  ReadOnly 1, Highlight Str[colorro]}  
-  paramaille                  = {15 , Name StrCat[pp3, "2nb of mesh elements per wavelength [-]"   ] , ReadOnly 0, Highlight Str[colorpp]},
-  paramaille_scale_sub        = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine substrate [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_layer_dep  = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine deposit layer [-]"] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_rod_out    = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine embedding [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_rods       = {1.5, Name StrCat[pp3, "3Custom mesh parameters/refine rods [-]"       ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_layer_cov  = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine cover layer [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-  paramaille_scale_sup        = {1  , Name StrCat[pp3, "3Custom mesh parameters/refine superstrate [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
-
+  Flag_o2_interp              = {1         , Name StrCat[pp3, "2Second order interpolation?"] , Choices {0,1}},
+  Flag_o2_geom                = {0         , Name StrCat[pp3, "3Second order mesh?"] , Choices {0,1}, Visible 0},
+  paramaille                  = {15 , Name StrCat[pp3, "4nb of mesh elements per wavelength [-]"   ] , ReadOnly 0, Highlight Str[colorpp]},
+  paramaille_scale_sub        = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine substrate [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_layer_dep  = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine deposit layer [-]"] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_rod_out    = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine embedding [-]"    ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_rods       = {1.5, Name StrCat[pp3, "6Custom mesh parameters/refine rods [-]"       ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_layer_cov  = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine cover layer [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},
+  paramaille_scale_sup        = {1  , Name StrCat[pp3, "6Custom mesh parameters/refine superstrate [-]"  ] , ReadOnly 0, Highlight Str[colorpp], Closed 1},  
+  
   multiplot    = {0, Choices{0,1}, Name StrCat[pp4, "Plot solution on multiple periods"]},
   plotRTgraphs = {1, Choices{0,1}, Name StrCat[pp4, "Plot R and T"]}
 ] ;