Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
You can generate a simple mesh in order to probe what's stored by doing something like: mesh1 = fp.Grid2D(nx=2, ny=2) mesh2 = fp.Grid2D(nx=2, ny=2) + [[2], [1]] mesh = mesh1 + mesh2 > On Jun 15, 2016, at 2:06 PM, James Pringle wrote: > > Jonathan -- > > Thank you,

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
The answer to both is "I don't think so" > On Jun 15, 2016, at 2:06 PM, James Pringle wrote: > > Jonathan -- > > Thank you, this is exactly what I need. Two more questions. > • Is the order of the vertices in faceVertexIDs important? > • Is the order of faces in

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Daniel Wheeler
I think that you need to instatiate one of these https://github.com/usnistgov/fipy/blob/develop/fipy/meshes/mesh2D.py#L70 with the correct arrays. For examples, >>> points = [[0,0], [0, 1], [1, 0], [1, 1]] >>> from scipy.spatial import Delaunay >>> tri = Delaunay(points) >>> tri.points

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread James Pringle
Jonathan -- Thank you, this is exactly what I need. Two more questions. 1. Is the order of the vertices in faceVertexIDs important? 2. Is the order of faces in cellFaceIDs important? Must they wind clockwise or counterclockwise? Thanks, Jamie On Wed, Jun 15, 2016 at 1:56 PM, Guyer,

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
The first three arguments to the Mesh2D constructor are (all that is) required: class Mesh2D(Mesh): def __init__(self, vertexCoords, faceVertexIDs, cellFaceIDs, ...): All other arguments have default values assigned. For your case: vertexCoords is of shape (2, N) where N is the number

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread James Pringle
Well, I am motivated to give it a go, since I only have the summer to make progress on project and it is blocking my research progress right now. Can you give me a pointer to where the appropriate quantities are defined? I can certainly write code to make the transformations, but it is a bit hard

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Daniel Wheeler
Hi Jamie, There is no automated way to make a FiPy mesh from Scipy's Delaunay object. The problem is that FiPy needs a face to vertex array and a cell to face array while the Delaunay object just has the cell to vertex array. The functionality to extract the face to vertex array and cell to face

Re: how to create large grid with holes and odd geometry

2016-06-08 Thread James Pringle
Thank you. Because of the regular nature of the original data, it is easy to make it all triangles. Cheers, Jamie On Wed, Jun 8, 2016 at 2:10 PM, Guyer, Jonathan E. Dr. (Fed) < jonathan.gu...@nist.gov> wrote: > Meshes with holes are not a problem for FiPy. Daniel will be happy to help > you

Re: how to create large grid with holes and odd geometry

2016-06-08 Thread Guyer, Jonathan E. Dr. (Fed)
Meshes with holes are not a problem for FiPy. Daniel will be happy to help you create a Mesh2D from the output of the triangle package. Basically, you need a list of vertex coordinates, a list of vertex IDs that make up faces, and a list of faces that make up cells. Having all triangles should

Re: how to create large grid with holes and odd geometry

2016-06-08 Thread Daniel Wheeler
Hi Jamie, The simplest way might be just to take a basic grid and just "switch off" the simulation outside of the black zone. This can be achieved by including a transient term in the equation and setting the coefficient to be large in the white zone and zero or something small in the black zone.

Re: how to create large grid with holes and odd geometry

2016-06-08 Thread Guyer, Jonathan E. Dr. (Fed)
If the domain were not so large and so sparse, I'd be inclined to create a simple, rectilinear Grid2D of the full extent and then use known coefficients to mask out (set B to zero?) the solution where you don't know/care. Assuming the axes are labeled in grid spacings (?), then your mesh would