|
SpECTRE
2021.08.02
|
#include <AdamsBashforthN.hpp>
Classes | |
| struct | Order |
Public Types | |
| using | options = tmpl::list< Order > |
| template<typename LocalVars , typename RemoteVars , typename Coupling > | |
| using | BoundaryHistoryType = BoundaryHistory< LocalVars, RemoteVars, std::result_of_t< const Coupling &(LocalVars, RemoteVars)> > |
Public Member Functions | |
| AdamsBashforthN (size_t order) noexcept | |
| AdamsBashforthN (const AdamsBashforthN &) noexcept=default | |
| AdamsBashforthN & | operator= (const AdamsBashforthN &) noexcept=default |
| AdamsBashforthN (AdamsBashforthN &&) noexcept=default | |
| AdamsBashforthN & | operator= (AdamsBashforthN &&) noexcept=default |
| template<typename Vars , typename DerivVars > | |
| void | update_u (gsl::not_null< Vars * > u, gsl::not_null< History< Vars, DerivVars > * > history, const TimeDelta &time_step) const noexcept |
| template<typename Vars , typename ErrVars , typename DerivVars > | |
| bool | update_u (gsl::not_null< Vars * > u, gsl::not_null< ErrVars * > u_error, gsl::not_null< History< Vars, DerivVars > * > history, const TimeDelta &time_step) const noexcept |
| template<typename Vars , typename DerivVars > | |
| bool | dense_update_u (gsl::not_null< Vars * > u, const History< Vars, DerivVars > &history, double time) const noexcept |
| template<typename LocalVars , typename RemoteVars , typename Coupling > | |
| std::result_of_t< const Coupling &(LocalVars, RemoteVars)> | compute_boundary_delta (const Coupling &coupling, gsl::not_null< BoundaryHistoryType< LocalVars, RemoteVars, Coupling > * > history, const TimeDelta &time_step) const noexcept |
| template<typename LocalVars , typename RemoteVars , typename Coupling > | |
| std::result_of_t< const Coupling &(LocalVars, RemoteVars)> | boundary_dense_output (const Coupling &coupling, const BoundaryHistoryType< LocalVars, RemoteVars, Coupling > &history, double time) const noexcept |
| size_t | order () const noexcept override |
| size_t | error_estimate_order () const noexcept override |
| size_t | number_of_past_steps () const noexcept override |
| double | stable_step () const noexcept override |
| TimeStepId | next_time_id (const TimeStepId ¤t_id, const TimeDelta &time_step) const noexcept override |
| template<typename Vars , typename DerivVars > | |
| bool | can_change_step_size (const TimeStepId &time_id, const TimeSteppers::History< Vars, DerivVars > &history) const noexcept |
| WRAPPED_PUPable_decl_template (AdamsBashforthN) | |
| AdamsBashforthN (CkMigrateMessage *) noexcept | |
| void | pup (PUP::er &p) noexcept override |
| template<typename Vars , typename DerivVars > | |
| void | update_u (const gsl::not_null< Vars * > u, const gsl::not_null< History< Vars, DerivVars > * > history, const TimeDelta &time_step) const noexcept |
| template<typename Vars , typename ErrVars , typename DerivVars > | |
| bool | update_u (const gsl::not_null< Vars * > u, const gsl::not_null< ErrVars * > u_error, const gsl::not_null< History< Vars, DerivVars > * > history, const TimeDelta &time_step) const noexcept |
| template<typename Vars , typename DerivVars > | |
| bool | dense_update_u (const gsl::not_null< Vars * > u, const History< Vars, DerivVars > &history, const double time) const noexcept |
| template<typename UpdateVars , typename Vars , typename DerivVars , typename Delta > | |
| void | update_u_impl (const gsl::not_null< UpdateVars * > u, const History< Vars, DerivVars > &history, const Delta &time_step, const size_t order) const noexcept |
| template<typename LocalVars , typename RemoteVars , typename Coupling > | |
| std::result_of_t< const Coupling &(LocalVars, RemoteVars)> | compute_boundary_delta (const Coupling &coupling, const gsl::not_null< BoundaryHistoryType< LocalVars, RemoteVars, Coupling > * > history, const TimeDelta &time_step) const noexcept |
Static Public Attributes | |
| static constexpr const size_t | maximum_order = 8 |
| static constexpr Options::String | help |
Friends | |
| bool | operator== (const AdamsBashforthN &lhs, const AdamsBashforthN &rhs) noexcept |
An Nth order Adams-Bashforth time stepper.
The stable step size factors for different orders are given by:
| Order | CFL Factor |
|---|---|
| 1 | 1 |
| 2 | 1 / 2 |
| 3 | 3 / 11 |
| 4 | 3 / 20 |
| 5 | 45 / 551 |
| 6 | 5 / 114 |
| 7 | 945 / 40663 |
| 8 | 945 / 77432 |
|
noexcept |
An explanation of the computation being performed by this function: \(\newcommand\tL{t^L}\newcommand\tR{t^R}\newcommand\tU{\tilde{t}\!} \newcommand\mat{\mathbf}\)
Suppose the local and remote sides of the interface are evaluated at times \(\ldots, \tL_{-1}, \tL_0, \tL_1, \ldots\) and \(\ldots, \tR_{-1}, \tR_0, \tR_1, \ldots\), respectively, with the starting location of the numbering arbitrary in each case. Let the step we wish to calculate the effect of be the step from \(\tL_{m_S}\) to \(\tL_{m_S+1}\). We call the sequence produced from the union of the local and remote time sequences \(\ldots, \tU_{-1}, \tU_0, \tU_1, \ldots\). For example, one possible sequence of times is:
\begin{equation} \begin{aligned} \text{Local side:} \\ \text{Union times:} \\ \text{Remote side:} \end{aligned} \cdots \begin{gathered} \, \\ \tU_1 \\ \tR_5 \end{gathered} \leftarrow \Delta \tU_1 \rightarrow \begin{gathered} \tL_4 \\ \tU_2 \\ \, \end{gathered} \leftarrow \Delta \tU_2 \rightarrow \begin{gathered} \, \\ \tU_3 \\ \tR_6 \end{gathered} \leftarrow \Delta \tU_3 \rightarrow \begin{gathered} \, \\ \tU_4 \\ \tR_7 \end{gathered} \leftarrow \Delta \tU_4 \rightarrow \begin{gathered} \tL_5 \\ \tU_5 \\ \, \end{gathered} \cdots \end{equation}
We call the indices of the step's start and end times in the union time sequence \(n_S\) and \(n_E\), respectively. We define \(n^L_m\) to be the union-time index corresponding to \(\tL_m\) and \(m^L_n\) to be the index of the last local time not later than \(\tU_n\) and similarly for the remote side. So for the above example, \(n^L_4 = 2\) and \(m^R_2 = 5\), and if we wish to compute the step from \(\tL_4\) to \(\tL_5\) we would have \(m_S = 4\), \(n_S = 2\), and \(n_E = 5\).
If we wish to evaluate the change over this step to \(k\)th order, we can write the change in the value as a linear combination of the values of the coupling between the elements at unequal times:
\begin{equation} \mat{F}_{m_S} = \mspace{-10mu} \sum_{q^L = m_S-(k-1)}^{m_S} \, \sum_{q^R = m^R_{n_S}-(k-1)}^{m^R_{n_E-1}} \mspace{-10mu} \mat{D}_{q^Lq^R} I_{q^Lq^R}, \end{equation}
where \(\mat{D}_{q^Lq^R}\) is the coupling function evaluated between data from \(\tL_{q^L}\) and \(\tR_{q^R}\). The coefficients can be written as the sum of three terms,
\begin{equation} I_{q^Lq^R} = I^E_{q^Lq^R} + I^R_{q^Lq^R} + I^L_{q^Lq^R}, \end{equation}
which can be interpreted as a contribution from equal-time evaluations and contributions related to the remote and local evaluation times. These are given by
\begin{align} I^E_{q^Lq^R} &= \mspace{-10mu} \sum_{n=n_S}^{\min\left\{n_E, n^L+k\right\}-1} \mspace{-10mu} \tilde{\alpha}_{n,n-n^L} \Delta \tU_n &&\text{if $\tL_{q^L} = \tR_{q^R}$, otherwise 0} \\ I^R_{q^Lq^R} &= \ell_{q^L - m_S + k}\!\left( \tU_{n^R}; \tL_{m_S - (k-1)}, \ldots, \tL_{m_S}\right) \mspace{-10mu} \sum_{n=\max\left\{n_S, n^R\right\}} ^{\min\left\{n_E, n^R+k\right\}-1} \mspace{-10mu} \tilde{\alpha}_{n,n-n^R} \Delta \tU_n &&\text{if $\tR_{q^R}$ is not in $\{\tL_{\vphantom{|}\cdots}\}$, otherwise 0} \\ I^L_{q^Lq^R} &= \mspace{-10mu} \sum_{n=\max\left\{n_S, n^R\right\}} ^{\min\left\{n_E, n^L+k, n^R_{q^R+k}\right\}-1} \mspace{-10mu} \ell_{q^R - m^R_n + k}\!\left(\tU_{n^L}; \tR_{m^R_n - (k-1)}, \ldots, \tR_{m^R_n}\right) \tilde{\alpha}_{n,n-n^L} \Delta \tU_n &&\text{if $\tL_{q^L}$ is not in $\{\tR_{\vphantom{|}\cdots}\}$, otherwise 0,} \end{align}
where for brevity we write \(n^L = n^L_{q^L}\) and \(n^R = n^R_{q^R}\), and where \(\ell_a(t; x_1, \ldots, x_k)\) a Lagrange interpolating polynomial and \(\tilde{\alpha}_{nj}\) is the \(j\)th coefficient for an Adams-Bashforth step over the union times from step \(n\) to step \(n+1\).
|
staticconstexpr |