TerminateIfConverged.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <tuple>
7 
10 
11 /// \cond
12 namespace tuples {
13 template <typename...>
14 class TaggedTuple;
15 } // namespace tuples
16 namespace Parallel {
17 template <typename>
18 struct ConstGlobalCache;
19 } // namespace Parallel
20 /// \endcond
21 
22 namespace LinearSolver {
23 namespace Actions {
24 
25 /*!
26  * \brief Terminate the algorithm if the linear solver has converged.
27  *
28  * Uses:
29  * - DataBox:
30  * - `LinearSolver::Tags::HasConverged`
31  */
33  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
34  typename ArrayIndex, typename ActionList,
35  typename ParallelComponent>
36  static auto apply(db::DataBox<DbTagsList>& box,
39  const ArrayIndex& /*array_index*/,
40  const ActionList /*meta*/,
41  const ParallelComponent* const /*meta*/) noexcept {
42  return std::tuple<db::DataBox<DbTagsList>&&, bool>(
43  std::move(box), db::get<LinearSolver::Tags::HasConverged>(box));
44  }
45 };
46 
47 } // namespace Actions
48 } // namespace LinearSolver
Defines DataBox tags for the linear solver.
Functionality for solving linear systems of equations.
Definition: TerminateIfConverged.hpp:22
Definition: TaggedTuple.hpp:25
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
constexpr auto apply(F &&f, const DataBox< BoxTags > &box, Args &&... args)
Apply the function f with argument Tags TagsList from DataBox box
Definition: DataBox.hpp:1595
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Defines classes and functions used for manipulating DataBox&#39;s.
Terminate the algorithm if the linear solver has converged.
Definition: TerminateIfConverged.hpp:32
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
A Charm++ chare that caches constant data once per Charm++ node.
Definition: ConstGlobalCache.hpp:76
Definition: SolvePoissonProblem.hpp:38
Definition: ComputeTimeDerivative.hpp:28