Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid3D getFaceCenters incorrect when mesh is offset #175

Closed
guyer opened this issue Sep 19, 2014 · 1 comment
Closed

Grid3D getFaceCenters incorrect when mesh is offset #175

guyer opened this issue Sep 19, 2014 · 1 comment

Comments

@guyer
Copy link
Member

guyer commented Sep 19, 2014

(as reported in http://article.gmane.org/gmane.comp.python.fipy/1418)

The Grid3D getFaceCenters doesn't appear to give correct
printout result when the mesh is offset. Below is my script:

from fipy import *

region_3D =  Grid3D(dx=1,dy=1,dz=1,nx=2,ny=2,nz=2) + ((0,),(0,),(2,))
x,y,z = region_3D.getFaceCenters()

Then, if I print out z vector, I don't see offset being applied on z-axis:

z = [ 0. ,  0. ,  0. ,  0. ,  1. ,  1. ,  1. ,  1. ,  2. ,  2. ,  2. ,
2. ,  0.5,  0.5,  0.5,  0.5,  0.5,  0.5,  1.5,  1.5,  1.5,  1.5,
1.5,  1.5,  0.5,  0.5,  0.5,  0.5,  0.5,  0.5,  1.5,  1.5,  1.5,
1.5,  1.5,  1.5]

The getCellCenters works just fine. The z vector from getCellCenters gives:

x,y,z =  region_3D.getCellCenters()
array([ 2.5,  2.5,  2.5,  2.5,  3.5,  3.5,  3.5,  3.5])

Imported from trac ticket #190, created by guyer on 06-09-2009 at 13:45, last modified: 06-09-2009 at 14:04

@guyer
Copy link
Member Author

guyer commented Sep 19, 2014

Fixed in r3052 and merged to trunk in r3056

Trac comment by guyer on 06-09-2009 at 14:04

@guyer guyer closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants