On Jun 7, 2012, at 5:35 PM, Yun Tao wrote:

> > But if the peak is advecting out of the domain, then it is not conserved.
> 
> Makes sense. And if I were to multiply the convection term by tanh(x) with x 
> being the position vector, which then will generate a fixed pt at (0,0), how 
> would I ensure conservation? In other words, albeit it's a 1-D example, how 
> do I enforce the total area under the probability density function in 
> s-cd1dx.mp4 from last email to equal 1?

If you use no boundary conditions, then conservation is guaranteed, as FiPy 
(and finite volume in general) assumes no-flux boundary conditions. You will, 
however, get pile-up at some of the boundaries, as you observed originally. 
This is because your probability function is trying to move out of the domain 
and the no-flux condition doesn't let it, so that "material" has to go 
somewhere and so it accumulates at the boundary. That pile-up is precisely a 
consequence of the conservation you are worried about.

If you constrain the values at the boundaries, then pile-up doesn't occur, but 
material will flux out of (or into) the domain. It has to. You are telling it 
to.

> > What version of FiPy are you running? As far as I can tell, 
> > Matplotlib2DViewer has been imported by `from fipy import *` for about six 
> > years.
> 
> The current FiPy I'm running is FiPy-2.2_dev5124 

Ah, I didn't realize you were using trunk/ (all of your scripts have used the 
2.1 syntax, so that's what I've been testing them with).

Thank you for pointing this out. You have identified two bugs in the 
MatplotlibViewer package on trunk/.

There is a typo in 

  
http://matforge.org/fipy/browser/trunk/fipy/viewers/matplotlibViewer/__init__.py?rev=5194#L13

and 

  
http://matforge.org/fipy/browser/trunk/fipy/viewers/matplotlibViewer/matplotlib2DViewer.py?rev=5194#L123

does not properly account for a refactoring we did on the mesh classes.

I have pushed fixes for both issues to SVN trunk/. Thank you for bringing this 
to our attention.



_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to