← Back to team overview

dolfin team mailing list archive

[Question #136385]: Please clarify behavior of "exterior_facet_domains"

 

New question #136385 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/136385

Hello -- I could not find documentation on how to use "exterior_facet_domains" correctly. By trial and error I observed the following confusing behavior (python file below).  I will appreciate any clarification on how to use this option correctly. Thanks! --Jay 

--------------------------

from dolfin import *

msh =  UnitSquare(2,2)
g = Constant(3.)
g1 = Constant(1.)

# boundary part
class Top(SubDomain):  
    def inside(self, x, on_boundary):
        return on_boundary and abs(x[1]-1) < DOLFIN_EPS
boundary_parts = MeshFunction("uint", msh, msh.topology().dim()-1)
boundary_parts.set_all(0)
Gamma = Top() 
Gamma.mark(boundary_parts, 1)

# assemble a form
U = FunctionSpace(msh, 'Raviart-Thomas', 2)
v = TestFunction(U)
n = FacetNormal(msh)
L = g*ds +  g1*ds(1)   

# unfortunately, assembling L in 3 ways, we obtain 3 different values 
b1 = assemble( L, exterior_facet_domains=boundary_parts,mesh=msh)
b2 = assemble( L, mesh=msh)
b3 = assemble( g*ds, mesh=msh) + \
     assemble( g1*ds(1), exterior_facet_domains=boundary_parts, mesh=msh)

print  (b1, b2, b3)  # only b3 gives the correct value


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



Follow ups