Daniel and Jonathan,

I have a few, hopefully quick, questions. I've created a mesh using gmsh that is oriented in the X-Z plane and would like to extrude it in the Y direction. When I try to do this in fipy, the z cordinates for the verts variable in the extrude function get set to zero, instead of the values assigned by gmsh. Does fipy only allow extrunsion in the z-direction?
I've attached a simple script and mesh file that illustrates this.

My second question also relates to using the gmsh-generated mesh file. In this file, gmsh tags the different surfaces with different numbers. Is it possible to access these numbers in fipy so they can be used to assign properties to the grid?

Finally, is there a way to return the 'layer number' in the extrude function? I'd like to use the layer number to calculate the thickness of the extruded layer.


Thanks,

Andy





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

from fipy import *

def addLayer(verts):
    print count
    addArray = verts.copy()
    #print verts
    addArray[:] = 0
    addArray[1] = .5
    return verts + addArray

length=1. ##cm
slices=2
mesh=GmshImporter2D('./extrude1.msh').extrude(layers=slices, 
extrudeFunc=addLayer)
$MeshFormat
2 0 8
$EndMeshFormat
$Nodes
12
1 0 0 0
2 0 0 100
3 100 0 100
4 100 0 0
5 100 0 50.00000000017764
6 50.00000000017764 0 0
7 0 0 49.99999999989662
8 49.99999999989662 0 100
9 25.00373630373327 0 70.37439509981473
10 30.26309952566156 0 33.30686961251601
11 69.04206566050681 0 33.18034210293228
12 61.73167755040554 0 66.07049498834333
$EndNodes
$Elements
26
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 1 3 0 1 0 3 5
6 1 3 0 1 0 5 4
7 1 3 0 2 0 4 6
8 1 3 0 2 0 6 1
9 1 3 0 3 0 1 7
10 1 3 0 3 0 7 2
11 1 3 0 4 0 2 8
12 1 3 0 4 0 8 3
13 2 3 0 6 0 2 8 9
14 2 3 0 6 0 9 7 2
15 2 3 0 6 0 10 6 1
16 2 3 0 6 0 1 7 10
17 2 3 0 6 0 11 4 6
18 2 3 0 6 0 5 4 11
19 2 3 0 6 0 9 8 12
20 2 3 0 6 0 11 6 10
21 2 3 0 6 0 10 7 9
22 2 3 0 6 0 9 12 10
23 2 3 0 6 0 11 10 12
24 2 3 0 6 0 12 3 5
25 2 3 0 6 0 5 11 12
26 2 3 0 6 0 8 3 12
$EndElements

Reply via email to