On Wed, Dec 3, 2008 at 2:36 PM, Jonathan Guyer <[EMAIL PROTECTED]> wrote:
>
>
> On Dec 2, 2008, at 4:28 PM, Ionut Vancea wrote:
>
>> Here I mean something like:
>>
>> \bar{\Phi}(r)=\int dr'\Phi(r')V(r-r')
>>
>> \nabla f(\bar{\Phi})
>
>
> As a first cut, I would try to implement this something like:
>
> x, y = mesh.getCellCenters()
> r = CellVariable(mesh=mesh, value=sqrt(x**2 + y**2))
> Phi = CellVariable(mesh=mesh, value=...)
> def V(delta): return ...
>
> integrator = numerix.vectorize(lambda rPrime: (Phi * V(rPrime -
> r)).getCellVolumeAverage())
> barPhi = CellVariable(mesh=mesh, value=integrator(r))
>
> Note that I've swapped the meaning of r and r' in the integral because of
> the way r is scoped overall.
>
> Making barPhi automatically update with changes in Phi or the coefficients
> of V() would be a little more tricky, but not impossible. Let's get it
> working the way you expect it to and then we can put together a new
> IntegratedCellVariable.
>Ok, I understand. Thank you for useful information. I will try to solve/implement and I will come back with questions/results. Cheers, -- === Ioan Vancea http://www.vioan.ro
