Subject: Re: [FFC-dev] stable finite element for incompressible nonlinear elasticity?

From: Anders Logg <[email-masked]>
Date: Tue, 25 Mar 2008 09:38:20 +0100

Try adding the option -r quadrature when compiling.

-- 
Anders

On Mon, Mar 24, 2008 at 05:39:22PM -0700, Chong Luo wrote:
> Thank you for the hint. P. Le Tallec also suggested in his book to try those
> (V_h, P_h) that are stable for Stokes problem.
> However, for some reason, the form file with Taylor-Hood elements (P2-P1) does
> not compile.
> I got a "MemoryError".
> 
> The form file NeoHookean.form:
> vector = VectorElement("Lagrange", "tetrahedron", 2)
> scalar = FiniteElement("Lagrange", "tetrahedron", 1)
> mixed = vector+scalar
> v = TestFunction(mixed)
> u = TrialFunction(mixed)
> U0 = Function(mixed)
> ...
> a = aa(u,v)*dx+bb(pr(u),v)*dx+bb(pr(v),u)*dx
> def L1(v):
>     return aa(U0,v)*dx-2*c10*dot(defgrad(vel(U0)),grad(vel(v)))*dx+dot(vel
> (v),f)*dx+dot(vel(v),g)*ds
> def L2(v):
>     return bb(pr(v),U0)*dx+pr(v)*(detF(U0)-1)*dx
> L = L1(v)+L2(v)
> 
> 
> The error:
>     A0 = ReferenceTensor(m, facet0, facet1)
>   File "/home/grad/luoxx039/local/lib/python2.5/site-packages/ffc/compiler/
> representation/tensor/referencetensor.py", line 28, in __init__
>     self.A0 = integrate(monomial, facet0, facet1)
>   File "/home/grad/luoxx039/local/lib/python2.5/site-packages/ffc/compiler/
> representation/tensor/monomialintegration.py", line 59, in integrate
>     A0 = __compute_product(psis, monomial.numeric * weights)
>   File "/home/grad/luoxx039/local/lib/python2.5/site-packages/ffc/compiler/
> representation/tensor/monomialintegration.py", line 242, in __compute_product
>     B = numpy.multiply.outer(B, Psi[ tuple([q] + [b[i] for i in bpart])])
> MemoryError
> 
> On the other hand, the one with (P1-P1) does compile, but the computation is
> not stable. What a life ...
> 
> Also, maybe my NeoHookean.form is too complicated, it takes a lot of time (5-10
> minutes) to compile the form file.
> And the size of NeoHookean.h is 4.8M, so it also takes a lot of time to compile
> main.cpp. Is there any way to speed up the compiling?
> 
> Thank you!
> 
> 
> Best,
> Chong Luo
> 
> ----- Original Message ----
> From: Anders Logg <[email-masked]>
> To: [email-masked]
> Sent: Monday, March 24, 2008 6:17:13 PM
> Subject: Re: [FFC-dev] stable finite element for incompressible nonlinear
> elasticity?
> 
> On Sun, Mar 23, 2008 at 03:44:31PM -0700, Chong Luo wrote:
> > Hi,
> >
> > I implemented 3D incompressible nonlinear elasticity (for neo-Hookean
> > materials) using FEniCS.
> > However, the iteration didn't converge.
> > The finite element spaces I chose are Lagrange element of degree 1 in
> > tetrahedron.
> >
> > I saw in P.Le Tallec's book (Handbook of Numerical Analysis, Vol III) that
> some
> > finite element spaces are stable (like Ruas finite element), while others are
> > not.
> > But it seems that Ruas finite element is not available in FEniCS.
> >
> > My question is, what are the possible choices of finite element spaces in
> > FEniCS
> > that would make 3D incompressible nonlinear elasticity stable?
> >
> > Thank you!
> >
> > Best,
> > Chong Luo
> 
> I have absolutely no idea, but why not try Taylor-Hood (P2-P1) or
> adding stabilization. See the Stokes demos in DOLFIN.
>

---

From: Andy Ray Terrel <[email-masked]>
Date: Tue, 25 Mar 2008 09:04:06 -0500

> main.cpp. Is there any way to speed up the compiling?

You need to add stabilization terms for P1-P1 to be a stable stokes 
element this is why the bilinear form has the delta*dot(grad(q), 
grad(p)) term in it.   I can't really see what is going on in your form 
but it appears that you are setting your trial and test functions to be 
the entire mixed space, this seems incorrect behaviour but it really 
depends on the parts that were left out of the form posted to the list.

Another step is to try a P1-P0 element, this won't be as large (or 
accurate) as the P2-P1 element but should be more stable than just P1-P1 
with no stabilization terms.  For a long list of stable stokes elements 
I recommend Brezzi-Fortin.

When compiling with very large .h files generated from ffc, one speedup 
I have found is to turn off all compiler optimizations.  (in g++ do -O0)

Andy