On Sun, May 28, 2017 at 6:02 AM, Lawrence Mitchell < lawrence.mitch...@imperial.ac.uk> wrote:
> > > > On 28 May 2017, at 09:16, leejearl <leeje...@126.com> wrote: > > > > Hi, Dave: I want to store a PetscInt tag for every cell of the dmplex > with the struct. Thanks, > > You probably want to use a DMLabel to store these ids. Unless you have a > different I'd for every cell. Several things to think about: 1) If you want to store a tag for EVERY cell, then just use an IS. Cell numberings are guaranteed to be contiguous and start from 0. 2) If you want to tag only SOME cells, then use a DMLabel as Lawrence suggests. This uses hash tables for fast construction, and sorted lists for fast search and retrieval. 3) If you want to store a VARIABLE number of data items per cell, then use a Section and an array that you allocate. Matt > > Lawrence > -- 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 http://www.caam.rice.edu/~mk51/