On Tue, Sep 30, 2008 at 4:46 AM, Evan Lezar <[EMAIL PROTECTED]> wrote: > On Tue, Sep 30, 2008 at 10:53 AM, Jed Brown <[EMAIL PROTECTED]> wrote: >> >> On Tue 2008-09-30 10:48, Evan Lezar wrote: >> > I was wondering what the best way is to concatenate PETSc matrices? I >> > am >> > currently using the set() method, but this takes quite a bit of time. >> >> What are you trying to do? You should probably preallocate the full >> matrix from the beginning. > > I am assembling a number of submatrices. And then trying to concatenate > them to form one large eigensystem. I do pre-allocate the matrix that I > want to place the entries in.
I agree with Jed. The best way to do this is to assemble the full system matrix, and then if submatrices are required, you pull them out using MatGetSubmatrix(). The only situation I can see that is different is in some algorithms like FETI in which submatrices are unassembled. Then you would have to use a MATIS structure, or something else depending on your algorithm. Matt > It may be that I would be able to use mixed elements to do the same thing. > I will see if I can get a code snippet together. > > Evan > >> >> Jed >> >> _______________________________________________ >> DOLFIN-dev mailing list >> [email protected] >> http://www.fenics.org/mailman/listinfo/dolfin-dev >> > > > _______________________________________________ > DOLFIN-dev mailing list > [email protected] > http://www.fenics.org/mailman/listinfo/dolfin-dev > > -- 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 _______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
