Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <array> 7 : #include <cstddef> 8 : #include <unordered_map> 9 : 10 : #include "Domain/Amr/Flag.hpp" 11 : 12 : /// \cond 13 : namespace amr { 14 : template <size_t VolumeDim> 15 : struct Info; 16 : } // namespace amr 17 : template <size_t VolumeDim, typename T> 18 : class DirectionalIdMap; 19 : template <size_t VolumeDim, typename T> 20 : class DirectionMap; 21 : template <size_t VolumeDim> 22 : class Element; 23 : template <size_t VolumeDim> 24 : class ElementId; 25 : template <size_t VolumeDim> 26 : class Mesh; 27 : template <size_t VolumeDim, typename IdType> 28 : class Neighbors; 29 : /// \endcond 30 : 31 : namespace amr { 32 : /*! 33 : * \ingroup AmrGroup 34 : * \brief Determine the new neighbors of an element during AMR, and the 35 : * neighbors' meshes. 36 : * 37 : * Can be used for both h-refinement and p-refinement. 38 : * 39 : * \param parent The parent element that is being refined. For h-refinement, 40 : * this is the element that is being split into children. For p-refinement, 41 : * this is the element that is being increased in resolution. 42 : * \param parent_info The AMR info of the parent element. 43 : * \param parent_neighbor_info The AMR info of the parent element's neighbors. 44 : * \param child_id The ID of the child element that is being created. For 45 : * h-refinement, this is the ID of the new child element. For p-refinement, 46 : * this is the same as the ID of the parent element. 47 : */ 48 : template <size_t VolumeDim> 49 : std::pair<DirectionMap<VolumeDim, Neighbors<VolumeDim, ElementId<VolumeDim>>>, 50 : DirectionalIdMap<VolumeDim, Mesh<VolumeDim>>> 51 1 : neighbors_of_child( 52 : const Element<VolumeDim>& parent, const Info<VolumeDim>& parent_info, 53 : const std::unordered_map<ElementId<VolumeDim>, Info<VolumeDim>>& 54 : parent_neighbor_info, 55 : const ElementId<VolumeDim>& child_id); 56 : } // namespace amr