[petsc-users] Create identity IS

Lisandro Dalcin dalcinl at gmail.com
Mon Apr 20 06:57:58 CDT 2015


On 20 April 2015 at 14:35, Florian Lindner <mailinglists at xgm.de> wrote:
> Hello,
>
> I use an index set for a row mapping but don't want to use one for the column mapping.
>
> I try to create an idenitity index set to supply to ISLocalToGlobalMappingCreateIS and MatSetLocalToGlobalMapping:
>
>   IS is;
>   ISCreate(PETSC_COMM_WORLD, &is);

At this point the index set does not have the type set.

>   ISSetIdentity(is);
>
> but I get an segmentation fault at the last line.
>

Bad error checking, you should get an error saying that the type is not yet set.

> What is the best way to create an identity index set?
>

I would use ISCreateStride(), and perhaps next ISToGeneral() if you
really want a ISGENERAL type.


-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459


More information about the petsc-users mailing list