# mesh

**URL:** https://fenicsproject.discourse.group/c/meshing/6.md

[Latest](https://fenicsproject.discourse.group/latest.md) · [Categories](https://fenicsproject.discourse.group/categories.md) · [Tags](https://fenicsproject.discourse.group/tags.md)

---

## [About the mesh category](https://fenicsproject.discourse.group/t/about-the-mesh-category/27)

<div class="topic-metadata">

**Author:** [@chris](https://fenicsproject.discourse.group/u/chris)\
**Replies:** 0

</div>

Use this category to discuss all issues with Meshing Mesh creation and importing Marking entities on Meshes Mesh refinement

---

## [Element type mixtures not allowed?](https://fenicsproject.discourse.group/t/element-type-mixtures-not-allowed/18309)

<div class="topic-metadata">

**Author:** [@ormkotta](https://fenicsproject.discourse.group/u/ormkotta)\
**Replies:** 4\
**Last updated:** [October 27, 2026, 11:48pm UTC](https://fenicsproject.discourse.group/t/element-type-mixtures-not-allowed/18309 "2026-10-27T23:48:01Z")

</div>

My noob random walk in the world of FEniCS/dolfinx has recently allowed me to generate 2D meshes with gmsh, which I then import with dolfinx.io.gmshio.read\_from\_mesh.I have even managed to get PyVista up and running insi…

---

## [Memory allocation error when reading in cell tags from a pre-defined mesh file](https://fenicsproject.discourse.group/t/memory-allocation-error-when-reading-in-cell-tags-from-a-pre-defined-mesh-file/19808)

<div class="topic-metadata">

**Author:** [@Lev](https://fenicsproject.discourse.group/u/Lev)\
**Replies:** 3\
**Last updated:** [September 9, 2026, 7:49am UTC](https://fenicsproject.discourse.group/t/memory-allocation-error-when-reading-in-cell-tags-from-a-pre-defined-mesh-file/19808 "2026-09-09T07:49:46Z")

</div>

I’m trying to load a mesh from an XDMF and H5 file (created in Gmsh) using the following code: from mpi4py import MPI # Create the MPI communicator comm = MPI.COMM\_WORLD import dolfinx # using dolfinx v0.7.2 import nu…

---

## [How to extract oriented facet connectivity from a mesh?](https://fenicsproject.discourse.group/t/how-to-extract-oriented-facet-connectivity-from-a-mesh/19797)

<div class="topic-metadata">

**Author:** [@MathPhy42](https://fenicsproject.discourse.group/u/MathPhy42)\
**Replies:** 4\
**Last updated:** [August 14, 2026, 3:22pm UTC](https://fenicsproject.discourse.group/t/how-to-extract-oriented-facet-connectivity-from-a-mesh/19797 "2026-08-14T15:22:23Z")

</div>

Hi everyone, I’m trying to extract the (oriented) connectivity array for a surface of my mesh, which can lie on the boundary or be an internal surface as well. I know you can simply get the connectivity array calling f2…

---

## [Importing XMDF file into workspace file](https://fenicsproject.discourse.group/t/importing-xmdf-file-into-workspace-file/19740)

<div class="topic-metadata">

**Author:** [@shivam](https://fenicsproject.discourse.group/u/shivam)\
**Replies:** 2\
**Last updated:** [June 24, 2026, 7:19pm UTC](https://fenicsproject.discourse.group/t/importing-xmdf-file-into-workspace-file/19740 "2026-06-24T19:19:25Z")

</div>

Hey y’all. I am working on an indentation model with penalty formulation. I have had a Python file which included both the generation of the mesh with Gmsh and solving the problem out, but as the project continues it was…

---

## [Height data as input into DOLFINx](https://fenicsproject.discourse.group/t/height-data-as-input-into-dolfinx/19739)

<div class="topic-metadata">

**Author:** [@Testosteronnie](https://fenicsproject.discourse.group/u/Testosteronnie)\
**Replies:** 2\
**Last updated:** [June 18, 2026, 9:16am UTC](https://fenicsproject.discourse.group/t/height-data-as-input-into-dolfinx/19739 "2026-06-18T09:16:53Z")

</div>

I’m currently working on a DG model to solve the shallow water equations, in both the dynamical wave form and the kinematic wave approximation. In the kinematic wave approximation the equations are simplified to: \\frac…

---

## [Possible Bug in mesh refinement](https://fenicsproject.discourse.group/t/possible-bug-in-mesh-refinement/19732)

<div class="topic-metadata">

**Author:** [@JanvdW](https://fenicsproject.discourse.group/u/JanvdW)\
**Replies:** 3\
**Last updated:** [June 11, 2026, 2:22pm UTC](https://fenicsproject.discourse.group/t/possible-bug-in-mesh-refinement/19732 "2026-06-11T14:22:45Z")

</div>

Hi, I am new to the Fenics project and dolfinx. So forgive me, if I misunderstand something. When experimenting with dolfinx for mesh refinement, I stumbled on some behavior I cannot explain to my self. Here is my cod…

---

## [Conversion of .mphtxt that comsol exports to mesh usable for fenics legacy](https://fenicsproject.discourse.group/t/conversion-of-mphtxt-that-comsol-exports-to-mesh-usable-for-fenics-legacy/19705)

<div class="topic-metadata">

**Author:** [@Zubair\_Shah](https://fenicsproject.discourse.group/u/Zubair_Shah)\
**Replies:** 2\
**Last updated:** [May 16, 2026, 8:27pm UTC](https://fenicsproject.discourse.group/t/conversion-of-mphtxt-that-comsol-exports-to-mesh-usable-for-fenics-legacy/19705 "2026-05-16T20:27:07Z")

</div>

Dear All, I am trying to use a COMSOL mesh exported in .mphtxt format with legacy FEniCS. However, I am not sure how to convert this format into one that can be used in my FEniCS code. Currently, my workflow uses the X…

---

## [Create periodic mesh of a sector geometry](https://fenicsproject.discourse.group/t/create-periodic-mesh-of-a-sector-geometry/19660)

<div class="topic-metadata">

**Author:** [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Replies:** 0\
**Last updated:** [April 18, 2026, 2:03am UTC](https://fenicsproject.discourse.group/t/create-periodic-mesh-of-a-sector-geometry/19660 "2026-04-18T02:03:51Z")

</div>

I have a sector geometry where the sector boundaries should be periodic. I am using routines defined in script to turn the mesh periodic. First challenge I encounter is that script.create\_periodic\_mesh does not work with…

---

## [Getting salome mesh to FEniCSx python](https://fenicsproject.discourse.group/t/getting-salome-mesh-to-fenicsx-python/19477)

<div class="topic-metadata">

**Author:** [@otaolafr](https://fenicsproject.discourse.group/u/otaolafr)\
**Replies:** 23\
**Last updated:** [March 17, 2026, 7:28am UTC](https://fenicsproject.discourse.group/t/getting-salome-mesh-to-fenicsx-python/19477 "2026-03-17T07:28:10Z")

</div>

Hello, first of all, my excuses if i am not clear enought please bear with me as It is my first post. I want to use FEniCSx to do some FEM simulations, I do not use Gmsh but Salome for my geometry and mesh generation. …

---

## [Model.occ.fragment vs model.occ.cut and options](https://fenicsproject.discourse.group/t/model-occ-fragment-vs-model-occ-cut-and-options/19591)

<div class="topic-metadata">

**Author:** [@mdbarrett](https://fenicsproject.discourse.group/u/mdbarrett)\
**Replies:** 1\
**Last updated:** [March 10, 2026, 5:48am UTC](https://fenicsproject.discourse.group/t/model-occ-fragment-vs-model-occ-cut-and-options/19591 "2026-03-10T05:48:01Z")

</div>

When solving Laplace/Poisson equation over a (2D) bounded region e.g. a rectangle, which contains electrodes e.g. a set of disks, there obviously no need for the interior of the electrodes to be included. Searches onlin…

---

## [Inconsistencies/ holes in mesh or "DOLFIN encountered an error." While creating a mesh](https://fenicsproject.discourse.group/t/inconsistencies-holes-in-mesh-or-dolfin-encountered-an-error-while-creating-a-mesh/19561)

<div class="topic-metadata">

**Author:** [@ehadi](https://fenicsproject.discourse.group/u/ehadi)\
**Replies:** 9\
**Last updated:** [March 4, 2026, 7:24am UTC](https://fenicsproject.discourse.group/t/inconsistencies-holes-in-mesh-or-dolfin-encountered-an-error-while-creating-a-mesh/19561 "2026-03-04T07:24:35Z")

</div>

Hi all, I am working on a 2D quad mesh into DOLFIN from two .txt files; one containing the nodal coordinates and one containing the element connectivity for 4-node quads. The mesh looks correct in ParaView when exporte…

---

## [Merging 2d coaxial circular meshes to a 3d model](https://fenicsproject.discourse.group/t/merging-2d-coaxial-circular-meshes-to-a-3d-model/19518)

<div class="topic-metadata">

**Author:** [@BlastPhemer](https://fenicsproject.discourse.group/u/BlastPhemer)\
**Replies:** 1\
**Last updated:** [February 20, 2026, 12:04pm UTC](https://fenicsproject.discourse.group/t/merging-2d-coaxial-circular-meshes-to-a-3d-model/19518 "2026-02-20T12:04:09Z")

</div>

I have a set of 2d meshes that i read from .msh files. Each 2d mesh is z=const circle with exact number of nodes in each layer. Layers differ by the circle radius and the z-position. All the layers are coaxial and I need…

---

## [Differences between reading msh or xdmf mesh](https://fenicsproject.discourse.group/t/differences-between-reading-msh-or-xdmf-mesh/19489)

<div class="topic-metadata">

**Author:** [@LGerard](https://fenicsproject.discourse.group/u/LGerard)\
**Replies:** 2\
**Last updated:** [February 12, 2026, 4:39pm UTC](https://fenicsproject.discourse.group/t/differences-between-reading-msh-or-xdmf-mesh/19489 "2026-02-12T16:39:43Z")

</div>

Hello, I have some questions regarding mesh reading in the scripts. What is the difference between reading a mesh directly from Gmsh versus reading the mesh from an XDMF file? # Extract mesh data mesh, ct, ft = io.gms…

---

## [Constrained surface with svmtk](https://fenicsproject.discourse.group/t/constrained-surface-with-svmtk/19239)

<div class="topic-metadata">

**Author:** [@Chris\_S](https://fenicsproject.discourse.group/u/Chris_S)\
**Replies:** 3\
**Last updated:** [January 6, 2026, 11:43am UTC](https://fenicsproject.discourse.group/t/constrained-surface-with-svmtk/19239 "2026-01-06T11:43:19Z")

</div>

I am trying to work out how to “constrain“ a section of a surface when using svmtk. I am using surface.isotropic\_remeshing(edge\_length, k, protect\_borders=protect\_borders) I would like to parse protect\_borders=True, bu…

---

## [Gmshio not available in v10](https://fenicsproject.discourse.group/t/gmshio-not-available-in-v10/18418)

<div class="topic-metadata">

**Author:** [@lclaire](https://fenicsproject.discourse.group/u/lclaire)\
**Replies:** 3\
**Last updated:** [November 24, 2025, 10:37am UTC](https://fenicsproject.discourse.group/t/gmshio-not-available-in-v10/18418 "2025-11-24T10:37:53Z")

</div>

Hello, I am trying to import gmhsio in v10 using import dolfinx.io.gmshio or from dolfinx.io import gmshio and it returns cannot import name 'gmshio' from 'dolfinx.io' No module named 'dolfinx.io.gmshio' Is it s…

---

## [Conda env, trouble with pyvista and mesh data in pml demo](https://fenicsproject.discourse.group/t/conda-env-trouble-with-pyvista-and-mesh-data-in-pml-demo/18375)

<div class="topic-metadata">

**Author:** [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Replies:** 0\
**Last updated:** [November 15, 2025, 5:55pm UTC](https://fenicsproject.discourse.group/t/conda-env-trouble-with-pyvista-and-mesh-data-in-pml-demo/18375 "2025-11-15T17:55:44Z")

</div>

I am using MacOS, with conda complex env using : conda create -n env3-10-complex -c conda-forge python=3.10 fenics-dolfinx ‘petsc=\*=complex\*’ mpich conda install -c conda-forge scipy matplotlib pip install gmsh pip ins…

---

## [Mesh stitching via DOLFINx](https://fenicsproject.discourse.group/t/mesh-stitching-via-dolfinx/18324)

<div class="topic-metadata">

**Author:** [@chenyongxin](https://fenicsproject.discourse.group/u/chenyongxin)\
**Replies:** 3\
**Last updated:** [November 4, 2025, 7:00am UTC](https://fenicsproject.discourse.group/t/mesh-stitching-via-dolfinx/18324 "2025-11-04T07:00:33Z")

</div>

Gmsh is used to create very complex meshes in my applications. The whole process of mesh generation is very time consuming as there are many boolean operations, such as holes and cuts. But luckily, the needed mesh has a …

---

## [Issue with quadrilateral mesh orientation when importing SALOME mesh into FEniCS 2019.1](https://fenicsproject.discourse.group/t/issue-with-quadrilateral-mesh-orientation-when-importing-salome-mesh-into-fenics-2019-1/18303)

<div class="topic-metadata">

**Author:** [@Andrea](https://fenicsproject.discourse.group/u/Andrea)\
**Replies:** 1\
**Last updated:** [October 27, 2025, 9:09pm UTC](https://fenicsproject.discourse.group/t/issue-with-quadrilateral-mesh-orientation-when-importing-salome-mesh-into-fenics-2019-1/18303 "2025-10-27T21:09:12Z")

</div>

Hi all, I created my quadrilateral mesh using SALOME and then imported it into my code. After generating the .xdmf and .h5 files, I encountered an issue when trying to use them: there seems to be a mismatch between the …

---

## [GMSH aspect ratio of cells](https://fenicsproject.discourse.group/t/gmsh-aspect-ratio-of-cells/18301)

<div class="topic-metadata">

**Author:** [@BlastPhemer](https://fenicsproject.discourse.group/u/BlastPhemer)\
**Replies:** 0\
**Last updated:** [October 25, 2025, 2:51am UTC](https://fenicsproject.discourse.group/t/gmsh-aspect-ratio-of-cells/18301 "2025-10-25T02:51:38Z")

</div>

Is there a way to set aspect ratio for cells (all cells, not only the boundary) between the specified directions, e.g. x:z = 1:4 in 3D or x:y = 1:4 in 2D? Haven’t found it in gmsh docs. Very much appreciated!

---

## [Creating a mesh with cells size depending on array values](https://fenicsproject.discourse.group/t/creating-a-mesh-with-cells-size-depending-on-array-values/18262)

<div class="topic-metadata">

**Author:** [@BlastPhemer](https://fenicsproject.discourse.group/u/BlastPhemer)\
**Replies:** 2\
**Last updated:** [October 14, 2025, 6:30am UTC](https://fenicsproject.discourse.group/t/creating-a-mesh-with-cells-size-depending-on-array-values/18262 "2025-10-14T06:30:46Z")

</div>

I’m simulating a plasma formation in magnetic field. I think it is convenient to create a mesh with cell size depending on values of magnetic field (e.g. proportional to inverse gradient of magnetic field). Magnetic fiel…

---

## [Generating mesh with svmtk](https://fenicsproject.discourse.group/t/generating-mesh-with-svmtk/18247)

<div class="topic-metadata">

**Author:** [@Chris\_S](https://fenicsproject.discourse.group/u/Chris_S)\
**Replies:** 8\
**Last updated:** [October 13, 2025, 4:53am UTC](https://fenicsproject.discourse.group/t/generating-mesh-with-svmtk/18247 "2025-10-13T04:53:59Z")

</div>

I have trouble generating a subdomain mesh as outline in an svmtk tutorial. I have been following the svmtk tutorials here “Mathematical Modeling of the Human Brain From Magnetic Resonance Images to Finite Element Simula…

---

## [Svmtk meshing, boundary tagging](https://fenicsproject.discourse.group/t/svmtk-meshing-boundary-tagging/18254)

<div class="topic-metadata">

**Author:** [@Chris\_S](https://fenicsproject.discourse.group/u/Chris_S)\
**Replies:** 3\
**Last updated:** [October 13, 2025, 4:43am UTC](https://fenicsproject.discourse.group/t/svmtk-meshing-boundary-tagging/18254 "2025-10-13T04:43:02Z")

</div>

I am able to generate meshes with svmtk, but I am not understanding how I can define boundary surface tags? I.e. if I have a mesh with subdomains, how do I set the boundary tag to 1 for subdomain A that boarders subdomai…

---

## [Unable to import extruded geometry mesh](https://fenicsproject.discourse.group/t/unable-to-import-extruded-geometry-mesh/18234)

<div class="topic-metadata">

**Author:** [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Replies:** 5\
**Last updated:** [September 30, 2025, 1:52pm UTC](https://fenicsproject.discourse.group/t/unable-to-import-extruded-geometry-mesh/18234 "2025-09-30T13:52:45Z")

</div>

I am considering a 3D geometry which is created by extruding a 2D one. The mesh by design should be a 2D one but extruded to 3D (prism element). However, it seems to be running into problem with conversion to dolfinx mes…

---

## [Preserving tags from meshio to dolfinx](https://fenicsproject.discourse.group/t/preserving-tags-from-meshio-to-dolfinx/18219)

<div class="topic-metadata">

**Author:** [@alsufe26](https://fenicsproject.discourse.group/u/alsufe26)\
**Replies:** 1\
**Last updated:** [September 27, 2025, 2:26pm UTC](https://fenicsproject.discourse.group/t/preserving-tags-from-meshio-to-dolfinx/18219 "2025-09-27T14:26:56Z")

</div>

Hi all, this is my first post and in fact my first week with fenicsx I used meshio to transform an ABQ .inp file into a xdmf. To preserve nsets, elsets and surfaces, I used point\_data and cell\_data of the meshio.Mesh co…

---

## [L2 Error in Navier Stokes code](https://fenicsproject.discourse.group/t/l2-error-in-navier-stokes-code/17871)

<div class="topic-metadata">

**Author:** [@sshah](https://fenicsproject.discourse.group/u/sshah)\
**Replies:** 4\
**Last updated:** [September 3, 2025, 5:54pm UTC](https://fenicsproject.discourse.group/t/l2-error-in-navier-stokes-code/17871 "2025-09-03T17:54:25Z")

</div>

Hi, I am trying to examine the L2 error variation for a refined mesh applied to your Navier-Stokes equation with Poiseuille flow. I observed that the error increases as the mesh is refined, whereas it is expected to dec…

---

## [Adjecency list creates unexpected triangles with multiple MPI processes](https://fenicsproject.discourse.group/t/adjecency-list-creates-unexpected-triangles-with-multiple-mpi-processes/18180)

<div class="topic-metadata">

**Author:** [@Aaron](https://fenicsproject.discourse.group/u/Aaron)\
**Replies:** 2\
**Last updated:** [September 2, 2025, 11:35am UTC](https://fenicsproject.discourse.group/t/adjecency-list-creates-unexpected-triangles-with-multiple-mpi-processes/18180 "2025-09-02T11:35:00Z")

</div>

For every cell in a 2D mesh I am trying to obtain the transformation from the reference cell to that cell. For this I need the location of the vertices and the adjacency list between the cells and vertices. The followin…

---

## [How to get the point coordinates with specifying its global index in the dolfinx.mesh.Mesh?](https://fenicsproject.discourse.group/t/how-to-get-the-point-coordinates-with-specifying-its-global-index-in-the-dolfinx-mesh-mesh/18172)

<div class="topic-metadata">

**Author:** [@lyunfei1211](https://fenicsproject.discourse.group/u/lyunfei1211)\
**Replies:** 1\
**Last updated:** [August 31, 2025, 6:02pm UTC](https://fenicsproject.discourse.group/t/how-to-get-the-point-coordinates-with-specifying-its-global-index-in-the-dolfinx-mesh-mesh/18172 "2025-08-31T18:02:09Z")

</div>

Hi, everyone! I want to obtain the points coordinates with the sorted order by their global indices in a dolfinx.mesh.Mesh(). First, I think this canbe done using mesh.geometry.x. However, I found that the points are ou…

---

## [DBCs on submesh - unexpected dof indices?](https://fenicsproject.discourse.group/t/dbcs-on-submesh-unexpected-dof-indices/18135)

<div class="topic-metadata">

**Author:** [@marchirschvogel](https://fenicsproject.discourse.group/u/marchirschvogel)\
**Replies:** 10\
**Last updated:** [August 23, 2025, 10:08am UTC](https://fenicsproject.discourse.group/t/dbcs-on-submesh-unexpected-dof-indices/18135 "2025-08-23T10:08:01Z")

</div>

Dear Community, For coupled problems (e.g. FSI), it can be beneficial to have a routine that removes Dirichlet BCs that are both set on a fluid and a solid mesh node (e.g. when two surfaces with DBCs meet at an edge), s…

---

## [Error importing mesh with filleted corners](https://fenicsproject.discourse.group/t/error-importing-mesh-with-filleted-corners/18087)

<div class="topic-metadata">

**Author:** [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Replies:** 2\
**Last updated:** [August 8, 2025, 4:39pm UTC](https://fenicsproject.discourse.group/t/error-importing-mesh-with-filleted-corners/18087 "2025-08-08T16:39:58Z")

</div>

Hi, I have a simple 2D geometry where I fillet each corner. Everything works in gmsh but somehow it causes the \`model\_to\_mesh\` operation to fail. I will appreciate if someone could point a way to get around this. Below …

[Next page](https://fenicsproject.discourse.group/c/meshing/6.md?page=1)
