MatGetArrayF90 returns 2d array

Lisandro Dalcin dalcinl at gmail.com
Thu Jul 2 14:59:41 CDT 2009


On Thu, Jul 2, 2009 at 1:47 PM, Barry Smith<bsmith at mcs.anl.gov> wrote:
>
>  MatGetArray() returns access to the nonzero values of the matrix in a
> format that depends on the underlying class. It is a perfectly reasonable
> method and has been there for decades just fine.
>

BTW, Matt commented about PETSc providing support for obtaining the
AIJ structure... I know how to get the "IJ" part, MatGetArray() let me
get the "A" part, but ... Where is the call that let one to get the
whole data, indices and values?


>  Barry
>
> On Jul 1, 2009, at 5:54 PM, Matthew Knepley wrote:
>
>> On Thu, Jul 2, 2009 at 2:36 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>
>> Satish,
>>
>>  Could you please convert these (both the stub code and the F90 interface)
>> to use a 1d array? In both 3.0.0 and petsc-dev.
>>
>> I am still against this, since it seems much nicer to get a 2D array
>> for the dense matrix, which is the ONLY matrix for which GetArray()
>> makes any sense I think.
>>
>>  Matt
>>
>>
>>  Thanks
>>
>>  Barry
>>
>> On Jun 30, 2009, at 6:37 PM, Jed Brown wrote:
>>
>> Matthew Knepley wrote:
>> I thought the idea was that MatGetArray() never applies to a sparse
>> matrix.  No other sparse format supports this, does it?
>>
>> That's not true at all, but the result is implementation-dependent.  For
>> example, the array for AIJ is different from the array for BAIJ.  For
>> this reason, you shouldn't be calling MatGetArray unless you know the
>> matrix type, but of course the F90 interface should agree with the C
>> interface.
>>
>> Jed
>>
>>
>>
>>
>>
>> --
>> 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
>
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594


More information about the petsc-users mailing list