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

FieldTransfer: enable coarsening #14802

Merged
merged 1 commit into from Feb 16, 2023

Conversation

sebproell
Copy link
Contributor

The new FieldTransfer class does not seem to be able to coarsen a non-constant FE field. This PR suggests a way to achieve this, similar to SolutionTransfer.

remark: I am not super happy with the implementation, since this functionality is mostly copied and adapted from SolutionTransfer and get_interpolated_dof_values. Overall FieldTransfer and SolutionTransfer share a lot of functionality but differ in certain details. There was some discussion how to best implement the requirements some of us have on transfer of field vectors in #12759. I would be happy to help in future development of these classes. Actually, I also require the averaging functionality of SolutionTransfer introduced in #13457.

@Rombur
Copy link
Member

Rombur commented Feb 15, 2023

I agree that FieldTransfer should not exist and everything should be done in SolutionTransfer but it's not obvious to me how that would work. @marcfehling maybe you should write down exactly how you envision this to work and I can take it from there.

include/deal.II/distributed/field_transfer.h Show resolved Hide resolved
const auto &fe = dof_handler.get_fe(fe_index);
Assert(fe.n_dofs_per_cell() > 0,
ExcMessage(
"Cannot coarsen onto a FiniteElement with no DoFs."));
Copy link
Member

Choose a reason for hiding this comment

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

Is that true even if all the children cells use FE_Nothing?

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 the FE here (returned by the domination logic) should never be FE_Nothing.

tests/hp/field_transfer_05.cc Outdated Show resolved Hide resolved
{
if (cell->is_locally_owned())
{
if (cell->center()[0] < 0.5)
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 add a test where you coarsen FE_Nothing cells

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 added it but now I get an error (floating point exception in LAPACKFullMatrix::vmult inside interpolate) when trying to resolve the hanging node constraints.

Copy link
Member

Choose a reason for hiding this comment

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

OK it is a weird thing to do anyway. I would be fine merging this PR which improves the current situation, if you open an issue that describes the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #14807

@marcfehling
Copy link
Member

I agree that FieldTransfer should not exist and everything should be done in SolutionTransfer but it's not obvious to me how that would work. @marcfehling maybe you should write down exactly how you envision this to work and I can take it from there.

As of now I can only refer to the initial idea I had here #11132 (comment), and here #12759 (comment) (and the follow-up discussion).

I cannot work on this topic right now as of immediate deadlines ahead. I will have time in spring to put more thought into it. We should also fix the remaining issues with FE_Nothing first, listed in #23 (project) (I will add this PR to the project). @Rombur -- I hope we can work on it together at the next meet-up, at the latest.

@marcfehling marcfehling added this to FE activation in SolutionTransfer in Fix `FE_Nothing` Feb 16, 2023
@Rombur
Copy link
Member

Rombur commented Feb 16, 2023

/rebuild

@masterleinad masterleinad merged commit 0d8c061 into dealii:master Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Fix `FE_Nothing`
FE activation in SolutionTransfer
Development

Successfully merging this pull request may close these issues.

None yet

4 participants