[petsc-users] DMPlex example with manual grid layout

Bernhard Reinhardt b.reinhardt at physik.uni-muenchen.de
Mon Oct 28 06:17:00 CDT 2013


Hi there,

I am trying to familiarize myself with unstructured grids. For this I 
started with the example given in the petsc-manual (mesh of 2 triangles) 
and tried to modify it according to my needs.

However, the example seems to be incomplete. At least I was not able to 
create a matrix without applying a DMPlexSetDimension.

In the end I decided to set up an an example as simple as possible:
1D transport of a scalar in a bar with periodic boundaries.

Lets say I have a bar consisting of 3 volumes and 3 faces.
You could write this down as a vector of length 3 containing the scalar 
in the volumes and a 3x3 matrix containing the transport coefficients on 
the faces.

I have already tried many different ways of setting this up with plex 
but always failed. Attached you find the version that makes most sense 
to me. It gives me vectors of length 3 and a 3x3 matrix. However, the 
matrix contains no writable entries and I think the returned closures 
are not correct.

Is there a simple example with good documentation of the individual 
steps like in the manual which is complete and working?

Kind regards

Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.f90
Type: text/x-fortran
Size: 5122 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131028/76959009/attachment.bin>


More information about the petsc-users mailing list