[petsc-dev] Creating a dmplex mesh from a cell list

Garnet Vaz garnet.vaz at gmail.com
Thu Feb 28 09:17:13 CST 2013


Hi Matt,

Yes. Thank you.

On Thu, Feb 28, 2013 at 6:53 AM, Matthew Knepley <knepley at gmail.com> wrote:
> On Thu, Feb 28, 2013 at 8:24 AM, Garnet Vaz <garnet.vaz at gmail.com> wrote:
>>
>> Hi,
>>
>> I would like to know what some of the arguments for
>> DMPlexCreateFromCellList are supposed to be for a triangular mesh.
>>
>> The function is:
>> DMPlexCreateFromCellList(MPI_Comm comm, PetscInt dim, PetscInt
>> numCells, PetscInt numVertices, PetscInt numCorners, PetscBool
>> interpolate, const int cells[], PetscInt spaceDim, const double
>> vertexCoords[], DM *dm)
>>
>> dim = 2
>> numCells = nCells (not the entire length of the cells array; instead
>> length/3)
>> numVertices = nVert (length of vertexCoords/2)
>> numCorners = 3
>> spaceDim = 2
>>
>> What is wrong with my understanding about the following variables?
>> The error I get is the following:
>>
>> [0]PETSC ERROR: Argument out of range!
>> [0]PETSC ERROR: Cone point 43 is not in the valid range [0, 43)!
>
>
> I have created a proper webpage for this function which will be on the web
> at midnight. Here it is
>
> /*@C
>   DMPlexCreateFromCellList - This takes as input common mesh generator
> output, a list of the vertices for each cell, and produces a DM
>
>   Input Parameters:
> + comm - The communicator
> . dim - The topological dimension of the mesh
> . numCells - The number of cells
> . numVertices - The number of vertices
> . numCorners - The number of vertices for each cell
> . interpolate - Flag indicating that intermediate mesh entities (faces,
> edges) should be created automatically
> . cells - An array of numCells*numCorners numbers, the vertices for each
> cell
> . spaceDim - The spatial dimension used for coordinates
> - vertexCoords - An array of numVertices*spaceDim numbers, the coordinates
> of each vertex
>
>   Output Parameter:
> . dm - The DM
>
>   Note: Two triangles sharing a face
> $
> $        2
> $      / | \
> $     /  |  \
> $    /   |   \
> $   0  0 | 1  3
> $    \   |   /
> $     \  |  /
> $      \ | /
> $        1
> would have input
> $  numCells = 2, numVertices = 4
> $  cells = [0 1 2  1 3 2]
> $
> which would result in the DMPlex
> $
> $        4
> $      / | \
> $     /  |  \
> $    /   |   \
> $   2  0 | 1  5
> $    \   |   /
> $     \  |  /
> $      \ | /
> $        3
>
>   Level: beginner
>
> .seealso: DMPlexCreate()
> @*/
>
> Does this help?
>
>   Thanks,
>
>      Matt
>
>>
>>
>> Thank You.
>>
>> --
>> Regards,
>> Garnet
>
>
>
>
> --
> 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



--
Regards,
Garnet



More information about the petsc-dev mailing list