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

Commit

Permalink
Merge pull request #553 from florianwechsung/fw/rspacefix
Browse files Browse the repository at this point in the history
* fw/rspacefix:
  fix handling of real functionspace in combination with vectorfunctionspace
  • Loading branch information
wence- committed Sep 27, 2018
2 parents 8da0436 + 04b1f29 commit 25ec8f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyop2/petsc_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,11 @@ def _DatMat(sparsity, dat=None):
"""A :class:`PETSc.Mat` with global size nx1 or nx1 implemented as a
:class:`.Dat`"""
if isinstance(sparsity.dsets[0], GlobalDataSet):
sizes = ((None, 1), (sparsity._ncols, None))
dset = sparsity.dsets[1]
sizes = ((None, 1), (dset.size*dset.cdim, None))
elif isinstance(sparsity.dsets[1], GlobalDataSet):
sizes = ((sparsity._nrows, None), (None, 1))
dset = sparsity.dsets[0]
sizes = ((dset.size * dset.cdim, None), (None, 1))
else:
raise ValueError("Not a DatMat")

Expand All @@ -979,10 +981,10 @@ class _DatMatPayload(object):
def __init__(self, sparsity, dat=None, dset=None):
if isinstance(sparsity.dsets[0], GlobalDataSet):
self.dset = sparsity.dsets[1]
self.sizes = ((None, 1), (sparsity._ncols, None))
self.sizes = ((None, 1), (self.dset.size * self.dset.cdim, None))
elif isinstance(sparsity.dsets[1], GlobalDataSet):
self.dset = sparsity.dsets[0]
self.sizes = ((sparsity._nrows, None), (None, 1))
self.sizes = ((self.dset.size * self.dset.cdim, None), (None, 1))
else:
raise ValueError("Not a DatMat")

Expand Down

0 comments on commit 25ec8f4

Please sign in to comment.