PETSc sparsity

Mark Adams adams at pppl.gov
Sat Jun 16 10:58:51 CDT 2007


I agree that its conceptually best to apply BCs at the element level  
but some codes don't for "good" reasons (eg, matrix assembly is done  
by many parts of the code and its easier to centralize the BC  
application after all the assembly is done) or "bad" reasons (eg,  
"its the way it is and we don't want to mess with it" or "it messes  
my solver up").

(I actually have a "bug" in Prometheus that makes me want the sparse  
structure of whole system, ie, dummy equations mess me up, so my  
users zeros out rows and columns of the element matrix before its  
assembled or zero out rows and columns after)

Thats nice to know that negative indices are ignored. convenient.

Mark

On Jun 15, 2007, at 10:13 PM, Matthew Knepley wrote:

> Also, I have talked to Wolfgang many times about this. I am a firm
> believer in eliminating the boundary values during assembly at the
> element level. PETSc provides an easy mechanism for this. By default,
> all negative indices in calls to VecSetValues and MatSetValues are
> ignored.
>
>  Matt
>
> On 6/15/07, Mark Adams <adams at pppl.gov> wrote:
>> Just a note, my way is much simpler - its two lines of code in a loop
>> over the boundary nodes, followed by an MatAsseblyBegin/End, and you
>> don't have to deal with parallel issues explicitly - PETSc does.  For
>> my FE codes the cost of this (dumb) way is negligible, PETSc
>> implements these methods pretty well.
>>
>> Mark
>>
>> On Jun 15, 2007, at 4:28 PM, Toby Young wrote:
>>
>> >
>> >
>> > Barry,
>> >
>> > Thank you for an interesting response.
>> >
>> >>   For algorithms that require dealing with the sparsity  
>> structure of
>> >> the matrix we generally just include the appropriate private
>> >> include file
>> >> for the matrix format and access the data directly in the
>> >> underlying format.
>> >
>> > Can you please elaborate. What do you mean by "the appropriate  
>> privat
>> > include file for the matrix"? Sorry, I got lost there.
>> >
>> > Best,
>> >       Toby
>> >
>> > -----
>> >
>> > Toby D. Young (Adiunkt)
>> > Department of Computational Science
>> > Institute of Fundamental Technological Research
>> > Polish Academy of Science
>> > Room 206, ul. Swietokrzyska 21
>> > 00-049 Warszawa, POLAND
>> >
>>
>> ********************************************************************* 
>> *
>> Mark Adams Ph.D.                                   Columbia  
>> University
>> 289 Engineering Terrace                                        MC  
>> 4701
>> New York NY 10027
>> adams at pppl.gov                                www.columbia.edu/ 
>> ~ma2325
>> voice: 212.854.4485                                  fax:  
>> 212.854.8257
>> ********************************************************************* 
>> *
>>
>>
>>
>
>
> -- 
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which
> their experiments lead.
> -- Norbert Wiener
>

**********************************************************************
Mark Adams Ph.D.                                   Columbia University
289 Engineering Terrace                                        MC 4701
New York NY 10027
adams at pppl.gov                                www.columbia.edu/~ma2325
voice: 212.854.4485                                  fax: 212.854.8257
**********************************************************************





More information about the petsc-dev mailing list