Subject: [FEniCS-dev] Strange scaling

From: "Artur Poźniak" <[email-masked]>
Date: Sun, 4 Jan 2009 02:29:11 +0100

Hello,

I faced such a strange behavior: when making the UnitSquare(n,n) two times
denser i.e. (2n,2n) the resulting strain components are exactly two times
smaller. Any idea why is that?

I used different solvers, both (quad. and tensor) representations.

thanks
Art

---

From: Anders Logg <[email-masked]>
Date: Mon, 5 Jan 2009 18:18:05 +0100

> I used different solvers, both (quad. and tensor) representations.

How do you compute the strain? I've checked with the elasticity demo
in DOLFIN and don't see this behaviour. You can plot components of the
strain by for example

  plot(u[1].dx(0))

Please direct further correspondence to [email-masked].

-- 
Anders

---

From: Artur Poźniak <[email-masked]>
Date: Wed, 28 Jan 2009 00:10:00 +0100

2009/1/5 Anders Logg <[email-masked]>

> in DOLFIN and don't see this behaviour. You can plot components of the
I meant displacements, not strains.
In elasticity demo you have given mesh in xml file so you don't change its
number of nodes or correct me if I'm wrong.
I still observe the strange displacement(number_of_nodes) as f(x)
dependence. But what I do is import from vtk files to Mathematica (row by
row) and perhaps I lost some scale factor?
What should I add to the *.form file to make plot(u[1].dx(0)) work (in C++
version)? Cause it says (Sub)Function has no member dx, what seems quite
obvious ;-)

Sorry if its too lame, but how could I access and export the \sigma_{ij}
(stress tensor defined in a *.form file) to any file?

Thanks in advance
Artur

---

From: Anders Logg <[email-masked]>
Date: Thu, 29 Jan 2009 10:11:36 +0100

On Wed, Jan 28, 2009 at 12:10:00AM +0100, Artur Poźniak wrote:
>     On Sun, Jan 04, 2009 at 02:29:11AM +0100, Artur Po niak wrote:
>     > Hello,
>     >
> I still observe the strange displacement(number_of_nodes) as f(x) dependence.
> But what I do is import from vtk files to Mathematica (row by row) and perhaps
> I lost some scale factor?

Plotting expressions does not work from C++, only from Python. In C++
you need to define a form for projecting your expression to some
suitable function space (like piecewise linears) and then plot the
resuting function.

> (stress tensor defined in a *.form file) to any file?

You need to compute the displacement field u, then feed that into a
form file to project sigma(u) to some suitable space so you get it as
a Function which you may then plot.

Try the Python interface, then you may do things like

  plot(sigma(u)[0][0])

-- 
Anders