← Back to team overview

dolfin team mailing list archive

Re: Applying boundary conditions using pydolfin

 

On Mon, Nov 19, 2007 at 08:49:56PM -0600, Marie Rognes wrote:
> Kristian Oelgaard wrote:
> >
> > You need to compile the form first:
> > (compiled_form, module, form_data) = jit(a)
> > bc.apply(A, b, compiled_form)
> >
> > Have a look in src/pydolfin/assemble.py (LinearPDE)
> >
> >   
> 
> Right. Thanks!
> 
> >> In addition, if I try just using
> >>
> >>     zero = Function(mesh, 0.0)
> >>     
> >
> > The function 'f' has to be a FFC function when creating your form. So you have
> > to initialise it with an element.
> >   
> >
> 
> Yes, makes sense now. So what would be the prettiest way of writing the 
> zero function for use with a form?

Probably

  zero = Function(mesh, 0.0)

or just

  zero = Function(0.0)

There are a number of small quirks like this that need to be sorted
out in the Python interface. When I wrote the JIT-interface for
PyDOLFIN I just made sure that the Poisson demo worked.

I'll be back at work next week. I can probably fix a few of these
issues then (but don't be afraid to look at assemble.py in
src/pydolfin and make fixes, it's just a few lines of simple Python
code).

/Anders


References