Skip to content

[IO] Enhance IO class by adding support for reading master-slave constraints and geometries from sub-model parts (transition to extend Metis geometries/constraint support)) #13304

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

Merged
merged 14 commits into from
Jun 3, 2025

Conversation

loumalouomega
Copy link
Member

📝 Description

  1. Code Cleanup and Comment Improvements:

    • Fixed minor formatting and consistency issues in the comments, particularly for license information and the PartitioningInfo struct.
  2. Expanded PartitioningInfo Struct:

    • Added new fields to the PartitioningInfo struct for handling additional entity types:
      • ConstraintsPartitions and GeometriesPartitions: New fields to track partitions where master-slave constraints and geometries are local, respectively.
      • ConstraintsAllPartitions and GeometriesAllPartitions: New fields to track partitions where master-slave constraints and geometries are present, including ghost partitions.
  3. Added Virtual Methods for Sub-Model Part Reading:

    • Introduced several new virtual methods for reading data from sub-model parts:
      • ReadSubModelPartElementsAndConditionsIds: The original method reads element and condition IDs. The newly added overload reads additional IDs for master-slave constraints and geometries.
      • ReadNodalGraphFromEntitiesList: Similar to the previous method, this one reads a nodal graph, and the new overload includes support for master-slave constraints and geometries.
    • Both new methods include a warning message, indicating that while the methods for master-slave constraints and geometries are not yet implemented, they extend the original functionality.

🆕 Changelog

@loumalouomega loumalouomega added Cleanup Kratos Core Transition Refactor When code is moved or rewrote keeping the same behavior labels Apr 2, 2025
@loumalouomega loumalouomega requested a review from a team as a code owner April 2, 2025 17:40
@loumalouomega loumalouomega enabled auto-merge April 2, 2025 17:41
@loumalouomega
Copy link
Member Author

@RiccardoRossi you can review this first, is a very small case

Copy link
Member

@RiccardoRossi RiccardoRossi left a comment

Choose a reason for hiding this comment

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

i am not into this ... is @pooyan-dadvand iterating this with you?

@loumalouomega
Copy link
Member Author

i am not into this ... is @pooyan-dadvand iterating this with you?

Yes

@pooyan-dadvand
Copy link
Member

I have two general comments on this PR:

  1. Do we need all the methods? Please don't add any method just for coherency. To my understanding we need a method to read the connectivity graph.
  2. Would you please change all the MasterSlaveConstraints with Constraints?

@loumalouomega
Copy link
Member Author

I have two general comments on this PR:

1. Do we need all the methods? Please don't add any method just for coherency. To my understanding we need a method to read the connectivity graph.

You mean to focus only in the extrictely necessary?

2. Would you please change all the MasterSlaveConstraints with Constraints?

I can some, but other not beacause we already defined in the io.h some methods with that name. I can rename them too if you agree.

@loumalouomega
Copy link
Member Author

I have two general comments on this PR:

1. Do we need all the methods? Please don't add any method just for coherency. To my understanding we need a method to read the connectivity graph.

You mean to focus only in the extrictely necessary?

Yes methods are used.

* @param rConstraintIds Set to store master-slave constraint IDs.
* @param rGeometriesIds Set to store geometry IDs.
*/
virtual void ReadSubModelPartEntitiesIds(
Copy link
Member

Choose a reason for hiding this comment

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

I understand that this is the substitution of the above method. Then we shall change the above one.....

Copy link
Member Author

Choose a reason for hiding this comment

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

I keep it the old one because we are just changing this file in this PR, in other case should be removed in the final one

* @param rGeometriesIds Set of geometry IDs.
* @return The size of the nodal graph.
*/
virtual std::size_t ReadNodalGraphFromEntitiesList(
Copy link
Member

Choose a reason for hiding this comment

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

This one again. I definitely suggest you to provide a list of usage in Kratos to see how changing the interface would affect us.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is used in the final PR:#13435
See applications/MetisApplication/custom_processes/metis_divide_submodelparts_heterogeneous_input_process.cpp

Copy link
Member

@pooyan-dadvand pooyan-dadvand left a comment

Choose a reason for hiding this comment

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

The interface is not tidy at all but it is a continuation of the existing one. For this reason I approve it for now and in the future we can change all of them coherently.

@loumalouomega loumalouomega merged commit 5c8bd02 into master Jun 3, 2025
11 checks passed
@loumalouomega loumalouomega deleted the core/transition-changes-io branch June 3, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Kratos Core Refactor When code is moved or rewrote keeping the same behavior Transition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants