[petsc-users] Question about MatGetRow

김성익 ksi2443 at gmail.com
Fri Feb 3 07:06:22 CST 2023


Following your comments,
I want to check below things.
For example, the global dense matrix are as below.
[image: image.png]
If I want to get first row ('1 2 0 0 3 0 0 4') in Proc 1.
Then I should put 'MatCreateSubMatrix
<https://petsc.org/main/docs/manualpages/Mat/MatCreateSubMatrix/>(mat, isrow
, NULL, MAT_INITIAL_MATRIX, *&*newmat)'
and isrow will be [0 1 2 3 4 5 6 7].

In this case, How can I make isrow?
Actually I can't understand the procedure of handling isrow.

Hyung Kim

2023년 2월 3일 (금) 오후 9:03, Mark Adams <mfadams at lbl.gov>님이 작성:

> https://petsc.org/main/docs/manualpages/Mat/MatCreateSubMatrix/
>
> Note, PETSc lets you give NULL arguments if there is a reasonable default.
> In this case give NULL for the column IS and you will get the whole
> columns.
>
> Mark
>
> On Fri, Feb 3, 2023 at 4:05 AM 김성익 <ksi2443 at gmail.com> wrote:
>
>> Hello,
>>
>>
>> By using MatGetRow, user can get vectors from local matrix (at each
>> process).
>>
>> However, I need other process's row values.
>> So I have 2 questions.
>>
>> 1. Is there any function for getting arrays from other process's??
>>
>> 2. Or is there any function like matrix version of vecscattertoall??
>>
>> Thanks,
>> Hyung Kim
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230203/382dc0f7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 6931 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230203/382dc0f7/attachment-0001.png>


More information about the petsc-users mailing list