Skip to content

Updates of SU2-python#1357

Merged
Nicola-Fonzi merged 31 commits intosu2code:developfrom
Nicola-Fonzi:publish
Aug 23, 2021
Merged

Updates of SU2-python#1357
Nicola-Fonzi merged 31 commits intosu2code:developfrom
Nicola-Fonzi:publish

Conversation

@Nicola-Fonzi
Copy link
Copy Markdown
Contributor

Proposed Changes

Dear all,

Here are some updates for the python fsi interface.

Namely:

  • Better use of mpi4py, using always numpy array (more computationally efficient)
  • Fix of the restarted coupled simulation
  • Automatic use of default values, in case of wrong inputs
  • Introduction of a sort of dry run, which actually prints out the mapped modes and the normals of the aerodynamic surface mesh. This is yet another step towards the automatic creation of ROM from aerodynamic response
  • Fix of small bugs

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, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • 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.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Aug 22, 2021

This pull request introduces 2 alerts and fixes 19 when merging 0cf08d4 into c2c78e2 - view on LGTM.com

new alerts:

  • 1 for Unused local variable
  • 1 for Variable defined multiple times

fixed alerts:

  • 13 for Variable defined multiple times
  • 6 for Unused import

@Nicola-Fonzi
Copy link
Copy Markdown
Contributor Author

Dear @pcarruscag, thank you very much for the review. I implemented the modification you suggested and corrected the indentation (sorry about that...)

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Aug 23, 2021

This pull request introduces 2 alerts and fixes 19 when merging 4ecf3ea into c2c78e2 - view on LGTM.com

new alerts:

  • 1 for Unused local variable
  • 1 for Variable defined multiple times

fixed alerts:

  • 13 for Variable defined multiple times
  • 6 for Unused import

Copy link
Copy Markdown
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

Thanks @Nicola-Fonzi 👍

Copy link
Copy Markdown
Contributor

@TobiKattmann TobiKattmann left a comment

Choose a reason for hiding this comment

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

Thanks @Nicola-Fonzi 💐 of course I cannot say anything content-wise but here are a few little spots I can nag about

return len(self.markers[markerID])

def getInterfaceNodeGlobalIndex(self, markerID, iVertex):
def getVertexGlobalIndex(self, markerID, iVertex): # TODO This solver is serial, thus global=local
Copy link
Copy Markdown
Contributor

@TobiKattmann TobiKattmann Aug 24, 2021

Choose a reason for hiding this comment

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

Are the TODO on your list to be tackled next? I would rather error-check and document the state then to write a TODO in the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi Tobi! Thank you very much for your time. Yes, you are right... TODOs in the code are ugly. They are definitely being tackled right now, this is why they are there, but I can remove them and just keep a note.

Comment on lines +858 to +859
if self.Config["RESTART_SOL"] == "NO": # If yes we already set it in the __setRestart function
self.timeStartCoupling = time
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if self.Config["RESTART_SOL"] == "NO": # If yes we already set it in the __setRestart function
self.timeStartCoupling = time
if self.Config["RESTART_SOL"] == "NO":
# If yes we already set it in the __setRestart function
self.timeStartCoupling = time

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure whether a comment 20 spaces away is the best thing todo, I would rather have it close to its partner lines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree

Comment on lines +1242 to +1243
for key in self.FluidHaloNodeList[iProc].keys(): # The key is the SU2 global
globalIndex = self.fluidIndexing[key] # This is the interface global, not the SU2 global
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not that I would understand what is going on but # The key is the SU2 global sounds like there is sth missing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you mean that it should be "the keys are..."?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, no I think more sth like

# The key is the SU2 global >node ID<

in case that makes any sense... That is the whole point :) I dont know what SU2 global alone should mean. I just had the feeling there was a noun missing (like e.g. node ID), not that I know it is missing.

Treat it more like a question: Is this sentence correct? If yes, then leave it as is 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see what you mean. No the comment was actually saying that each key in the dictionary consists of the global ID of an interface node. However, from your question, I feel it was not really clear... I try to clarify

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please have a look at #1359

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.

3 participants