[petsc-users] Equivalent to MatGetColumnVector for rows?

Jeremy Theler jeremy at seamplex.com
Wed Oct 19 04:38:53 CDT 2016


Hi all

Is there an equivalent to MatGetColumnVector() but for getting rows of a
matrix as a vector?

What I want to do is to compute the reactions of the nodes that belong
to a Dirichlet boundary condition in a FEM linear elastic problem. I set
these BCs with MatZeroRows() with a one in the diagonal and the desired
displacement in the RHS vector. But before calling MatZeroRows(), I want
to “remember” what the row looked like so after solving the problem, if
I multipliy this original row by the solution vector I get the reaction
corresponding to that row's DOF.

I have implemented something with MatGetRow() that seems to work but it
is some lame I am even embarrased of sharing with the list what I have
done.

Any suggestion is welcome.

Thanks
--
jeremy theler
www.seamplex.com




More information about the petsc-users mailing list