BUG: creating submesh from a periodic mesh fails

Aperta
#5,518 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start from the reproducer: PeriodicUnitCubeMesh with all directions periodic, relabelled via RelabeledMesh, then passed to Submesh for the facet dimension, which segfaults inside PETSc. Check whether the crash happens before or after the marker assignment, and whether UnitCubeMesh avoids it because of the periodic topology. Whether periodic meshes should support submeshes at all is still open, so confirm that with a maintainer first. Done means the snippet either runs or fails with a clear error instead of a SEGV.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Creating a facet submesh from a fully periodic PeriodicUnitCubeMesh causes a PETSc segmentation fault. The example is below:

from firedrake import *

mesh = PeriodicUnitCubeMesh(10, 10, 10, directions=[True, True, True])
x, y, z = SpatialCoordinate(mesh)

# Assign a facet marker to the mesh (since there are no markers in periodic case).
V = FunctionSpace(mesh, "HDiv Trace", 0)
f = Function(V)
f.interpolate(conditional(z > 0.99, 1, 0))
mesh = RelabeledMesh(mesh, [f], [1])

print("Boundary markers:", mesh.exterior_facets.unique_markers)

# Crashes here.
face_mesh = Submesh(mesh, mesh.topological_dimension - 1, 1)

The call to Submesh crashes with:

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.
--------------------------------------------------------------------------
Firedrake Version: 2026.10.0
PETSc Version:     {'major': 3, 'minor': 26, 'subminor': 0, 'release': True, 'date': 'unknown', 'authorinfo': ('The PETSc Team', '[email protected]', 'https://petsc.org/')}

Everything works if the base mesh is UnitCubeMesh(10, 10, 10). I am not sure if such operation is expected to work at all in the periodic case...

Lingua principale
Python
Stelle
684
Fork
204
Merge medio
4g 14h
PR unite (30g)
46

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firedrakeproject/firedrake

Tutte le issue di firedrakeproject/firedrake

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.