Skip to content

Commit 74ecb96

Browse files
authored
Deprecate variable layer extrusion (#5028)
1 parent da58079 commit 74ecb96

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

firedrake/mesh.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from textwrap import dedent
2121
from pathlib import Path
2222
import typing
23+
import warnings
2324

2425
from pyop2 import op2
2526
from pyop2.mpi import (
@@ -3451,7 +3452,7 @@ def ExtrudedMesh(mesh, layers, layer_height=None, extrusion_type='uniform', peri
34513452
:arg layers: number of extruded cell layers in the "vertical"
34523453
direction. One may also pass an array of
34533454
shape (cells, 2) to specify a variable number
3454-
of layers. In this case, each entry is a pair
3455+
of layers (deprecated). In this case, each entry is a pair
34553456
``[a, b]`` where ``a`` indicates the starting
34563457
cell layer of the column and ``b`` the number
34573458
of cell layers in that column.
@@ -3515,6 +3516,13 @@ def ExtrudedMesh(mesh, layers, layer_height=None, extrusion_type='uniform', peri
35153516
name = name if name is not None else mesh.name + "_extruded"
35163517
layers = np.asarray(layers, dtype=IntType)
35173518
if layers.shape:
3519+
warnings.warn(
3520+
"Variable layer extrusion is deprecated and will be removed "
3521+
"in the 2026.10.0 release. If possible we recommend using "
3522+
"Submesh instead. Please get in touch if this is a critical "
3523+
"issue for you.",
3524+
FutureWarning,
3525+
)
35183526
if periodic:
35193527
raise ValueError("Must provide constant layer for periodic extrusion")
35203528
if layers.shape != (mesh.cell_set.total_size, 2):

0 commit comments

Comments
 (0)