fdrmrc / Polydeal

C++ implementation of Polygonal Discontinuous Galerkin method within the deal.II Finite Element library.
https://fdrmrc.github.io/Polydeal/
Other
0 stars 0 forks source link

Add `children()` method to accessor class #107

Closed fdrmrc closed 6 months ago

fdrmrc commented 7 months ago

Depends on #106

Adds a member children() to the Accessor class. It returns the indices of the children polytopes. This, together with the DoFHandler over which these children are living, allows retrieving DoF indices associated to children and, ultimately, to set embedding matrices up in a "two-level-transfer" fashion.

I have tried this locally and works as follows:

    std::vector<types::global_dof_index> local_dof_indices_child(dg_fe.n_dofs_per_cell());
    for (const auto &polytope : ah_coarse->polytope_iterators())
      {
        const types::global_cell_index polytope_index = polytope->index();
        const auto &children = polytope->children(); // ! method added by this PR
        for (const types::global_cell_index child_idx : children)
          {
            const typename DoFHandler<dim>::active_cell_iterator &child_dh =
              ah_fine->polytope_to_dh_iterator(child_idx);
            child_dh->get_dof_indices(local_dof_indices_child);
          }
          // define sparsity pattern and perform loc2glb distribution
      }

A test showing what I wrote above will be added.

fdrmrc commented 6 months ago

This has been tested and used in all multigrid tests. I'm merging this.