This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Apply boundary condition issue for non square matrix problem

+1 vote
AE= assemble(aE)
bE = assemble(LE)
bc1.apply(AE,bE)

Let me put it simpler.
I can't apply essential bcs when assembled matrix is non square in UBUNTU FENICS but it works in Windows FENICS.

The only difference is that the assembled matrix in UBUNTU is PETScMATRIX type and in Windows it is UBlasMatrix type.

The error shows:

PETSC ERROR: Object is in wrong state!
PETSC ERROR: Matrix is missing diagonal entry.

I wonder why when the type of AE matrix changes from uBLASMatrix into PETScMatrix,
the bc.apply command can't work properly anymore for a non square matrix.
Any solution to deal with this?

Thanks so much.

asked Dec 3, 2013 by wmy32552316wmy FEniCS Novice (230 points)
edited Dec 3, 2013 by wmy32552316wmy

1 Answer

0 votes

It would be easier to help if you provided a complete, minimal script that reproduces the error. However, if you're missing diagonal entries I guess you could try

A.ident_zeros()
answered Dec 3, 2013 by mikael-mortensen FEniCS Expert (29,340 points)

Thanks for your reply. I have updated my question with complete script.

A minimal script I would look at, this is way too long.

Let me put it simpler.
I can't apply essential bcs when assembled matrix is non square in UBUNTU FENICS but it works in Windows FENICS.

The only difference is that the assembled matrix in UBUNTU is PETScMATRIX type and in Windows it is UBlasMatrix type.

You could try to feed the keyword keep_diagonal=True to the assembler.

...