On Mon, 20 Jan 2014 15:17:14 -0800 Nikolaus Rath <[email protected]> wrote:
> On 01/20/2014 02:13 PM, Nikolaus Rath wrote: > > On 01/18/2014 04:12 AM, Jan Blechta wrote: > >> On Fri, 17 Jan 2014 16:54:27 -0800 > >> Nikolaus Rath <[email protected]> wrote: > >> > >>> On 01/09/2014 11:19 AM, Jan Blechta wrote: > >>>>>>> I would like to solve the following equation (which does not > >>>>>>> directly come from a PDE): > >>>>>>> > >>>>>>> \int dV f(x) * \partial_r g(x) = \int dA u(x) * \partial_n > >>>>>>> g(x) > >>>>>>> > >>>>>>> f(x) is known, u(x) is unknown, and the equation should hold > >>>>>>> for any g(x) that satisfy Laplace's equation. > >>>>>>> > >>>>>>> In other words, I'm looking for a weight function u(x), such > >>>>>>> that the surface integral of the normal derivative of any g(x) > >>>>>>> (weighted by u) gives the same result as the volume integral > >>>>>>> of the radial derivative of > >>>>>>> g(x) (weighted by the known function f(x)). > >>>>>>> > >>>>>>> Is it possible to do this with FEniCS? > >>>>>>> It seems that the equation itself is easy to express in UFL, > >>>>>>> but I am not sure how do deal with the fact that there are no > >>>>>>> boundary conditions, and that any trial function g(x) needs to > >>>>>>> satisfy Laplace's equation. > >>>>>> > >>>>>> Yes. Look at the demo > >>>>>> > >>>>>> demo/documented/neumann-poisson > >>>>>> > >>> [...] > >>>>> > >>>>> However, even after going through the example, I'm not sure how > >>>>> I can tell FEniCS to use only trial functions satisfying > >>>>> Laplace's equation. In the example, the constraint on the test > >>>>> functions seems to fix just the constant offset. It's not clear > >>>>> to me to extend this to something more complicated, where the > >>>>> constraint itself takes the form of a PDE. Do you think you > >>>>> could explain in a bit more detail? > >>>> > >>>> You change the constraint to Laplace problem, and the space R for > >>>> Lagrange multiplier and corresponding test function to some > >>>> appropriate FE subspace of Sobolev space W_0^{1,2}. Hint: > >>>> http://en.wikipedia.org/wiki/Lagrange_multipliers_on_Banach_spaces > >>> > >>> > >>> Alright, I did quite a bit of reading now (mostly Gockenbach, also > >>> looked into Bhatti, Reddy and Strang), and I think I got the part > >>> about natural/essential vs Neumann/Dirichlet boundary conditions > >>> (and also got a lot more understanding of the finite element > >>> method itself). Thanks for the pointers! > >>> > >>> > >>> However, I am still struggling to combine the finite element > >>> method with Lagrange multipliers. I think I have a good handle on > >>> Lagrange multipliers for constrained optimization of a scalar > >>> function or integral, but I fail to transfer this to FE. > >> > >> Ok, potential for Poisson problem is > >> > >> \Psi(u) = 1/2 \int |\nabla u|^2 - L(u) > > > > Ah, the potential is the starting point. Thanks! > > > >> So if you want to minimize \Psi on V = H^1(\Omega) subject to > >> constraint \int u = 0, you do can try to find a minimum (u, c) \in > >> (V \times R) of > >> > >> \Psi(u) - c \int u > >> > > > > My apologies if I'm slow, but why would I want to find a minimum > > (u,c) \in (V * R)? It seems to me that I don't want to find a > > specific value c -- I want a minimum u \in V \forall c. > > Nevermind that question. Since c is the Lagrange multiplier of course > we need to solve for it. I got confused because I didn't see any > additional constraint equations being used to actually determine the > value. But that is just because of the special case \int u = 0, > correct? > > For the more general case \int u = u0, am I right that we'd need to > set up an extra term in the linear form? > > (u, c) = TrialFunction(W) > (v, d) = TestFunctions(W) > g = Expression("-sin(5*x[0])") > a = (inner(grad(u), grad(v)) + c*v + u*d)*dx > L = g*v*ds + Constant(u0) * d * dx Correct. Jan > > > Best, > Nikolaus _______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
