Dan, I think this is the kind of thing you want (It's actually a list of list (a matrix form). ellist is a 3x3 matrix of variables
append is the key function


ellist=[]
bclist=[]
outside=mesh1.getExteriorFaces()
for i in range(3):
        tmplist=[]
        bctemp=[]
        for j in range(3):
tmplist.append(CellVariable(mesh = mesh1 ,value = a [i][j], hasOl
d = 1))
                bctemp.append((FixedValue(outside,a[i][j]),))
        ellist.append(tmplist)
        bclist.append(bctemp)



On May 5, 2006, at 9:53 AM, Daniel Lewis wrote:


Hi folks,

Can you create a list object in FiPy using the cell variables defined below?

# Create the cell variables and put them on the mesh.
from fipy.variables.cellVariable import CellVariable
alpha = CellVariable(name = "alpha",
                      mesh = mesh)
beta = CellVariable(name = "beta",
                      mesh = mesh)
liquid = CellVariable(name = "liquid",
                      mesh = mesh)
comp = CellVariable(name = "composition",
                     mesh = mesh)

The object is to access the variables using something like:

phase[1], phase[2], phase[3]

Will this work?  Some of the calculations are iterative and it would
be nice to loop over phase numbers...

Dan

Dan Lewis
Assistant Professor
Materials Research Center, Room 110
Rensselaer Polytechnic Institute
http://www.rpi.edu/~lewisd2









Dr. James A. Warren

Leader, Thermodynamics and Kinetics Group, Metallurgy Division
Materials Science and Engineering Laboratory
National Institute of Standards and Technology

Adjunct Professor, Inst. for Physical Science and Technology, U. Maryland

Contact Information:
NIST                                            email:[EMAIL PROTECTED]
100 Bureau Drive, Stop 8554 WWW:http://www.ctcms.nist.gov/ ~jwarren Gaithersburg, MD 20899-8554 Phone: (301)975-5708/FAX:(301) 975-4553




Reply via email to