Skip to content

Conversation

@GitPaean
Copy link
Member

No description provided.

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Dec 22, 2025
@GitPaean
Copy link
Member Author

jenkins build this failure_report please

@GitPaean GitPaean force-pushed the testing_limiting_wqtotal branch from ff10ccb to 4af9514 Compare December 22, 2025 11:53
@GitPaean
Copy link
Member Author

jenkins build this failure_report please

@GitPaean
Copy link
Member Author

the regression results do not look worrying (most likely)

@GitPaean GitPaean force-pushed the testing_limiting_wqtotal branch from 4af9514 to 2f5269c Compare January 6, 2026 13:46
// value_[seg][WQTotal] = old_primary_variables[seg][WQTotal] - relaxation_factor * dwells[seg][WQTotal];
auto dx = relaxation_factor * dwells[seg][WQTotal];
const Scalar sign = dx > 0.? 1. : -1.;
dx = sign * std::max(std::min(1., std::abs(dx)), 0.4 * std::abs(dx));
Copy link
Member

Choose a reason for hiding this comment

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

This will fail to compile if Scalar is different from double (the std::min() and std::max() function templates cannot be specialised when applied to objects of different types).

That said, it's not immediately clear to me what this is trying to do. Are you trying to leave "small" dx values unchanged and limit "large" values? If so, I'd probably write it
as

if (std::abs(dx) > some_threshold) {
    dx = sign * std::max(some_threshold, static_cast<Scalar>(0.4) * std::abs(dx));
}

instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the comments regarding the Scalar issue. It is not in any way the PR will go in with this types of design. It is mostly for discussion and communication with the people working together. And also 1. is a relatively big value (it is per second), but it was too small for the cases we are looking at during the Newton iterations.

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

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants