[petsc-users] Which matrix object type should I use?

Smith, Barry F. bsmith at mcs.anl.gov
Thu Apr 12 14:10:08 CDT 2018


   Are your matrix entries stored in parallel or is your current code that generates the rows, columns, and values sequential.

   Does your matrix have a pointwise-block structure (like from having multiple degrees of freedom per grid point) or is it a scalar PDE? If scalar than you use AIJ matrices if point wise-block structure then use BAIJ. If symmetric than use SBAIJ.

   How are your matrix entries generated? Via the finite element method, finite differences, something else? Is there a mesh, how do you handle the mesh?

   Barry


> On Apr 12, 2018, at 1:54 PM, Klaus Burkart <k_burkart at yahoo.com> wrote:
> 
> I am confused with matrix object types and which one to use in my case:
> 
> 
> I want to solve a linear system using multiple processes. The steps I am struggling with is the import of the global matrix and global rhs vector into applicable PETSc objects.
> 
> The global matrix is currently stored in CSR format using 3 arrays. Array one contains all the row indices, array two all the column indices, array three all the values of the global matrix. In addition to that, there's a vector object containing the rhs vector.
> 
> I think for the vector object I should use VectorCreateMPI with m set to PETSC_DECIDE?
> 
> 
> What's the matrix object I should use in my case which also takes care of the allocation local matrices to the processes at a later stage i.e. creates the local matrices in line with the rhs vector?
> 
> Klaus



More information about the petsc-users mailing list