Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Apr 2, 2024
1 parent 304a38e commit f30f9e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyop2/sparsity.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def fill_with_zeros(PETSc.Mat mat not None, dims, maps, iteration_regions, set_d
PetscInt[:, ::1] rmap, cmap, tempmap
PetscInt **rcomposedmaps = NULL
PetscInt **ccomposedmaps = NULL
PetscInt nrcomposedmaps = 0, nccomposedmaps = 0, rset_entry, cset_entry
PetscInt nrcomposedmaps, nccomposedmaps, rset_entry, cset_entry
PetscInt *rvals
PetscInt *cvals
PetscInt *roffset
Expand Down Expand Up @@ -235,6 +235,7 @@ def fill_with_zeros(PETSc.Mat mat not None, dims, maps, iteration_regions, set_d
else:
rflags.append(set_writeable(pair[0])) # Memoryviews require writeable buffers
rmap = pair[0].values_with_halo # Map values
nrcomposedmaps = 0
if isinstance(pair[1], op2.ComposedMap):
m = pair[1].flattened_maps[0]
cflags.append(set_writeable(m))
Expand All @@ -243,6 +244,7 @@ def fill_with_zeros(PETSc.Mat mat not None, dims, maps, iteration_regions, set_d
else:
cflags.append(set_writeable(pair[1]))
cmap = pair[1].values_with_halo
nccomposedmaps = 0
# Handle ComposedMaps
CHKERR(PetscMalloc2(nrcomposedmaps, &rcomposedmaps, nccomposedmaps, &ccomposedmaps))
for i in range(nrcomposedmaps):
Expand Down

0 comments on commit f30f9e1

Please sign in to comment.