Hi,
Am 14. Feb 2012, 22:12 schrieb John Chapman <[email protected]>:
> Thanks Guido,
>
> I have two solutions to the same equation in the same domain, but
> potentially with different triangulations, different finite elements
> and, crucially, different hp::DoFHandlers. One is effectively my
> reference solution and the other some refinement. I would like to find
> the difference between them.
>
> I don't think I can use VectorTools::interpolate_to_different_mesh (I
> think this is a new addition to the library) as my underlying finite
> elements may be different (drawn from the same hp::FECollection
> though, but differing element to element - is this what is meant by
> dof1 and dof2 must be drawn from the same finite element
> discretisation' in the VectorTools documentation?
Why not try a two step approach in your case?
Say, you have two triangulations tria_1 and tria_2 with a common coarse
grid, and two dof-handler dof_1 and dof_2 linked to tria_1 resp. tria_2
with potentially different hp::FECollections.
And you want to interpolate u_1 living on dof_1 to u_2 on dof_2.
First step:
- Initialize a third dof-handler dof_3 with tria_2 "but the same"
hp::FECollection as dof_1. (See (b) below.)
- Use VectorTools::interpolate_to_different_mesh to get an interpolation
u_3 on dof_3 ( u_1 on dof_1 --> u_3 on dof_3 )
I'm not sure whether this step will work for the hp::dof_handler "out of
the box":
VectorTools::interpolate_to_different_mesh interpolates by looping over
the finest common grid (with the help of an InterGrid) and getting and
setting values with
source_cell->get_interpolated_dof_values(u1, cache);
destination_cell->set_dof_values_by_interpolation(cache, u2);
So these two functions must
(a) be implemented in the case of an hp::dof_handler and
(b) make sense for the context you're using it:
Basically you must ensure that e.g. tria_2 is a strict refinement
of tria_1 and every cell of dof_2 has the same finite element
ansatz as the corresponding parent cell in dof_1.
Second step:
- Use FETools::interpolate to get the final interpolation u_2 on
dof_2. ( u_3 on dof_3 --> u_2 on dof_2)
As long as tria_2 is a refinement of tria_1 this should give exactly the
interpolation you want.
Best,
Matthias
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii