-
Notifications
You must be signed in to change notification settings - Fork 247
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
[ContactStructuralMechanicsApplication] Refactor ContactUtilities to cpp #7616
Conversation
applications/ContactStructuralMechanicsApplication/custom_utilities/contact_utilities.cpp
Outdated
Show resolved
Hide resolved
///@} | ||
///@name Namespaces | ||
///@{ | ||
|
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.
I think this is legacy from the previous implementation
const int num_threads = OpenMPUtils::GetNumThreads(); | ||
std::vector<double> max_vector(num_threads, 0.0); | ||
double nodal_h; | ||
#pragma omp parallel for private(nodal_h) | ||
for(int i = 0; i < static_cast<int>(r_nodes_array.size()); ++i) { | ||
auto it_node = it_node_begin + i; | ||
KRATOS_DEBUG_ERROR_IF_NOT(it_node->SolutionStepsDataHas(NODAL_H)) << "ERROR:: NODAL_H not added" << std::endl; | ||
nodal_h = it_node->FastGetSolutionStepValue(NODAL_H); | ||
|
||
const int id = OpenMPUtils::ThisThread(); | ||
|
||
if (nodal_h > max_vector[id]) | ||
max_vector[id] = nodal_h; | ||
} | ||
|
||
return *std::max_element(max_vector.begin(), max_vector.end()); |
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.
just to say that this could be done simpler with the ParallelUtilities
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.
I have it in my TODO list
#include "contact_structural_mechanics_application_variables.h" | ||
#include "includes/model_part.h" |
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.
this is used in this file, I wouldn't remove
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.
Done, reapproval?
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.
As this is only refactor I'd leave changes for a future PR. @loumalouomega and @philbucher up to you 😉
Description
Moving ContactUtilities to cpp
Changelog