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

Derive remaining managers from ManagerBase #6097

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

gassmoeller
Copy link
Member

A suggestion for how to finish #1775. This is still work in progress and unfortunately not completely backwards compatible, but at least the incompatibility is only limited to two rarely used functions in the code, not the input file. The traction manager (and the velocity manager once I get to it) need additional information compared to ManagerBase, namely which boundary each plugin is responsible for, and which components (of the tensor components xyz). The main change is the type of internal storage container, and the access functions get_active_boundary_traction_conditions and get_active_boundary_traction_names. Opinions? If we we agree this is a good idea I can continue with the velocity manager.

Copy link
Contributor

@bangerth bangerth left a comment

Choose a reason for hiding this comment

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

Yes, nice idea. I supposed you also want to do this for the boundary velocity manager?


Assert(boundary_plugins != boundary_traction_objects.end(),
[[maybe_unused]] bool found_plugin = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not there yet -- we still allow compiling ASPECT with C++14.

Comment on lines 67 to 82
unsigned int i=0;
for (const auto &plugin: this->plugin_objects)
{
if (this->boundary_indicators[i])
{
const Tensor<1,dim> plugin_traction = plugin->boundary_traction(boundary_indicator,
position,
normal_vector);
for (unsigned int d=0; d<dim; ++d)
if (this->component_masks[i][d])
traction[d] += plugin_traction[d];
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Something is not right with this code. I don't see you incrementing i anywhere. It's also not clear that this-boundary_indicators[i] is a bool. Are you forgetting to compare it against boundary_indicator?

@gassmoeller
Copy link
Member Author

/rebuild

@gassmoeller gassmoeller changed the title [WIP] Derive remaining managers from ManagerBase Derive remaining managers from ManagerBase Oct 25, 2024
@gassmoeller
Copy link
Member Author

Something is not right with this code. I don't see you incrementing i anywhere. It's also not clear that this-boundary_indicators[i] is a bool. Are you forgetting to compare it against boundary_indicator?

Yes, I rushed this PR a bit, I mostly needed feedback if the idea is sound in general. I have cleaned up the PR, addressed your comments and expanded it to the boundary velocity manager. I think this should work now, but I am open to suggestions for changes.

Copy link
Member

@tjhei tjhei left a comment

Choose a reason for hiding this comment

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

minor nitpick for doxygen formatting...

/**
* A list of boundary traction objects that have been requested in the
* parameter file.
*
* @deprecated: This variable is no longer used, but needed to issue a proper
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @deprecated: This variable is no longer used, but needed to issue a proper
* @deprecated This variable is no longer used, but needed to issue a proper

@@ -206,6 +252,11 @@ namespace aspect
* mapped to one of the plugins of traction boundary conditions (e.g.
* "function"). If the components string is empty, it is assumed the
* plugins are used for all components.
*
* @deprecated: Remove this variable when the deprecated functions
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @deprecated: Remove this variable when the deprecated functions
* @deprecated Remove this variable when the deprecated functions

@gassmoeller
Copy link
Member Author

Thanks for the review. I have addressed all comments, all commits are squashed and I updated the date of the changelog entry. I will leave this open for a day or two and merge if there are no other comments.

@gassmoeller gassmoeller merged commit 74fbe92 into geodynamics:main Feb 5, 2025
8 checks passed
@gassmoeller gassmoeller deleted the convert_managers branch February 5, 2025 10:39
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