Projection from fine low order basis function to coarse high order basis function
I have data in a fine mesh which I triangulate and interpolate with linear basis functions. Then I want to represent this data with a coarser mesh but with higher order basis functions. Typically the number of degrees of freedom in my coarser higher order mesh is equal or smaller than the one in the finer low order mesh.
If I do a Least Squares finite element approach to this problem I should get something like this:
<u_l,v> = <u_h,v>
Where u_l is the finite element representation of my function in the fine low order basis and u_h is the representation of my function in the coarse high order basis (the least squares approximation I wish to find) and v are the high order basis functions.
But this is what, I think, the function projection does. So, I tried it and it did not work. I get a piecewise linear representation of the fine mesh but in a coarser mesh. So no use for the high order basis.
This is an example in 1D of what I am talking about. I was expecting F_high_
Thank you
from dolfin import *
# define the expression of the function to interpolate
F_analytical = Expression(
# define the coarse and fine meshes
mesh_fine = UnitIntervalMes
mesh_coarse = UnitIntervalMesh(4)
# define the low and high order function spaces
V_low_order = FunctionSpace(
V_high_order = FunctionSpace(
# project the function into the low order basis function space
F_low_order = project(
# project the function into the high order basis function space
F_high_order = project(
# project from high order to low order to plot with higher resolution
F_high_order_plot = project(
# project from low order to high order
F_high_
# project this new high order into lower order to plot with higher resolution
F_high_
# plot everything
plot(F_low_order)
plot(F_
plot(F_
interactive()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Artur Palha
- Solved:
- Last query:
- Last reply: