On Nov 28, 2012, at 5:15 PM, Adrian Jacobo wrote: > I'm solving an equation in 3d and I need to calculate the integral of the > field. What is the most convenient/fast way of doing this?
int = var.cellVolumeAverage * var.mesh.numberOfCells > A related question: how can I access individual points of the field? Right > now, to access the point C(x,y,z) I'm doing C(((x,),(y,),(z,))), where C is a > CellVariable over a Grid3d mesh. This seems cumbersome (an I don't fully > understand the notation, I just found it in an example). Is there a cleaner > way of doing it? The C(points) notation is intended to return the value of C at multiple points. You specify the points with a list of lists (or a tuple of tuples, as you have done): [[x1, x2, x3, ...], [y1, y2, y3, ...], [z1, z2, z3, ...]] For a single point, I guess this is a bit cumbersome, but the idea is that it's symmetrical with things like var.cellCenters. _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
