SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
ah Namespace Reference

Contains utilities for working with apparent horizons. More...

Namespaces

namespace  callbacks
 Callbacks used by the apparent horizon finder.
namespace  Criteria
 Criteria for deciding how resolution of an apparent horizon should be adapted.
namespace  Tags
 Tags for the apparent horizon finder.

Classes

struct  Component
 The singleton parallel component responsible for finding horizons. More...
class  Criterion
 Base class for criteria that determine how the resolution of an apparent horizon should be changed. More...
struct  FindApparentHorizon
 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...
struct  HorizonOptions
 Options for finding an apparent horizon. More...
struct  Initialize
 Initialize items related to the horizon finder. More...

Typedefs

template<size_t Dim>
using source_vars
template<size_t Dim, typename Frame>
using vars_to_interpolate_to_target
template<typename Frame>
using tags_for_observing
using surface_tags_for_observing = tmpl::list<ylm::Tags::RicciScalar>
template<size_t Dim, typename Frame>
using compute_items_on_target

Enumerations

enum class  Destination { Observation , ControlSystem }
 Label for what a horizon find will be used for.

Functions

template<typename HorizonMetavars, typename DbTags, typename Metavariables>
void invoke_callbacks (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const std::optional< std::string > &dependency, const FastFlow::Status status)
 Invoke the callbacks specified in the horizon_find_callbacks alias of the HorizonMetavars.
template<typename Fr>
void clean_up_horizon_finder (gsl::not_null< std::optional< LinkedMessageId< double > > * > current_time_optional, gsl::not_null< std::unordered_map< LinkedMessageId< double >, ah::Storage::SingleTimeStorage< Fr > > * > all_storage, gsl::not_null< std::set< LinkedMessageId< double > > * > completed_times, gsl::not_null< FastFlow * > fast_flow)
 Cleans up the horizon finder after a horizon find has finished.
template<typename Fr>
bool set_current_iteration_coords (gsl::not_null< ah::Storage::Iteration< Fr > * > current_iteration, gsl::not_null< std::vector< size_t > * > block_order, const LinkedMessageId< double > &time, const FastFlow &fast_flow, const ylm::Strahlkorper< Fr > &initial_guess, const ylm::Strahlkorper< Fr > &previous_iteration_surface, const std::deque< ah::Storage::PreviousSurface< Fr > > &previous_surfaces, size_t max_compute_coords_retries, const Domain< 3 > &domain, const domain::FunctionsOfTimeMap &functions_of_time, const std::optional< size_t > &current_resolution_l=std::nullopt, bool rerunning_with_higher_resolution=false)
 Compute the target points for the current iteration.
template<typename Fr>
void compute_vars_to_interpolate_to_target (gsl::not_null< Variables< ah::vars_to_interpolate_to_target< 3, Fr > > * > target_vars, const tnsr::aa< DataVector, 3 > &spacetime_metric, const tnsr::aa< DataVector, 3 > &pi, const tnsr::iaa< DataVector, 3 > &phi, const tnsr::ijaa< DataVector, 3 > &deriv_phi, const LinkedMessageId< double > &time, const Domain< 3 > &domain, const Mesh< 3 > &mesh, const ElementId< 3 > &element_id, const domain::FunctionsOfTimeMap &functions_of_time)
 Compute the ah::vars_to_interpolate_to_target for a given element_id from the ah::source_vars in that element.
template<typename Fr>
void set_current_time (gsl::not_null< std::optional< LinkedMessageId< double > > * > current_time, gsl::not_null< std::set< LinkedMessageId< double > > * > pending_times, const std::set< LinkedMessageId< double > > &completed_times, const std::unordered_map< LinkedMessageId< double >, ah::Storage::SingleTimeStorage< Fr > > &all_storage, const ::Verbosity &verbosity, const std::string &name)
 Determines what the current time should be.
template<typename HorizonMetavars, typename Metavariables>
bool check_if_current_time_is_ready (const LinkedMessageId< double > &current_time, Parallel::GlobalCache< Metavariables > &cache, const LinkedMessageId< double > &incoming_time, const ElementId< 3 > &incoming_element_id, const ::Mesh< 3 > &incoming_mesh, const std::optional< std::string > &dependency)
 Checks if the current time is ready.
std::ostreamoperator<< (std::ostream &os, Destination destination)
template<typename Fr>
bool interpolate_volume_data (gsl::not_null< ah::Storage::Iteration< Fr > * > current_iteration_storage, const ah::Storage::VolumeVariables< Fr > &volume_vars_storage, const ElementId< 3 > &element_id)
 Interpolate volume data from any new elements received by the horizon finder to the target points.
template<typename Fr>
bool operator== (const HorizonOptions< Fr > &lhs, const HorizonOptions< Fr > &rhs)
template<typename Fr>
bool operator!= (const HorizonOptions< Fr > &lhs, const HorizonOptions< Fr > &rhs)

Detailed Description

Contains utilities for working with apparent horizons.

Typedef Documentation

◆ compute_items_on_target

template<size_t Dim, typename Frame>
using ah::compute_items_on_target
Initial value:
tmpl::list<
Computes the surface area of a Strahlkorer, given an AreaElement and a Strahlkorper .
Definition Tags.hpp:363
Computes the Christodoulou mass from the dimensionful spin angular momentum and the irreducible mass ...
Definition Tags.hpp:478
Computes the approximate-Killing-Vector quasilocal spin magnitude of a Strahlkorper.
Definition Tags.hpp:428
Computes the dimensionful spin angular momentum vector.
Definition Tags.hpp:453
Computes the dimensionless spin magnitude from the dimensionful spin magnitude and the christodoulo...
Definition Tags.hpp:502
Computes the Irreducible mass of an apparent horizon from its area.
Definition Tags.hpp:383
Calculates the spin function which is proportional to the imaginary part of the Strahlkorper’s comple...
Definition Tags.hpp:403
Definition Tags.hpp:187
Definition Tags.hpp:242
Definition Tags.hpp:213
Calculates the Extrinsic curvature of a 2D Strahlkorper embedded in a 3D space.
Definition Tags.hpp:135
Computes 3-covariant gradient of a Strahlkorper's normal.
Definition Tags.hpp:111
Definition Tags.hpp:128
Definition Tags.hpp:106
Definition Tags.hpp:84
Computes the pointwise maximum of the Strahlkorper's intrinsic Ricci scalar curvature.
Definition Tags.hpp:180
Computes the pointwise minimum of the Strahlkorper’s intrinsic Ricci scalar curvature.
Definition Tags.hpp:198
Definition Tags.hpp:299
Computes the reciprocal of the magnitude of the one form perpendicular to the horizon.
Definition Tags.hpp:47
Definition Tags.hpp:148
Definition Tags.hpp:61
Computes the two-dimensional intrinsic Ricci scalar of a Strahlkorper.
Definition Tags.hpp:157
Definition Tags.hpp:332
Definition Tags.hpp:42
Computes the unit one-form perpendicular to the horizon.
Definition Tags.hpp:69
Computes the UnitNormalVector perpendicular to the horizon.
Definition Tags.hpp:89

◆ source_vars

template<size_t Dim>
using ah::source_vars
Initial value:
tmpl::list<gr::Tags::SpacetimeMetric<DataVector, Dim>,
Definition IndexType.hpp:46
Prefix indicating spatial derivatives.
Definition Prefixes.hpp:46
Auxiliary variable which is analytically the spatial derivative of the spacetime metric.
Definition Tags.hpp:38
Conjugate momentum to the spacetime metric.
Definition Tags.hpp:27

◆ tags_for_observing

template<typename Frame>
using ah::tags_for_observing
Initial value:
Tag representing the surface area of a Strahlkorper.
Definition Tags.hpp:356
The Christodoulou mass, which is a function of the dimensionful spin angular momentum and the irreduc...
Definition Tags.hpp:471
The dimensionful spin angular momentum vector.
Definition Tags.hpp:446
The dimensionless spin magnitude of a Strahlkorper.
Definition Tags.hpp:493
The Irreducible (areal) mass of an apparent horizon.
Definition Tags.hpp:377
The pointwise maximum of the Strahlkorper's intrinsic Ricci scalar curvature.
Definition Tags.hpp:174
The pointwise minimum of the Strahlkorper’s intrinsic Ricci scalar curvature.
Definition Tags.hpp:192

◆ vars_to_interpolate_to_target

template<size_t Dim, typename Frame>
using ah::vars_to_interpolate_to_target
Initial value:
tmpl::list<gr::Tags::SpatialMetric<DataVector, Dim, Frame>,
Definition Tags.hpp:139
Inverse of the spatial metric.
Definition Tags.hpp:32
Computes the spatial Ricci tensor from the spatial Christoffel symbol of the second kind and its deri...
Definition Tags.hpp:174

Function Documentation

◆ check_if_current_time_is_ready()

template<typename HorizonMetavars, typename Metavariables>
bool ah::check_if_current_time_is_ready ( const LinkedMessageId< double > & current_time,
Parallel::GlobalCache< Metavariables > & cache,
const LinkedMessageId< double > & incoming_time,
const ElementId< 3 > & incoming_element_id,
const ::Mesh< 3 > & incoming_mesh,
const std::optional< std::string > & dependency )

Checks if the current time is ready.

Details

If the current time is after any expiration time, registers a callback for the ah::FindApparentHorizon action (but doesn't send the volume variables again because we already did that). Returns if the current time is ready or not.

◆ clean_up_horizon_finder()

template<typename Fr>
void ah::clean_up_horizon_finder ( gsl::not_null< std::optional< LinkedMessageId< double > > * > current_time_optional,
gsl::not_null< std::unordered_map< LinkedMessageId< double >, ah::Storage::SingleTimeStorage< Fr > > * > all_storage,
gsl::not_null< std::set< LinkedMessageId< double > > * > completed_times,
gsl::not_null< FastFlow * > fast_flow )

Cleans up the horizon finder after a horizon find has finished.

Details

Removes the current time from the storage map, adds the current time to the completed times, and then resets the current time. If the completed times have more than 1000 entries, this will limit the size to 1000.

◆ interpolate_volume_data()

template<typename Fr>
bool ah::interpolate_volume_data ( gsl::not_null< ah::Storage::Iteration< Fr > * > current_iteration_storage,
const ah::Storage::VolumeVariables< Fr > & volume_vars_storage,
const ElementId< 3 > & element_id )

Interpolate volume data from any new elements received by the horizon finder to the target points.

Details

For each new element, the vars_to_interpolate_to_target in all_volume_variables are interpolated to the target points and stored in current_iteration_storage.

◆ invoke_callbacks()

template<typename HorizonMetavars, typename DbTags, typename Metavariables>
void ah::invoke_callbacks ( const gsl::not_null< db::DataBox< DbTags > * > box,
Parallel::GlobalCache< Metavariables > & cache,
const std::optional< std::string > & dependency,
const FastFlow::Status status )

Invoke the callbacks specified in the horizon_find_callbacks alias of the HorizonMetavars.

Details

Before invoking the callbacks, this function

  1. Restricts the final interpolated variables from the \(L_\mathrm{mesh}\) used for the FastFlow algorithm, to the actual \(L\) of the Strahlkorper.
  2. Adds the current Strahlkorper to the ah::Tags::PreviousSurfaces.
  3. Copies the Strahlkorper, its time derivative, and the dependency into the box. Also possibly computes the Inertial coordinates of the final Strahlkorper and stores them in the box if the frame of the HorizonMetavars isn't the Inertial frame.

◆ set_current_iteration_coords()

template<typename Fr>
bool ah::set_current_iteration_coords ( gsl::not_null< ah::Storage::Iteration< Fr > * > current_iteration,
gsl::not_null< std::vector< size_t > * > block_order,
const LinkedMessageId< double > & time,
const FastFlow & fast_flow,
const ylm::Strahlkorper< Fr > & initial_guess,
const ylm::Strahlkorper< Fr > & previous_iteration_surface,
const std::deque< ah::Storage::PreviousSurface< Fr > > & previous_surfaces,
size_t max_compute_coords_retries,
const Domain< 3 > & domain,
const domain::FunctionsOfTimeMap & functions_of_time,
const std::optional< size_t > & current_resolution_l = std::nullopt,
bool rerunning_with_higher_resolution = false )

Compute the target points for the current iteration.

Details

Returns whether the computation of the target points was successful or if there are some points outside the domain. If computation fails, one of two attempts to recover will happen:

  • For the zeroth fast flow iteration, this will increase the \(l=0,m=0\) coefficient (i.e. the size) by 50%.
  • For all other iterations, the coefficients become

    \begin{equation}S^{\mathrm{new}}_{lm} = \frac{1}{2}\left(S^{\mathrm{previous}}_{lm} + S^{\mathrm{failed}}_{lm}\right) \end{equation}

    where \(S^{\mathrm{failed}}_{lm}\) are the coefficients of the failed computation and \(S^{\mathrm{previous}}_{lm}\) are the coefficients from the previous successful iteration.

This function will try recomputing the coords using the above two rules max_compute_coords_retries times before returning false.

Parameters
current_iterationThe returned pointer to the current Iteration object
block_orderPriority order to search blocks for containing points (see block_logical_coordinates for details)
timeThe current time
fast_flowThe FastFlow object for the current horizon find
initial_guessIf the current iteration number is zero and rerunning_with_higher_resolution == false, current_iteration is set to this Strahlkorper
previous_iteration_surfaceIf empty, current_iteration is set to initial_guess; if one previous iteration, current_iteration is set to that previous iteration; if two previous iterations, current_iteration is set by linearly extrapolating in time the two pervious iterations; if three or more previous iterations, current_iteration is set by quadratic extrpolation of the three most recent iterations
previous_surfacesPreviously successful iteratios used to attempt to recover when some points are outside the domain.
max_compute_coords_retriesRetry up to this many times before returning false
domainThe spatial domain in which the horizon is being found
functions_of_timeThe functions of time for the current domain
current_resolution_lOptional; if specified, current_iteration is prolonged or restricted to this resolution
rerunning_with_higher_resolutionMust be false unless current_resolution_l is set; if true, then on iteration zero, set the initial guess to the previous iteration surface

Returns: Whether or not set_current_iteration_coords succeeded

◆ set_current_time()

template<typename Fr>
void ah::set_current_time ( gsl::not_null< std::optional< LinkedMessageId< double > > * > current_time,
gsl::not_null< std::set< LinkedMessageId< double > > * > pending_times,
const std::set< LinkedMessageId< double > > & completed_times,
const std::unordered_map< LinkedMessageId< double >, ah::Storage::SingleTimeStorage< Fr > > & all_storage,
const ::Verbosity & verbosity,
const std::string & name )

Determines what the current time should be.

Details

If there's already a current time, or there are no pending times available, then there's nothing to do. Otherwise, checks if the first pending time is the next to use. If so, sets it as the current time and removes it from pending.