-
Notifications
You must be signed in to change notification settings - Fork 708
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
Tetrahedral refinement and FiniteElement::prolongation/restriction. #16772
Comments
The test |
Picking up the discussion in #16755 When running diff --git a/tests/multigrid-global-coarsening/multigrid_a_01.cc b/tests/multigrid-global-coarsening/multigrid_a_01.cc
index b8b8991feb..424d3cd9f6 100644
--- a/tests/multigrid-global-coarsening/multigrid_a_01.cc
+++ b/tests/multigrid-global-coarsening/multigrid_a_01.cc
@@ -130,7 +130,7 @@ test(const unsigned int n_refinements,
deallog << dim << ' ' << fe_degree_fine << ' ' << n_refinements << ' '
<< (do_simplex_mesh ? "tri " : "quad") << ' '
- << solver_control.last_step() << std::endl;
+ << solver_control.last_step() << ' ' << dof_handlers[max_level].n_dofs() << std::endl;
static unsigned int counter = 0;
@@ -168,6 +168,7 @@ main(int argc, char **argv)
for (const auto ones_on_diagonal : {false, true})
{
+ if(false)
for (unsigned int n_refinements = 2; n_refinements <= 4; ++n_refinements)
for (unsigned int degree = 1; degree <= 4; ++degree)
test<2>(n_refinements,
@@ -177,6 +178,6 @@ main(int argc, char **argv)
for (unsigned int n_refinements = 2; n_refinements <= 4; ++n_refinements)
for (unsigned int degree = 1; degree <= 2; ++degree)
- test<2>(n_refinements, degree, true /*triangle*/, ones_on_diagonal);
+ test<3>(n_refinements, degree, true /*triangle*/, ones_on_diagonal);
}
} I get the following output (the second last numbers are the number of iterations):
The number of iterations look very similar before and after the patch. Is this related to the fact that this is |
If we run this test one more iteration and start with a subdivided hyper cube with 1 subdivision and an additional global refinement instead, you start to see better iteration counts:
This shows that either the embedding (for continuous shape functions) is correct also when the geometric configuration changes, or that the errors made in this process are insensitive within multigrid (because it is only a high-frequency error that gets damped on the finer level). I also checked with polynomial degree 3 (where I observed a bug, see #16775) and got 4-5 iterations. |
Right, we now can also test |
When testing the new refinement method compared to the old one, I only looked at DG. What I did observe was when going to a polynomial degree of 3 there was an segfault for pure geometric multigrid (so only h-refinement). This also happened for a ch-strategy in ExaDG. For a polynomial degree of 2 or less this didn't occur, also this error didn't show if p-refinement was used first in the multigrid preconditioner. Yet, the error occurs also if |
I am not sure what the best approach is. But let me document what I am currently thinking:
Manually setting the type in dealii/include/deal.II/fe/fe_tools.templates.h Lines 1736 to 1739 in 53bb2ba
|
@dominiktassilostill In a first step, what you could do is to prolongate a linear function from a coarse grid to a fine grid and to interpolate a linear function from a fine grid to a coarse grid. I guess the resulting solution is not linear anymore? |
I checked the prolongation matrices for the 3 different refinement cases and some of them are different. As the first 4 children are the same in each case, they also have the same prolongation matrices, for the rest there are only a few different entries (as most of the entries are 0 anyways) so as @kronbichler suggested the interpolation error is probably small and the tests do not show the effect.
@peterrum does this cover the outcome of your suggested experiment or was it intended to check something different? |
What @peterrum was suggesting is the approximation quality of the transfer, which means considering not the entries in the matrix itself, but the result: To this, you interpolate a linear function on the coarse grid, say a single Simplex. You can visualize it there with ParaView. Then prolongate the solution to the finer grid and visualize the result again. Since the linear function should be in the function space for both cases, it should look exactly the same. I believe that the two cases we introduced in the other PR do reproduce this behavior, but cause some artifacts for Either way, this problem should eventually be fixed. The interesting question would be whether the combination of restriction and prologation "almost" cures the problem in the special case of multigrid, apart from a fine-scale error.
Are you referring to a new name here? It is not really an anisotropic refinement, so I would not use the existing data structures for that, but set up a new path that stores these as |
The procedure @peterrum describes is in essence what |
As mentioned in #16755 (comment), now that we refine tetrahedra in different ways depending on the cell's geometry, a bunch of things are likely wrong. Specifically (copied from there):
I'm coming a bit late to this, but if the subdivision of a cell into children now depends on the specific cell, how does that affect what we do in
FiniteElement::get_prolongation_matrix()
? This function provides a matrix that facilitates the prolongation of values from the mother to a child cell. I don't know whether we implement these for tet cells already, but wouldn't we have to adapt what the function does?Specifically, we currently have
The use of
GeometryInfo<dim>
here is suspicious to begin with, but in any case,FETools::compute_embedding_matrices()
only works by considering the geometry of the reference cell (=reference tetrahedron here).The text was updated successfully, but these errors were encountered: