Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constrain_element_matrix changes the col_dofs vector size #3773

Closed
rebpoli opened this issue Jan 28, 2024 · 3 comments
Closed

constrain_element_matrix changes the col_dofs vector size #3773

rebpoli opened this issue Jan 28, 2024 · 3 comments

Comments

@rebpoli
Copy link

rebpoli commented Jan 28, 2024

I call

dof_map.constrain_element_matrix(matrix, row_dofs, col_dofs, false)

The col_dofs is modified and the size increases by 1.

This is crashing the code, because I use the col_dofs more than once.

Is that supposed to be?

Renato

@jwpeterson
Copy link
Member

It is indeed possible for the size of col_dofs to be changed by a call to

dof_map.constrain_element_matrix(matrix, row_dofs, col_dofs, false)

This is because internally that function calls DofMap::build_constraint_matrix(), passing in col_dofs as an argument,
and within that function we have the following:

  // If we added any DOFS then we need to do this recursively.
  // It is possible that we just added a DOF that is also
  // constrained!
  //
  // Also, we need to handle the special case of an element having DOFs
  // constrained in terms of other, local DOFs
  
  ...
  
      // Add new dependency dofs to the end of the current dof set
      elem_dofs.insert(elem_dofs.end(),
                       dof_set.begin(), dof_set.end());
  

@rebpoli
Copy link
Author

rebpoli commented Jan 30, 2024 via email

@jwpeterson
Copy link
Member

Closing because I don't think this is really an Issue so much as a clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants