-
Notifications
You must be signed in to change notification settings - Fork 248
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
[Core] Mixed Generic Criterion - fixing error when dofs and input variables mismatch #11688
[Core] Mixed Generic Criterion - fixing error when dofs and input variables mismatch #11688
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch!
kratos/solving_strategies/convergencecriterias/mixed_generic_criteria.h
Outdated
Show resolved
Hide resolved
kratos/solving_strategies/convergencecriterias/mixed_generic_criteria.h
Outdated
Show resolved
Hide resolved
…riteria.h Co-authored-by: Philipp Bucher <[email protected]>
Hmm there are some tests failing in @KratosMultiphysics/geomechanics because in some cases they are only checking some variables (WATER_PRESSURE) even if they also have dofs for DISPLACEMENT. I think that is actually a fair use, so maybe instead of throwing an error we should just skip the dof if the variable was not added to |
Why is |
I agree that the function should be const. But I think its also a fair use that for example in the context of a CFD problem where you have VELOCITY and PRESSURE dofs, for whatever reason you only want to check VELOCITY (that'd throw an error with current implementation in this MR) |
I just pushed my suggestion @philbucher @KratosMultiphysics/implementation-committee @KratosMultiphysics/technical-committee |
perhaps there should be a setting to explicitly ignore these dofs? I feel like just neglecting them silently can cause problems too |
…//github.com/KratosMultiphysics/Kratos into core/mixed-generic-criteria-using-at-for-map
Hmm honestly I do not see it. What do you want to do with dofs that do not belong to any of the input variables? You do not even have a target error for those, relative and absolute errors are only defined for input vars... |
then you can/should ignore those. Only a suggestion, IMO one should be fully aware of what dofs are used in a simulation, and how the convergence is checked |
...TrilinosApplication/custom_strategies/convergencecriterias/trilinos_mixed_generic_criteria.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
It seems its passing now :) @philbucher |
kratos/solving_strategies/convergencecriterias/mixed_generic_criteria.h
Outdated
Show resolved
Hide resolved
kratos/solving_strategies/convergencecriterias/mixed_generic_criteria.h
Outdated
Show resolved
Hide resolved
kratos/solving_strategies/convergencecriterias/mixed_generic_criteria.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense for me. It is customary to have more DOFs than the ones you might want to actually check (think for instance in any volume coupling problem). My suggestions are purely aesthetic and typos in documentation.
23b9c17
comments addressed @rubenzorrilla ;) |
* @param rVarLocalKey variable local key | ||
* @return dof variable is found or not | ||
*/ | ||
bool FindVarLocalKey( | ||
typename DofsArrayType::const_iterator iDof, | ||
typename DofsArrayType::const_iterator itDof, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about passing the variable? The dof is only used to access the variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well I used the dof to minimize the duplicated code in the trilinos side, what is the advantage on passing the variable instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a philosophical question :)
I try to always pass the least amount of information possible
📝 Description
There was a bug in our code that took some time to debug. We were sending the wrong variables to the constructor, so as the dofset included different variables, new entries were being added to the mLocalKeyMap as it was using the brackets operator (added new entry if it does not exist). This caused me errors in omp as two threads might try to create this new entry at the same time. Im skipping now the dofs that do not match any of the input variables