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 mapping fe field similarity #9769

Merged

Conversation

kronbichler
Copy link
Member

We had the cell similarity detection in MappingFEField enabled (in analogy to MappingQGeneric), even though we cannot know for an Euler vector whether there really is a similarity. Therefore, we must completely disable this concept in case of a MappingFEField and similarily also for MappingManifold.

Fixes #9757

@kronbichler
Copy link
Member Author

The diff is best watched without whitespace,
https://github.com/dealii/dealii/pull/9769/files?diff=unified&w=1

@kronbichler kronbichler force-pushed the fix_mapping_fe_field_similarity branch from 87da40a to 20de795 Compare March 29, 2020 14:04
@kronbichler kronbichler added this to the Release 9.2 milestone Mar 29, 2020
Copy link
Member

@bangerth bangerth left a comment

Choose a reason for hiding this comment

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

Good detective work!

OK with the minor changes while you're there. Since you're also changing MappingManifold, do you want to add a similar test for that class as well?

MappingFEField when the underlying mesh had similarities, even though the
deformed cells did not. This would lead to wrong Jacobians and transformed
shape function gradients, among others, when running deal.II without threads.
This is now fixed.
Copy link
Member

Choose a reason for hiding this comment

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

Can you update that the same fix applies to MappingManifold (since you also do this in this patch)?

}
for (unsigned int k = 0; k < data.n_shape_functions; ++k)
{
unsigned int comp_k = fe.system_to_component_index(k).first;
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
unsigned int comp_k = fe.system_to_component_index(k).first;
const unsigned int comp_k = fe.system_to_component_index(k).first;

for (unsigned int i = 0; i < spacedim; ++i)
for (unsigned int k = 0; k < data.n_shape_functions; ++k)
{
unsigned int comp_k = fe.system_to_component_index(k).first;
Copy link
Member

Choose a reason for hiding this comment

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

While you're there:

Suggested change
unsigned int comp_k = fe.system_to_component_index(k).first;
const unsigned int comp_k = fe.system_to_component_index(k).first;

for (unsigned int j = 0; j < spacedim; ++j)
for (unsigned int k = 0; k < data.n_shape_functions; ++k)
{
unsigned int comp_k = fe.system_to_component_index(k).first;
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
unsigned int comp_k = fe.system_to_component_index(k).first;
const unsigned int comp_k = fe.system_to_component_index(k).first;

@kronbichler
Copy link
Member Author

Since you're also changing MappingManifold, do you want to add a similar test for that class as well?

To be honest, I don't know a good way of how to construct a proper manifold that would trigger this. Let me make a short test with a spherical manifold in 2d.

@kronbichler kronbichler force-pushed the fix_mapping_fe_field_similarity branch from 20de795 to 6cc3b12 Compare March 29, 2020 18:13
@kronbichler
Copy link
Member Author

It turned out that it was not too complicated to get that test - just take a refined hyper cube and let the edges be deformed differently with MappingManifold. Cells are similar but the deformed shapes are not.
I have pushed this test, alongside with the proposed updates.

@kronbichler kronbichler merged commit 3b5b170 into dealii:master Mar 30, 2020
@kronbichler kronbichler deleted the fix_mapping_fe_field_similarity branch March 30, 2020 05:15
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.

Test matrix_free/matrix_vector_faces_28.debug fails
2 participants