-
Notifications
You must be signed in to change notification settings - Fork 63
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
Handle the deprecated parameters of individual entries to a list entry #1171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small things where a g conversion is missing, otherwise very good. Love this. Maybe a good idea to add a changelog entry?
@@ -0,0 +1,65 @@ | |||
Warning in file <depreciated_parameters.prm>: You are using the deprecated spelling <gx> of the parameter <g>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
God this is fucking nice
...ved-cfd-dem/gas-solid-spouted-cylinder-bed/dem-packing-in-spouted-cylinder-bed-generator.prm
Show resolved
Hide resolved
examples/unresolved-cfd-dem/gas-solid-spouted-cylinder-bed/gas-solid-spouted-cylinder-bed.prm
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing way to handle deprecated parameters. Good job! I added some tiny comments here and there, and I believe you are aware of the "deprecated" instead of "depreciated". Apart from that, good to go for me.
applications_tests/lethe-particles/depreciated_parameters.output
Outdated
Show resolved
Hide resolved
set gx = 0.0 | ||
set gy = -1 | ||
set gz = 0.0 | ||
set g = 0.0, -1, 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird value for the gravity haha
set gx = 0.0 | ||
set gy = -1 | ||
set gz = 0.0 | ||
set g = 0.0, -1, 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this gravity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values of test don't need to be realistic. Sometime, (let's speak for myself) we need to tuned parameter in order to reproduce a specific bug or to reduce simulation time
# Gravitational acceleration in z direction | ||
set gz = -9.81 | ||
# Gravitational acceleration vector | ||
set g = 0.0, 0.0, 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you change the default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it was always set to 0.0 for all directions in the code, the doc was wrong
@blaisb Above the change log entry, I will update the PR template. Do you prefer I do it in this PR or in another very small PR, let's say without other reviewers? |
Whatever you think is best, both for me are OK. I generally prefer seperated PRs, but if its really minor, go ahead and do it in this one. |
fdc3f94
to
ac2c23f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good to go for me. Just add the flag reviewed and ready to merge once @OGaboriault is fine with the PR.
#1171) Description Parameters are often changed as refactoring in the DEM solver, but it causes issues when running simulation with old parameter files. Those files get incompatible with the latest version of the code and need to be updated by the user. There is a function in deal.II (called declare_alias()) that allows to still use old parameters as alias, but need to be the same type so the parsing stays the same. Also, it can give a warning about the deprecated file. We started, and we are planning, to convert some old individual parameter entries to one parameter that is a list of values. It means 3 parameters of double will be changed to one parameter of a list of double. In order to avoid the above, this refactoring aims to handles those old parameters. The only issue with the current implementation is there is no way to assert if the new parameter is set as a double. Also, this PR applies those changes to the gravity force in DEM. Testing New test deprecated_parameter uses the old gx, gy, gz parameters. The old parameters (in 2d or 3d) were tested and it works well and gives a warning for the deprecated parameter. Documentation The parameters gx, gy and gz are now g.
chaos-polymtl#1171) Description Parameters are often changed as refactoring in the DEM solver, but it causes issues when running simulation with old parameter files. Those files get incompatible with the latest version of the code and need to be updated by the user. There is a function in deal.II (called declare_alias()) that allows to still use old parameters as alias, but need to be the same type so the parsing stays the same. Also, it can give a warning about the deprecated file. We started, and we are planning, to convert some old individual parameter entries to one parameter that is a list of values. It means 3 parameters of double will be changed to one parameter of a list of double. In order to avoid the above, this refactoring aims to handles those old parameters. The only issue with the current implementation is there is no way to assert if the new parameter is set as a double. Also, this PR applies those changes to the gravity force in DEM. Testing New test deprecated_parameter uses the old gx, gy, gz parameters. The old parameters (in 2d or 3d) were tested and it works well and gives a warning for the deprecated parameter. Documentation The parameters gx, gy and gz are now g. Former-commit-id: 6c4a9d0
#1171) Description Parameters are often changed as refactoring in the DEM solver, but it causes issues when running simulation with old parameter files. Those files get incompatible with the latest version of the code and need to be updated by the user. There is a function in deal.II (called declare_alias()) that allows to still use old parameters as alias, but need to be the same type so the parsing stays the same. Also, it can give a warning about the deprecated file. We started, and we are planning, to convert some old individual parameter entries to one parameter that is a list of values. It means 3 parameters of double will be changed to one parameter of a list of double. In order to avoid the above, this refactoring aims to handles those old parameters. The only issue with the current implementation is there is no way to assert if the new parameter is set as a double. Also, this PR applies those changes to the gravity force in DEM. Testing New test deprecated_parameter uses the old gx, gy, gz parameters. The old parameters (in 2d or 3d) were tested and it works well and gives a warning for the deprecated parameter. Documentation The parameters gx, gy and gz are now g. Former-commit-id: 6c4a9d0
Description
Parameters are often changed as refactoring in the DEM solver, but it causes issues when running simulation with old parameter files.
Those files get incompatible with the latest version of the code and need to be updated by the user.
There is a function in deal.II (called
declare_alias()
) that allows to still use old parameters as alias, but need to be the same type so the parsing stays the same. Also, it can give a warning about the deprecated file.We started, and we are planning, to convert some old individual parameter entries to one parameter that is a list of values.
It means 3 parameters of double will be changed to one parameter of a list of double.
In order to avoid the above, this refactoring aims to handles those old parameters.
The only issue with the current implementation is there is no way to assert if the new parameter is set as a double.
Also, this PR applies those changes to the gravity force in DEM.
Testing
New test
deprecated_parameter
uses the old gx, gy, gz parameters.The old parameters (in 2d or 3d) were tested and it works well and gives a warning for the deprecated parameter.
Documentation
The parameters
gx
,gy
andgz
are nowg
.Miscellaneous (will be removed when merged)
I suggest we update the same test if we use other deprecated parameters
I changed the g parameter because I wanted to add a function version for my example, but I realised that it won't be very effective. So I drop this idea, but kept the list parameter. I added a way to use deprecated parameters because the gravity parameter is in every DEM prm file and the change may annoyed people (meeee the first!)
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: