← Back to team overview

dolfin team mailing list archive

Re: Matrix concatenation

 

On Tue, Sep 30, 2008 at 4:46 AM, Evan Lezar <evanlezar@xxxxxxxxx> wrote:
> On Tue, Sep 30, 2008 at 10:53 AM, Jed Brown <jed@xxxxxxxx> 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
>> DOLFIN-dev@xxxxxxxxxx
>> http://www.fenics.org/mailman/listinfo/dolfin-dev
>>
>
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> 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


Follow ups

References