ElementActions.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <limits>
8 #include <optional>
9 #include <tuple>
10 #include <type_traits>
11 #include <utility>
12 
14 #include "DataStructures/DataBox/PrefixHelpers.hpp"
15 #include "NumericalAlgorithms/Convergence/HasConverged.hpp"
16 #include "NumericalAlgorithms/Convergence/Tags.hpp"
18 #include "Parallel/AlgorithmMetafunctions.hpp"
19 #include "Parallel/GetSection.hpp"
20 #include "Parallel/GlobalCache.hpp"
21 #include "Parallel/Invoke.hpp"
22 #include "Parallel/Reduction.hpp"
23 #include "Parallel/Tags/Section.hpp"
24 #include "ParallelAlgorithms/LinearSolver/Gmres/ResidualMonitorActions.hpp"
25 #include "ParallelAlgorithms/LinearSolver/Gmres/Tags/InboxTags.hpp"
28 #include "Utilities/Functional.hpp"
29 #include "Utilities/GetOutput.hpp"
30 #include "Utilities/Gsl.hpp"
32 #include "Utilities/Requires.hpp"
33 #include "Utilities/TMPL.hpp"
34 
35 /// \cond
36 namespace tuples {
37 template <typename...>
38 class TaggedTuple;
39 } // namespace tuples
40 namespace LinearSolver::gmres::detail {
41 template <typename Metavariables, typename FieldsTag, typename OptionsGroup>
42 struct ResidualMonitor;
43 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
44  typename Label, typename ArraySectionIdTag>
45 struct PrepareStep;
46 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
47  typename Label, typename ArraySectionIdTag>
48 struct NormalizeOperandAndUpdateField;
49 } // namespace LinearSolver::gmres::detail
50 /// \endcond
51 
52 namespace LinearSolver::gmres::detail {
53 
54 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
55  typename Label, typename SourceTag, typename ArraySectionIdTag>
56 struct PrepareSolve {
57  private:
58  using fields_tag = FieldsTag;
59  using initial_fields_tag = db::add_tag_prefix<::Tags::Initial, fields_tag>;
60  using source_tag = SourceTag;
61  using operator_applied_to_fields_tag =
63  using operand_tag =
65  using basis_history_tag =
67 
68  public:
69  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
70  typename ArrayIndex, typename ActionList,
71  typename ParallelComponent>
73  db::DataBox<DbTagsList>& box,
74  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
76  const ArrayIndex& array_index, const ActionList /*meta*/,
77  const ParallelComponent* const /*meta*/) noexcept {
78  db::mutate<Convergence::Tags::IterationId<OptionsGroup>>(
79  make_not_null(&box),
80  [](const gsl::not_null<size_t*> iteration_id) noexcept {
81  *iteration_id = 0;
82  });
83 
84  // Skip the initial reduction on elements that are not part of the section
85  if constexpr (not std::is_same_v<ArraySectionIdTag, void>) {
86  if (not db::get<Parallel::Tags::Section<ParallelComponent,
87  ArraySectionIdTag>>(box)
88  .has_value()) {
89  return {std::move(box)};
90  }
91  }
92 
94  ::Verbosity::Debug)) {
95  Parallel::printf("%s %s: Prepare solve\n", get_output(array_index),
96  Options::name<OptionsGroup>());
97  }
98 
99  db::mutate<operand_tag, initial_fields_tag, basis_history_tag>(
100  make_not_null(&box),
101  [](const auto operand, const auto initial_fields,
102  const auto basis_history, const auto& source,
103  const auto& operator_applied_to_fields,
104  const auto& fields) noexcept {
105  *operand = source - operator_applied_to_fields;
106  *initial_fields = fields;
107  *basis_history = typename basis_history_tag::type{};
108  },
109  get<source_tag>(box), get<operator_applied_to_fields_tag>(box),
110  get<fields_tag>(box));
111 
112  auto& section = Parallel::get_section<ParallelComponent, ArraySectionIdTag>(
113  make_not_null(&box));
114  Parallel::contribute_to_reduction<InitializeResidualMagnitude<
115  FieldsTag, OptionsGroup, ParallelComponent>>(
116  Parallel::ReductionData<
118  inner_product(get<operand_tag>(box), get<operand_tag>(box))},
119  Parallel::get_parallel_component<ParallelComponent>(cache)[array_index],
121  ResidualMonitor<Metavariables, FieldsTag, OptionsGroup>>(cache),
122  make_not_null(&section));
123 
124  if constexpr (Preconditioned) {
125  using preconditioned_operand_tag =
127  using preconditioned_basis_history_tag =
129 
130  db::mutate<preconditioned_basis_history_tag>(
131  make_not_null(&box),
132  [](const auto preconditioned_basis_history) noexcept {
133  *preconditioned_basis_history =
134  typename preconditioned_basis_history_tag::type{};
135  });
136  }
137 
138  return {std::move(box)};
139  }
140 };
141 
142 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
143  typename Label, typename ArraySectionIdTag>
144 struct NormalizeInitialOperand {
145  private:
146  using fields_tag = FieldsTag;
147  using operand_tag =
149  using basis_history_tag =
151 
152  public:
153  using const_global_cache_tags =
154  tmpl::list<logging::Tags::Verbosity<OptionsGroup>>;
155  using inbox_tags = tmpl::list<Tags::InitialOrthogonalization<OptionsGroup>>;
156 
157  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
158  typename ArrayIndex, typename ActionList,
159  typename ParallelComponent>
161  size_t>
162  apply(db::DataBox<DbTagsList>& box,
164  const Parallel::GlobalCache<Metavariables>& /*cache*/,
165  const ArrayIndex& array_index, const ActionList /*meta*/,
166  const ParallelComponent* const /*meta*/) noexcept {
167  const size_t iteration_id =
168  db::get<Convergence::Tags::IterationId<OptionsGroup>>(box);
169  auto& inbox = get<Tags::InitialOrthogonalization<OptionsGroup>>(inboxes);
170  if (inbox.find(iteration_id) == inbox.end()) {
171  return {std::move(box), Parallel::AlgorithmExecution::Retry,
173  }
174 
175  auto received_data = std::move(inbox.extract(iteration_id).mapped());
176  const double residual_magnitude = get<0>(received_data);
177  auto& has_converged = get<1>(received_data);
178  db::mutate<Convergence::Tags::HasConverged<OptionsGroup>>(
179  make_not_null(&box),
180  [&has_converged](const gsl::not_null<Convergence::HasConverged*>
181  local_has_converged) noexcept {
182  *local_has_converged = std::move(has_converged);
183  });
184 
185  // Skip steps entirely if the solve has already converged
186  constexpr size_t step_end_index = tmpl::index_of<
187  ActionList,
188  NormalizeOperandAndUpdateField<FieldsTag, OptionsGroup, Preconditioned,
189  Label, ArraySectionIdTag>>::value;
191  return {std::move(box), Parallel::AlgorithmExecution::Continue,
192  step_end_index + 1};
193  }
194 
195  // Skip the solve entirely on elements that are not part of the section. To
196  // do so, we skip ahead to the `ApplyOperatorActions` action list between
197  // `PrepareStep` and `PerformStep`. Those actions need a chance to run even
198  // on elements that are not part of the section, because they may take part
199  // in preconditioning (see Multigrid preconditioner).
200  if constexpr (not std::is_same_v<ArraySectionIdTag, void>) {
201  if (not db::get<Parallel::Tags::Section<ParallelComponent,
202  ArraySectionIdTag>>(box)
203  .has_value()) {
204  constexpr size_t prepare_step_index =
205  tmpl::index_of<ActionList,
206  PrepareStep<FieldsTag, OptionsGroup, Preconditioned,
207  Label, ArraySectionIdTag>>::value;
208  return {std::move(box), Parallel::AlgorithmExecution::Continue,
209  prepare_step_index + 1};
210  }
211  }
212 
214  ::Verbosity::Debug)) {
215  Parallel::printf("%s %s(%zu): Normalize initial operand\n",
216  get_output(array_index), Options::name<OptionsGroup>(),
217  iteration_id);
218  }
219 
220  db::mutate<operand_tag, basis_history_tag>(
221  make_not_null(&box),
222  [residual_magnitude](const auto operand,
223  const auto basis_history) noexcept {
224  *operand /= residual_magnitude;
225  basis_history->push_back(*operand);
226  });
227 
228  constexpr size_t this_action_index =
229  tmpl::index_of<ActionList, NormalizeInitialOperand>::value;
230  return {std::move(box), Parallel::AlgorithmExecution::Continue,
231  this_action_index + 1};
232  }
233 };
234 
235 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
236  typename Label, typename ArraySectionIdTag>
237 struct PrepareStep {
238  using const_global_cache_tags =
239  tmpl::list<logging::Tags::Verbosity<OptionsGroup>>;
240 
241  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
242  typename ArrayIndex, typename ActionList,
243  typename ParallelComponent>
245  db::DataBox<DbTagsList>& box,
246  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
247  const Parallel::GlobalCache<Metavariables>& /*cache*/,
248  const ArrayIndex& array_index, const ActionList /*meta*/,
249  const ParallelComponent* const /*meta*/) noexcept {
250  const size_t iteration_id =
251  db::get<Convergence::Tags::IterationId<OptionsGroup>>(box);
253  ::Verbosity::Debug)) {
254  Parallel::printf("%s %s(%zu): Prepare step\n", get_output(array_index),
255  Options::name<OptionsGroup>(), iteration_id);
256  }
257 
258  if constexpr (Preconditioned) {
259  using fields_tag = FieldsTag;
260  using operand_tag =
262  using preconditioned_operand_tag =
264  using operator_tag = db::add_tag_prefix<
266  std::conditional_t<Preconditioned, preconditioned_operand_tag,
267  operand_tag>>;
268 
269  db::mutate<preconditioned_operand_tag, operator_tag>(
270  make_not_null(&box),
271  [](const auto preconditioned_operand,
272  const auto operator_applied_to_operand,
273  const auto& operand) noexcept {
274  // Start the preconditioner at zero because we have no reason to
275  // expect the remaining residual to have a particular form.
276  // Another possibility would be to start the preconditioner with an
277  // initial guess equal to its source, so not running the
278  // preconditioner at all means it is the identity, but that approach
279  // appears to yield worse results.
280  *preconditioned_operand =
281  make_with_value<typename preconditioned_operand_tag::type>(
282  operand, 0.);
283  // Also set the operator applied to the initial preconditioned
284  // operand to zero because it's linear. This may save the
285  // preconditioner an operator application if it's optimized for
286  // this.
287  *operator_applied_to_operand =
288  make_with_value<typename operator_tag::type>(operand, 0.);
289  },
290  get<operand_tag>(box));
291  }
292  return {std::move(box)};
293  }
294 };
295 
296 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
297  typename Label, typename ArraySectionIdTag>
298 struct PerformStep {
299  private:
300  using fields_tag = FieldsTag;
301  using operand_tag =
303  using preconditioned_operand_tag =
305 
306  public:
307  using const_global_cache_tags =
308  tmpl::list<logging::Tags::Verbosity<OptionsGroup>>;
309 
310  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
311  typename ArrayIndex, typename ActionList,
312  typename ParallelComponent>
314  size_t>
315  apply(db::DataBox<DbTagsList>& box,
316  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
318  const ArrayIndex& array_index, const ActionList /*meta*/,
319  const ParallelComponent* const /*meta*/) noexcept {
320  // Skip to the end of the step on elements that are not part of the section
321  if constexpr (not std::is_same_v<ArraySectionIdTag, void>) {
322  if (not db::get<Parallel::Tags::Section<ParallelComponent,
323  ArraySectionIdTag>>(box)
324  .has_value()) {
325  constexpr size_t step_end_index =
326  tmpl::index_of<ActionList,
327  NormalizeOperandAndUpdateField<
328  FieldsTag, OptionsGroup, Preconditioned, Label,
329  ArraySectionIdTag>>::value;
330  return {std::move(box), Parallel::AlgorithmExecution::Continue,
331  step_end_index};
332  }
333  }
334 
335  const size_t iteration_id =
336  db::get<Convergence::Tags::IterationId<OptionsGroup>>(box);
338  ::Verbosity::Debug)) {
339  Parallel::printf("%s %s(%zu): Perform step\n", get_output(array_index),
340  Options::name<OptionsGroup>(), iteration_id);
341  }
342 
343  using operator_tag = db::add_tag_prefix<
345  std::conditional_t<Preconditioned, preconditioned_operand_tag,
346  operand_tag>>;
347  using orthogonalization_iteration_id_tag =
350  using basis_history_tag =
352 
353  if constexpr (Preconditioned) {
354  using preconditioned_basis_history_tag =
356 
357  db::mutate<preconditioned_basis_history_tag>(
358  make_not_null(&box),
359  [](const auto preconditioned_basis_history,
360  const auto& preconditioned_operand) noexcept {
361  preconditioned_basis_history->push_back(preconditioned_operand);
362  },
363  get<preconditioned_operand_tag>(box));
364  }
365 
366  db::mutate<operand_tag, orthogonalization_iteration_id_tag>(
367  make_not_null(&box),
368  [](const auto operand,
369  const gsl::not_null<size_t*> orthogonalization_iteration_id,
370  const auto& operator_action) noexcept {
371  *operand = typename operand_tag::type(operator_action);
372  *orthogonalization_iteration_id = 0;
373  },
374  get<operator_tag>(box));
375 
376  auto& section = Parallel::get_section<ParallelComponent, ArraySectionIdTag>(
377  make_not_null(&box));
379  StoreOrthogonalization<FieldsTag, OptionsGroup, ParallelComponent>>(
380  Parallel::ReductionData<
384  get<Convergence::Tags::IterationId<OptionsGroup>>(box),
385  get<orthogonalization_iteration_id_tag>(box),
386  inner_product(get<basis_history_tag>(box)[0],
387  get<operand_tag>(box))},
388  Parallel::get_parallel_component<ParallelComponent>(cache)[array_index],
390  ResidualMonitor<Metavariables, FieldsTag, OptionsGroup>>(cache),
391  make_not_null(&section));
392 
393  constexpr size_t this_action_index =
394  tmpl::index_of<ActionList, PerformStep>::value;
395  return {std::move(box), Parallel::AlgorithmExecution::Continue,
396  this_action_index + 1};
397  }
398 };
399 
400 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
401  typename Label, typename ArraySectionIdTag>
402 struct OrthogonalizeOperand {
403  private:
404  using fields_tag = FieldsTag;
405  using operand_tag =
407  using orthogonalization_iteration_id_tag =
410  using basis_history_tag =
412 
413  public:
414  using inbox_tags = tmpl::list<Tags::Orthogonalization<OptionsGroup>>;
415 
416  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
417  typename ArrayIndex, typename ActionList,
418  typename ParallelComponent>
420  size_t>
421  apply(db::DataBox<DbTagsList>& box,
424  const ArrayIndex& array_index, const ActionList /*meta*/,
425  const ParallelComponent* const /*meta*/) noexcept {
426  const size_t iteration_id =
427  db::get<Convergence::Tags::IterationId<OptionsGroup>>(box);
428  auto& inbox = get<Tags::Orthogonalization<OptionsGroup>>(inboxes);
429  if (inbox.find(iteration_id) == inbox.end()) {
430  return {std::move(box), Parallel::AlgorithmExecution::Retry,
432  }
433 
434  const double orthogonalization =
435  std::move(inbox.extract(iteration_id).mapped());
436 
437  db::mutate<operand_tag, orthogonalization_iteration_id_tag>(
438  make_not_null(&box),
439  [orthogonalization](
440  const auto operand,
441  const gsl::not_null<size_t*> orthogonalization_iteration_id,
442  const auto& basis_history) noexcept {
443  *operand -= orthogonalization *
444  gsl::at(basis_history, *orthogonalization_iteration_id);
445  ++(*orthogonalization_iteration_id);
446  },
447  get<basis_history_tag>(box));
448 
449  const auto& next_orthogonalization_iteration_id =
450  get<orthogonalization_iteration_id_tag>(box);
451  const bool orthogonalization_complete =
452  next_orthogonalization_iteration_id == iteration_id + 1;
453  const double local_orthogonalization =
454  inner_product(orthogonalization_complete
455  ? get<operand_tag>(box)
456  : gsl::at(get<basis_history_tag>(box),
457  next_orthogonalization_iteration_id),
458  get<operand_tag>(box));
459 
460  auto& section = Parallel::get_section<ParallelComponent, ArraySectionIdTag>(
461  make_not_null(&box));
463  StoreOrthogonalization<FieldsTag, OptionsGroup, ParallelComponent>>(
464  Parallel::ReductionData<
468  iteration_id, next_orthogonalization_iteration_id,
469  local_orthogonalization},
470  Parallel::get_parallel_component<ParallelComponent>(cache)[array_index],
472  ResidualMonitor<Metavariables, FieldsTag, OptionsGroup>>(cache),
473  make_not_null(&section));
474 
475  // Repeat this action until orthogonalization is complete
476  constexpr size_t this_action_index =
477  tmpl::index_of<ActionList, OrthogonalizeOperand>::value;
478  return {std::move(box), Parallel::AlgorithmExecution::Continue,
479  orthogonalization_complete ? (this_action_index + 1)
480  : this_action_index};
481  }
482 };
483 
484 template <typename FieldsTag, typename OptionsGroup, bool Preconditioned,
485  typename Label, typename ArraySectionIdTag>
486 struct NormalizeOperandAndUpdateField {
487  private:
488  using fields_tag = FieldsTag;
489  using initial_fields_tag = db::add_tag_prefix<::Tags::Initial, fields_tag>;
490  using operand_tag =
492  using preconditioned_operand_tag =
494  using basis_history_tag =
496  using preconditioned_basis_history_tag =
498  Preconditioned, preconditioned_operand_tag, operand_tag>>;
499 
500  public:
501  using const_global_cache_tags =
502  tmpl::list<logging::Tags::Verbosity<OptionsGroup>>;
503  using inbox_tags = tmpl::list<Tags::FinalOrthogonalization<OptionsGroup>>;
504 
505  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
506  typename ArrayIndex, typename ActionList,
507  typename ParallelComponent>
509  size_t>
510  apply(db::DataBox<DbTagsList>& box,
512  const Parallel::GlobalCache<Metavariables>& /*cache*/,
513  const ArrayIndex& array_index, const ActionList /*meta*/,
514  const ParallelComponent* const /*meta*/) noexcept {
515  const size_t iteration_id =
516  db::get<Convergence::Tags::IterationId<OptionsGroup>>(box);
517  auto& inbox = get<Tags::FinalOrthogonalization<OptionsGroup>>(inboxes);
518  if (inbox.find(iteration_id) == inbox.end()) {
519  return {std::move(box), Parallel::AlgorithmExecution::Retry,
521  }
522 
523  // Retrieve reduction data from inbox
524  auto received_data = std::move(inbox.extract(iteration_id).mapped());
525  const double normalization = get<0>(received_data);
526  const auto& minres = get<1>(received_data);
527  auto& has_converged = get<2>(received_data);
528  db::mutate<Convergence::Tags::HasConverged<OptionsGroup>,
530  make_not_null(&box),
531  [&has_converged](
532  const gsl::not_null<Convergence::HasConverged*> local_has_converged,
533  const gsl::not_null<size_t*> local_iteration_id) noexcept {
534  *local_has_converged = std::move(has_converged);
535  ++(*local_iteration_id);
536  });
537 
538  // Elements that are not part of the section jump directly to the
539  // `ApplyOperationActions` for the next step.`
540  constexpr size_t this_action_index =
541  tmpl::index_of<ActionList, NormalizeOperandAndUpdateField>::value;
542  constexpr size_t prepare_step_index =
543  tmpl::index_of<ActionList,
544  PrepareStep<FieldsTag, OptionsGroup, Preconditioned,
545  Label, ArraySectionIdTag>>::value;
546  if constexpr (not std::is_same_v<ArraySectionIdTag, void>) {
547  if (not db::get<Parallel::Tags::Section<ParallelComponent,
548  ArraySectionIdTag>>(box)
549  .has_value()) {
550  return {std::move(box), Parallel::AlgorithmExecution::Continue,
551  get<Convergence::Tags::HasConverged<OptionsGroup>>(box)
552  ? (this_action_index + 1)
553  : (prepare_step_index + 1)};
554  }
555  }
556 
558  ::Verbosity::Debug)) {
559  Parallel::printf("%s %s(%zu): Complete step\n", get_output(array_index),
560  Options::name<OptionsGroup>(), iteration_id);
561  }
562 
563  db::mutate<operand_tag, basis_history_tag, fields_tag>(
564  make_not_null(&box),
565  [normalization, &minres](
566  const auto operand, const auto basis_history, const auto field,
567  const auto& initial_field,
568  const auto& preconditioned_basis_history) noexcept {
569  // Avoid an FPE if the new operand norm is exactly zero. In that case
570  // the problem is solved and the algorithm will terminate (see
571  // Proposition 9.3 in \cite Saad2003). Since there will be no next
572  // iteration we don't need to normalize the operand.
573  if (LIKELY(normalization > 0.)) {
574  *operand /= normalization;
575  }
576  basis_history->push_back(*operand);
577  *field = initial_field;
578  for (size_t i = 0; i < minres.size(); i++) {
579  *field += minres[i] * gsl::at(preconditioned_basis_history, i);
580  }
581  },
582  get<initial_fields_tag>(box),
583  get<preconditioned_basis_history_tag>(box));
584 
585  // Repeat steps until the solve has converged
586  return {std::move(box), Parallel::AlgorithmExecution::Continue,
587  get<Convergence::Tags::HasConverged<OptionsGroup>>(box)
588  ? (this_action_index + 1)
589  : prepare_step_index};
590  }
591 };
592 
593 } // namespace LinearSolver::gmres::detail
gsl::at
constexpr T & at(std::array< T, N > &arr, Size index)
Retrieve a entry from a container, with checks in Debug mode that the index being retrieved is valid.
Definition: Gsl.hpp:125
std::apply
T apply(T... args)
utility
Parallel::AlgorithmExecution::Retry
@ Retry
Temporarily stop executing iterable actions, but try the same action again after receiving data from ...
UNLIKELY
#define UNLIKELY(x)
Definition: Gsl.hpp:73
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:15
Parallel::ReductionDatum
The data to be reduced, and invokables to be called whenever two reduction messages are combined and ...
Definition: Reduction.hpp:65
InnerProduct.hpp
LinearSolver::Tags::OperatorAppliedTo
The linear operator applied to the data in Tag
Definition: Tags.hpp:53
GlobalCache.hpp
Parallel::get_parallel_component
auto get_parallel_component(GlobalCache< Metavariables > &cache) noexcept -> Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag >> &
Access the Charm++ proxy associated with a ParallelComponent.
Definition: GlobalCache.hpp:535
Parallel::printf
void printf(const std::string &format, Args &&... args)
Print an atomic message to stdout with C printf usage.
Definition: Printf.hpp:103
LinearSolver::Tags::KrylovSubspaceBasis
A set of vectors that form a basis of the -th Krylov subspace .
Definition: Tags.hpp:161
db::add_tag_prefix
typename detail::add_tag_prefix_impl< Prefix, Tag, Args... >::type add_tag_prefix
Definition: PrefixHelpers.hpp:51
tuple
db::get
const auto & get(const DataBox< TagList > &box) noexcept
Retrieve the item with tag Tag from the DataBox.
Definition: DataBox.hpp:791
Tags.hpp
get_output
std::string get_output(const T &t) noexcept
Get the streamed output of t as a std::string
Definition: GetOutput.hpp:14
funcl::Sqrt
Functional for computing sqrt on an object.
Definition: Functional.hpp:275
LinearSolver::inner_product
double inner_product(const Lhs &lhs, const Rhs &rhs) noexcept
The local part of the Euclidean inner product on the vector space w.r.t. which the addition and scala...
Definition: InnerProduct.hpp:71
Parallel::AlgorithmExecution::Continue
@ Continue
Leave the algorithm termination flag in its current state.
DataBox.hpp
cstddef
logging::Tags::Verbosity
Tag for putting Verbosity in a DataBox.
Definition: Tags.hpp:33
Assert.hpp
MakeWithValue.hpp
tuples::TaggedTuple
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
Parallel::AlgorithmExecution
AlgorithmExecution
The possible options for altering the current execution of the algorithm, used in the return type of ...
Definition: AlgorithmMetafunctions.hpp:31
Convergence::Tags::IterationId
Identifies a step in an iterative algorithm.
Definition: Tags.hpp:74
ActionTesting::cache
Parallel::GlobalCache< Metavariables > & cache(MockRuntimeSystem< Metavariables > &runner, const ArrayIndex &array_index) noexcept
Returns the GlobalCache of Component with index array_index.
Definition: MockRuntimeSystemFreeFunctions.hpp:382
limits
Gsl.hpp
LinearSolver::Tags::Orthogonalization
The prefix for tags related to an orthogonalization procedure.
Definition: Tags.hpp:126
Requires.hpp
LIKELY
#define LIKELY(x)
Definition: Gsl.hpp:67
optional
make_not_null
gsl::not_null< T * > make_not_null(T *ptr) noexcept
Construct a not_null from a pointer. Often this will be done as an implicit conversion,...
Definition: Gsl.hpp:880
std::conditional_t
std::numeric_limits::max
T max(T... args)
Parallel::contribute_to_reduction
void contribute_to_reduction(ReductionData< Ts... > reduction_data, const SenderProxy &sender_component, const TargetProxy &target_component, [[maybe_unused]] const gsl::not_null< SectionType * > section=&no_section()) noexcept
Perform a reduction from the sender_component (typically your own parallel component) to the target_c...
Definition: Reduction.hpp:272
Convergence::Tags::HasConverged
Holds a Convergence::HasConverged flag that signals the iterative algorithm has converged,...
Definition: Tags.hpp:86
type_traits
Parallel::Tags::Section
The Parallel::Section<ParallelComponent, SectionIdTag> that this element belongs to.
Definition: Section.hpp:29
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13