← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Fix remaining unchecked demos. Some demos still broken:

 

On Wednesday 17 December 2008 22:57:48 Anders Logg wrote:
> On Wed, Dec 17, 2008 at 10:53:32PM +0100, DOLFIN wrote:
> > One or more new changesets pushed to the primary dolfin repository.
> > A short summary of the last three changesets is included below.
> >
> > changeset:   5406:bc43cc830c11058dcabf239a5a7f878bb860fabb
> > tag:         tip
> > user:        Anders Logg <logg@xxxxxxxxx>
> > date:        Wed Dec 17 22:53:27 2008 +0100
> > files:       TODO demo/la/eigensolver/python/demo.py
> > demo/pde/optimization/python/demo.py description:
> > Fix remaining unchecked demos. Some demos still broken:
> >
> >   EE demo/pde/nonlinear-poisson/python/demo.py
> >   EE demo/pde/poisson1D/python/demo.py                    viper problem
> > with 1D EE demo/pde/waveguide/python/demo.py                    results
> > in C++ and Python differ EE
> > demo/pde/dg/advection_diffusion/python/demo.py
> >   EE demo/nls/nonlinearpoisson/python/demo.py
> >   EE demo/mesh/partitioning/python/demo.py
> >   EE demo/mesh/intersection/python/demo.py                strange
> > transformation EE demo/ode/aliev-panfilov/python/demo.py
> > EE demo/ode/lorenz/python/demo.py
>
> We may ignore the ODE demos here. Some work is needed to get the ODE
> solvers to function from Python but they have only worked in part
> before so it's not very important now.
>
> The following demos remain:
>
>    demo/pde/nonlinear-poisson/python/demo.py            ?
>    demo/pde/poisson1D/python/demo.py                    viper problem with
> 1D demo/pde/waveguide/python/demo.py                    results in C++ and
> Python differ 
>    demo/pde/dg/advection_diffusion/python/demo.py       ? 

This demo is somewhat depricated as it stands now. I added it based on the 
previous c++ demo. Since then has the c++ demo changed, to be more simple, 
but including the builtin OutflowFacet special function. This is not included 
in the python interface.

To get it up and running in python we need to add OutflowFacet to the python 
interface. This should be doable, and quite straightforward with the new 
function interface. Please correct me:

class OutflowFacet(ffc.Function,cpp.OutflowFacet):
    def __init__(self, vec_field):
        appropriate check on vec_field
        mesh = vec_field.function_space().mesh()

        # Define the OutflowFacet form
        n = FacetNormal(mesh)
        a = ffc.dot(vec_field,n)*ffc.ds
        self._dolfin_form = Form(a)

        domain  = dim2domain[mesh.topology().dim()]
        self._element = ffc.FiniteElement("Discontinuous Lagrange", domain, 0)

        ffc.Function.__init__(self, self._element)
        cpp.OutflowFacet(self, self._dolfin_form)

It is a bastard wrt being a full fledged dolfin.Function, it does not define 
its own function space. I do not know if this would be a problem as the c++ 
counterpart neither initiate its base class with a functionspace. 

Once this function is in place the rest should be quite straight forward.

Johan

>    demo/nls/nonlinearpoisson/python/demo.py             ?
>    demo/mesh/partitioning/python/demo.py                move passembly code
> from sandbox demo/mesh/intersection/python/demo.py                strange
> transformation
>
> If we can fix these, we could get out 0.9.0 before Christmas (and then
> 0.9.1 etc as we fix more bugs).




Follow ups

References