asreeve | 9 Jul 18:57

(unknown)


Daniel and Jonathan:

I'd like to concatenate two 3-D extruded mesh files. The examples in the 
users guide indicate this can be done, but I can't seem to get the 
examples listed there to work and was curious if this feature has been 
dropped or the convention for doing this has changed?

I've created two grids that I'd like to add together in the Z direction. 
Some of the cells have a thickness of zero, and need to be removed from 
the mesh. I was hoping I could do this be extruding a mesh that removed 
the 'empty cells', and then attach it to the other mesh. Is this possible, 
or do I need to handle all this in one extruded file?

Andy

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

Daniel Wheeler | 10 Jul 20:33
Gravatar

Re:


On Wed, Jul 9, 2008 at 1:00 PM, asreeve <asreeve@...> wrote:
>
> Daniel and Jonathan:
>
> I'd like to concatenate two 3-D extruded mesh files. The examples in the
> users guide indicate this can be done, but I can't seem to get the examples
> listed there to work and was curious if this feature has been dropped or the
> convention for doing this has changed?

Which examples exactly?

> I've created two grids that I'd like to add together in the Z direction.
> Some of the cells have a thickness of zero, and need to be removed from the
> mesh. I was hoping I could do this be extruding a mesh that removed the
> 'empty cells', and then attach it to the other mesh. Is this possible, or do
> I need to handle all this in one extruded file?

I'm not sure that one can remove cells from a mesh. I wasn't aware
that it was possible. I am also not aware of mesh concatenation
breaking other than a ticket being submitted for something. Can you
give an example of what you are trying to do?

I still have one of your previous mails with in my inbox that I
haven't dealt with. I am planning to work on it, but haven't had a
chance.

--

-- 
Daniel Wheeler

(Continue reading)

asreeve | 10 Jul 22:38

Re:


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]]
(Continue reading)

Daniel Wheeler | 10 Jul 23:35
Gravatar

Re:


On Thu, Jul 10, 2008 at 4:38 PM, asreeve <asreeve@...> wrote:
>
> Daniel,
>
> The examples I am trying are out of the reference manual (page 40 and 41).

Check out http://matforge.org/fipy/browser/trunk/fipy/meshes/common/mesh.py#L70

The manual on the web doesn't correspond to trunk. This is an argument
for having the guide and manual updated at every commit, which is
possible, but we don't do it. Perhaps we should. I can't build you a
new copy of the reference manual as my build mechanism seems to be
hosed. You can always look in the code to figure out how the new
example should work.

http://matforge.org/fipy/browser/trunk/fipy/meshes/common/mesh.py#L70

You'll notice that mostly everything has been transposed between v1.2 and trunk.

> 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?

to add to the y-values only do "mesh + ((0,),(value,))"

> 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
(Continue reading)


Gmane