On Mar 8, 2012, at 7:15 AM, Andreas Hasenkopf wrote:

> to get to know fipy I tried to solve the Poisson equation in 2D for two
> adjacent rings: one had a constant charge density and the other one was
> used as boundary condition \phi=0.
> But as I do not really know the charge distribution in the rings I tried
> to use another approach by solving the Laplace equation and use both
> rings as boundary conditions. But unfortunately my script does not
> produce any feasible results unless I specify only FixedValues for the
> borders of the plotting area.


> mesh = Grid2D(dx=dx,dy=dx,nx=nx,ny=nx)

> bcs = (
>    FixedValue(value=0.,faces=mesh.getExteriorFaces() & ((
> (X-x0-L/4)**2+(Y-y0-L/4)**2<(L/4.)**2 ))),
>    FixedValue(value=-5.,faces=mesh.getExteriorFaces() & (
> (x-x0)**2+(y-y0)**2<(15*dx)**2 )),
> )

As far as I can tell, you have defined a square domain and then are trying to 
define boundary conditions on circles that lie within that domain. FiPy's 
BoundaryCondition classes do not support internal boundary conditions like 
this. The only reason you don't get an error is because by and'ing with the 
exterior faces, you are passing through only the faces on the exterior square 
boundary that also lie on the defined circles. Those appear to be empty sets, 
so you are actually imposing no boundary conditions at all and FiPy uses its 
default no-flux on all exterior faces.

In order to apply boundary conditions to ring boundaries, you either need to 
define your ring-shaped domain with Gmsh or you should be able to define 
internal constraints using the techniques described at 

http://www.ctcms.nist.gov/fipy/documentation/FAQ.html#i-can-t-get-the-fixedvalue-or-fixedflux-boundary-condition-objects-to-work-right-what-do-i-do-now
 



_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to