|
SpECTRE
v2026.09.05
|
Simple action run on the horizon finder by the Elements which receives volume data, finds the apparent horizon, and calls the callbacks after the horizon is found. More...
#include <FindApparentHorizon.hpp>
Public Types | |
| using | frame = typename HorizonMetavars::frame |
Static Public Member Functions | |
| template<typename ParallelComponent, typename DbTags, typename Metavariables, typename ArrayIndex> | |
| static void | apply (db::DataBox< DbTags > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &, const LinkedMessageId< double > &incoming_time, const ElementId< 3 > &incoming_element_id, const ::Mesh< 3 > &incoming_mesh, Variables< ah::vars_to_interpolate_to_target< 3, frame > > &&incoming_vars_to_interpolate, const std::optional< std::string > &dependency, const bool vars_have_already_been_received=false) |
Simple action run on the horizon finder by the Elements which receives volume data, finds the apparent horizon, and calls the callbacks after the horizon is found.
First, the volume variables ah::vars_to_interpolate_to_target and the dependency are put into the ah::Tags::Storage for the incoming time. Then, we try to set the ah::Tags::CurrentTime with the ah::set_current_time function. Once we have a current time, we ensure the functions of time are up-to-date at this current time with ah::check_if_current_time_is_ready. If they are not, we re-trigger this action with vars_have_already_been_received set to true and not sending any new volume data.
Once we ensure the functions of time are ready, we compute the cartesian coordinates for the current fast-flow iteration surface with ah::set_current_iteration_coords. Once we have the coords, we interpolate the volume date onto these coordinates. After that, we do one iteration of the FastFlow algorithm to get a new surface. If we haven't converged yet, we compute new cartesian and start another iteration. Once we have converged, we call the callbacks with ah::invoke_callbacks and then clean up the horizon finer with ah::clean_up_horizon_finder. Then we try to set a new current time and the process starts over again. If FastFlow never converges or the interpolation fails, we call the horizon_find_failure_callbacks from the HorizonMetavars.
The dependency is the name of the volume data that an observers::ObserverWriter holds for the incoming time until the horizon find at that time succeeds or fails (see ah::callbacks::SendDependencyToObserverWriter), or std::nullopt if there is no such data. Since this action can receive volume data for a later time while it is still working on the current time, the dependency is stored per time and copied from the storage of the current time into ah::Tags::Dependency right before the callbacks for that time are invoked, on success (in ah::invoke_callbacks) as well as on failure.