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
Fix compiler warning #13914
Fix compiler warning #13914
Conversation
@@ -3697,6 +3697,9 @@ namespace internal | |||
const unsigned int face_no, | |||
const MatrixFreeFunctions::ShapeInfo<Number> &shape_info) | |||
{ | |||
if (dim == 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.
Question: is it possible to have a 1D RT? If not one should probably also add here an assert!
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.
I think it is asserted in the class itself, but I might be mistaken
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.
There is no assert here:
dealii/include/deal.II/matrix_free/evaluation_kernels.h
Lines 3555 to 3557 in ecdd5f2
if (shape_info.element_type == MatrixFreeFunctions::tensor_raviart_thomas) | |
interpolate_generic_raviart_thomas<do_evaluate, add_into_output>( | |
n_components, input, output, flags, face_no, shape_info); |
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.
This is the one I was referring to
dealii/source/fe/fe_raviart_thomas_nodal.cc
Line 445 in ecdd5f2
Assert(dim >= 2, ExcImpossibleInDim(dim)); |
/rebuild |
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.
This looks good, let us merge it soon and see if the outcome is as desired.
if (dim == 1) | ||
return; |
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.
if (dim == 1) | |
return; | |
if (dim == 1) | |
{ | |
Assert(false, ExcInternalError()); | |
return; | |
} |
As you said, as this condition should never be met, I would suggest to clarify this be adding another assertion here right before the return statement. If you want to, you could add another in-source comment to why this return statement is necessary.
ecdd5f2
to
6ce72c8
Compare
Fix compiler warning
Related to #13910 (comment)
Haven't tried to compile myself but I'm guessing this would work.