[petsc-users] Question on non-zero pattern

Sanjay Govindjee s_g at berkeley.edu
Thu Mar 14 14:50:17 CDT 2013


Found my answer, use

           call MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr)

after the MatAssemblyEnd( ).


On 3/14/13 11:28 AM, Sanjay Govindjee wrote:
> Is there a mechanism for resetting a matrix's non-zero pattern?
>
> In particular,  I have a preallocated a matrix, set the values, and 
> assembled it.
> And used it to solve a problem.
>
> Now I would like to zero it, and reassemble it with a different 
> non-zero pattern.
> Note the matrix has been preallocated so that it can accommodate both 
> non-zero
> patterns.
>
> -sanjay

-- 
-----------------------------------------------
Sanjay Govindjee, PhD, PE
Professor of Civil Engineering
Vice Chair for Academic Affairs

779 Davis Hall
Structural Engineering, Mechanics and Materials
Department of Civil Engineering
University of California
Berkeley, CA 94720-1710

Voice:  +1 510 642 6060
FAX:    +1 510 643 5264
s_g at berkeley.edu
http://www.ce.berkeley.edu/~sanjay
-----------------------------------------------

New Books:

Engineering Mechanics of Deformable
Solids: A Presentation with Exercises
http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641
http://ukcatalogue.oup.com/product/9780199651641.do
http://amzn.com/0199651647


Engineering Mechanics 3 (Dynamics)
http://www.springer.com/materials/mechanics/book/978-3-642-14018-1
http://amzn.com/3642140181

-----------------------------------------------



More information about the petsc-users mailing list