Subject: [FEniCS-dev] sparse matrix/parallel

From: Gideon Simpson <[email-masked]>
Date: Fri, 4 Jan 2008 16:40:14 -0500

I have a sparse matrix that I'm constructing and beforehand I'm  
setting the sparsity pattern and then I will populate the matrix.   
Obviously dolfin is not going to handle everything so I ask this:

Will the "right" way to do this, in parallel, be to separately use  
the underlying PETSc routines for setting the values using  
MatGetOwnershipRange and MatSetValues?

Also, after the appropriate entries in sparsity_pattern are set,  
should I then call sparsity_pattern.apply() ?

-gideon

---

From: Anders Logg <[email-masked]>
Date: Sun, 6 Jan 2008 09:19:25 +0100

On Fri, Jan 04, 2008 at 04:40:14PM -0500, Gideon Simpson wrote:
> I have a sparse matrix that I'm constructing and beforehand I'm setting the 
> sparsity pattern and then I will populate the matrix.  Obviously dolfin is not
> going to handle everything so I ask this:
> 
> Will the "right" way to do this, in parallel, be to separately use the 
> underlying PETSc routines for setting the values using MatGetOwnershipRange and
> MatSetValues?

We haven't worked this all out yet for DOLFIN (at least not I). So if
you want to control the way the PETSc matrix is created, do

  Mat mat;
  PETSc MatFoo calls
  PETScMatrix A(mat);

> Also, after the appropriate entries in sparsity_pattern are set, should I then
> call sparsity_pattern.apply() ?

Yes.

-- 
Anders