Created
April 17, 2018 10:58
-
-
Save presheaf/52a88007a842825b05beecbbd297c741 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dolfin import * | |
from xii import * | |
N = 20 | |
EPS = 1E-3 | |
_mesh = RectangleMesh(Point(0, -1), Point(1, 1), N, 2 * N) | |
stokes_subdomain = dolfin.CompiledSubDomain( | |
"x[1] > 0", eps=EPS | |
) | |
subdomains = MeshFunction('size_t', _mesh, _mesh.topology().dim(), 0) | |
# Awkward marking | |
for cell in cells(_mesh): | |
x = cell.midpoint().array() | |
if stokes_subdomain.inside(x, False): | |
subdomains[cell] = 1 | |
else: | |
subdomains[cell] = 0 | |
submeshes, interface, _ = mortar_meshes( | |
subdomains, range(2), strict=True, tol=EPS) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment