Skip to content
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

Merged
merged 1 commit into from Jun 7, 2022
Merged

Conversation

NiklasWik
Copy link
Contributor

Related to #13910 (comment)

Haven't tried to compile myself but I'm guessing this would work.

@@ -3697,6 +3697,9 @@ namespace internal
const unsigned int face_no,
const MatrixFreeFunctions::ShapeInfo<Number> &shape_info)
{
if (dim == 1)
Copy link
Member

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!

Copy link
Contributor Author

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

Copy link
Member

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:

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);

Copy link
Contributor Author

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

Assert(dim >= 2, ExcImpossibleInDim(dim));

@kronbichler
Copy link
Member

/rebuild

Copy link
Member

@kronbichler kronbichler left a 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.

Comment on lines 3700 to 3701
if (dim == 1)
return;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

@kronbichler kronbichler merged commit 45a0cfb into dealii:master Jun 7, 2022
@NiklasWik NiklasWik deleted the compiler_warnings branch June 7, 2022 11:21
mkghadban pushed a commit to OpenFCST/dealii that referenced this pull request Sep 8, 2022
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.

None yet

5 participants