[dune-fem] Interpolation of discrete function over a different grid
Agnese, Marco
m.agnese13 at imperial.ac.uk
Thu Oct 8 13:09:11 CEST 2015
Hi Martin,
> have a look at 'dune/fem/space/common/interpolate.hh'. It does exactly the
> same for Lagrange functions.
Inside the interpolate function it extracts the local function and uses the space local interpolate since the two df are defined on the same grid so they have the same entities.
Unfortunately I cannot do this.
> As the grids differ, you evaluate df1 in global coordinates. Please note that
> in general every evaluation requires a grid traversal due to the
> HierarchicSearch used internally. If grid2 is SPGrid, you may safely use this
> approach, because SPGrid specializes the HierarchicSearch utility in an
> efficient manner.
I use an unrefined Alberta grid.
Do you know which is the computational cost of evaluate in global coordinates?
Does it needs to loop over all the entities until it finds the entity which contains the point and than evaluate the df?
If so, in my case it should be very expensive since it would be O(#entitties).
> Depending on your problem, you might want to invest additional development
> time at this point.
I am willing to do it but right now I don't see a way to improve the situation. So any suggestions is more than welcomed!
Hi Claus,
> are both grids totally arbitrary, or are they somehow related in terms
> of mesh adaptation?
it depends. I am solving a two phase Navier-Stokes problem using a fitted mesh.
At each time step my interface moves and I have to move also my bulk mesh to avoid a quick degradation of the mesh quality.
Sometimes I perform only a mesh smoothing and in this case grid2 is exactly grid1 with the vertices slightly displaced.
In this case it should be possible to adopt a more clever approcah than the one suggested by me.
Sometimes the mesh smoothing is not sufficient and I have to recreate the mesh from scratch keeping fixed only the interface and the domain boundary.
In this case there is no further relation between the two grids.
For seek of completeness, the discrete function which I need to interpolate is the velocity.
Cheers,
Marco.
More information about the dune-fem
mailing list