dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10077
Re: BC specification in PyDOLFIN
> -----Original Message-----
> From: dolfin-dev-bounces@xxxxxxxxxx
> [mailto:dolfin-dev-bounces@xxxxxxxxxx] On Behalf Of Anders Logg
> Sent: Monday, October 13, 2008 8:37 AM
> To: dolfin-dev@xxxxxxxxxx
> Subject: Re: [DOLFIN-dev] BC specification in PyDOLFIN
>
> On Mon, Oct 13, 2008 at 08:10:35AM -0600, Ostien, Jakob T wrote:
> > Hi,
> >
> > Is it currently possible to set the boundary condition
> search specification in PyDOLFIN?
> >
> > in cpp
> > DirichletBC bc(function, mesh, subdomain, geometric);
> >
> > in PyDOLFIN
> > bc = DirichletBC(function, mesh, subdomain, geometric)
> >
> > this gives
> > NameError: name 'geometric' is not defined
> >
> > (same for pointwise)
> >
> > Jake
>
> Does it work if you instead write dolfin.geometric?
Yes (see below).
>
> In that case, it's a simple fix to include it in the
> __init__.py file for DOLFIN (site-packages/dolfin/__init__.py).
Adding the following to __init__.py got rid of the NameError.
# BC specification
from dolfin import topological, geometric, pointwise
However a simple 2D DG elasticity script uncovers other problems. Namely, trying to use the pointwise specification gives the following error:
TypeError: 'PySwigObject' object is unscriptable Swig director method error. Error detected when calling 'SubDomain.inside'
(I have absolutely no idea what that even means, I don't know python/swig very well)
Also, trying to use a LinearPDE gives a seg fault for the geometric specification. (or some other nasty glibc error)
Other than that, assembling and solving using the geometric specification for the BCs gives me the answer I expect.
Thanks. I'll attach the script if anyone is interested.
Jake
>
> --
> Anders
>
Attachment:
2D_dg_demo.py
Description: 2D_dg_demo.py
Follow ups
References