Skip to content

Conversation

@tjhei
Copy link
Member

@tjhei tjhei commented Oct 24, 2025

This might be the fix for #6726

@tjhei
Copy link
Member Author

tjhei commented Oct 24, 2025

@mibillen Would you be able to try out this PR with the different test cases you ran? Thank you!

@tjhei
Copy link
Member Author

tjhei commented Oct 24, 2025

(this only works for velocity constraints and so /tests/pressure_constraint crashes , I will need to fix the code to handle pressure and other constraints)

@tjhei tjhei force-pushed the gmg-prescribed-velocity branch from 9e9d970 to da5c980 Compare October 25, 2025 01:54
@mibillen
Copy link
Contributor

Hi Timo, Sorry for the delay, I was traveling. I've tried testing this version but the velocity is still not applied to the solution (see attached image)

Can you confirm that my steps for downloading your PR are correct:
git clone https://github.com/tjhei/aspect.git
git switch gmg-prescribed-velocity
compile aspect

Screenshot 2025-10-27 at 1 54 24 PM

@tjhei
Copy link
Member Author

tjhei commented Oct 28, 2025

Yes, that should work. Is this using the old technique (signal) like the test or the new way?

@mibillen
Copy link
Contributor

I used the new way that Haoyuan and Rene implemented. But since you asked, I just ran using the old way (with the separate shard library) and that one also does not work. I've attached both of the parameter files.
corner_flow_main.txt
corner_flow_orig_pr.txt

@tjhei
Copy link
Member Author

tjhei commented Oct 29, 2025

This is what I get with my patch for your first .prm file:
image

Without the patch, I only get large velocities on the diagonal.

@mibillen
Copy link
Contributor

mibillen commented Oct 29, 2025 via email

Copy link
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

Thanks this looks like the right fix! However, there are two things I dont understand (see comments), I would like to understand them before merging this, just to make sure there is no other bug hiding in there. Do you have an idea? If not I can also try to investigate later.

sim.prescribed_solution_manager.constrain_solution(constraints_v);

// Let plugins add more constraints if they so choose:
sim.signals.post_constraints_creation(*this, constraints_v);
Copy link
Member

Choose a reason for hiding this comment

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

Oh, so we had a bug here? Is that why the prescribed_velocity test and the other signal tests need an update even though they dont use the prescribed solution manager?

Copy link
Member Author

Choose a reason for hiding this comment

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

both were missing: prescribed_solution_manager and the signal (the old way of adding constraints)

Copy link
Member

Choose a reason for hiding this comment

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

I dont understand why only this test is affected, even though the other three prescribed_solution_velocity_function_... tests have the same settings? And in #6660 we tested that these tests give the expected results, which they did. Do you understand the difference between the tests?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I think I at least understand the second part. Looking at this again: #6660 (comment) We likely had this problem from the beginning that only the velocities inside the indicated region were prescribed and velocities outside just wouldnt react to them. However, that still doesnt explain why the other 3 tests are not affected by this change. Do the tests maybe not see/expect velocities outside the prescribed region?

Copy link
Member Author

Choose a reason for hiding this comment

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

Weird, yes. It could be that the output we print doesn't show the change?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, the tests work fine if the values are constrained to velocity 0.

@tjhei
Copy link
Member Author

tjhei commented Oct 30, 2025

@gassmoeller The tests produce output at t=0 and t=1 year while the constrained values are linear in t. Without this PR they constrained values are set to zero velocity, which is quite close to the expected values.

@gassmoeller
Copy link
Member

Ah, I see, thanks for checking. Is there an easy way to modify the tests to make them more sensitive? Increase the velocity or start with a non zero velocity? Or do you think it isnt worth the effort?

@tjhei
Copy link
Member Author

tjhei commented Oct 30, 2025

Is there an easy way to modify the tests to make them more sensitive? Increase the velocity or start with a non zero velocity?

I added a commit that changes the constrained velocities for the three unaffected tests. If the tests fail now, I can open a separate PR to change them before we merge this PR.

@tjhei
Copy link
Member Author

tjhei commented Oct 30, 2025

Let's merge #6743 first and then rebase this PR to confirm things are tested sufficiently.

@tjhei tjhei force-pushed the gmg-prescribed-velocity branch from d8a122a to d5dc086 Compare October 31, 2025 03:19
@tjhei
Copy link
Member Author

tjhei commented Oct 31, 2025

Hm. The tests are not sensitive enough it seems. I will need to set things up locally and confirm first.

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.

3 participants