From: John Peterson <jwpeterson@gm...>  20131212 18:09:28

On Thu, Dec 12, 2013 at 10:59 AM, Andrew Donaldson Davis <davisad@...> wrote: > Hi, > > I am trying to get the spatial points corresponding to the degrees of > freedom for a specific variable in a libMesh::System. However, I am having > some trouble if the degree of the variable's shape functions is less than > the mesh. Here is the code I am using > > int varNum = 0 > set<libMesh::dof_id_type> dofIndices; > system.local_dof_indices(varNum, dofIndices); > > const libMesh::MeshBase& mesh =system.get_mesh(); > > for (auto dofIter = dofIndices.begin(); dofIter != dofIndices.end(); > ++dofIter) { > libMesh::Point pt = mesh.point(*dofIter); > cout << pt << endl; > } > > This works fine if, for example, varNum is order 2 and the mesh is > libMesh::QUAD9. However, if varNum is linear (order) and the mesh still > libMesh::QUAD9 I am not getting the correct subset of mesh points. It > looks like the set dofIndices contains the numbers 1,2,3,...,N, which I > believe give the first N points in the mesh. I expected dofIndices not to > contain sequential numbers. Shouldn't it skip some on each element > (corresponding to the DOFs that aren't used by the basis)? Does anyone > know a better way to accomplish this? I guess it would depend on the node numbering in your mesh? Is it possible that the first N nodes are actually the corner vertices of the QUAD9s and hence correspond to the DOF ids for the linear finite element? Is your mesh created via build_square()?  John 