Fix deprecation warnings with deal.II master#6961
Conversation
vovannikov
left a comment
There was a problem hiding this comment.
I think you got confused with the error message. Its text stayed from one of the first implementations and has to be changed to something like
"Unable to assign the function since the target is not set in the proxy. Most probably, you explicitly provided the stepper object to ARKode in its constructor and then tried to use the old backwards compatibility callback assignment. This is discouraged: assign directly the callbacks of the provided stepper object."
Eventually, if you create a stepper object and then explicitly provide it to the ARKode constructor, then the callbacks can't be assigned to the ARKode object. This is done to discourage their usage, since callbacks are different for different ARKODE steppers. Currently, only the wrapper for ARKStep is available in deal.II, but I will add more of them.
| SUNDIALS::ARKode<VectorType> ode(data); | ||
| ode.explicit_function = [&] (const double /*time*/, | ||
| const VectorType &y, | ||
| VectorType &grain_size_rates_of_change) |
There was a problem hiding this comment.
For this code to work, this part has to look something like this:
| VectorType &grain_size_rates_of_change) | |
| auto explicit_function = [&] (const double /*time*/, | |
| const VectorType &y, | |
| VectorType &grain_size_rates_of_change) { ... }; | |
| #if DEAL_II_VERSION_GTE(9,8,0) | |
| SUNDIALS::ARKStepper<VectorType>::AdditionalData stepper_data; | |
| stepper_data.order = 3; | |
| stepper_data.maximum_non_linear_iterations = 30; | |
| SUNDIALS::ARKStepper<VectorType> stepper(stepper_data); | |
| SUNDIALS::ARKode<VectorType> ode(stepper, ode_data); | |
| stepper.explicit_function = explicit_function; | |
| #else | |
| ode_data.maximum_order = 3; | |
| ode_data.maximum_non_linear_iterations = 30; | |
| SUNDIALS::ARKode<VectorType> ode(ode_data); | |
| ode.explicit_function = explicit_function; | |
| #endif |
There was a problem hiding this comment.
Basically, you assign callbacks either to ode (if a stepper was not created explicitly) or to stepper (if you have created a stepper and then provided it to ode).
|
Ah, thanks for the clarification. I have updated the code to consistently use the new approach if available. You are right, what confused me was that I assumed I could use the new stepper class for everything except for the callback function. |
|
Thanks, @gassmoeller, for working on this -- I had it on my list for today (had already compiled current deal.II and ASPECT)... |
|
The indent check fails with this error, which I really don't understand: Is something wrong with the docker image this check runs on? |
|
The tester is still unreliable. The error you saw was because it couldnt add the repository with deal.ii version 9.6, therefore it installed the default deal.ii package of that ubuntu (9.3 i think). That then caused the error. After some restarts the tester finally worked, so I think this is ready now. |
Fix some of the remaining deprecation warnings introduced by dealii/dealii#19282.
This now compiles without warnings, but I receive the error I attach below when I run our tests. I would have understood if we got another deprecation warning (because we assign an explicit function to
ARKode.explicit_functionwhich is now deprecated), but I dont understand the error.@vovannikov: I thought I saw code in 19282 that kept the existing functions working?
Could you take a look if we are using the class wrong, or if there is a bug in the compatibility? The relevant code is here:
aspect/source/material_model/reaction_model/grain_size_evolution.cc
Line 188 in a646ade