Re: Spatially varying 2D source in fipy 3

2012-12-05 Thread Jonathan Guyer
This is http://matforge.org/fipy/ticket/447, which we haven't resolved yet. At this point, either do: X, Y = mesh.cellCenters[0], mesh.cellCenters[1] or X, Y = mesh.cellCenters X = CellVariable(mesh=mesh, value=X) Y = CellVariable(mesh=mesh, value=Y) There is no reason to use the get.

Re: Spatially varying 2D source in fipy 3

2012-12-05 Thread Adam Stone
I found the problem, although I don't quite understand it. If I do either X, Y = mesh.cellCenters or X, Y = mesh.getCellCenters() then type(X) gives a numpy array and results in this error. However, if I do X, Y = mesh.cellCenters[0], mesh.cellCenters[1] or X, Y = mesh.getCellCenters()[0],

Spatially varying 2D source in fipy 3

2012-12-05 Thread Adam Stone
I am interested in modeling a heat equation problem with a Gaussian heat source, so I need a way to define a source as a function of X and Y. A search turned up a previous 1D case from the older version in which something like this was done: X = mesh.getCellCenters()[0] eq = (TransientTerm() ==

Re: solving navier-stokes equation in semicircle

2012-12-05 Thread Jonathan Guyer
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 id

Re: solving navier-stokes equation in semicircle

2012-12-05 Thread Tanya Gornak
On 4 December 2012 18:56, Daniel Wheeler wrote: > > > > On Tue, Dec 4, 2012 at 12:38 PM, Tanya Gornak wrote: >> >> >> >> No, this would not work for me. I need Cartesian mesh, because I want >> to test new method for solving pressure correction equation, >> and it works only on Cartesian mesh. >>

Re: Will FiPy objects misbehave if not in the __main__ namespace?

2012-12-05 Thread Lafras Uys
Dear Jonathan and Daniel, Thank you for the quick responses. I've solved my problem. In my method definition: def setInitial(self): self.a.setValue(linspace(1,7,self.nx)) self.b.setValue(1) It is very important to call *.updateOld() after *.setValue(). Otherwise, the first sweep of the