Yun - I've gotten your script to "work" and posted the changes to:
https://gist.github.com/guyer/caca956463dfc3835722/revisions The main changes I made were: * to get rid of the intrep2d, as it wasn't working properly [signal_fct(xf, yf) generates a result of shape (len(xf), len(xf)) instead of (len(xf),).] I was able to get it working a bit better, but not completely, and I realized that it doesn't really do anything for you that simply placing your signals in a CellVariable and then letting it calculate its .faceValue doesn't accomplish. * simplify the calculation of faceVelocity (m.faceValues is already a rank-1 FaceVariable) Although this script functions, I suspect it's not really what you're looking for. The signals are all extremely localized and faceVelocity is really not responsive to the density of signals, but just discretely to whether there's a signal in a given cell. If that's so, I think you'll want to calculate a density field for the signals, rather than placing them in discrete locations. - Jon On Aug 19, 2015, at 8:00 PM, Yun Tao <[email protected]> wrote: > Hi FiPy community, > > I'm currently trying to combine the powerful tool of FiPy with agent-based > modeling. The problem I'm trying to solve is this: > > In a 2D landscape scattered with "deterrent point signals", I want to solve > for the transient solution of a convection-diffusion (Fokker-Planck) equation > that increases its advection towards its central attractor in a way that is > proportional to the interpolated density of local signals. I therefore expect > to see gradual deformation, and slowing down of spread, in the solution > boundary as diffusion brings it closer to clustered signals. > > However, since the point signals are located on mesh cell centers and the > convection coefficient in FiPy requires FaceVariable inputs, there is a > problem with dimensionality I cannot quite understand. How should I integrate > these two processes? > > I've attached my current script, which has the convection term commented out > for now. Left figure is the PDE solution; right figure is the locations of > the signal points. > > Any help would be greatly appreciated. > > Thanks, > Yun > > > -- > Yun Tao > PhD > University of California, Davis > Department of Environmental Science and Policy > One Shields Avenue > Davis, CA 95616 > <fipy-ibm2_test_forum.py>_______________________________________________ > fipy mailing list > [email protected] > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
