Subject: [FEniCS-users] How to get det(F) from displacement

From: Chong Luo <[email-masked]>
Date: Wed, 30 Sep 2009 07:26:08 -0700 (PDT)

Suppose I use fenics to solve incompressible elasticity, and get the
displacement u. Now I want to check if the incompressibility is well
satisfied, and want to plot the field (det(F)-1), where F = I+grad(u).
Is there any way in fenics to do it?

Thank you!

Best,
Chong

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 30 Sep 2009 15:30:34 +0100

> Is there any way in fenics to do it?

Set up a variational problem to project (det(F)-1) onto a scalar P0 
basis. You can then plot the scalar function using ParaView.

Garth

> Thank you!
> 
> Best,
> Chong
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> FEniCS-users mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/fenics-users

---

From: Anders Logg <[email-masked]>
Date: Wed, 30 Sep 2009 16:45:07 +0200

> basis. You can then plot the scalar function using ParaView.

It should also be possible to plot it directly, at least from Python:

  plot(det(F) - 1)

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 30 Sep 2009 15:46:51 +0100

> It should also be possible to plot it directly, at least from Python:

Will Python perform a projection? If so, onto which basis?

Garth

---

From: Anders Logg <[email-masked]>
Date: Wed, 30 Sep 2009 17:46:55 +0200

> Will Python perform a projection? If so, onto which basis?

Yes, onto piecewise linears.

The plot() function will check if the input is a Function, Mesh or
MeshFunction and if so plot it. Otherwise, it will try to project it
to piecewise linears and then plot it.

--
Anders

---

From: Chong Luo <[email-masked]>
Date: Wed, 30 Sep 2009 15:23:22 -0700 (PDT)

It worked. Thank you for the idea!

Best,
Chong

________________________________
From: Garth N. Wells <[email-masked]>
To: Chong Luo <[email-masked]>
Cc: [email-masked]
Sent: Wednesday, September 30, 2009 9:30:34 AM
Subject: Re: [FEniCS-users] How to get det(F) from displacement

Chong Luo wrote:
> Suppose I use fenics to solve incompressible elasticity, and get the displacement u. Now I want to check if the incompressibility is well satisfied, and want to plot the field (det(F)-1), where F = I+grad(u). Is there any way in fenics to do it?
> 

Set up a variational problem to project (det(F)-1) onto a scalar P0 basis. You can then plot the scalar function using ParaView.

Garth