[petsc-users] Set matrix column to vector

Florian Lindner mailinglists at xgm.de
Mon Sep 1 04:10:24 CDT 2014


Hello,

I want to set the entire column of a N x M matrix to a N vector. What is 
the best way to do that?

My first guess would be to VecGetArray and use that array for 
MatSetValuesLocal with nrow = VecGetLocalSize. What is the best to say 
MatSetValuesLocal that I want to set all rows continuesly (same like 
passing irow = [0, 1, ..., VecGetLocalSize-1]?

Any better way?

Thanks,
Florian


More information about the petsc-users mailing list