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

[GeoMechanicsApplication] Improved reading of input files from settlement workflow #11562

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

avdg81
Copy link
Contributor

@avdg81 avdg81 commented Sep 14, 2023

📝 Description
So far, when a stage was run using the settlement workflow (in C++), it always attempted to read the given mdpa file. Although the set of input files worked using the Python workflow, it raised an error when the custom workflow was used (about already existing elements). To prevent that, we now follow the same approach as in our Python workflow. That is, when the model part corresponding to the given model part name already exists, don't attempt to create a new one and also don't attempt to read the mdpa file. With these changes, the Python workflow and the custom (C++) workflow are more consistent.

🆕 Changelog

  • Use std::filesystem::paths rather than strings when handling file paths. This implicitly addresses problems related to path separators on different platforms. Use "generic strings" when the API expects a string rather than a path object.
  • Only attempt to read from a material file when one is specified in the ProjectParameters.json file.
  • The approach for reading of .mdpa files in KratosGeoSettlement is now more in line with how this is handled by the Python code. We first check whether the given model part name corresponds to an existing model part. If not, we create a new one and populate it using the data from the .mdpa file.

@avdg81 avdg81 added the GeoMechanics Issues related to the GeoMechanicsApplication label Sep 14, 2023
@avdg81 avdg81 requested review from rfaasse and WPK4FEM September 14, 2023 07:59
@avdg81 avdg81 self-assigned this Sep 14, 2023
rfaasse
rfaasse previously approved these changes Sep 14, 2023
Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

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

Looks good to me! I have a couple of questions, but they are mainly to verify my understanding of the flow

- Use `std::filesystem::path`s rather than strings when handling file
  paths. This implicitly addresses problems related to path separators
  on different platforms. Use "generic strings" when the API expects a
  string rather than a path object.
- Only attempt to read from a material file when one is specified in the
  `ProjectParameters.json` file.
- The approach for reading of `.mdpa` files in `KratosGeoSettlement` is
  now more in line with how this is handled by the Python code. We first
  check whether the given model part name corresponds to an existing
  model part. If not, we create a new one and populate it using the data
  from the `.mdpa` file.
@avdg81 avdg81 force-pushed the geo/improved-input-reading-settlement branch from 7b92284 to 70f3aac Compare September 14, 2023 09:51
@avdg81 avdg81 merged commit 47a1c2b into master Sep 15, 2023
@avdg81 avdg81 deleted the geo/improved-input-reading-settlement branch September 15, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GeoMechanics Issues related to the GeoMechanicsApplication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Read mdpa file only once when running a settlement workflow
2 participants