Thanks Guido,

I thought that this might be the case after the difficulty I was having making it work! I will outline my what I want to achieve and then perhaps it will become clear why I was trying to extract the locations of the dofs. I have started a new thread to help people searching the newsgroups in future.

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? http://www.dealii.org/developer/doxygen/deal.II/namespaceVectorTools.html#a6c3d07284fa93f50f53176a751f2f3ee).

Therefore my plan was to loop over each cell in one of the meshes, find the list of dof indices on that cell, find their true Point<dim> location then populate a new vector using VectorTools::point_value(other_dof_handler, other_solution, point, value). Not efficient, perhaps, but pretty robust. Then I could simply subtract the two vectors and use VectorTools::integrate_difference.

Of course I realise that I was thinking of the solution vectors in the incorrect way - like a list of x,y,z values not a list of values describing the dof structure of the elements.

I think I should try again with VectorTools::interpolate_to_different_mesh and see if I can make it work.

Perhaps I should be just creating an FEFieldFunction and then feeding that into integrate_difference?

Many thanks with any suggestions.

John


On 14/02/12 17:20, Guido Kanschat wrote:
John, there is no correspondence between dofs and locations. It
depends very much on the finite element, whether such a correspondence
is possible at all. For instance for the elements based on orthogonal
polynomials, it is not.

If you are using Lagrange elements, these are based on interpolation.
Thus ,the closest to the location of a dof would be the location of
the support point of its associated interpolating function. FE_Q has a
function support_point(i), which returns this location for dof i on
the reference cell. Then, you can just map it to the actual cell.

Does this help?
Best,
Guido

On Sun, Feb 12, 2012 at 5:53 AM, John Chapman<[email protected]>  wrote:
How can I find the true location of a degree of freedom?

I have a finite element solution vector of the same length as the number of
degrees of freedom. If I know the index of the degree of freedom I would
like to know the location of the degree of freedom so I can use
VectorTools::point_value to get the value of a different solution at the
same point (which comes from a different dof_handler defined on the same
grid). I don't want to/can't use VectorTools::interpolate as I am working
with hp.

I think there must be some correspondence between dofs and locations, but I
can't work out how to extract it. I was going to use support points, but I
am dealing with discontinuous elements so the cells don't have any.

Thanks,

John
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii


_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to