On Dec 5, 2012, at 5:55 AM, Tanya Gornak wrote:
>> Tanya, It might be better to use one of the standard grid classes and then
>> use source terms to blank out exterior cells. Seems much easier to me at
>> least to get something working. Worry about optimizing it later.
>
> Thanks, Daniel. Your idea is great and I've already done something like this.
> But in current simulation I definitely need curved boundary with Neumann
> boundary condition on faces.
>
> I think that I shall use Benny's idea and create my own mesh class.
It's not very efficient for large N, but you should be able to concatenate a
bunch of Grid2D's:
N = 10
dr = r / N
mesh = 0
for layer in xrange(N):
theta = nx.arccos((N - layer - 0.5) * dr / r)
w = int(N * nx.sin(theta))
mesh = mesh + (Grid2D(nx=2 * w, ny=1, dx=dr, dy=dr) + [[-w * dr], [(N -
layer) * dr]])
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]