Skip to content

Commit 5066a62

Browse files
authored
BDDC: Fix block sizes (#4253)
1 parent 1d154ca commit 5066a62

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

firedrake/preconditioners/fdm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,11 @@ def setup_block(self, Vrow, Vcol):
777777
P.setISAllowRepeated(self.allow_repeated)
778778
P.setLGMap(rmap, cmap)
779779
if on_diag and ptype == "is" and self.allow_repeated:
780-
bsize = Vrow.finat_element.space_dimension() * Vrow.value_size
780+
bsize = Vrow.finat_element.space_dimension() * Vrow.block_size
781781
local_mat = P.getISLocalMat()
782782
nblocks = local_mat.getSize()[0] // bsize
783-
local_mat.setVariableBlockSizes([bsize] * nblocks)
783+
sizes = numpy.full((nblocks,), bsize, dtype=PETSc.IntType)
784+
local_mat.setVariableBlockSizes(sizes)
784785
P.setPreallocationNNZ((dnz, onz))
785786

786787
if not (ptype.endswith("sbaij") or ptype == "is"):

tests/firedrake/regression/test_bddc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def solve_riesz_map(mesh, family, degree, bcs, condense):
111111

112112
@pytest.fixture(params=(2, 3), ids=("square", "cube"))
113113
def mesh(request):
114-
nx = 4
115114
dim = request.param
115+
nx = 4
116116
msh = UnitSquareMesh(nx, nx, quadrilateral=True)
117117
if dim == 3:
118118
msh = ExtrudedMesh(msh, nx)
@@ -126,5 +126,5 @@ def mesh(request):
126126
def test_bddc_fdm(mesh, family, degree, condense):
127127
bcs = True
128128
tdim = mesh.topological_dimension()
129-
expected = 6 if tdim == 2 else 11
129+
expected = 7 if tdim == 2 else 11
130130
assert solve_riesz_map(mesh, family, degree, bcs, condense) <= expected

0 commit comments

Comments
 (0)