There is also a .physicalFaces field defined for a gmsh mesh. > On May 11, 2017, at 6:39 PM, Zhekai Deng <zhekaideng2...@u.northwestern.edu> > wrote: > > Hi All, > > I wonder is there any way to specify the FaceVariable based on the naming > from gmsh ? For example, I name my sub domain in gmsh as "top" and "bottom". > In Fipy, I would like to do something similar to following: > > velocityX_Top = (1-Epsilon*Epsilon)/(Epsilon*Epsilon)*(yFace + > Epsilon*np.sqrt(1-xFace*xFace)) > velocityY_Top = > (1-Epsilon*Epsilon)/Epsilon*(xFace*yFace)/(np.sqrt(1-xFace*xFace)) > velocityX_Bottom = yFace > velocityY_Bottom = -xFace > > velocityVector = FaceVariable(mesh=mesh.physicalCells["top"], rank=1) > velocityVector[0] = velocityX_Top > velocityVector[1] = velocityY_Top > > velocityVector = FaceVariable(mesh=mesh.physicalCells["bottom"], rank=1) > velocityVector[0] = velocityX_Bottom > velocityVector[1] = velocityY_Bottom > > I think it gives me error because the mesh.physicalCells is cell index, not > face index. But is there any way I could do get all face index using sub > domain ID? > > I have attached the complete and minimal code to demonstrate what I try to > achieve. > > Thanks! > > Zhekai > > <example.py>_______________________________________________ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
_______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]