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

Feature restructuring sliding meshes #2334

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

LaSerpe
Copy link
Contributor

@LaSerpe LaSerpe commented Jul 30, 2024

Proposed Changes

This a initial merge to begin incorporating some modification to the sliding mesh interface which we are planning to improve in the next future.

Related Work

Mostly performance improvements in the creation of the super mesh for the Weighted Average sliding mesh approach.
ADT is now used to initialize the supermesh construction. Some portions of the code were re-implemented using a smarter algorithm which reduces the code length.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • [ x] I am submitting my contribution to the develop branch.
  • [ x] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • [ x] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • [x ] I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@LaSerpe LaSerpe changed the base branch from master to develop July 30, 2024 09:54
Comment on lines +620 to +622
// end = clock();
// cout << "Reconstruct supermesh: " << fixed << double(end - start) / double(CLOCKS_PER_SEC) << setprecision(5) <<
// " sec " << endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -184,6 +215,8 @@

target_segment = new unsigned long[2];

// start = clock();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -173,6 +202,8 @@
*/
if (nVertexTarget) targetVertices[markTarget].resize(nVertexTarget);

// start = clock();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +193 to +195
// end = clock();
// cout << "Build ADT: " << fixed << double(end - start) / double(CLOCKS_PER_SEC) << setprecision(5) << " sec " <<
// endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -165,6 +171,29 @@
Donor_LinkedNodes = Buffer_Receive_LinkedNodes;
Donor_Proc = Buffer_Receive_Proc;

// start = clock();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +161 to +163
// end = clock();
// cout << "Reconstruct donor: " << fixed << double(end - start) / double(CLOCKS_PER_SEC) << setprecision(5) << "
// sec " << endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -153,9 +154,14 @@
Target_StartLinkedNodes = Buffer_Receive_StartLinkedNodes;
Target_LinkedNodes = Buffer_Receive_LinkedNodes;

// start = clock();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +145 to +147
// end = clock();
// cout << "Reconstruct Target: " << fixed << double(end - start) / double(CLOCKS_PER_SEC) << setprecision(5) << "
// sec " << endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -142,9 +138,14 @@
3 -Reconstruct the boundaries from parallel partitioning
*/

// start = clock();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

Normal = new su2double[nDim];
Direction = new su2double[nDim];

// clock_t start, end;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
break;
}
}
VertexADT.DetermineNearestNode(&Coord_i[0], dist, donor_StartIndex, rankID);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
VertexADT.DetermineNearestNode(&Coord_i[0], dist, donor_StartIndex, rankID);
VertexADT.DetermineNearestNode(Coord_i, dist, donor_StartIndex, rankID);

Comment on lines +414 to +415
unsigned long* DB_nNode_donor;
su2double*** DB_nNode_donor_element;
Copy link
Member

Choose a reason for hiding this comment

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

Can you use the vector and matrix classes here?

* \param[in] P2 - second point of triangle
* \param[in] P3 - third point of triangle
*/
static su2double ComputeTriangleArea(const su2double* P1, const su2double* P2, const su2double* P3);
Copy link
Member

Choose a reason for hiding this comment

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

Since it's just one line it's better to define it inline. We may already have something similar in GeometryToolbox, and if not you can add this function to it.

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.

2 participants