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.
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],
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() ==
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
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.
>>
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