Hi,
I need to solve a velocity-pressure equation, where we know that the pressure only depends on one variable. Right now I have:
mesh = UnitSquareMesh(30, 30)
V= VectorElement(“Lagrange”, mesh.ufl_cell(), degree = 2, dim = 2)
P = FiniteElement(“Lagrange”, mesh.ufl_cell(), degree = 1)
TH = V * P
VP = FunctionSpace(mesh, TH)
But I would like to have something like
mesh = UnitSquareMesh(30, 30)
mesh_p = UnitIntervalMesh(30)
V= VectorElement(“Lagrange”, mesh.ufl_cell(), degree = 2, dim = 2)
P = FiniteElement(“Lagrange”, mesh_p.ufl_cell(), degree = 1)
TH = V * P
VP = FunctionSpace(mesh, TH),
and then to define a up function on VP and solve for up. Of course this does not work as I get “Sub elements must live on the same cell.”, as P is defined only on mesh_p. Which makes sense, but how could I make fenics understand that P should be defined on the whole 2D space, it is just that along the second variable it is constant? So, it is one-dimensional in dependence, but defined in 2D using the same value from 1D as a constant.
Thanks so much for any ideas.