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

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


  So you want to have a parallel linear? solver and the rest of the code including Jacobian generation sequential?

   Barry


> On Apr 12, 2018, at 2:32 PM, Klaus Burkart <k_burkart at yahoo.com> wrote:
> 
> Are your matrix entries stored in parallel or is your current code that generates the rows, columns, and values sequential.
> 
> >> The three arrays are the result of a matrix format conversion to CSR format in my cfd application interface, the code is 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.
> 
> >> I assume it's a case for AIJ
> 
> 
> 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?
> 
> >> Via finite volume, yes there is a mesh but I am only replacing the matrix solver (as I've done with another LA library before) afterwards returning the solution vector to the application where all the other steps are handled
> 
>   Klaus
> 
> 
> Am Donnerstag, 12. April 2018, 21:10:12 MESZ hat Smith, Barry F. <bsmith at mcs.anl.gov> Folgendes geschrieben:
> 
> 
> 
>   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