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

Fix given displacement BC's of FEA solver and CElasticityMovement #658

Merged
merged 5 commits into from
Mar 1, 2019

Conversation

pcarruscag
Copy link
Member

Proposed Changes

Problem: If a given displacement boundary was cut during partitioning the solver would give wrong results.
Reason: When "de-singularizing" the stiffness matrix the column was only being deleted by the rank that owned the corresponding node.
Fix: All ranks delete the column (and update the load vector).

Before:
image

After:
image

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.

@vdweide
Copy link
Contributor

vdweide commented Feb 22, 2019

Did you check whether the results are identical, independent of the number of MPI ranks?

@pcarruscag
Copy link
Member Author

I sure did. What I did not do was reproduce the problem in CElasticityMovement, that is only used for FSI and I only have 2D FSI cases, for which it is less probable that the boundaries will be cut.

@pcarruscag
Copy link
Member Author

This had to be more intricate than first impressions suggested...
The displacements applied by CElasticityMovement to FSI interfaces come from the vertices, but halo vertices do not have the correct (i.e. communicated) coordinates which means for those the force vector contributions were not being computed correctly.
The known blocks (prescribed displacement) of the displacement vector are now set and communicated before "de-singularizing" the matrix, that process then grabs displacements from the displacement vector instead of from the vertices.

Copy link
Member

@economon economon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one comment

else{
StiffMatrix.SetBlock(iNode,jPoint,matrixId);
}
if (iNode != jPoint) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several places where you do a similar operation as to what is done here.. have you considered reusing something like StiffMatrix.DeleteValsRowi() or creating a new version that suits what you are doing here within the matrix class to save some code by calling it instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes definitely, especially since these operations can be performed more efficiently if the sparsity pattern is know. And there are other areas too, for example we currently add the contribution of the mass matrix to the stiffness matrix in a similar block by block way. But I would prefer to address all of those in one PR and avoid creating conflicts between ongoing PR's.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think creating a StiffMatrix.DeleteValsColi() would do the job. There is some room for code saving in all of this implementation, but I agree with @pcarruscag, that could be done in an additional PR.

Copy link
Contributor

@rsanfer rsanfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pcarruscag,
nice catch! This should have a positive impact on the parallel behaviour of the mesh adjoint, which required some particular treatment back in time to get it working. I've synced the PR with develop and will get it merged as soon as the tests pass.
Thanks!

else{
StiffMatrix.SetBlock(iNode,jPoint,matrixId);
}
if (iNode != jPoint) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think creating a StiffMatrix.DeleteValsColi() would do the job. There is some room for code saving in all of this implementation, but I agree with @pcarruscag, that could be done in an additional PR.

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

Successfully merging this pull request may close these issues.

5 participants