Skip to content

Conversation

@Waqar-ukaea
Copy link
Collaborator

PR for #111

Copy link
Collaborator

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Thanks @Waqar-ukaea - I have a few questions here about the choice of defaults

return surface_metadata_.at({surface, type});
}
catch (const std::out_of_range e) {
return VOID_MATERIAL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This already suggests that the transmission boundary condition should be the default. A surface property is never a material.

Although I wonder if this is a good choice for default if/when other properties get applied to surfaces?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not really certain what the best default for this would be so I'm going to leave it as is for now. Maybe @pshriwise has a better idea of what we should do here.

Copy link
Collaborator

@pshriwise pshriwise Jun 13, 2025

Choose a reason for hiding this comment

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

For this I'd recommend a transmission boundary as @gonuke said.

return {PropertyType::BOUNDARY_CONDITION, "transmission"};

Copy link
Collaborator

Choose a reason for hiding this comment

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

Although I wonder if this is a good choice for default if/when other properties get applied to surfaces?

Can you expand on what you mean here @gonuke?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In theory, surfaces could get tagged with metadata for purposes other than boundary conditions, e.g. some variance reduction parameters, etc. In such a case, a default that represents a boundary condition may not be the best default.

return {PropertyType::BOUNDARY_CONDITION, "transmission"};
return surface_metadata_.at({surface, type});
}
catch (const std::out_of_range e) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't the count check above make this already more robust? Can you add tests that fail before this change and pass afterwards?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, could this count approach be used for volume properties as well, instead of the exception?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed on this one too. Added a similar count check for get_volume_property()

@gonuke
Copy link
Collaborator

gonuke commented Jun 3, 2025

Looking at the Property system in constants.h it seems that

  1. There is already a note to formally separate volume properties from surface properties, and
  2. There may be room to define some kind of PROPERTY_NOT_FOUND constant

@Waqar-ukaea
Copy link
Collaborator Author

There is probably a wider conversation to be had about how exactly we want to be handling exceptions within XDG. I went with try catch blocks because I'm familiar with them but there probably is a better approach we can take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants