Daniel et al. --
As referenced earlier in this thread, I have a complex domain with
holes in it; I now have it broken up into triangles, based on the Delaunay
package in SciPy. I have
1. Locations of all vertex coordinates,
2. list of vertices that make up faces
3. list of faces that make cells
4. list of faces that make up all the internal and external boundaries.
Can you point me to any code or documentation that would help me understand
how to make this into a Mesh2D object? I am having a devil of a time
figuring out from the manual online. The best would be something that used
the output of either the triangles or scipy.spatial.Delaunay() packaged.
My equation is of the form
0=J(Psi,A(x,y)) + \Del(B(x,y)*\Del Psi)
and I can get the coefficients A(x,y) and B(x,y) on either the faces or in
the cell centers are needed.
Thank you.
Jamie Pringle
University of New Hampshire
On Wed, Jun 8, 2016 at 2:13 PM, Pringle, James <[email protected]>
wrote:
> 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) <
> [email protected]> wrote:
>
>> 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 be pretty easy; it gets messy when you've got mixes of different
>> cell topologies.
>>
>> > On Jun 8, 2016, at 10:57 AM, James Pringle <[email protected]> wrote:
>> >
>> > Thank you; the axes were indeed in grid spacing, and your back of the
>> envelope calculation of sparsity was exactly correct.
>> >
>> > I am now playing around with the python triangle package to create a
>> triangular mesh with the appropriate holes and boundary defined. (e.g.
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__dzhelil.info_triangle__data-2D4.png&d=CwICAg&c=c6MrceVCY5m5A_KAUkrdoA&r=oMf1-WHpUHeD7kN3S7612CDdF2TDPqDF9R-n-71Ks1Y&m=k71WczOQwQx8_RK9cU8wRK_X2spChhXjIrj5C0zWgw4&s=Qk6jAmccEUMVpP5TFa_gtI6T1b4bSBcRfmUOVIkzC-s&e=
>> ) .
>> >
>> > What is the best way to covert the triangle data (similar in form to
>> scipy.spatial.Delaunay output) into the form fipy likes -- or what is the
>> best documentation of the fipy mesh data structure?
>> >
>> > Does FiPy have the capability to deal with holes in a triangle mesh,
>> and have BC's on them? I did see the trick that Danial Wheeler mentioned.
>> Thanks!
>> >
>> > After I get the mesh, I was planing to reverse engineer the output of
>> fipy.meshes.gmshMesh.Gmsh2D to figure out how to get my mesh into fipy if
>> you don't mention something better.
>> >
>> > Thanks a bunch,
>> > Jamie
>> >
>> > On Wed, Jun 8, 2016 at 1:46 PM, Guyer, Jonathan E. Dr. (Fed) <
>> [email protected]> wrote:
>> > 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 have around 5 million elements in it, with fewer than 1 million
>> actually being solved (although it looks like even less than 20% of the
>> domain is active). I don't think that would perform very well.
>> >
>> > I'm not thinking of anything clever with Gmsh off the top of my head.
>> >
>> > You could break the total domain into sub-grids, only instantiate the
>> corresponding Grid2D's if they're not empty, and then concatenate them
>> together. Sketching:
>> >
>> > A B C D
>> > +-----+-----+-----+-----+
>> > 1| | ** | | |
>> > | | ** | | |
>> > +-----+-----+-----+-----+
>> > 2| | *|** | |
>> > | | |* * | |
>> > +-----+-----+-----+-----+
>> > 3| | | *** | |
>> > | | | ***| |
>> > +-----+-----+-----+-----+
>> > 4| | | **|* |
>> > | | | *| * |
>> > +-----+-----+-----+-----+
>> >
>> >
>> > mesh = gridB1 + gridB2 + gridC2 + gridC3 + gridC4 + gridD4
>> >
>> >
>> >
>> >
>> > > On Jun 7, 2016, at 10:46 AM, James Pringle <[email protected]> wrote:
>> > >
>> > > Dear mailing list & developers --
>> > >
>> > > I am looking for hints on the best way to proceed in creating a
>> grid/mesh for a rather complex geometry. I am just looking for which method
>> (Gmsh or something else?) to start with, so I can most efficiently start
>> coding without exploring blind alleys.
>> > >
>> > > I am solving an elliptic/advective problem of the form
>> > >
>> > > 0=J(Psi,A(x,y)) + \Del(B(x,y)*\Del Psi)
>> > >
>> > > where Psi is the variable to solve for, and A(x,y) and B(x,y) are
>> coefficients known on a set of discrete points shown as black in
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__dl.dropboxusercontent.com_u_382250_Grid01.png&d=CwICAg&c=c6MrceVCY5m5A_KAUkrdoA&r=oMf1-WHpUHeD7kN3S7612CDdF2TDPqDF9R-n-71Ks1Y&m=pa2VS0gonWbqlcwLDzR4QyP-iFHDpvnSHIqg-fk0QD4&s=ctz2HUgelmtveB6M5tJgv57BV8OqeCl3-MMJoIQOtmk&e=
>> . The black appears solid because the grid is dense.
>> > >
>> > > The locations of the points where the coefficients are known define
>> the grid. The number of points is large (911130 points) and they are evenly
>> spaced where they exist. Note that there are holes in the domain that
>> represent actual islands in the ocean.
>> > >
>> > > I am happy to keep the resolution of the grid/mesh equal to the
>> spacing of the points where the coefficients are known.
>> > >
>> > > What is the best way to approach creating a grid for this problem? I
>> would love code, of course, but would be very happy with suggestions of the
>> best way to start.
>> > >
>> > > Thanks
>> > > Jamie Pringle
>> > > University of New Hampshire
>> > > _______________________________________________
>> > > fipy mailing list
>> > _______________________________________________
>> > fipy mailing list
>> > [email protected]
>> >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ctcms.nist.gov_fipy&d=CwICAg&c=c6MrceVCY5m5A_KAUkrdoA&r=oMf1-WHpUHeD7kN3S7612CDdF2TDPqDF9R-n-71Ks1Y&m=k71WczOQwQx8_RK9cU8wRK_X2spChhXjIrj5C0zWgw4&s=ZlwRiPQRsHFfFbNbFOJVXFP8iclTVLa_h-_eiPMxC1k&e=
>> > [ NIST internal ONLY:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__email.nist.gov_mailman_listinfo_fipy&d=CwICAg&c=c6MrceVCY5m5A_KAUkrdoA&r=oMf1-WHpUHeD7kN3S7612CDdF2TDPqDF9R-n-71Ks1Y&m=k71WczOQwQx8_RK9cU8wRK_X2spChhXjIrj5C0zWgw4&s=WMw1oGwKqSZIvp_pqmXAoOYuZceMEUfMPIU1Bbsv32E&e=
>> ]
>>
>>
>> _______________________________________________
>> fipy mailing list
>> [email protected]
>>
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ctcms.nist.gov_fipy&d=CwICAg&c=c6MrceVCY5m5A_KAUkrdoA&r=oMf1-WHpUHeD7kN3S7612CDdF2TDPqDF9R-n-71Ks1Y&m=k71WczOQwQx8_RK9cU8wRK_X2spChhXjIrj5C0zWgw4&s=ZlwRiPQRsHFfFbNbFOJVXFP8iclTVLa_h-_eiPMxC1k&e=
>> [ NIST internal ONLY:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__email.nist.gov_mailman_listinfo_fipy&d=CwICAg&c=c6MrceVCY5m5A_KAUkrdoA&r=oMf1-WHpUHeD7kN3S7612CDdF2TDPqDF9R-n-71Ks1Y&m=k71WczOQwQx8_RK9cU8wRK_X2spChhXjIrj5C0zWgw4&s=WMw1oGwKqSZIvp_pqmXAoOYuZceMEUfMPIU1Bbsv32E&e=
>> ]
>>
>
>
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]