Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <type_traits> 7 : 8 : #include "ParallelAlgorithms/Amr/Protocols/Projector.hpp" 9 : #include "Utilities/ProtocolHelpers.hpp" 10 : #include "Utilities/TMPL.hpp" 11 : 12 1 : namespace amr::protocols { 13 : /// \brief Compile-time information for AMR projectors 14 : /// 15 : /// A class conforming to this protocol is placed in the metavariables to 16 : /// provide the following: 17 : /// - `element_array`: The array component on which AMR is performed. 18 : /// - `projectors`: A type list of AMR projectors (each of which must conform to 19 : /// amr::protocols::Projector) that will be applied by: 20 : /// - amr::Actions::InitializeChild and amr::Actions::InitializeParent in 21 : /// order to initialize data on newly created elements. 22 : /// - amr::Actions::AdjustDomain in order to update data on existing 23 : /// elements in case their Mesh or neighbors have changed. 24 : /// 25 : /// Here is an example for a class conforming to this protocol: 26 : /// 27 : /// \snippet Amr/Test_Protocols.cpp amr_projectors 28 1 : struct AmrMetavariables { 29 : template <typename ConformingType> 30 0 : struct test { 31 0 : using element_array = typename ConformingType::element_array; 32 0 : using projectors = typename ConformingType::projectors; 33 : static_assert( 34 : tmpl::all<projectors, 35 : tt::assert_conforms_to<tmpl::_1, Projector>>::value); 36 : }; 37 : }; 38 : } // namespace amr::protocols