← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] merge

 

On Monday 15 December 2008 11:06:00 Anders Logg wrote:
> On Sun, Dec 14, 2008 at 10:48:31PM +0100, Johan Hake wrote:
> > On Sunday 14 December 2008 22:42:44 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:   5342:80da9660bd6639498aee34b430340877a017b08d
> > > tag:         tip
> > > parent:      5341:b69b68ceb0b70ec4c387c8bdf7c0a94164e07e98
> > > parent:      5340:8e01a163726d6ddc2d72382bf1e5ec1d4b86522c
> > > user:        "Johan Hake <hake@xxxxxxxxx>"
> > > date:        Sun Dec 14 22:42:41 2008 +0100
> > > files:       TODO
> > > description:
> > > merge
> > >
> > >
> > > changeset:   5341:b69b68ceb0b70ec4c387c8bdf7c0a94164e07e98
> > > parent:      5335:11eae42fc1852b3b0aca0d247ed0d2f003b05201
> > > user:        "Johan Hake <hake@xxxxxxxxx>"
> > > date:        Sun Dec 14 22:41:08 2008 +0100
> > > files:       TODO demo/pde/periodic/python/demo.py
> > > dolfin/swig/dolfin_mesh_pre.i dolfin/swig/typemaps.i
> > > site-packages/dolfin/compile_function.py description:
> > > Fixed periodic python demo.
> > >   - Added a director typemap for "double *y" in map
> >
> > In addition to fix the typemap I also had to change
> >
> >   bc0 = DirichletBC(V, u0, DirichletBoundary())
> >
> > to
> >
> >   dbc = DirichletBoundary()
> >   bc0 = DirichletBC(V, u0, dbc)
> >
> > This is probably not obvious but a quite common error related to swig
> > generated python classes.
> >
> > The DirichletBoundary subdomain get garbage collected killing its C++
> > equivalent. We therefore have to keep a reference in the demo, which
> > prevents this.
> >
> > Johan
>
> ok, do we expect this to get better once we get shared pointers
> working across C++/Python?

Yes, I suppose so.

> Creating an anonymous instance of the SubDomain works fine in the
> Poisson demo (and other demos that use DirichletBC), but not when
> using PeriodicBC. The reason is that for DirichletBC, the SubDomain is
> used by the constructor to build an internal data structure (in the
> form of a MeshFunction) which is later used by apply(), but for
> PeriodicBC, the SubDomain is stored and later used by apply().

Ok, I just assumed it also had implications for the DirichletBC.

Johan


References