Hello everyone,
I’m a new user of Fenics and I can’t find a simple way to define boundary conditions. I have a linear elasticity problem with pure Neumann boundary conditions. I apply exact expressions of stresses \sigma_{ij} on the external boundary. So, when we talk about the linear term in the weak formulation \int_{ \partial\Omega } (\sigma \cdot n) \cdot v, I’m going to substitute exacte functions for each component of tensor.
The best code would be
n = FacetNormal(mesh)
L = dot( dot( sigma, n ), v )*ds
but I don’t understand how to define a tensor of Expressions. Of cause, I can calculate each term of the final sum, but maybe you know a “smarter” way for this?
In general, we use Expressions to define Dirichlet conditions, for example
u_D = Expression(’1 + x[0]*x[0] + 2*x[1]*x[1]’, degree=2)
but in my case the functions aren’t expressed as polynomials, so there will be a small error after the interpolation in the FE space. I would like to apply exacte values of the functions instead of their FE representations.
How can I do it?
And the third question. Can we use a python (instead of C++) expression of functions in the Expression?
Thank you for your attention!