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

[All] Unification of MainKratos.py #858

Merged
merged 16 commits into from
Jan 20, 2022
Merged

Conversation

rubenzorrilla
Copy link
Member

As discussed in here this adds the analysis_stage field to the ProjectParameters.json input file (e.g. "analysis_stage" : "KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis".

This makes possible to do a dynamic import of it, that turns into the unification of all the MainKratos.py scripts of the interface so we will have a unique AnalysisStageWithFlush, which will be stored in the exec folder of the interface. Note that this requires to assume that the Python module name (in snake_case) matches the class name (in UpperCamelCase) (e.g. KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis implements the class FluidDynamicsAnalysis). This was the case in all the cases except the FSIApplication (see this PR) and the DEM application.

Besides this, the analysis_stage could be used for other (e.g. the unification of the ROM scripts @Rbravo555 @SADPR ) and documentation purposes.

I updated all the applications of the interface. Some comments and missing TODOs would be:

  • ShallowWater: although it didn't use the analysis stage with flush I updated it accordingly to do so. @miguelmaso
  • PFEMThermic: although it didn't use the analysis stage with flush I updated it accordingly to do so. @rlrangel
  • DEM: the structure of the input is way different to that of the rest of apps so I preferred to not touch as I'm not familiar with it. I think it would be better to introduce these changes in a future PR @GuillermoCasas @maceligueta

I tested all the updated applications. However for the next applications I didn't run the predefined examples completely as I didn't compiled all the required apps

  • ShalowWater @miguelmaso
  • PFEMFluid @rlrangel
  • PFEMThermic @AFranci
  • MPM @antonialarese @VeronikaSinger
    I note however that the input files are properly generated, meaning that the execution is interrupted (as expected) when the dynamic import takes place. Hence, I dare say that everything should be fine (letting you know just in case)

@rubenzorrilla rubenzorrilla added enhancement after release To tag those tasks to be done after the upcoming release labels Nov 29, 2021
@rubenzorrilla rubenzorrilla self-assigned this Nov 29, 2021
@jginternational
Copy link
Member

I'll approve this merge AFTER the release 9.0 of the GUI, and in a PR delete the json entry where the apps inform of their main script, since i'll be the same for everyone.

@rubenzorrilla
Copy link
Member Author

I'll approve this merge AFTER the release 9.0 of the GUI, and in a PR delete the json entry where the apps inform of their main script, since i'll be the same for everyone.

Not sure at all, but maybe it's not a bad idea to keep that json entry (just in case). Up to you.

@GuillermoCasas
Copy link
Member

Ok, I will have a look at it with @maceligueta .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
after release To tag those tasks to be done after the upcoming release enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants