pyccel/psydac

cannot convert 3D curl matrix to sparse when using periodic BC and 1 cell along the same direction

e-moral-sanchez opened this issue · 0 comments

The tosparse() method of the 3D curl matrix fails when we use periodic BC along a direction with only one cell.

Minimum example:

domain = Cube('domain', bounds1=(0, 1), bounds2=(0,1), bounds3=(0,1))
derham = Derham(domain)
domain_h = discretize(domain, ncells=[2, 2, 1], periodic=(False,False,True))
derham_h = discretize(derham, domain_h, degree=[1, 1, 1])
D0, D1, D2 = derham_h.derivatives_as_matrices
D1_m = D1.tosparse() # Fails

It does not fail if there is more than one cell or if no periodic BC are imposed.