@@ -73,7 +73,7 @@ def create_vector_wrap(x: Vector) -> PETSc.Vec: # type: ignore[name-defined]
7373
7474
7575def 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 )
0 commit comments