← Back to team overview

dolfin team mailing list archive

Re: [Question #110430]: Plot boundary conditions

 

On Mon, May 10, 2010 at 12:11:25PM -0000, bluejerry wrote:
> New question #110430 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/110430
>
> Hi,
>
> I would like to plot the boundary conditions in my problem. The boundary condition is a DirichletBC using a generic function as part of the Expression (class MyFunc : public Expression ....) I have tried the following:
>
> Let "bc" be the DirichletBC and "be" the Expression used to describe the BC.
>
> 1. plot(bc, mesh = mesh, element=V.ufl_element())
> => "RuntimeError: Don't know how to plot given object and projection failed: <DOLFIN object x (unnamed data)"

You can't plot a DirichletBC.

> 2. plot(be, mesh = BoundaryMesh(mesh), element=V.ufl_element())
> => "RuntimeError: *** Error: Current facet is unknown"

Your function seems to be using data.facet() which is only available
during assembly and then only when assembling over facets. That means
your function can't be plotted (since it is not well defined for
example in the interior).

--
Anders


> Am I missing something?
>
> Something that might be related and possibly a bug, when I try to plot "be" as follows:
>
> pts = array([[0.0,0.0,0.0], [0.5,0.5,0.5]], dtype='d') # Assume points are on boundary
> plot(be, mesh=mesh, element=V.ufl_element(), plot_pts=pts)
> => TypeError: in method 'MyFunc_eval', argument 3 of type 'dolfin::Data const &'
> I assume that the data sent to MyFunc_eval should be of a different type, but this would be inconsistent with the general way of plotting arbitrary points.
>
> Thank you
>
> Renier
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp

Attachment: signature.asc
Description: Digital signature


Follow ups

References