Subject: [FEniCS-users] new user, neumann BC

From: Nicola Cocca <[email-masked]>
Date: Mon, 17 Aug 2009 10:25:55 +0000 (GMT)

Hi, First of all Thanks for a really interesting approach to FEM. I'm new to FEniCS and I'm just trying working out some simple exercises. First step is understanding how to treat Neumann BC.

I attacked the simple formulation:

a     = ( dot( grad(u), grad(v) ) )*dx
L     = f*v*dx
( for all v in H_0^2 )

 Now, the atsk is how to model H_0^2 spaces. Maybe I should treat the Neumann part in FFC adding a linear term... tried something but didn't work.
Please send me a hint!

---

From: Anders Logg <[email-masked]>
Date: Mon, 17 Aug 2009 12:59:30 +0200

On Mon, Aug 17, 2009 at 10:25:55AM +0000, Nicola Cocca wrote:
> Hi, First of all Thanks for a really interesting approach to FEM. I'm new to
> FEniCS and I'm just trying working out some simple exercises. First step is
> understanding how to treat Neumann BC.
>
> Now, the atsk is how to model H_0^2 spaces. Maybe I should treat the Neumann
> part in FFC adding a linear term... tried something but didn't work.
> Please send me a hint!

Just add it to the form:

  L = f*v*dx + v*g*ds

This adds a Neumann condition du/dn = g on the part of the boundary
where g is nonzero.

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 17 Aug 2009 12:16:06 +0100

Nicola Cocca wrote:
> Hi, First of all Thanks for a really interesting approach to FEM. I'm 
> new to FEniCS and I'm just trying working out some simple exercises. 
> First step is understanding how to treat Neumann BC.
> 
> Now, the atsk is how to model H_0^2 spaces. 

Take a look at

The '_0' part is handled on the DOLFIN side in the application of 
boundary conditions. Take a look at

   demo/pde/poisson/cpp

Is there a special reason why you want H^2 functions rather H^1? FFC 
(via FIAT) does not currently provide any H^2 functions (I believe that 
Rob is currently working on this in FIAT). If you want to solve a 
fourth-order problem look at

   demo/pde/dg/biharmonic/cpp

If it's the biharmonic equation that you're interested in, it's 
straightforward to construct a stable mixed scheme using equal order H^1 
conforming P^k elements. The Cahn-Hilliard demo

   demo/pde/cahn-hilliard/cpp

uses this approach.

Garth

Maybe I should treat the
> Neumann part in FFC adding a linear term... tried something but didn't work.
> Please send me a hint!
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> FEniCS-users mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/fenics-users