[petsc-users] Questions concerning ex12.c

Matthew Knepley knepley at gmail.com
Wed Feb 26 15:11:27 CST 2014

On Wed, Feb 26, 2014 at 12:29 PM, Jones,Martin Alexander <
MAJones2 at mdanderson.org> wrote:

>  How do we input an auxillary field so that we can use the a[] array in
> the f0_u function in ex12.c ?
> Void f0_u(const PetscScalar u[], const PetscScalar gradU[], const
> PetscScalar a[], const PetscScalar gradA[],const PetscReal x[], PetscScalar
> f0[])
> I would like a=constant within a bounded volume and a=0 outside the
> bounded volume.
> Any help on this is much appreciated. Thanks.

This mode sounds like -variable_coefficient field, which creates an a[] in
some FE space. Then you use
-mat_petscspace_order k for order k (in the example I test 0 and 1). The
function SetupMaterial() makes
the auxiliary field values, and uses the pointwise function nu_2d() to do
it. You can substitute your own
pointwise function there, or take over at a higher level and directly put
your values in the Vec.



>  Martin Jones

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/20140226/1428ed88/attachment.html>

More information about the petsc-users mailing list