// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2016 - 2024 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-2.1-or-later. Detailed license information // governing the source code and code contributions can be found in // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. // // ------------------------------------------------------------------------ #ifndef dealii_mg_transfer_internal_h #define dealii_mg_transfer_internal_h #include #include #include #include #include DEAL_II_NAMESPACE_OPEN namespace internal { namespace MGTransfer { /** * Internal function for filling the copy indices from global to level * indices * * If @p skip_interface_dofs is false, the mapping will also contain * DoFs at the interface between levels. This is desirable when * transferring solution vectors instead of residuals. */ template void fill_copy_indices( const DoFHandler &dof_handler, const MGConstrainedDoFs *mg_constrained_dofs, std::vector>> ©_indices, std::vector>> ©_indices_global_mine, std::vector>> ©_indices_level_mine, const bool skip_interface_dofs = true); /** * Given the collection of child cells in lexicographic ordering as seen * from the parent, this function computes the first index of the given * child */ template unsigned int compute_shift_within_children(const unsigned int child, const unsigned int fe_shift_1d, const unsigned int fe_degree); /** * A structure that stores data related to the finite element contained in * the DoFHandler. Used only for the initialization using * setup_transfer. */ template struct ElementInfo { /** * A variable storing the degree of the finite element. The selection of * the computational kernel is based on this number. */ unsigned int fe_degree; /** * A variable storing whether the element is continuous and there is a * joint degree of freedom in the center of the 1d line. */ bool element_is_continuous; /** * A variable storing the number of components in the finite element. */ unsigned int n_components; /** * A variable storing the number of degrees of freedom on all child cells. * It is 2dim*fe.n_dofs_per_cell() for DG elements and * somewhat less for continuous elements. */ unsigned int n_child_cell_dofs; /** * An array that holds the numbering between the numbering of degrees of * freedom in the finite element and the lexicographic numbering needed * for the tensor product application. */ std::vector lexicographic_numbering; /** * This variable holds the one-dimensional embedding (prolongation) matrix * from parent element to all the children. */ std::vector prolongation_matrix_1d; }; /** * Set up most of the internal data structures of MGTransferMatrixFree */ template void setup_transfer( const DoFHandler &dof_handler, const MGConstrainedDoFs *mg_constrained_dofs, const std::vector> &external_partitioners, ElementInfo &elem_info, std::vector> &level_dof_indices, std::vector>> &parent_child_connect, std::vector &n_owned_level_cells, std::vector>> &dirichlet_indices, std::vector> &weights_on_refined, std::vector> ©_indices_global_mine, MGLevelObject> &vector_partitioners); /** * Helper function for setup_transfer. Checks for identity constrained * dofs and replace with the indices of the dofs to which they are * constrained */ void resolve_identity_constraints( const MGConstrainedDoFs *mg_constrained_dofs, const unsigned int level, std::vector &dof_indices); } // namespace MGTransfer } // namespace internal DEAL_II_NAMESPACE_CLOSE #endif