[GeoMechanicsApplication] Improved reading of input files from settlement workflow #11562
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 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 themdpa
file. With these changes, the Python workflow and the custom (C++) workflow are more consistent.🆕 Changelog
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.ProjectParameters.json
file..mdpa
files inKratosGeoSettlement
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.