← Back to team overview

dolfin team mailing list archive

Re: [Question #153453]: more than 2 subdomains in 2D?

 

Question #153453 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/153453

    Status: Answered => Open

Achim Schroll is still having a problem:
the following script only works for 0 <= marker <= 1.
why is that and how do you then mark more than 2 (different) subdomains?
achim.

from dolfin import *

mesh = UnitSquare(62, 62)
V = FunctionSpace(mesh, "CG", 1)

class OmegaSub(SubDomain):
    def inside(self, x, on_boundary):
        return True if x[0] <= 0.5 else False

marker = 1

subdomains = MeshFunction('uint', mesh, 2)
subdomain = OmegaSub()
subdomain.mark(subdomains, marker)

l2 = assemble(Constant(1.0)*dx(marker), mesh=mesh, cell_domains=subdomain)
print "L2 norm = %g"%(sqrt(l2))

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



References