[petsc-users] block matrix in serial

Matthew Knepley knepley at gmail.com
Wed Sep 16 06:40:37 CDT 2015


On Tue, Sep 15, 2015 at 9:05 PM, Adrian Croucher <a.croucher at auckland.ac.nz>
wrote:

> hi
>
> I have a test code (attached) that sets up a finite volume mesh using
> DMPlex, with 2 degrees of freedom per cell.
>
> I then create a matrix using DMCreateMatrix(), having used DMSetMatType()
> to set the matrix type to MATBAIJ or MATMPIBAIJ, to take advantage of the
> block structure.
>
> This works OK and gives me the expected matrix structure when I run on > 1
> processor, but neither MATBAIJ or MATMPIBAIJ works if I run it in serial:
>

Plex should automatically discover the block size from the Section. If not,
it uses block size 1. I have to look
at the example to see why the discovery is not working. Do you have any
constraints?

  Thanks,

    Matt


> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: Petsc has generated inconsistent data
> [0]PETSC ERROR: Blocksize of layout 2 must match that of mapping 1
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Development GIT revision: v3.6.1-811-gaf4f2ea GIT
> Date: 2015-08-18 17:44:25 -0500
> [0]PETSC ERROR: ./testmat on a linux-gnu-c-opt named des108 by acro018 Wed
> Sep 16 13:51:27 2015
> [0]PETSC ERROR: Configure options --download-netcdf --download-exodusii
> --with-hdf5-dir=/usr --download-triangle --download-ptscotch -
> -download-chaco
> [0]PETSC ERROR: #1 PetscLayoutSetISLocalToGlobalMapping() line 248 in
> /home/acro018/software/PETSc/code/src/vec/is/utils/pmap.c
> [0]PETSC ERROR: #2 MatSetLocalToGlobalMapping() line 1876 in
> /home/acro018/software/PETSc/code/src/mat/interface/matrix.c
> [0]PETSC ERROR: #3 DMCreateMatrix_Plex() line 853 in
> /home/acro018/software/PETSc/code/src/dm/impls/plex/plex.c
> [0]PETSC ERROR: #4 DMCreateMatrix() line 961 in
> /home/acro018/software/PETSc/code/src/dm/interface/dm.c
> --------------------------------------------------------------------------
>
> It only works in serial if I use MATAIJ.
>
> Is there a reason why the block matrix types don't appear to work in
> serial, at least in this case? (I'm running the PETSc 'next' branch.)
>
> - Adrian
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 84611
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150916/cca49086/attachment-0001.html>


More information about the petsc-users mailing list