Daniel,

The examples I am trying are out of the reference manual (page 40 and 41).

Here's the input and output from ipython:

#####

In [1]: from fipy import *

In [2]: from fipy.meshes.grid2D import Grid2D

In [3]: baseMesh = Grid2D(dx = 1.0, dy = 1.0, nx = 2, ny = 2)

In [4]: print baseMesh.getCellCenters()
[[ 0.5  1.5  0.5  1.5]
 [ 0.5  0.5  1.5  1.5]]
####

This last mesh is transposed when compared to the output on page 40 of the ref. manual. Here , I need to now account for the transposed array, so I add 4 values instead of 2 (following the example results in an error):

####
In [8]: translatedMesh = baseMesh + (5, 10, 15, 20)

In [9]: print translatedMesh.getCellCenters()
[[  5.5  11.5  15.5  21.5]
 [  5.5  10.5  16.5  21.5]]
####

Now the values are really messed up. I haven't translated the mesh, but instead have added the same values to both the x and y coordinates. How do I add a constant to all the Y (or Y) values to translate the mesh so I can then concatenate them?

What I'm hoping I can do, but am doubtful it is possible, is to add two meshed together that are linked at only a some of the faces. In 2-D, you could envision creating a horizontal and vertical mesh, say 5 by 2 and 2 by 6, and linking then together so they make an L or T-shaped final mesh. The two original meshes would now be linked across and share two faces.

Don't worry about any older e-mails I sent that you have not responded to. I've either found a work-around or figured out what I was doing wrong. There's no rush on this either, as I'll be away for a couple weeks doing field work.

Thanks for your help,

Andy

----------------------
Andrew Reeve
Dept. of Earth Science
University of Maine
Orono, ME 04469



Reply via email to