[petsc-users] MatPrealloctor
Randall Mackie
rlmackie862 at gmail.com
Fri Jul 29 16:33:16 CDT 2022
Why do I have to set the block size to 3? I’m not trying to create a block matrix.
In fact just a couple months ago I was told I don’t have block matrices and I had to remove calls to set the block size:
https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2022-May/046094.html
This works fine without the MatPreallocator routines.
Randy
> On Jul 29, 2022, at 2:23 PM, Barry Smith <bsmith at petsc.dev> wrote:
>
>
> I'm hoping that it is as simple as that you did not set the block size of your newly created matrix to 3?
>
>
>
>> On Jul 29, 2022, at 4:04 PM, Randall Mackie <rlmackie862 at gmail.com <mailto:rlmackie862 at gmail.com>> wrote:
>>
>> Hi Barry,
>>
>> It seems like this should be trivial to get working but so far I’ve been unsuccessful.
>> Most likely I’m doing something wrong but I have no idea what that is.
>>
>> I’ve attached a little test program that fails with the errors:
>>
>> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
>> [0]PETSC ERROR: Petsc has generated inconsistent data
>> [0]PETSC ERROR: Blocksize of layout 1 must match that of mapping 3 (or the latter must be 1)
>> [0]PETSC ERROR: See https://petsc.org/release/faq/ <https://petsc.org/release/faq/> for trouble shooting.
>> [0]PETSC ERROR: Petsc Release Version 3.17.3, Jun 29, 2022
>> [0]PETSC ERROR: ./test on a linux-gfortran-complex-debug named rmackie-VirtualBox by rmackie Fri Jul 29 12:16:13 2022
>> [0]PETSC ERROR: Configure options --with-clean=1 --with-scalar-type=complex --with-debugging=1 --with-fortran=1 --download-mpich=../external/mpich-4.0.1.tar.gz
>> [0]PETSC ERROR: #1 PetscLayoutSetISLocalToGlobalMapping() at /home/rmackie/PETSc/petsc-3.17.3/src/vec/is/utils/pmap.c:363
>> [0]PETSC ERROR: #2 MatSetLocalToGlobalMapping() at /home/rmackie/PETSc/petsc-3.17.3/src/mat/interface/matrix.c:2012
>>
>>
>> Any help to point me in the right direction is appreciated.
>>
>> Randy M.
>>
>> <files.zip>
>>
>>> On Jul 28, 2022, at 2:49 PM, Barry Smith <bsmith at petsc.dev <mailto:bsmith at petsc.dev>> wrote:
>>>
>>>
>>> I am not sure what you are asking exactly but I think so, so long have you have called MatSetLocalToGlobalMapping() and the "stencil" idea makes sense for your discretization.
>>>
>>> Barry
>>>
>>>
>>>> On Jul 28, 2022, at 5:41 PM, Randall Mackie <rlmackie862 at gmail.com <mailto:rlmackie862 at gmail.com>> wrote:
>>>>
>>>> Dear PETSc users:
>>>>
>>>> Can one use a MatPreallocator and then call MatPreAlloctorPreallocate if using MatStencil routines (which seem to call MatSetValuesLocal).
>>>>
>>>>
>>>> Thanks, Randy
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220729/d7c851a9/attachment-0001.html>
More information about the petsc-users
mailing list