gdmcbain / fenics-tuto-in-skfem

reproducing the examples from the FEniCS tutorial in scikit-fem
14 stars 1 forks source link

check 06-elasticity #3

Closed gdmcbain closed 5 years ago

gdmcbain commented 5 years ago

The solution in 06_elasticity hasn't been quantitatively checked. A quick visual comparison with the FEniCS solution, opening them simultaneously in ParaView, seemed to show an anomalous sideways displacement in the present solution. By symmetry, I don't think there should be a net sideways effect.

gdmcbain commented 5 years ago

The 'sideways' direction here is y. Actually it's much smaller in scikit-fem

u[basis.nodal_dofs].sum(axis=1)

array([-1.58484337e-14, -1.18547937e-02, -1.27821300e+01])

than in FEniCS!

u.compute_vertex_values().reshape((3, -1)).sum(axis=1)

array([ -0.02251172, 0.92770099, -11.26352845])

gdmcbain commented 5 years ago

Here is a superposition of the two solutions; the anomalous leftward (+y) deformation from FEniCS is clearly visible.

sideways

Figure:— Deformed beams: (coloured) FEniCS, (grey, with elements) scikit-fem

gdmcbain commented 5 years ago

The problem seems to go away in FEniCS with mesh refinement; using

nmesh = 2**0
mesh = BoxMesh(Point(0, 0, 0), Point(L, W, W), 10*nmesh, 3*nmesh, 3*nmesh)

and

u.compute_vertex_values().reshape((3, -1)).mean(axis=1)

the mean vertex sideshift reduces to

nmesh v
1 0.00527103
2 2.56439808e-03
4 8.04848519e-04