How to define a tensor space

More
4 years 5 months ago #2869 by Lily
Hi,

I am trying to define a symmetric stress tensor. I wonder if there is any sentence like "TensorL2(mesh, order=1, sym=symmtry) ", and if there is any example that uses tensor space?

Thanks in advance.
More
4 years 5 months ago #2870 by mneunteufel
Hi Lily,

currently there is no "TensorL2" FESpace directly available in NGSolve. You can use copies of L2 to construct a symmetric tensor space. E.g. in 2D
Code:
fesL2 = L2(mesh, order=1) MatrixL2 = FESpace( [fesL2,fesL2,fesL2] ) (uxx,uxy,uyy),(vxx,vxy,vyy) = MatrixL2.TnT() um = CoefficientFunction( (uxx, uxy, uxy, uyy), dims=(2,2)) vm = CoefficientFunction( (vxx, vxy, vxy, vyy), dims=(2,2)) ... gf = GridFunction(MatrixL2) gfm = CoefficientFunction( (gf.components[0],gf.components[1], gf.components[1],gf.components[2]), dims=(2,2) ) Draw(gfm,mesh,"gfm")

Attached you'll find a minimal example where a non-symmetric matrix gets projected.

There are matrix-valued spaces in NGSolve: HDivDiv, HCurlCurl, HCurlDiv (the first two are symmetric, the latter is not). The HDivDiv space is used e.g. in the Hellan-Herrmann-Johnson method for forth-order problems.

Best
Michael

File Attachment:

File Name: matrixl2.py
File Size:1 KB
Attachments:
The following user(s) said Thank You: Manuel Sanchez
Time to create page: 0.114 seconds