SpECTRE
v2023.05.16
|
Classes and functions used in implementation of size control. More...
Classes | |
struct | ControlErrorArgs |
Packages some of the inputs to the State::control_error, so that State::control_error doesn't need a large number of arguments. More... | |
struct | CrossingTimeInfo |
Holds information about crossing times, as computed by ZeroCrossingPredictors. More... | |
struct | ErrorDiagnostics |
A simple struct to hold diagnostic information about computing the size control error. More... | |
struct | Info |
Holds information that is saved between calls of SizeControl. More... | |
class | State |
Represents a 'state' of the size control system. More... | |
struct | StateUpdateArgs |
Packages some of the inputs to the State::update, so that State::update doesn't need a large number of arguments. More... | |
Functions | |
template<typename Frame > | |
ErrorDiagnostics | control_error (const gsl::not_null< Info * > info, const gsl::not_null< intrp::ZeroCrossingPredictor * > predictor_char_speed, const gsl::not_null< intrp::ZeroCrossingPredictor * > predictor_comoving_char_speed, const gsl::not_null< intrp::ZeroCrossingPredictor * > predictor_delta_radius, double time, const Strahlkorper< Frame > &apparent_horizon, const Strahlkorper< Frame > &excision_boundary, double grid_frame_excision_boundary_radius, const Strahlkorper< Frame > &time_deriv_apparent_horizon, const Scalar< DataVector > &lapse_on_excision_boundary, const tnsr::I< DataVector, 3, Frame > &frame_components_of_grid_shift, const tnsr::ii< DataVector, 3, Frame > &spatial_metric_on_excision_boundary, const tnsr::II< DataVector, 3, Frame > &inverse_spatial_metric_on_excision_boundary, const std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > &function_of_time) |
Computes the size control error, updating the stored info. More... | |
void | register_derived_with_charm () |
Classes and functions used in implementation of size control.
ErrorDiagnostics control_system::size::control_error | ( | const gsl::not_null< Info * > | info, |
const gsl::not_null< intrp::ZeroCrossingPredictor * > | predictor_char_speed, | ||
const gsl::not_null< intrp::ZeroCrossingPredictor * > | predictor_comoving_char_speed, | ||
const gsl::not_null< intrp::ZeroCrossingPredictor * > | predictor_delta_radius, | ||
double | time, | ||
const Strahlkorper< Frame > & | apparent_horizon, | ||
const Strahlkorper< Frame > & | excision_boundary, | ||
double | grid_frame_excision_boundary_radius, | ||
const Strahlkorper< Frame > & | time_deriv_apparent_horizon, | ||
const Scalar< DataVector > & | lapse_on_excision_boundary, | ||
const tnsr::I< DataVector, 3, Frame > & | frame_components_of_grid_shift, | ||
const tnsr::ii< DataVector, 3, Frame > & | spatial_metric_on_excision_boundary, | ||
const tnsr::II< DataVector, 3, Frame > & | inverse_spatial_metric_on_excision_boundary, | ||
const std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > & | function_of_time | ||
) |
Computes the size control error, updating the stored info.
Frame | should be Frame::Distorted if Frame::Distorted exists. |
info | struct containing parameters that will be used/filled. Some of the fields in info will guide the behavior of other control system components like the averager and (possibly) the time step. |
predictor_char_speed | ZeroCrossingPredictor for the characteristic speed. |
predictor_comoving_char_speed | ZeroCrossingPredictor for the comoving characteristic speed. |
predictor_delta_radius | ZeroCrossingPredictor for the difference in radius between the horizon and the excision boundary. |
time | the current time. |
apparent_horizon | the current horizon in frame Frame. |
excision_boundary | a Strahlkorper representing the excision boundary in frame Frame. Note that the excision boundary is assumed to be a sphere in the grid frame. |
grid_frame_excision_boundary_radius | the radius of the (assumed spherical) excision boundary in the grid frame. |
time_deriv_apparent_horizon | Time derivative of apparent_horizon, where the time derivative is taken in frame Frame. That is, this should simply be lim dt->0 (apparent_horizon(t+dt)-apparent_horizon(t))/dt with no advective terms. |
lapse_on_excision_boundary | Lapse on the excision boundary. |
frame_components_of_grid_shift | The quantity \(\beta^i \frac{\partial x^\hat{i}}{\partial x_i}\) (see below) evaluated on the excision boundary. This is a tensor in frame Frame. |
spatial_metric_on_excision_boundary | metric in frame Frame. |
inverse_spatial_metric_on_excision_boundary | metric in frame Frame. |
function_of_time | FunctionOfTime that is being controlled. This function_of_time contains DataVectors of size 1. |
Returns: Returns an ErrorDiagnostics
object which, in addition to the actual control error, holds a lot of diagnostic information about how the control error was calculated. This information could be used to print to a file if desired.
The characteristic speed that is needed here is
\begin{align} v &= -\alpha -n_i\beta^i \\ v &= -\alpha -n_\hat{i}\hat{\beta}^\hat{i} - n_\hat{i}\frac{\partial x^\hat{i}}{\partial t} \\ v &= -\alpha -n_\bar{i}\bar{\beta}^\bar{i} - n_\bar{i}\frac{\partial x^\bar{i}}{\partial t} \\ v &= -\alpha - n_\hat{i} \frac{\partial x^\hat{i}}{\partial x^i} \beta^i, \end{align}
where we have written many equivalent forms in terms of quantities defined in different frames.
Here \(\alpha\) is the lapse, which is invariant under frame transformations, \(n_i\), \(n_\hat{i}\), and \(n_\bar{i}\) are the metric-normalized normal one-form to the Strahlkorper in the grid, distorted, and inertial frames, and \(\beta^i\), \(\hat{\beta}^\hat{i}\), and \(\bar{\beta}^\bar{i}\) are the shift in the grid, distorted, and inertial frames.
Note that we decorate the shift with hats and bars in addition to decorating its index, because the shift transforms in a non-obvious way under frame transformations so it is easy to make mistakes. To be clear, these different shifts are defined by
\begin{align} \beta^i &= \alpha^2 g^{0i},\\ \hat{\beta}^\hat{i} &= \alpha^2 g^{\hat{0}\hat{i}},\\ \bar{\beta}^\bar{i} &= \alpha^2 g^{\bar{0}\bar{i}}, \end{align}
where \(g^{ab}\) is the spacetime metric, and they transform like
\begin{align} \hat{\beta}^\hat{i} &= \beta^i \frac{\partial x^\hat{i}}{\partial x^i}- \frac{\partial x^\hat{i}}{\partial t}. \end{align}
The quantity we pass as frame_components_of_grid_shift is
\begin{align} \beta^i \frac{\partial x^\hat{i}}{\partial x^i} &= \hat{\beta}^\hat{i} + \frac{\partial x^\hat{i}}{\partial t} \\ &= \bar{\beta}^\bar{j}\frac{\partial x^\hat{i}}{\partial x^i} \frac{\partial x^i}{\partial x^\bar{j}} + \frac{\partial x^\hat{i}}{\partial x^\bar{j}} \frac{\partial x^\bar{j}}{\partial t}, \end{align}
where we have listed several equivalent formulas that involve quantities in different frames.