On Wed, Aug 13, 2014 at 2:48 AM, aymeric aymeric <[email protected]> wrote:
> - I create a dmplex with DMPlexCreateHexBoxMesh > - Distribute it with DMPlexDistribute > Here you are missing a crucial step. You have to define a data layout over the mesh. The most basic way to do this is to create a PetscSection object, and then use DMSetDefaulSection(). There is a helper function for this: http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMPlexCreateSection.html The DMDA has a default layout in which every vertex gets dof degrees of freedom. Thanks, Matt > - Create a Vec based on the distributed dmplex with DMCreateGlobalVector > - But when I check the size of this Vec with VecGetOwnershipRange or > VecGetSize, it is empty. > > What am I missing? > > I know this is possible, because in SNES ex12.c a vector is created using > this sequence of commands. Unfortunately, it some other commands are also > used, but they are not all documented. > > Thanks. > -- 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
