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

PETScMatrix initialization with TensorLayout

0 votes

Hello,

I wish to initialize a distributed PETScMatrix while controlling its distribution among ranks.
I can do this for a PETScVector with the "init" routine (which enables to specify the range of each rank).
For matrices, the equivalent "init" routine requires specifying a "TensorLayout", but
when I try to define one, I obtain
NameError: name 'tensorlayout' is not defined
Maybe I am missing an "import"?

I have the same problem with the current 1.4 and development versions of FEniCS.

Could you please help me with this?
Thanks much.
Serge

asked Dec 8, 2014 by svancri FEniCS Novice (210 points)

1 Answer

0 votes

To get low-level control, try using petsc4py to create the PETSc object, and then initialise a PETScMatrix with the PETSc object.

answered Dec 17, 2014 by Garth N. Wells FEniCS Expert (35,930 points)
...