On Dec 7, 2012, at 5:32 PM, dely wrote:

> I am writing to ask how to correctly use setValue with the where argument 
> when running fipy in parallel. For example, to set the value of a 
> cellVariable in a hemispherical region on the bottom boundary of a mesh, I 
> can do the following:
> 
> x, y = myMesh.cellCenters
> myCellVar.setValue(1, where=((x - nx * dx / 2)**2 + y**2) < radius**2)
> 
> This works fine in serial, however, in parallel, this sets the value in a 
> hemispherical region on the bottom boundary of the domain allocated to each 
> processor. In other words, if I specify 3 processors, I get 3 hemispheres 
> stacked on top of each other.

I do not see this behavior, but it may depend on how you declared myMesh.

Nonetheless, I'm pretty sure this is due to 
http://matforge.org/fipy/ticket/447, which has caused problems for other users 
recently.

Try:

  x, y = mesh.cellCenters[0], mesh.cellCenters[1]

That way x and y should be CellVariable's and be broadcast properly across 
processors. Because of ticket:447, you're presently getting NumPy arrays, which 
don't broadcast (I honestly don't know why it works for me).


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

Reply via email to