Dear Dr. Guyer,

Thank you for you precious advices:

Indeed, I had misunderstood how to do the meshing and that was the source of 
the apparent shift in the solver behaviour.

Thank you also for your suggestions regarding the results viewing optimization: 
it's true indeed that this way is more elegant and would have exhibited where 
my problem came from.

With my best regards; and a good week-end to all,

Fanny

-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Jonathan Guyer
Envoyé : jeudi 11 août 2011 20:13
À : Multiple recipients of list
Objet : Re: time issues with implicit method + full script



On Aug 11, 2011, at 10:59 AM, JAMBON Fanny 213198 wrote:

> Here is the full script (I do not use the fipy viewer but pylab, make sure 
> you have it installed!).

A better way to do this is to use the MatplotlibViewer and then manipulate its 
axes as you desire:

   view = MatplotlibViewer(vars=cH)
   view.axes.plot(X_scale, Sol, marker='o')
   view.plot()

This allows FiPy to properly position its solution values, which is a problem 
in your script.


> ## Mesh
> X_scale= n.linspace(0,2.0e+4,1000)# grid 0-> 20 um ; units[nm]

> Nbx=len(X_scale) 
> deltax= 1.0/float(Nbx)

You calculate the analytical solution over a domain of [0, 2.0e+4 nm], but your 
FiPy grid is only [0, 1.0 nm]. Try:

  deltax= 2.0e+4/float(Nbx)

instead.



> # Graph plotting
> Y_scale=tuple(cH)
> plt.plot(X_scale,Y_scale, marker='x')

The values of cH are not evaluated at [0., 20.02002002, 40.04004004, ...] as 
given by linspace, but rather at [1.00000000e+01, 3.00000000e+01, 
5.00000000e+01, ...].

Better to do 

   plt.plot(mesh.getCellCenters()[0], cH.getValue(), marker='x')

or better still to use the MatplotlibViewer as I show above.






Reply via email to