← Back to team overview

fenics team mailing list archive

Re: Strange scaling

 

On Wed, Jan 28, 2009 at 12:10:00AM +0100, Artur Poźniak wrote:
> 
> 
> 2009/1/5 Anders Logg <logg@xxxxxxxxx>
> 
>     On Sun, Jan 04, 2009 at 02:29:11AM +0100, Artur Po niak wrote:
>     > 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
> 
>     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))
> 
> 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 ;-)

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.

> 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?

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

Attachment: signature.asc
Description: Digital signature


References