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

[Core][Geometries] Adding geometry order information #12204

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

loumalouomega
Copy link
Member

roigcarlo and others added 4 commits March 19, 2024 11:17
What a beautiful world we live on in which we can experience the joy of compiling for multiple platforms and operating systems
@loumalouomega loumalouomega requested a review from a team as a code owner March 19, 2024 10:17
@loumalouomega loumalouomega removed the request for review from a team March 21, 2024 09:57
@loumalouomega
Copy link
Member Author

@jcotela do we proceed?

* @var KratosGeometryOrderType::Kratos_Quintic_Order: Defines a quintic geometry. Represents the highest polynomial order here, with the highest accuracy and computational cost.
* @var KratosGeometryOrderType::Kratos_Unknown_Order: Used when the geometry order is unknown or not specified. Allows for flexibility in geometry definition.
*/
enum KratosGeometryOrderType {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be very difficult to use. I'd rather recommend an optional int

Copy link
Member Author

Choose a reason for hiding this comment

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

An enum can always be converted to a int, and the order coincides with the enum value

Copy link
Contributor

Choose a reason for hiding this comment

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

but why go the roundabout way of defining it as an enum in the first place? Why is an enum better here than an std::optional<int>? As far as I see it, the enum arbitrarily restricts the orders we can represent.

Copy link
Member Author

Choose a reason for hiding this comment

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

We already use enums in many things for geometries, would you thinks it would be easier to just simply use unsigned int and end of story? opinions @KratosMultiphysics/technical-committee

Copy link
Contributor

Choose a reason for hiding this comment

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

would you thinks it would be easier to just simply use unsigned int and end of story

an unisgned wouldn't be able to represent undefined order, and I think the undefined state of an std::optional fits better than using -1 with signed integers, or some other arbitrary stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jcotela do you agree?, opinion @KratosMultiphysics/technical-committee ?

Copy link
Member

Choose a reason for hiding this comment

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

Hi @loumalouomega sorry for the delay, I had forgotten about this PR. Unfortunately, this change was intended for a feature that we won't be implementing so strictly speaking I no longer need it. Having said that, I think it may be useful to have a way to programmatically inquire about the interpolation order of a specific geometry instance, if the core developers agree.

Regarding the enum vs std::optional, I understand that the order is a category here (the geometry is lineal or quadratic in the same way it is a linear triangle or a cubic hexhahedron) so an enum seems appropriate. I could see using an int so that values have a natural greater/less than comparison in addition to equality checks, but I am not sure about the need for optional. After all, it should be straightforward to figure out the interpolation order for each derived geometry. @matekelemen what use case do you see for an undefined order? Working with base geometery instances?

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 will not touch this PR until a consencus is reached

Copy link
Contributor

Choose a reason for hiding this comment

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

what use case do you see for an undefined order?

Well, there's a Kratos_Unknown_Order in the current PR so I thought there's a use case for it. Also geometries that don't overload this function should return an undefined value instead of some made-up default.

I'm not familiar with IGA in kratos, but I could imagine an undefined order for a default-constructed IGA geometry as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

If everyone agreess I can change that

@loumalouomega
Copy link
Member Author

What is the status of this?

@matekelemen
Copy link
Contributor

What is the status of this?

I'm not blocking, just recommended an optinal int instead of an enum. I think we're still waiting for a review from the technical committee.

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.

None yet

4 participants