Namespaces | Functions
MockRuntimeSystemFreeFunctions.hpp File Reference
#include <cstddef>
#include <random>
#include <utility>
#include <vector>
#include "Framework/MockRuntimeSystem.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/Requires.hpp"
#include "Utilities/TMPL.hpp"
#include "Utilities/TypeTraits.hpp"

Go to the source code of this file.

Namespaces

 ActionTesting
 Structures used for mocking the parallel components framework in order to test actions.
 

Functions

template<typename Metavariables >
void ActionTesting::set_phase (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Metavariables::Phase &phase) noexcept
 Set the phase of all parallel components to phase
 
template<typename Component , typename... Options>
void ActionTesting::emplace_component (const gsl::not_null< MockRuntimeSystem< typename Component::metavariables > * > runner, const typename Component::array_index &array_index, Options &&... opts) noexcept
 Emplaces a distributed object with index array_index into the parallel component Component. The options opts are forwarded to be used in a call to detail::ForwardAllOptionsToDataBox::apply.
 
template<typename Component , typename... Options, typename Metavars = typename Component::metavariables, Requires< detail::has_initialization_phase_v< Metavars >> = nullptr>
void ActionTesting::emplace_component_and_initialize (const gsl::not_null< MockRuntimeSystem< typename Component::metavariables > * > runner, const typename Component::array_index &array_index, const typename detail::get_initialization< Component >::InitialValues &initial_values, Options &&... opts) noexcept
 Emplaces a distributed object with index array_index into the parallel component Component. The options opts are forwarded to be used in a call to detail::ForwardAllOptionsToDataBox::apply Additionally, the simple tags in the DataBox are initialized from the values set in initial_values.
 
template<typename Component , typename TagsList , typename Metavariables >
const auto & ActionTesting::get_databox (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Retrieves the DataBox with tags TagsList (omitting the GlobalCache and add_from_options tags) from the parallel component Component with index array_index.
 
template<typename Component , typename TagsList , typename Metavariables >
auto & ActionTesting::get_databox (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index) noexcept
 
template<typename Component , typename Metavariables >
size_t ActionTesting::get_next_action_index (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Get the index in the action list of the next action.
 
template<typename Component , typename Tag , typename Metavariables >
const auto & ActionTesting::get_databox_tag (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns the Tag from the DataBox of the parallel component Component with array index array_index. If the component's current DataBox type does not contain Tag then an error is emitted.
 
template<typename Component , typename InboxTag , typename Metavariables >
const auto & ActionTesting::get_inbox_tag (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns the InboxTag from the parallel component Component with array index array_index.
 
template<typename Component , typename InboxTag , typename Metavariables >
auto & ActionTesting::get_inbox_tag (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index) noexcept
 
template<typename Component , typename Tag , typename Metavariables >
bool ActionTesting::box_contains (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns true if the current DataBox of Component with index array_index contains the tag Tag. If the tag is not contained, returns false.
 
template<typename Component , typename Tag , typename Metavariables >
bool ActionTesting::tag_is_retrievable (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns true if the tag Tag can be retrieved from the current DataBox of Component with index array_index.
 
template<typename Component , typename Metavariables >
void ActionTesting::next_action (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index) noexcept
 Runs the next action in the current phase on the array_indexth element of the parallel component Component.
 
template<typename Component , typename Metavariables >
bool ActionTesting::is_ready (MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Runs the is_ready function and returns the result for the next action in the current phase on the array_indexth element of the parallel component Component.
 
template<typename Component , typename Action , typename Metavariables , typename... Args>
void ActionTesting::simple_action (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index, Args &&... args) noexcept
 Runs the simple action Action on the array_indexth element of the parallel component Component.
 
template<typename Component , typename Action , typename Metavariables , typename... Args>
void ActionTesting::threaded_action (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index, Args &&... args) noexcept
 Runs the simple action Action on the array_indexth element of the parallel component Component.
 
template<typename Component , typename Metavariables >
void ActionTesting::invoke_queued_simple_action (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index) noexcept
 Runs the next queued simple action on the array_indexth element of the parallel component Component.
 
template<typename Component , typename Metavariables >
bool ActionTesting::is_simple_action_queue_empty (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns true if there are no simple actions in the queue.
 
template<typename Component , typename Metavariables >
void ActionTesting::invoke_queued_threaded_action (const gsl::not_null< MockRuntimeSystem< Metavariables > * > runner, const typename Component::array_index &array_index) noexcept
 Runs the next queued threaded action on the array_indexth element of the parallel component Component.
 
template<typename Component , typename Metavariables >
bool ActionTesting::is_threaded_action_queue_empty (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns true if there are no threaded actions in the queue.
 
template<typename Component , typename Metavariables >
bool ActionTesting::get_terminate (const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index) noexcept
 Returns whether or not the Component with index array_index has been terminated.
 
template<typename ComponentList , typename MockRuntimeSystem , typename ArrayIndex >
std::vector< size_t > ActionTesting::indices_of_components_with_queued_actions (const gsl::not_null< MockRuntimeSystem * > runner, const ArrayIndex &array_index) noexcept
 Returns a vector of all the indices of the Components in the ComponentList that have queued actions.
 
template<typename ComponentList , typename MockRuntimeSystem , typename Generator , typename ArrayIndex >
void ActionTesting::invoke_random_queued_action (const gsl::not_null< MockRuntimeSystem * > runner, const gsl::not_null< Generator * > generator, const std::vector< size_t > &index_map, const ArrayIndex &array_index) noexcept
 Invokes the next queued action on a random Component. index_map is the thing returned by indices_of_components_with_queued_actions
 

Detailed Description

Defines free functions that wrap MockRuntimeSystem member functions.