On Thu, Dec 12, 2013 at 10:59 AM, Andrew Donaldson Davis
<davi...@mit.edu> 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

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to