Problem resolved - I was using mesh.faceCenters instead of mesh.vertexCoords. gmsh lists vertex coordinates. Thought I should comment what the fix was regardless of how silly it is.
#importing gmsh .msh into fipy from fipy import * import os mesh=Gmsh2D(os.path.splitext(“enter_file_path_to_.msh_file_here_including_ext.")[0]+'.msh',communicator=serial) X,Y=mesh.vertexCoords The coordinates X,Y will match the vertices from gmsh. - Kyle On Dec 19, 2014, at 2:30 PM, Guyer, Jonathan E. Dr. <[email protected]> wrote: > We would need to see an illustration of this to diagnose > > On Dec 19, 2014, at 1:22 PM, Kyle Briton Lawlor <[email protected]> wrote: > >> Ok. Thanks. I will look into that. >> >> I found a way around getting the .msh file. I tried to import a mesh like is >> done in the diffusion.anisotropy example. I created a circular mesh in gmsh. >> Then imported the .msh file in the Gmsh2D() function. However, Gmsh2D() >> seems to be adding extra grid points to the mesh. Why is this? I can know >> exactly how many nodes there are from gmsh and its different from what FiPy >> is showing. >> >> Thanks, >> Kyle >> >> On Dec 19, 2014, at 1:17 PM, Guyer, Jonathan E. Dr. >> <[email protected]> wrote: >> >>> You can use var.cellVolumeAverage, mesh.cellVolumes, and masks (e.g., "x < >>> 5." etc.) to perform integrals like this. >>> >>> >>> On Dec 19, 2014, at 11:48 AM, Kyle Briton Lawlor <[email protected]> >>> wrote: >>> >>>> Hi, FiPy. >>>> >>>> I am using FiPy for a 2D problem on a triangular mesh generated through >>>> gmsh in a circular or annular region. For my problem I need to calculate >>>> some integrals over the mesh for functions of the solution variables. I am >>>> attempting to do this by trying to compute volumes of irregular triangular >>>> prisms. I guess it is worth asking, is there pre-assembled way to do this >>>> in FiPy? >>>> >>>> If not, my question is when I create the mesh with gmsh in FiPy, is there >>>> a way I can get to the .msh file that one can obtain when using gmsh on >>>> its own? I have a way of computing areas for the gmsh mesh if I have that >>>> file. >>>> >>>> Thanks ahead, >>>> Kyle >>>> _______________________________________________ >>>> fipy mailing list >>>> [email protected] >>>> http://www.ctcms.nist.gov/fipy >>>> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] >>> >>> >>> _______________________________________________ >>> fipy mailing list >>> [email protected] >>> http://www.ctcms.nist.gov/fipy >>> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] >> >> >> _______________________________________________ >> fipy mailing list >> [email protected] >> http://www.ctcms.nist.gov/fipy >> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > > _______________________________________________ > fipy mailing list > [email protected] > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
