This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Impose integral value on a part of the boundary

0 votes

Hello,
I solve a linear elastic problem with boundary conditions :

  • one part of the boundary is clamped

  • and on one part I want to impose the value of the integral using a Lagrange Multiplier :

              int_\Gamma_1 \sigma . n ds  = R_n
    

where R_n is known.

Do you know if it is possible to do this ?
Thanks by advance

asked Jan 23, 2017 by stephanepa FEniCS Novice (350 points)

1 Answer

+1 vote

Hi, seems like the constraint can be enforced with Lagrange multiplier in FunctionSpace(mesh, 'R', 0), i.e. single dof/value on whole mesh. Consider

from dolfin import *

mesh = UnitSquareMesh(40, 40)
f = Expression('sin(k*pi*x[1])+cos(k*pi*x[0])', k=5, degree=3)
g = Constant(1)
u0 = Constant(0)

V = FiniteElement('Lagrange', mesh.ufl_cell(), 1)
Q = FiniteElement('Real', mesh.ufl_cell(), 0)
W = MixedElement([V, Q])

W = FunctionSpace(mesh, W)
bc = DirichletBC(W.sub(0), u0, 'near(x[1], 0)')

u, p = TrialFunctions(W)
v, q = TestFunctions(W)

right = CompiledSubDomain('near(x[0], 1)')
bdries = FacetFunction('size_t', mesh, 0)
right.mark(bdries, 1)

ds1 = Measure('ds', domain=mesh, subdomain_data=bdries, subdomain_id=1)

a = inner(grad(u), grad(v))*dx + inner(p, v)*ds1 + inner(q, u)*ds1
L = inner(f, v)*dx + inner(g, q)*ds1

w = Function(W)
solve(a == L, w, bc)

u, _ = w.split(deepcopy=True)
plot(u)
interactive()

print assemble(u*ds1)
answered Jan 23, 2017 by MiroK FEniCS Expert (80,920 points)
edited Apr 24, 2017 by MiroK

Thanks
I looked at this exemple : the Lagrange multiplier is defined on the whole domain.
But I dont know how to define a Lagrange multiplier only on one part of the boundary.
My best

Hi,
Did you solve your question? I would also like to impose an integral boundary condition. For example, net flux along an internal boundary needs to be zero.
Thanks in advance

...