Thanks for pointing out the difference between the return types of "x,y = mesh.cellCenters" and "x,y = mesh.cellCenters[0], mesh.cellCenters[1]". I was unaware of that. I just realized that I was already using the nomenclature recommended. In fact, my script fails entirely when using "x,y = myMesh.cellCenters".
In any case, the problem I described below goes away when I add "from fipy import *" to the beginning of my script. If possible, I would prefer to import the specific modules necessary to run in parallel rather than importing *. Are there specific modules needed for running in parallel or do I have to import *? On Dec 10, 2012, at 10:25 AM, Jonathan Guyer wrote: > > 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 > [email protected] > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
