On Thu, 8 Nov 2018, Yuxiang Wang wrote:

> Sorry for the naive question. In short, I have a system with three
> variables (first order Lagrangian elements). I thought that for each of the
> node in the mesh, it would have a DOF attached to it with n_comp==1.
> However, when I used the following code snippet to check, the n_comp is
> actually 0 (not 1).
>
> for (auto node : mesh.node_ptr_range())
>  std::cout << node->n_comp(0, 0) << std::endl;
>
> What I was trying to achieve is to iterate through all the nodes, and
> assign solution values to each variable DOF attached to the node from a
> Eigen::Vector3d. Then I got the error message about:
>
> Assertion `comp < this->n_comp(s,var)' failed.
> comp = 0
> this->n_comp(s,var) = 0
>
> Any help would be appreciated. Thank you!

Are you on a mesh with only first-order geometric elements?  If not
then the higher-order nodes (e.g. the mid-edge nodes on a TRI6) will
have n_comp == 0 for first-order Lagrange variables.
---
Roy


_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to