Different Mesh on different platform

I am using two different envionments.

  1. Windows 10 + Python 3.10.5
  2. Linux ngswebapp 5.4.0-174-generic + Python 3.7.3
import ngsolve
  1. 6.2.2402
  2. 6.2.2402-18-gf9cf1f250
from ngsolve import *
from ngsolve.webgui import Draw
mesh = Mesh(unit_square.GenerateMesh(maxh=0.1))
fes = H1(mesh, order=2, dirichlet="left|right|bottom|top")
print ("ndof =", fes.ndof)
  1. 505
  2. 493

What is the source of this difference?
Is it related to the random numbers?
How do I fix it?


It’s not about random numbers but there were changes in the Netgen mesh optimization routines.

Running β€œgit diff v6.2.2402..6.2.2402-18-gf9cf1f250 external_dependencies/netgen” gives

diff --git a/external_dependencies/netgen b/external_dependencies/netgen
index 70abacaf8..f96ccabeb 160000
--- a/external_dependencies/netgen
+++ b/external_dependencies/netgen
@@ -1 +1 @@
-Subproject commit 70abacaf826c673f4b642533216301f009a8e8c9
+Subproject commit f96ccabeb661e4c5f4e2b297fc7852af6336b219

You can find the Netgen changes here:

To get consistent number of dofs you need to use the same version of Netgen.


1 Like