-
Notifications
You must be signed in to change notification settings - Fork 8
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
Replace the ".uid" in polarpoissonlikesolver.hpp. #196
base: main
Are you sure you want to change the base?
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.
Indeed this should silence the warnings but I am afraid we still have the same underlying problem. Calling the constructor https://ddc.mdls.fr/classddc_1_1DiscreteElement.html#af6776e89752caf2077e70f690502a5e5 should be done as a last resort. One should see uid()
and this constructor as DDC exits.
Isn't there a function in splines that could get you the Idx<RCellDim>
for example ? Is RCellDim
the dimension of knots ?
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.
RCellDim
is the dimension of the cells on which the bsplines are defined. It is declared here:
gyselalibxx/src/pde_solvers/polarpoissonlikesolver.hpp
Lines 80 to 82 in 0647e3d
struct RCellDim | |
{ | |
}; |
As it is inside this class I don't think it is dangerous to call this constructor.
That said in the places where - Idx<RCellDim>(0)
is used it seems to me that some of the operations could be carried out directly with an Idx
.
assert(ib_test_theta.uid() < BSplinesTheta::degree() + 1); | ||
assert(ib_trial_r.uid() < BSplinesR::degree() + 1); | ||
assert(ib_trial_theta.uid() < BSplinesTheta::degree() + 1); | ||
assert((ib_test_r - Idx<RBasisSubset>(0)).value() < BSplinesR::degree() + 1); |
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.
assert((ib_test_r - Idx<RBasisSubset>(0)).value() < BSplinesR::degree() + 1); | |
assert(ib_test_r < Idx<RBasisSubset>(BSplinesR::degree() + 1)); |
const std::size_t idx_trial_r_val = (idx_trial_r - m_idx_bsplines_r_front).value(); | ||
const std::size_t idx_trial_theta_val | ||
= (idx_trial_theta - m_idx_bsplines_theta_front).value(); | ||
const std::size_t first_overlap_element_r_val | ||
= idx_trial_r_val < BSplinesR::degree() | ||
? 0 | ||
: idx_trial_r_val - BSplinesR::degree(); | ||
|
||
const Idx<RCellDim> first_overlap_element_r(first_overlap_element_r_val); |
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.
Are integers needed here? Is it not possible to do something like:
const std::size_t idx_trial_r_val = (idx_trial_r - m_idx_bsplines_r_front).value(); | |
const std::size_t idx_trial_theta_val | |
= (idx_trial_theta - m_idx_bsplines_theta_front).value(); | |
const std::size_t first_overlap_element_r_val | |
= idx_trial_r_val < BSplinesR::degree() | |
? 0 | |
: idx_trial_r_val - BSplinesR::degree(); | |
const Idx<RCellDim> first_overlap_element_r(first_overlap_element_r_val); | |
const Idx<RCellDim> first_overlap_element_r( | |
idx_trial_r < Idx<RCellDim>(BSplinesR::degree()) | |
? Idx<RCellDim>(0) | |
: idx_trial_r - BSplinesR::degree()); |
?
Or is idx_trial_r
the wrong type for this?
If you want to fix the warnings in this file then the 2 remaining warnings (which are easier to fix) should be addressed. That said I was under the impression that we had agreed to leave this file as it is (with the warnings) for now as this code should be replaced in the coming months by a new implementation written by @etiennemlb . I think that a clean solution to these warnings involves more work than simply writing |
I noticed that the static_analysis often fails on the
polarpoissonlikesolver.hpp
file because of the remaining.uid()
. I tried to replace them.