[petsc-users] Uninitialized values within mesh generation

Matthew Knepley knepley at gmail.com
Sun Apr 19 17:24:34 CDT 2015


On Sun, Apr 19, 2015 at 5:20 PM, Justin Chang <jchang27 at uh.edu> wrote:

> Hi all,
>
> I have the following lines for mesh generation:
>
>       DM boundary;
>       ierr = DMCreate(comm,&boundary);CHKERRQ(ierr);
>       ierr = DMSetType(boundary, DMPLEX);CHKERRQ(ierr);
>       ierr = DMSetDimension(boundary, spatialDim-1);CHKERRQ(ierr);
>       switch (spatialDim) {
>         case 2:
>         {
>           ierr =
> DMPlexCreateSquareBoundary(boundary,lower,upper,edges);CHKERRQ(ierr);
>           break;
>         }
>         case 3:
>         {
>           ierr =
> DMPlexCreateCubeBoundary(boundary,lower,upper,edges);CHKERRQ(ierr);
>           break;
>         }
>         default:
>           SETERRQ1(comm,PETSC_ERR_SUP,"Dimension not supported:
> %d",spatialDim);
>       }
>       ierr = DMPlexGenerate(boundary,NULL,PETSC_TRUE,dm);CHKERRQ(ierr);
>       ierr = DMDestroy(&boundary);CHKERRQ(ierr);
>
> where lower and upper are global PetscScalars * and edges is a global
> PetscInt *. These values are PetscCalloc'ed and initialized via commandline
> options (PetscOptionsGetScalar/IntArray). When I run my code with valgrind,
> I get the following messages:
>
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706==    at 0x65E778C: TetGenMeshPointTraverse(TetGenMesh*, double**)
> (ctetgen.c:4107)
> ==12706==    by 0x661C8F8: TetGenMeshDelaunizeVertices(TetGenMesh*)
> (ctetgen.c:12091)
> ==12706==    by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*)
> (ctetgen.c:21483)
> ==12706==    by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool,
> _p_DM**) (plexgenerate.c:834)
> ==12706==    by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706==    by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706==    by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706==    at 0x661BF6C: TetGenMeshDelaunayIncrFlip(TetGenMesh*,
> triface*, double**, long, PetscBool, PetscBool, double, Queue*)
> (ctetgen.c:12011)
> ==12706==    by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*)
> (ctetgen.c:12113)
> ==12706==    by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*)
> (ctetgen.c:21483)
> ==12706==    by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool,
> _p_DM**) (plexgenerate.c:834)
> ==12706==    by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706==    by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706==    by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706==    at 0x661BFB6: TetGenMeshDelaunayIncrFlip(TetGenMesh*,
> triface*, double**, long, PetscBool, PetscBool, double, Queue*)
> (ctetgen.c:12014)
> ==12706==    by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*)
> (ctetgen.c:12113)
> ==12706==    by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*)
> (ctetgen.c:21483)
> ==12706==    by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool,
> _p_DM**) (plexgenerate.c:834)
> ==12706==    by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706==    by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706==    by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706==    at 0x661C004: TetGenMeshDelaunayIncrFlip(TetGenMesh*,
> triface*, double**, long, PetscBool, PetscBool, double, Queue*)
> (ctetgen.c:12017)
> ==12706==    by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*)
> (ctetgen.c:12113)
> ==12706==    by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*)
> (ctetgen.c:21483)
> ==12706==    by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool,
> _p_DM**) (plexgenerate.c:834)
> ==12706==    by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706==    by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706==    by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706==    at 0x661C048: TetGenMeshDelaunayIncrFlip(TetGenMesh*,
> triface*, double**, long, PetscBool, PetscBool, double, Queue*)
> (ctetgen.c:12020)
> ==12706==    by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*)
> (ctetgen.c:12113)
> ==12706==    by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*)
> (ctetgen.c:21483)
> ==12706==    by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool,
> _p_DM**) (plexgenerate.c:834)
> ==12706==    by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706==    by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706==    by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706==    at 0x661B232: TetGenMeshInsertVertexBW(TetGenMesh*, double*,
> triface*, PetscBool, PetscBool, PetscBool, PetscBool, locateresult*)
> (ctetgen.c:11905)
> ==12706==    by 0x661C2AF: TetGenMeshDelaunayIncrFlip(TetGenMesh*,
> triface*, double**, long, PetscBool, PetscBool, double, Queue*)
> (ctetgen.c:12046)
> ==12706==    by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*)
> (ctetgen.c:12113)
> ==12706==    by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*)
> (ctetgen.c:21483)
> ==12706==    by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool,
> _p_DM**) (plexgenerate.c:834)
> ==12706==    by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706==    by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706==    by 0x40DBA8: main (main.c:1005)
> ==12706==
>
> What does this mean? Is there something wrong/missing with the current
> implementation of the mesh generation?
>

Honestly, I have no idea. That is my mechanical translation of TetGen to C,
which could have bugs but I could never
find them. It seems to work on all problems I have tried. I did it so I
could open up the interface beyond what he exposes
in the command line interface. Also I made it use PetscMalloc, etc.

  Thanks,

    Matt


> Thanks,
> Justin
>
>
>
> --
> Justin Chang
> PhD Candidate, Civil Engineering - Computational Sciences
> University of Houston, Department of Civil and Environmental Engineering
> Houston, TX 77004
> (512) 963-3262
>



-- 
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/20150419/0d15c3b6/attachment-0001.html>


More information about the petsc-users mailing list