Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <vector> 7 : 8 : #include "Utilities/TMPL.hpp" 9 : #include "Evolution/Imex/Protocols/ImplicitSourceJacobian.hpp" 10 : 11 : namespace imex { 12 : /// Type of guess returned from an implicit sector's `initial_guess` 13 : /// mutator. If `ExactSolution` is returned, the implicit solve is 14 : /// skipped. 15 0 : enum class GuessResult { InitialGuess, ExactSolution }; 16 : 17 : /// Mutator for the `initial_guess` of an implicit sector that does 18 : /// not modify the variables. The initial guess is therefore the 19 : /// result of the explicit step. 20 1 : struct GuessExplicitResult { 21 0 : using return_tags = tmpl::list<>; 22 0 : using argument_tags = tmpl::list<>; 23 : template <typename ImplicitVars> 24 0 : static std::vector<GuessResult> apply( 25 : const ImplicitVars& /*inhomogeneous_terms*/, 26 : const double /*implicit_weight*/) { 27 : return {}; 28 : } 29 : }; 30 : 31 : /// Mutator for the `jacobian` of an implicit sector that has an 32 : /// analytic solution. Such a sector never does numerical solves, and 33 : /// so does not need an available jacobian. 34 : /// 35 : /// \note The `source` mutator is always required, even if the 36 : /// implicit equation can be solved analytically. 37 1 : struct NoJacobianBecauseSolutionIsAnalytic 38 : : tt::ConformsTo<imex::protocols::ImplicitSourceJacobian>, 39 : tt::ConformsTo<::protocols::StaticReturnApplyable> { 40 0 : using return_tags = tmpl::list<>; 41 0 : using argument_tags = tmpl::list<>; 42 0 : [[noreturn]] static void apply(); 43 : }; 44 : } // namespace imex