matrix assembly

Matt Funk mafunk at nmsu.edu
Fri Jun 30 18:46:02 CDT 2006


Hi,

i have a matrix stored in the matrix free format. I.e. an array indicating the 
row number, an array storing the column number and the array of corresponding 
values. 

I was wondering what the best way is to build the PETsC matrix using this. I 
was hoping that there is call to some sparse matrix assembler function to 
which is simply pass these three arrays and it builds the matrix for me. 

However, i did not find anything that simple. So i guess i need to do it row 
by row using the MatSetValues fcn() after allocating the memory for the 
matrix (i.e. pretty much as the procedure described on p.54 of the user 
manual)?

mat





On Friday 30 June 2006 14:30, Satish Balay wrote:
> Added to petsc-dev now.
>
> Satish
>
> On Fri, 30 Jun 2006, Barry Smith wrote:
> >    Mathieu,
> >
> >     Cool, thanks.
> >
> >    Satish,
> >
> >     Could you please apply the diff to petsc-dev now and then push
> > so any future changes anyone makes will be combatiable with the new
> > code.
> >
> >     Thanks
> >
> >      Barry
> >
> > On Fri, 30 Jun 2006, Mathieu Taillefumier wrote:
> > > Good morning everybody,
> > >
> > > I finished to modify the code of the library in order to compile the
> > > complex version with a C compiler. A few numbers of files have been
> > > modified. This modifications include a modification of the file
> > > language.py where I put in comment two lines forcing to compile the
> > > library with a c++ compiler. Since I don't really know python, I just
> > > put them as a comment, but i think it is better to put a message
> > > indicating that compiling the complex version of Petsc needs a C90
> > > compliant compiler (gcc 3.4 and after work, it works also with icc) and
> > > is experimental. Actually I am working with this modifications and it
> > > seems to work like a charm (I had no problem with it).
> > > I still need some time to convert the example programs which do not
> > > compile but it will be done soon.
> > > Note for all of us :
> > >    Don't use the name I as a variable anymore. It is a reserved word of
> > > the language.
> > >    For most of us, the modifications must be transparent.
> > >
> > > Regards
> > >
> > > Mathieu




More information about the petsc-users mailing list