Skip to content

BDDC: Fix block sizes #4253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions firedrake/preconditioners/fdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,11 @@ def setup_block(self, Vrow, Vcol):
P.setISAllowRepeated(self.allow_repeated)
P.setLGMap(rmap, cmap)
if on_diag and ptype == "is" and self.allow_repeated:
bsize = Vrow.finat_element.space_dimension() * Vrow.value_size
bsize = Vrow.finat_element.space_dimension() * Vrow.block_size
local_mat = P.getISLocalMat()
nblocks = local_mat.getSize()[0] // bsize
local_mat.setVariableBlockSizes([bsize] * nblocks)
sizes = numpy.full((nblocks,), bsize, dtype=PETSc.IntType)
local_mat.setVariableBlockSizes(sizes)
P.setPreallocationNNZ((dnz, onz))

if not (ptype.endswith("sbaij") or ptype == "is"):
Expand Down
4 changes: 2 additions & 2 deletions tests/firedrake/regression/test_bddc.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def solve_riesz_map(mesh, family, degree, bcs, condense):

@pytest.fixture(params=(2, 3), ids=("square", "cube"))
def mesh(request):
nx = 4
dim = request.param
nx = 4
msh = UnitSquareMesh(nx, nx, quadrilateral=True)
if dim == 3:
msh = ExtrudedMesh(msh, nx)
Expand All @@ -126,5 +126,5 @@ def mesh(request):
def test_bddc_fdm(mesh, family, degree, condense):
bcs = True
tdim = mesh.topological_dimension()
expected = 6 if tdim == 2 else 11
expected = 7 if tdim == 2 else 11
assert solve_riesz_map(mesh, family, degree, bcs, condense) <= expected
Loading