# mesh

**URL:** https://fenicsproject.discourse.group/c/meshing/6.md?page=1

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

**Page:** 2

---

## [Mesh.locate\_entities\_boundary() does not seem to work if importing mesh nodes and cells](https://fenicsproject.discourse.group/t/mesh-locate-entities-boundary-does-not-seem-to-work-if-importing-mesh-nodes-and-cells/17976)

<div class="topic-metadata">

**Author:** [@alex24](https://fenicsproject.discourse.group/u/alex24)\
**Replies:** 3\
**Last updated:** [July 14, 2025, 6:13pm UTC](https://fenicsproject.discourse.group/t/mesh-locate-entities-boundary-does-not-seem-to-work-if-importing-mesh-nodes-and-cells/17976 "2025-07-14T18:13:13Z")

</div>

Hi, When I generate a mesh using dolfinx, I can do the following and it generates the right boundary condition: # Function to mark noslip bc def noslip\_boundary2(x): return np.isclose(x\[2\], z\_val) # No slip bounda…

---

## [Trying to convert mesh from MPI.COMM\_SELF to MPI.COMM\_WORLD](https://fenicsproject.discourse.group/t/trying-to-convert-mesh-from-mpi-comm-self-to-mpi-comm-world/17968)

<div class="topic-metadata">

**Author:** [@mgalexan](https://fenicsproject.discourse.group/u/mgalexan)\
**Replies:** 3\
**Last updated:** [July 11, 2025, 3:55pm UTC](https://fenicsproject.discourse.group/t/trying-to-convert-mesh-from-mpi-comm-self-to-mpi-comm-world/17968 "2025-07-11T15:55:54Z")

</div>

I’m working on a simulation that needs certain mesh refinements to be done before any computations are made, and because of the number of cores required I’m finding it too slow to do these refinements in parallel, so I’m…

---

## [How to create subdomains(boundaries) of polygonal meshes, and how to assign arrays of values to a boundary?](https://fenicsproject.discourse.group/t/how-to-create-subdomains-boundaries-of-polygonal-meshes-and-how-to-assign-arrays-of-values-to-a-boundary/17893)

<div class="topic-metadata">

**Author:** [@fea](https://fenicsproject.discourse.group/u/fea)\
**Replies:** 1\
**Last updated:** [July 7, 2025, 3:09am UTC](https://fenicsproject.discourse.group/t/how-to-create-subdomains-boundaries-of-polygonal-meshes-and-how-to-assign-arrays-of-values-to-a-boundary/17893 "2025-07-07T03:09:52Z")

</div>

I have 2 questions which arise from wanting to apply Dirichlet boundary conditions to a L-shaped polygon like the one below where it can be seen that the boundary values are 0 everywhere except for the left side of t…

---

## [Unexpected behavior of SpatialCoordinate, when using create\_submesh](https://fenicsproject.discourse.group/t/unexpected-behavior-of-spatialcoordinate-when-using-create-submesh/17877)

<div class="topic-metadata">

**Author:** [@mknoeller](https://fenicsproject.discourse.group/u/mknoeller)\
**Replies:** 2\
**Last updated:** [July 3, 2025, 6:56am UTC](https://fenicsproject.discourse.group/t/unexpected-behavior-of-spatialcoordinate-when-using-create-submesh/17877 "2025-07-03T06:56:27Z")

</div>

Dear Community, when creating a submesh using dolfinx.mesh.create\_submesh and visualizing the spatial coordinates I find that the mesh is somehow destroyed/ the triangles appear to be wrongly associated. The phenomenon…

---

## [First time getting started with Fenics (and using a finite element analysis package in general), could I have some advice or help on a problem I'm working on?](https://fenicsproject.discourse.group/t/first-time-getting-started-with-fenics-and-using-a-finite-element-analysis-package-in-general-could-i-have-some-advice-or-help-on-a-problem-im-working-on/17796)

<div class="topic-metadata">

**Author:** [@fea](https://fenicsproject.discourse.group/u/fea)\
**Replies:** 12\
**Last updated:** [June 26, 2025, 6:00am UTC](https://fenicsproject.discourse.group/t/first-time-getting-started-with-fenics-and-using-a-finite-element-analysis-package-in-general-could-i-have-some-advice-or-help-on-a-problem-im-working-on/17796 "2025-06-26T06:00:04Z")

</div>

I have the following L-shaped block with equally spaced grid points that I want to solve Laplace’s Equation w/ a Dirichlet Boundary Condition over: Initially, I wrote up a Jacobi iteration solver to solve the Euler B…

---

## [Shape optimization](https://fenicsproject.discourse.group/t/shape-optimization/17715)

<div class="topic-metadata">

**Author:** [@raboynics](https://fenicsproject.discourse.group/u/raboynics)\
**Replies:** 12\
**Last updated:** [June 24, 2025, 5:27am UTC](https://fenicsproject.discourse.group/t/shape-optimization/17715 "2025-06-24T05:27:12Z")

</div>

I would appreciate some guidance. I have a FeniCSx (dolfinx 0.9) code that performs some computations, it works fine for a given mesh. The mesh consists of 2 regions, one is a three quarters-annulus that is fixed, and t…

---

## [L-shape mesh generation with right element](https://fenicsproject.discourse.group/t/l-shape-mesh-generation-with-right-element/5514)

<div class="topic-metadata">

**Author:** [@Linda\_Alzaben](https://fenicsproject.discourse.group/u/Linda_Alzaben)\
**Replies:** 11\
**Last updated:** [June 22, 2025, 7:40pm UTC](https://fenicsproject.discourse.group/t/l-shape-mesh-generation-with-right-element/5514 "2025-06-22T19:40:52Z")

</div>

Hi, I would like to construct an L-shape domain with ‘right’ element( this is the aim). To do so, I have constructed two rectangles and would like to add them together. How can I implement this? from dolfin import \* …

---

## [Unable to optimize higher order mesh](https://fenicsproject.discourse.group/t/unable-to-optimize-higher-order-mesh/17755)

<div class="topic-metadata">

**Author:** [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Replies:** 1\
**Last updated:** [June 16, 2025, 8:20am UTC](https://fenicsproject.discourse.group/t/unable-to-optimize-higher-order-mesh/17755 "2025-06-16T08:20:07Z")

</div>

The gmshio.model\_to\_mesh crashes when it operates on a higher order mesh which was later optimized as well. It works fine if the optimization is done on first order mesh before conversion to higher order. I get the follo…

---

## [Gmsh not recognizing separate surfaces in .stl](https://fenicsproject.discourse.group/t/gmsh-not-recognizing-separate-surfaces-in-stl/17744)

<div class="topic-metadata">

**Author:** [@Gabriella\_Myslo](https://fenicsproject.discourse.group/u/Gabriella_Myslo)\
**Replies:** 2\
**Last updated:** [June 12, 2025, 6:15pm UTC](https://fenicsproject.discourse.group/t/gmsh-not-recognizing-separate-surfaces-in-stl/17744 "2025-06-12T18:15:47Z")

</div>

Hello, I am working on a simulation project where I have been running simulations on a geometry (.msh) provided in the simulation software download package. However, now I would like to import a custom geometry made by …

---

## [How to work with nonconforming meshes?](https://fenicsproject.discourse.group/t/how-to-work-with-nonconforming-meshes/17735)

<div class="topic-metadata">

**Author:** [@Giovanni\_Esposito](https://fenicsproject.discourse.group/u/Giovanni_Esposito)\
**Replies:** 1\
**Last updated:** [June 11, 2025, 3:15pm UTC](https://fenicsproject.discourse.group/t/how-to-work-with-nonconforming-meshes/17735 "2025-06-11T15:15:12Z")

</div>

Hi, I solved a Dirichlet problem associated to a Laplace equation with FEniCSx, in a square. After that, I computed the normal derivatives in the cells of the mesh adjacent to the boundary of the square. Then I want to…

---

## [GMSH boundary layer](https://fenicsproject.discourse.group/t/gmsh-boundary-layer/17680)

<div class="topic-metadata">

**Author:** [@Katie](https://fenicsproject.discourse.group/u/Katie)\
**Replies:** 1\
**Last updated:** [June 6, 2025, 8:34am UTC](https://fenicsproject.discourse.group/t/gmsh-boundary-layer/17680 "2025-06-06T08:34:17Z")

</div>

Hi all, I have an issue when generating a boundary layer in GMSH. I am making a mesh with a boundary layer perpendicular to a boundary, as seen here. Overall it is doing a pretty good job. The issue is at the corner…

---

## [Error reading gmsh mesh created with extrude command](https://fenicsproject.discourse.group/t/error-reading-gmsh-mesh-created-with-extrude-command/17693)

<div class="topic-metadata">

**Author:** [@avishmj](https://fenicsproject.discourse.group/u/avishmj)\
**Replies:** 1\
**Last updated:** [June 3, 2025, 3:36pm UTC](https://fenicsproject.discourse.group/t/error-reading-gmsh-mesh-created-with-extrude-command/17693 "2025-06-03T15:36:44Z")

</div>

Hi! In the below MWE, I am creating a dented solid cylinder mesh in gmsh (version 4.11.1) using the extrude() command as given in the gmsh file given below. When importing it to FEniCS, it says there’s error in creating …

---

## [Importing geometry and giving new tags](https://fenicsproject.discourse.group/t/importing-geometry-and-giving-new-tags/17678)

<div class="topic-metadata">

**Author:** [@pierremrtt](https://fenicsproject.discourse.group/u/pierremrtt)\
**Replies:** 4\
**Last updated:** [June 2, 2025, 11:57pm UTC](https://fenicsproject.discourse.group/t/importing-geometry-and-giving-new-tags/17678 "2025-06-02T23:57:58Z")

</div>

Dear community, I’d like to add a new numerical case to my study. It happens that the geometry is not super complex, but still almost impossible to do it by hand with gmsh python library. I have the geometry in COMSOL,…

---

## [Bug in extracting physical tags from sphere](https://fenicsproject.discourse.group/t/bug-in-extracting-physical-tags-from-sphere/17675)

<div class="topic-metadata">

**Author:** [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Replies:** 3\
**Last updated:** [June 1, 2025, 5:20am UTC](https://fenicsproject.discourse.group/t/bug-in-extracting-physical-tags-from-sphere/17675 "2025-06-01T05:20:45Z")

</div>

I want to extract physical tags from my geometry all the way up to zero dimensional entities i.e. points using this script. However, I stumbled upon a strange bug in the process which appears to be present in gmshio.mode…

---

## [How to get the area of a hemi sphere](https://fenicsproject.discourse.group/t/how-to-get-the-area-of-a-hemi-sphere/17662)

<div class="topic-metadata">

**Author:** [@quantumtopology](https://fenicsproject.discourse.group/u/quantumtopology)\
**Replies:** 6\
**Last updated:** [May 30, 2025, 12:11am UTC](https://fenicsproject.discourse.group/t/how-to-get-the-area-of-a-hemi-sphere/17662 "2025-05-30T00:11:54Z")

</div>

Hello, I am trying to build a hemi sphere and calculate the area by following the tutorial Integration measures, but the code does not give the correct result. Here is my code. import gmsh import dolfinx, ufl from mpi4…

---

## [Using weight with parmetis partitioner](https://fenicsproject.discourse.group/t/using-weight-with-parmetis-partitioner/17639)

<div class="topic-metadata">

**Author:** [@SalzmanA](https://fenicsproject.discourse.group/u/SalzmanA)\
**Replies:** 2\
**Last updated:** [May 21, 2025, 7:14pm UTC](https://fenicsproject.discourse.group/t/using-weight-with-parmetis-partitioner/17639 "2025-05-21T19:14:16Z")

</div>

Hello, In version 0.9 of C++ Dolfinx, I could not find a way to perform load balancing on a mesh using weights per cell, as proposed by the Parmetis API. I just want to check that I didn’t miss the right solution, as I…

---

## [Error with msh file](https://fenicsproject.discourse.group/t/error-with-msh-file/17617)

<div class="topic-metadata">

**Author:** [@Katie](https://fenicsproject.discourse.group/u/Katie)\
**Replies:** 2\
**Last updated:** [May 16, 2025, 9:46am UTC](https://fenicsproject.discourse.group/t/error-with-msh-file/17617 "2025-05-16T09:46:06Z")

</div>

Hi all, For context, I am converting a .key file to a .msh file. However, I’m having trouble reading the msh file, and I suspect there is an error somewhere in the formatting. The error occurs for a very simple mesh, wi…

---

## [Adding 1d physical groups to gmsh model causes errors when convert it to dolfinx mesh](https://fenicsproject.discourse.group/t/adding-1d-physical-groups-to-gmsh-model-causes-errors-when-convert-it-to-dolfinx-mesh/17618)

<div class="topic-metadata">

**Author:** [@quantumtopology](https://fenicsproject.discourse.group/u/quantumtopology)\
**Replies:** 1\
**Last updated:** [May 16, 2025, 8:15am UTC](https://fenicsproject.discourse.group/t/adding-1d-physical-groups-to-gmsh-model-causes-errors-when-convert-it-to-dolfinx-mesh/17618 "2025-05-16T08:15:19Z")

</div>

Hello, I wrote a function to generate a 2d area by gmsh. But there are some problems in the generate\_mesh function. If I only add the region group or region + parabola group, the code runs correctly. It prints 1/6 as I…

---

## [Assembling Global Node Vector from Distributed Mesh in Parallel Computation](https://fenicsproject.discourse.group/t/assembling-global-node-vector-from-distributed-mesh-in-parallel-computation/17587)

<div class="topic-metadata">

**Author:** [@saragazzoni](https://fenicsproject.discourse.group/u/saragazzoni)\
**Replies:** 5\
**Last updated:** [May 12, 2025, 2:10pm UTC](https://fenicsproject.discourse.group/t/assembling-global-node-vector-from-distributed-mesh-in-parallel-computation/17587 "2025-05-12T14:10:10Z")

</div>

We are running a parallel computation and need to reconstruct the global connectivity matrix and the global node vector. Specifically, we compute a quantity h locally on each node of our mesh within each processor. Now, …

---

## [Change comm on submesh](https://fenicsproject.discourse.group/t/change-comm-on-submesh/17514)

<div class="topic-metadata">

**Author:** [@cianwilson](https://fenicsproject.discourse.group/u/cianwilson)\
**Replies:** 2\
**Last updated:** [May 7, 2025, 9:22pm UTC](https://fenicsproject.discourse.group/t/change-comm-on-submesh/17514 "2025-05-07T21:22:39Z")

</div>

Hi, I’m trying to “change” the comm on a submesh from the comm it inherits from the full mesh to a split (or otherwise smaller sub-) comm. The full mesh has been partitioned by region so that certain ranks are guarante…

---

## [Problem : how to remove z-values to force 2d mesh (meshio)](https://fenicsproject.discourse.group/t/problem-how-to-remove-z-values-to-force-2d-mesh-meshio/1541)

<div class="topic-metadata">

**Author:** [@AMM](https://fenicsproject.discourse.group/u/AMM)\
**Replies:** 13\
**Last updated:** [May 6, 2025, 6:08pm UTC](https://fenicsproject.discourse.group/t/problem-how-to-remove-z-values-to-force-2d-mesh-meshio/1541 "2025-05-06T18:08:52Z")

</div>

Hi, I have some problem with the definition of normal when the mesh is imported from gmsh. Indeed, taking a 2d mesh of gmsh (on my .msh file I have a component in z but which is worth 0 everywhere) and defining a norma…

---

## [Failure in importing second-order mesh in legacy FEniCS](https://fenicsproject.discourse.group/t/failure-in-importing-second-order-mesh-in-legacy-fenics/17513)

<div class="topic-metadata">

**Author:** [@yuki\_y](https://fenicsproject.discourse.group/u/yuki_y)\
**Replies:** 2\
**Last updated:** [April 30, 2025, 1:37pm UTC](https://fenicsproject.discourse.group/t/failure-in-importing-second-order-mesh-in-legacy-fenics/17513 "2025-04-30T13:37:57Z")

</div>

Hi everyone in the community, I’m quite a newbie in Fenics(2019.1.0)/Fenicsx(0.9), actually also a newbie in FEM simulation, so please forgive me if my questions are not so smart. Recently I’m working on 2D contact pro…

---

## [Not all facet tags are plotted](https://fenicsproject.discourse.group/t/not-all-facet-tags-are-plotted/17468)

<div class="topic-metadata">

**Author:** [@tomd](https://fenicsproject.discourse.group/u/tomd)\
**Replies:** 3\
**Last updated:** [April 29, 2025, 6:44am UTC](https://fenicsproject.discourse.group/t/not-all-facet-tags-are-plotted/17468 "2025-04-29T06:44:36Z")

</div>

Hi all, I am dealing with mixed-dimensional PDEs when I ran into an issue with computing facet tags. Trying to reproduce Dokken’s tutorial I do not see all the desired facets marked in the plot. The MWE is from mpi4py…

---

## [Relation of midpoints to node ID with 2nd order meshes](https://fenicsproject.discourse.group/t/relation-of-midpoints-to-node-id-with-2nd-order-meshes/17496)

<div class="topic-metadata">

**Author:** [@chenyongxin](https://fenicsproject.discourse.group/u/chenyongxin)\
**Replies:** 0\
**Last updated:** [April 24, 2025, 3:13am UTC](https://fenicsproject.discourse.group/t/relation-of-midpoints-to-node-id-with-2nd-order-meshes/17496 "2025-04-24T03:13:12Z")

</div>

I simulate FSI problems on a single 2nd order mesh in three-dimension. I need to retrieve the node coordinates and connectivity of vertices and midpoints on each fluid-structure interface facet, respectively. Say if ther…

---

## [Parallel implementation of adaptive mesh refinemet](https://fenicsproject.discourse.group/t/parallel-implementation-of-adaptive-mesh-refinemet/17454)

<div class="topic-metadata">

**Author:** [@Fenil](https://fenicsproject.discourse.group/u/Fenil)\
**Replies:** 1\
**Last updated:** [April 17, 2025, 3:44pm UTC](https://fenicsproject.discourse.group/t/parallel-implementation-of-adaptive-mesh-refinemet/17454 "2025-04-17T15:44:01Z")

</div>

Hello everyone, I’m working with FEniCSx 0.8.0 to implement a brittle fracture phase field model using adaptive mesh refinement. The simulation behaves as expected when run in serial, but produces incorrect results when…

---

## [How to properly handle mesh refinement in dynamic adaptive loops](https://fenicsproject.discourse.group/t/how-to-properly-handle-mesh-refinement-in-dynamic-adaptive-loops/17374)

<div class="topic-metadata">

**Author:** [@nikoleeaa](https://fenicsproject.discourse.group/u/nikoleeaa)\
**Replies:** 1\
**Last updated:** [April 4, 2025, 3:39pm UTC](https://fenicsproject.discourse.group/t/how-to-properly-handle-mesh-refinement-in-dynamic-adaptive-loops/17374 "2025-04-04T15:39:59Z")

</div>

I’m implementing an adaptive mesh loop where I need to: Solve PDEs on current mesh Compute error indicators based on solutions Mark cells according to error indicators Refine marked cells to generate new mesh change cu…

---

## [Overlapped Surfaces in gmsh](https://fenicsproject.discourse.group/t/overlapped-surfaces-in-gmsh/17297)

<div class="topic-metadata">

**Author:** [@VladCucuiet](https://fenicsproject.discourse.group/u/VladCucuiet)\
**Replies:** 1\
**Last updated:** [March 25, 2025, 12:49pm UTC](https://fenicsproject.discourse.group/t/overlapped-surfaces-in-gmsh/17297 "2025-03-25T12:49:45Z")

</div>

Hello, I want to create a mesh with a disk surrounded by a rectangle. I want to set boundary conditions at the disk margins. I succeeded to open it in dolfinx, but I think there is a problem with the marker. It shouws t…

---

## [Segmentation Fault](https://fenicsproject.discourse.group/t/segmentation-fault/17286)

<div class="topic-metadata">

**Author:** [@filippo\_baldini](https://fenicsproject.discourse.group/u/filippo_baldini)\
**Replies:** 2\
**Last updated:** [March 24, 2025, 7:58pm UTC](https://fenicsproject.discourse.group/t/segmentation-fault/17286 "2025-03-24T19:58:49Z")

</div>

I am constructing a Backward Facing Step mesh using gmsh(4.12.1). This is my script to create the .msh file: import gmsh import numpy as np from mpi4py import MPI gmsh.initialize() proc = MPI.COMM\_WORLD.rank if proc …

---

## [Custom made non uniform mesh](https://fenicsproject.discourse.group/t/custom-made-non-uniform-mesh/17264)

<div class="topic-metadata">

**Author:** [@Neofytos\_Neofytou](https://fenicsproject.discourse.group/u/Neofytos_Neofytou)\
**Replies:** 6\
**Last updated:** [March 21, 2025, 1:47pm UTC](https://fenicsproject.discourse.group/t/custom-made-non-uniform-mesh/17264 "2025-03-21T13:47:34Z")

</div>

Hello everyone, I am using fenics-dolfinx 0.9.0 with Linux (Ubuntu 24.04.2 LTS). I am trying to create a custom mesh to solve the mixed Poisson problem, following the approach described here: Mixed formulation for the …

---

## [Error with Adaptive Mesh Refinement in Phase-Field Simulation (FEniCS)](https://fenicsproject.discourse.group/t/error-with-adaptive-mesh-refinement-in-phase-field-simulation-fenics/17206)

<div class="topic-metadata">

**Author:** [@Bharath](https://fenicsproject.discourse.group/u/Bharath)\
**Replies:** 4\
**Last updated:** [March 20, 2025, 12:12pm UTC](https://fenicsproject.discourse.group/t/error-with-adaptive-mesh-refinement-in-phase-field-simulation-fenics/17206 "2025-03-20T12:12:45Z")

</div>

Hi, I am implementing adaptive meshing for a phase-field fracture simulation in FEniCS. However, I am encountering the following error: KeyError: Mesh(VectorElement(FiniteElement("Lagrange", triangle, 1), dim=2), 0) I…

[Previous page](https://fenicsproject.discourse.group/c/meshing/6.md)

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