Hello everybody,
I have a Function f : \Omega \subset \mathbb{R}^3 \to \mathbb{R} with
f \in H^1_0(\Omega) and i want to calculate \nabla f \in H_0(curl)
My function is
f(x)=sin(\pi \cdot x_1)\cdot sin(\pi \cdot x_2)\cdot sin(\pi\cdot x_3)
and I know that
\nabla f(x)= \left( \begin{array}{c} \pi\cdot cos(\pi\cdot _1)\cdot sin(\pi \cdot x_2)\cdot sin(\pi \cdot x_3) \\ \pi \cdot sin(\pi \cdot x_1) \cdot cos(\pi \cdot x_2)\cdot sin(\pi \cdot x_3) \\ \pi \cdot sin(\pi \cdot x_1) \cdot sin(\pi \cdot x_2)\cdot cos(\pi \cdot x_3) \end{array}\right)
I have some questions:
-how I have to define f? I tried
pi = math.pi
eta = Expression('sin(pi*x[0])+sin(pi*x[1])+sin(pi*x[2])', degree=1)`
Is this so ok?
-how can i set \nabla f manually and what I have to do so that Fenics computes it automatically?
from dolfin import*
mesh = UnitCubeMesh(10, 10, 10)
V = FiniteElement("N1curl", mesh.ufl_cell(), 1)
S = FiniteElement("Lagrange", mesh.ufl_cell(), 1)
Y = VectorFunctionSpace(mesh, 'P', 1)
Z = V * S
W = FunctionSpace(mesh, Z)
Thanks for your help.
Noya