I have generated a gmsh mesh that I imported into FiPy via Gmsh2D. I would like to adress the surface Faces to set boundary conditions but I did not know how to.
In FiPy examples I found in the documentation it is suggested to name certain lines to address them later. How do I do this after I imported the mesh into fipy?
// note: if you do not use any labels, all Cells will be included.
Physical Surface("Outer") = {1};
Physical Surface("Middle") = {2};
Physical Surface("Inner") = {3};
// label the "north-west" part of the exterior boundary
// note: you only need to label the Face elements
// (Physical Line in 2D and Physical Surface in 3D) that correspond
// to boundaries you are interested in. FiPy does not need them to
// construct the Mesh.
Physical Line("NW") = {5};
-----------------
Edit:
For simple surface faces this will work:
I overlooked mesh.exteriorFaces
.
For a simple circle this leads to the simple solution:
xfc, yfc = mesh.faceCenters() # returns x faceCenters coordinate, ...
xcc, ycc = mesh.cellCenters()
plot(xfc[where(mesh.exteriorFaces == False)],yfc[where(mesh.exteriorFaces == False)],'ro', label='inside')
plot(xfc[where(mesh.exteriorFaces == True)],yfc[where(mesh.exteriorFaces == True)],'ko', label='surface')
legend()
Nevertheless i am still searching for an answer on how to access the gmsh code from outside, but maybe this helps others:)