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 : 9 : /// \cond 10 : namespace amr { 11 : enum class Flag; 12 : class Policies; 13 : } // namespace amr 14 : template <size_t Dim> 15 : class ElementId; 16 : namespace gsl { 17 : template <typename T> 18 : class not_null; 19 : } // namespace gsl 20 : template <size_t Dim> 21 : class Mesh; 22 : /// \endcond 23 : 24 : namespace amr { 25 : /// \brief Updates amr_decision so that it satisfies amr_policies 26 : /// 27 : /// \details 28 : /// - If amr_policies.isotropy() is Isotropic, the Flag%s are changed to all be 29 : /// the same as the maximum priority flag 30 : /// - If any Flag would cause the refinement levels or resolution to violate 31 : /// their bounds, the Flag is changed to DoNothing. Note that the minimum 32 : /// resolution is Basis and Quadrature dependent, so may be higher than the 33 : /// given amr_policies.refinement_limits().minimum_resolution() 34 : /// - If an `amr_decision` tried to go beyond the `amr::Limits` in any 35 : /// direction, this function will error if 36 : /// `amr::Limits::error_beyond_limits()` is true. 37 : template <size_t Dim> 38 1 : void enforce_policies(gsl::not_null<std::array<Flag, Dim>*> amr_decision, 39 : const amr::Policies& amr_policies, 40 : const ElementId<Dim>& element_id, const Mesh<Dim>& mesh); 41 : } // namespace amr