bueler / p4pdes

C and Python examples from my book on using PETSc and Firedrake to solve PDEs
MIT License
180 stars 69 forks source link

redesign ch10/msh2petsc.py #46

Closed bueler closed 4 years ago

bueler commented 4 years ago

It needs to work with different gmsh formats. Currently it expects format version 2.2, but that is at least at 4.1 now.

The script already reads a section at a time. Note that from the Gmsh format spec we have

To represent a simple mesh, the minimal sections that should be present in the file are $MeshFormat, $Nodes and $Elements. Nodes are assumed to be defined before elements.

But in Chapter 10 we also need $PhysicalNames. All other sections (e.g. $Entities) are already ignored by the design of msh2petsc.py.

The Gmsh doc site has a page for the legacy format which seems to be 2.2.

Plans:

bueler commented 4 years ago

Workaround for chapter 10 gmsh, until msh2petsc.py is improved:

bueler commented 4 years ago

This is substantially done. (See branch update-to-gmsh41.) But there is an unwarranted line format assumption revealed by the koch/ example. So TODO: fix msh2petsc.py to remove unwarranted, and build regression to check.

bueler commented 4 years ago

The koch example now works. As far as I can tell msh2petsc.py is correct. But there is a mysterious hang, at least on galago, for koch5 and higher.

bueler commented 4 years ago

The mysterious hang is not present on thelio with latest petsc.

This issue is fixed in master.

bueler commented 4 years ago

The "mysterious hang" on galago was fixed by upgrading the ubuntu 20.04 version of openblas. See https://github.com/xianyi/OpenBLAS/issues/2642