Skip to content

Commit ee49bf3

Browse files
committed
Test
1 parent d6a3104 commit ee49bf3

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

python/dolfinx/la/petsc.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def create_vector_wrap(x: Vector) -> PETSc.Vec: # type: ignore[name-defined]
7373

7474

7575
def create_vector(
76-
maps: typing.Sequence[tuple[IndexMap, int]], kind: str | None = None
76+
maps: typing.Sequence[tuple[IndexMap, int]], kind: str = "mpi"
7777
) -> PETSc.Vec: # type: ignore[name-defined]
7878
"""Create a PETSc vector from a sequence of maps and blocksizes.
7979
@@ -118,15 +118,15 @@ def create_vector(
118118
A PETSc vector with the prescribed layout. The vector is not
119119
initialised to zero.
120120
"""
121-
if len(maps) == 1:
122-
# Single space case
123-
index_map, bs = maps[0]
124-
ghosts = index_map.ghosts.astype(PETSc.IntType) # type: ignore[attr-defined]
125-
size = (index_map.size_local * bs, index_map.size_global * bs)
126-
b = PETSc.Vec().createGhost(ghosts, size=size, bsize=bs, comm=index_map.comm) # type: ignore
127-
if kind == PETSc.Vec.Type.MPI:
128-
_assign_block_data(maps, b)
129-
return b
121+
# if len(maps) == 1:
122+
# # Single space case
123+
# index_map, bs = maps[0]
124+
# ghosts = index_map.ghosts.astype(PETSc.IntType) # type: ignore[attr-defined]
125+
# size = (index_map.size_local * bs, index_map.size_global * bs)
126+
# b = PETSc.Vec().createGhost(ghosts, size=size, bsize=bs, comm=index_map.comm) # type: ignore
127+
# if kind == PETSc.Vec.Type.MPI:
128+
# _assign_block_data(maps, b)
129+
# return b
130130

131131
if kind is None or kind == PETSc.Vec.Type.MPI: # type: ignore[attr-defined]
132132
b = dolfinx.cpp.fem.petsc.create_vector_block(maps)

python/test/unit/fem/test_assembler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_vector_single_space_as_block():
184184
mesh = create_unit_square(MPI.COMM_WORLD, 3, 3)
185185
gdim = mesh.geometry.dim
186186
V = functionspace(mesh, ("Lagrange", 1, (gdim,)))
187-
assert petsc_create_vector(V).getAttr("_blocks") is None
187+
# assert petsc_create_vector(V).getAttr("_blocks") is None
188188
assert petsc_create_vector(V, kind="mpi").getAttr("_blocks") is not None
189189

190190

0 commit comments

Comments
 (0)