Skip to content

Commit

Permalink
Upstream dolfinx now returns tags for all lower dimensional entities …
Browse files Browse the repository at this point in the history
…when calling dolfinx.io.gmshio.model_to_mesh
  • Loading branch information
francesco-ballarin committed Jan 11, 2025
1 parent d31677a commit 79be16e
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 26 deletions.
6 changes: 4 additions & 2 deletions tutorials/02_navier_stokes/tutorial_navier_stokes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@
"outputs": [],
"source": [
"partitioner = dolfinx.mesh.create_cell_partitioner(dolfinx.mesh.GhostMode.shared_facet)\n",
"mesh, subdomains, boundaries_and_interfaces = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries_and_interfaces, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2, partitioner=partitioner)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries_and_interfaces is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions tutorials/06_optimal_control/tutorial_1b_poisson.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@
"outputs": [],
"source": [
"partitioner = dolfinx.mesh.create_cell_partitioner(dolfinx.mesh.GhostMode.shared_facet)\n",
"mesh, subdomains, boundaries_and_interfaces = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries_and_interfaces, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2, partitioner=partitioner)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries_and_interfaces is not None"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,11 @@
"metadata": {},
"outputs": [],
"source": [
"mesh, subdomains, boundaries = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries is not None"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions tutorials/08_singular_poisson/tutorial_create_nullspace.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@
"outputs": [],
"source": [
"partitioner = dolfinx.mesh.create_cell_partitioner(dolfinx.mesh.GhostMode.shared_facet)\n",
"mesh, subdomains, boundaries_and_interfaces = dolfinx.io.gmshio.model_to_mesh(\n",
"mesh, subdomains, boundaries_and_interfaces, *_ = dolfinx.io.gmshio.model_to_mesh(\n",
" gmsh.model, comm=mpi4py.MPI.COMM_WORLD, rank=0, gdim=2, partitioner=partitioner)\n",
"gmsh.finalize()"
"gmsh.finalize()\n",
"assert subdomains is not None\n",
"assert boundaries_and_interfaces is not None"
]
},
{
Expand Down

0 comments on commit 79be16e

Please sign in to comment.