Using vertex_to_dof_map

Asked by oxidising

I've inherited some code and I'm having problems getting it to compile. I understand that since 1.4.0 there has been the deprecation of member methods vertex_to_dof_map and dof_to_vertex_map.
In this code I have

Mesh myobj_mesh0("file.xml.gz");
Heat::FunctionSpace V_myobj(myobj_mesh);
std::vector<std::size_t> myobj_dof_locations = V_myobj.dofmap()->vertex_to_dof_map( myobj_mesh );

And was getting an error saying vertex_to_dof_map is not a member function (due to the deprecation)
I've made modifications to the third line to make it

std::vector<std::size_t> myobj_dof_locations = vertex_to_dof_map( myobj_mesh );

and now I'm getting

error: invalid initialization of reference of type ‘const dolfin::FunctionSpace&’ from expression of type ‘dolfin::Mesh’

Can anyone point me in the right direction?

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johannes Ring (johannr) said :
#1

FEniCS no longer uses Launchpad for Questions & Answers. Please consult the documentation on the FEniCS web page for where and how to (re)post your question: http://fenicsproject.org/support/

Can you help with this problem?

Provide an answer of your own, or ask oxidising for more information if necessary.

To post a message you must log in.