Line data Source code
1 1 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : /// \file
5 : /// Defines all group definitions
6 :
7 : #pragma once
8 :
9 : /*!
10 : * \defgroup ActionsGroup Actions
11 : * \brief A collection of steps used in algorithms.
12 : */
13 :
14 : /*!
15 : * \defgroup AderGroup ADER
16 : * \brief Functions and classes needed for ADER (Arbitrary high-order using
17 : * DERivatives) time integration
18 : */
19 :
20 : /*!
21 : * \defgroup AmrGroup Adaptive Mesh Refinement
22 : * \brief Functions and classes specific to hp-adaptive mesh refinement.
23 : */
24 :
25 : /*!
26 : * \defgroup AnalyticDataGroup Analytic Data
27 : * \brief Analytic data used to specify (for example) initial data to the
28 : * equations implemented in \ref EvolutionSystemsGroup.
29 : */
30 :
31 : /*!
32 : * \defgroup AnalyticSolutionsGroup Analytic Solutions
33 : * \brief Analytic solutions to the equations implemented in \ref
34 : * EvolutionSystemsGroup and \ref EllipticSystemsGroup.
35 : */
36 :
37 : /*!
38 : * \defgroup BoundaryConditionsGroup Boundary Conditions
39 : * A collection of boundary conditions used for evolutions.
40 : */
41 :
42 : /*!
43 : * \defgroup CharmExtensionsGroup Charm++ Extensions
44 : * \brief Classes and functions used to make Charm++ easier and safer to use.
45 : */
46 :
47 : /*!
48 : * \defgroup ComputationalDomainGroup Computational Domain
49 : * \brief The building blocks used to describe the computational domain.
50 : *
51 : * ### Description
52 : * The VolumeDim-dimensional computational Domain is constructed from a set of
53 : * non-overlapping Block%s. Each Block is a distorted VolumeDim-dimensional
54 : * hypercube. Each codimension-1 boundary of a Block is either part of the
55 : * external boundary of the computational domain, or is identical to a boundary
56 : * of one other Block. Each Block is subdivided into one or more Element%s
57 : * that may be changed dynamically if AMR is enabled.
58 : */
59 :
60 : /*!
61 : * \defgroup ConservativeGroup Conservative System Evolution
62 : * \brief Contains generic functions used for evolving conservative
63 : * systems.
64 : */
65 :
66 : /*!
67 : * \defgroup ConstantExpressionsGroup Constant Expressions
68 : * \brief Contains an assortment of constexpr functions
69 : *
70 : * ### Description
71 : * Contains an assortment of constexpr functions that are useful for
72 : * metaprogramming, or efficient mathematical computations, such as
73 : * exponentiating to an integer power, where the power is known at compile
74 : * time.
75 : */
76 :
77 : /*!
78 : * \defgroup ControlSystemGroup Control System
79 : * \brief Contains control system elements
80 : *
81 : * The control system manages the time-dependent mapping between frames, such as
82 : * the fixed computational frame (grid frame) and the inertial frame. The
83 : * time-dependent parameters of the mapping are adjusted by a feedback control
84 : * system in order to follow the dynamical evolution of objects such as horizons
85 : * of black holes or surfaces of neutron stars. For example, in binary black
86 : * hole simulations the map is typically a composition of maps that include
87 : * translation, rotation, scaling, shape, etc.
88 : * Each map under the governance of the control system has an associated
89 : * time-dependent map parameter \f$\lambda(t)\f$ that is a piecewise Nth order
90 : * polynomial. At discrete times (called reset times), the control system resets
91 : * the Nth time derivative of \f$\lambda(t)\f$ to a new constant value, in order
92 : * to minimize an error function \f$Q(t)\f$ that is specific to each map. At
93 : * each reset time, the Nth derivative of \f$\lambda(t)\f$ is set to a function
94 : * \f$U(t)\f$, called the control signal, that is determined by \f$Q(t)\f$ and
95 : * its time derivatives and time integral. Note that \f$\lambda(t)\f$,
96 : * \f$U(t)\f$, and \f$Q(t)\f$ can be vectors.
97 : *
98 : * The key components of the control system are:
99 : * - FunctionsOfTime: each map has an associated FunctionOfTime that represents
100 : * the map parameter \f$\lambda(t)\f$ and relevant time derivatives.
101 : * - ControlError: each map has an associated ControlError that computes
102 : * the error, \f$Q(t)\f$. Note that for each map, \f$Q(t)\f$ is defined to
103 : * follow the convention that \f$dQ = -d \lambda\f$ as \f$Q \rightarrow 0\f$.
104 : * - Averager: an averager can be used to average out the noise in the 'raw'
105 : * \f$Q(t)\f$ returned by the ControlError.
106 : * - Controller: the map controller computes the control signal \f$U(t)\f$ from
107 : * \f$Q(t)\f$ and its time integral and time derivatives.
108 : * The control is accomplished by setting the Nth derivative of
109 : * \f$\lambda(t)\f$ to \f$U(t)\f$. Two common controllers are PID
110 : * (proportional/integral/derivative)
111 : * \f[U(t) = a_{0}\int_{t_{0}}^{t} Q(t') dt'+a_{1}Q(t)+a_{2}\frac{dQ}{dt}\f]
112 : * or
113 : * PND (proportional/N derivatives)
114 : * \f[ U(t) = \sum_{k=0}^{N} a_{k} \frac{d^kQ}{dt^k} \f]
115 : * The coefficients \f$ a_{k} \f$ in the computation of \f$U(t)\f$ are chosen
116 : * at each time such that the error \f$Q(t)\f$ will be critically damped
117 : * on a timescale of \f$\tau\f$ (the damping time),
118 : * i.e. \f$Q(t) \propto e^{-t/\tau}\f$.
119 : * - TimescaleTuner: each map has a TimescaleTuner that dynamically adjusts
120 : * the damping timescale \f$\tau\f$ appropriately to keep the error \f$Q(t)\f$
121 : * within some specified error bounds. Note that the reset time interval,
122 : * \f$\Delta t\f$, is a constant fraction of this damping timescale,
123 : * i.e. \f$\Delta t = \alpha \tau\f$ (empirically, we have found
124 : * \f$\alpha=0.3\f$ to be a good choice).
125 : *
126 : *
127 : * For additional details describing our control system approach, see
128 : * \cite Hemberger2012jz.
129 : */
130 :
131 : /*!
132 : * \defgroup CoordinateMapsGroup Coordinate Maps
133 : * \brief Functions for mapping coordinates between different frames
134 : *
135 : * Coordinate maps provide the maps themselves, the inverse maps, along
136 : * with the Jacobian and inverse Jacobian of the maps.
137 : */
138 :
139 : /*!
140 : * \defgroup CoordMapsTimeDependentGroup Coordinate Maps, Time-dependent
141 : * \brief Functions for mapping time-dependent coordinates between different
142 : * frames
143 : *
144 : * Coordinate maps provide the maps themselves, the inverse maps, the Jacobian
145 : * and inverse Jacobian of the maps, and the frame velocity (time derivative of
146 : * the map)
147 : */
148 :
149 : /*!
150 : * \defgroup DataBoxGroup DataBox
151 : * \brief Documentation, functions, metafunctions, and classes necessary for
152 : * using DataBox
153 : *
154 : * DataBox is a heterogeneous compile-time associative container with lazy
155 : * evaluation of functions. DataBox can not only store data, but can also store
156 : * functions that depend on other data inside the DataBox. The functions will be
157 : * evaluated when the data they return is requested. The result is cached, and
158 : * if a dependency of the function is modified the cache is invalidated.
159 : *
160 : * #### Simple and Compute Tags and Their Items
161 : *
162 : * The compile-time keys are `struct`s called tags, while the values are called
163 : * items. Tags are quite minimal, containing only the information necessary to
164 : * store the data and evaluate functions. There are two different types of tags
165 : * that a DataBox can hold: simple tags and compute tags. Simple tags are for
166 : * data that is inserted into the DataBox at the time of creation, while compute
167 : * tags are for data that will be computed from a function when the compute item
168 : * is retrieved. If a compute item is never retrieved from the DataBox then it
169 : * is never evaluated.
170 : *
171 : * Simple tags must have a member type alias `type` that is the type of the data
172 : * to be stored and a `static std::string name()` method that returns the name
173 : * of the tag. Simple tags must inherit from `db::SimpleTag`.
174 : *
175 : * Compute tags must also have a `static std::string name()` method that returns
176 : * the name of the tag, but they cannot have a `type` type alias. Instead,
177 : * compute tags must have a static member function or static member function
178 : * pointer named `function`. `function` can be a function template if necessary.
179 : * The `function` must take all its arguments by `const` reference. The
180 : * arguments to the function are retrieved using tags from the DataBox that the
181 : * compute tag is in. The tags for the arguments are set in the member type
182 : * alias `argument_tags`, which must be a `tmpl::list` of the tags corresponding
183 : * to each argument. Note that the order of the tags in the `argument_list` is
184 : * the order that they will be passed to the function. Compute tags must inherit
185 : * from `db::ComputeTag`.
186 : *
187 : * Here is an example of a simple tag:
188 : *
189 : * \snippet Test_DataBox.cpp databox_tag_example
190 : *
191 : * and an example of a compute tag with a function pointer:
192 : *
193 : * \snippet Test_DataBox.cpp databox_mutating_compute_item_tag
194 : *
195 : * If the compute item's tag is inline then the compute item is of the form:
196 : *
197 : * \snippet Test_DataBox.cpp compute_item_tag_function
198 : *
199 : * Compute tags can also have their functions be overloaded on the type of its
200 : * arguments:
201 : *
202 : * \snippet Test_DataBox.cpp overload_compute_tag_type
203 : *
204 : * or be overloaded on the number of arguments:
205 : *
206 : * \snippet Test_DataBox.cpp overload_compute_tag_number_of_args
207 : *
208 : * Compute tag function templates are implemented as follows:
209 : *
210 : * \snippet Test_DataBox.cpp overload_compute_tag_template
211 : *
212 : * Finally, overloading, function templates, and variadic functions can be
213 : * combined to produce extremely generic compute tags. The below compute tag
214 : * takes as template parameters a parameter pack of integers, which is used to
215 : * specify several of the arguments. The function is overloaded for the single
216 : * argument case, and a variadic function template is provided for the multiple
217 : * arguments case. Note that in practice few compute tags will be this complex.
218 : *
219 : * #### Subitems and Prefix Tags
220 : *
221 : * A simple or compute tag might also hold a collection of data, such as a
222 : * container of `Tensor`s. In many cases you will want to be able to retrieve
223 : * individual elements of the collection from the DataBox without having to
224 : * first retrieve the collection. The infrastructure that allows for this is
225 : * called *Subitems*. The subitems of the parent tag must refer to a subset of
226 : * the data inside the parent tag, e.g. one `Tensor` in the collection. If the
227 : * parent tag is `Parent` and the subitems tags are `Sub<0>, Sub<1>`, then when
228 : * `Parent` is added to the DataBox, so are `Sub<0>` and `Sub<1>`. This means
229 : * the retrieval mechanisms described below will work on `Parent`, `Sub<0>`, and
230 : * `Sub<1>`.
231 : *
232 : * Subitems specify requirements on the tags they act on. For example, there
233 : * could be a requirement that all tags with a certain type are to be treated as
234 : * a Subitems. Let's say that the `Parent` tag holds a `Variables`, and
235 : * `Variables` can be used with the Subitems infrastructure to add the nested
236 : * `Tensor`s. Then all tags that hold a `Variables` will have their subitems
237 : * added into the DataBox. To add a new type as a subitem the `db::Subitems`
238 : * struct must be specialized. See the documentation of `db::Subitems` for more
239 : * details.
240 : *
241 : * The DataBox also supports *prefix tags*, which are commonly used for items
242 : * that are related to a different item by some operation. Specifically, say
243 : * you have a tag `MyTensor` and you want to also have the time derivative of
244 : * `MyTensor`, then you can use the prefix tag `dt` to get `dt<MyTensor>`. The
245 : * benefit of a prefix tag over, say, a separate tag `dtMyTensor` is that prefix
246 : * tags can be added and removed by the compute tags acting on the original tag.
247 : * Prefix tags can also be composed, so a second time derivative would be
248 : * `dt<dt<MyTensor>>`. The net result of the prefix tags infrastructure is that
249 : * the compute tag that returns `dt<MyTensor>` only needs to know its input
250 : * tags, it knows how to name its output based off that. In addition to the
251 : * normal things a simple or a compute tag must hold, prefix tags must have a
252 : * nested type alias `tag`, which is the tag being prefixed. Prefix tags must
253 : * also inherit from `db::PrefixTag` in addition to inheriting from
254 : * `db::SimpleTag` or `db::ComputeTag`.
255 : *
256 : * #### Creating a DataBox
257 : *
258 : * You should never call the constructor of a DataBox directly. DataBox
259 : * construction is quite complicated and the helper function `db::create`
260 : * should be used instead. `db::create` is used to construct a
261 : * new DataBox. It takes two typelists as explicit template parameters, the
262 : * first being a list of the simple tags to add and the second being a list of
263 : * compute tags to add. If no compute tags are being added then only the simple
264 : * tags list must be specified. The tags lists should be passed as
265 : * `db::create<db::AddSimpleTags<simple_tags...>,
266 : * db::AddComputeTags<compute_tags...>>`. The arguments to `db::create` are the
267 : * initial values of the simple tags and must be passed in the same order as the
268 : * tags in the `db::AddSimpleTags` list. If the type of an argument passed to
269 : * `db::create` does not match the type of the corresponding simple tag a static
270 : * assertion will trigger. Here is an example of how to use `db::create`:
271 : *
272 : * \snippet Test_DataBox.cpp create_databox
273 : *
274 : * #### Accessing and Mutating Items
275 : *
276 : * To retrieve an item from a DataBox use the `db::get` function. `db::get`
277 : * will always return a `const` reference to the object stored in the DataBox
278 : * and will also have full type information available. This means you are able
279 : * to use `const auto&` when retrieving tags from the DataBox. For example,
280 : * \snippet Test_DataBox.cpp using_db_get
281 : *
282 : * If you want to mutate the value of a simple item in the DataBox use
283 : * `db::mutate`. Any compute item that depends on the mutated item will have its
284 : * cached value invalidated and be recomputed the next time it is retrieved from
285 : * the DataBox. `db::mutate` takes a parameter pack of tags to mutate as
286 : * explicit template parameters, a `gsl::not_null` of the DataBox whose items
287 : * will be mutated, an invokable, and extra arguments to forward to the
288 : * invokable. The invokable takes the arguments passed from the DataBox by
289 : * `const gsl::not_null` while the extra arguments are forwarded to the
290 : * invokable. The invokable is not allowed to retrieve anything from the
291 : * DataBox, so any items must be passed as extra arguments using `db::get` to
292 : * retrieve them. For example,
293 : *
294 : * \snippet Test_DataBox.cpp databox_mutate_example
295 : *
296 : * In addition to retrieving items using `db::get` and mutating them using
297 : * `db::mutate`, there is a facility to invoke an invokable with tags from the
298 : * DataBox. `db::apply` takes a `tmpl::list` of tags as an explicit template
299 : * parameter, will retrieve all the tags from the DataBox passed in and then
300 : * invoke the invokable with the items in the tag list. Similarly,
301 : * `db::mutate_apply` invokes the invokable but allows for mutating some of
302 : * the tags. See the documentation of `db::apply` and `db::mutate_apply` for
303 : * examples of how to use them.
304 : *
305 : */
306 :
307 : /*!
308 : * \defgroup DataBoxTagsGroup DataBox Tags
309 : * \brief Structures and metafunctions for labeling the contents of DataBoxes
310 : */
311 :
312 : /*!
313 : * \defgroup DataStructuresGroup Data Structures
314 : * \brief Various useful data structures used in SpECTRE
315 : */
316 :
317 : /*!
318 : * \defgroup DgSubcellGroup DG-Subcell
319 : * \brief Functions and classes specific to the discontinuous Galerkin method
320 : * supplemented with a finite volume or finite difference subcell limiter. Can
321 : * also be thought of as a DG-FD hybrid method.
322 : */
323 :
324 : /*!
325 : * \defgroup DiscontinuousGalerkinGroup Discontinuous Galerkin
326 : * \brief Functions and classes specific to the Discontinuous Galerkin
327 : * algorithm.
328 : */
329 :
330 : /*!
331 : * \defgroup EllipticSystemsGroup Elliptic Systems
332 : * \brief All available elliptic systems
333 : */
334 :
335 : /*!
336 : * \defgroup EquationsOfStateGroup Equations of State
337 : * \brief The various available equations of state
338 : */
339 :
340 : /*!
341 : * \defgroup ErrorHandlingGroup Error Handling
342 : * Macros and functions used for handling errors
343 : */
344 :
345 : /*!
346 : * \defgroup EventsAndTriggersGroup Events and Triggers
347 : * \brief Classes and functions related to events and triggers
348 : */
349 :
350 : /*!
351 : * \defgroup EvolutionSystemsGroup Evolution Systems
352 : * \brief All available evolution systems and information on how to implement
353 : * evolution systems
354 : *
355 : * \details Actions and parallel components may require an evolution system to
356 : * expose the following types:
357 : *
358 : * - `volume_dim`: The number of spatial dimensions
359 : * - `variables_tag`: The evolved variables to compute DG volume contributions
360 : * and fluxes for.
361 : * - `compute_time_derivative`: A struct that computes the bulk contribution to
362 : * the DG discretization of the time derivative. Must expose a `tmpl::list` of
363 : * `argument_tags` and a static `apply` function that takes the following
364 : * arguments in this order:
365 : * - First, the types of the tensors in
366 : * `db::add_tag_prefix<Metavariables::temporal_id::step_prefix, variables_tag>`
367 : * (which represent the time derivatives of the variables) as not-null pointers.
368 : * - The types of the `argument_tags` as constant references.
369 : *
370 : * Actions and parallel components may also require the Metavariables to expose
371 : * the following types:
372 : *
373 : * - `system`: See above.
374 : * - `temporal_id`: A DataBox tag that identifies steps in the algorithm.
375 : * Generally use `Tags::TimeStepId`.
376 : */
377 :
378 : /*!
379 : * \defgroup ExecutablesGroup Executables
380 : * \brief A list of executables and how to use them
381 : *
382 : * <table class="doxtable">
383 : * <tr>
384 : * <th>Executable Name </th><th>Description </th>
385 : * </tr>
386 : * <tr>
387 : * <td> \ref ParallelInfoExecutablePage "ParallelInfo" </td>
388 : * <td> Executable for checking number of nodes, cores, etc.</td>
389 : * </tr>
390 : * <tr>
391 : * <td> ExportEquationOfStateForRotNS </td>
392 : * <td> Exports a 1d equation of state in a table format that the RotNS fortran
393 : * code can read in.</td>
394 : * </tr>
395 : * </table>
396 : */
397 :
398 : /*!
399 : * \defgroup FileSystemGroup File System
400 : * \brief A light-weight file system library.
401 : */
402 :
403 : /*!
404 : * \defgroup FiniteDifferenceGroup Finite Difference
405 : * \brief Functions needed for (conservative) finite difference methods.
406 : */
407 :
408 : /*!
409 : * \defgroup GeneralRelativityGroup General Relativity
410 : * \brief Contains functions used in General Relativistic simulations
411 : */
412 :
413 : /*!
414 : * \defgroup HDF5Group HDF5
415 : * \brief Functions and classes for manipulating HDF5 files
416 : */
417 :
418 : /*!
419 : * \defgroup InitializationGroup Initialization
420 : * \brief Actions and metafunctions used for initialization of parallel
421 : * components.
422 : */
423 :
424 : /*!
425 : * \defgroup LimitersGroup Limiters
426 : * \brief Limiters to control shocks and surfaces in the solution.
427 : */
428 :
429 : /*!
430 : * \defgroup LinearSolverGroup Linear Solver
431 : * \brief Algorithms to solve linear systems of equations
432 : *
433 : * \details In a way, the linear solver is for elliptic systems what time
434 : * stepping is for the evolution code. This is because the DG scheme for an
435 : * elliptic system reduces to a linear system of equations of the type
436 : * \f$Ax=b\f$, where \f$A\f$ is a global matrix representing the DG
437 : * discretization of the problem. Since this is one equation for each node in
438 : * the computational domain it becomes unfeasible to numerically invert the
439 : * global matrix \f$A\f$. Instead, we solve the problem iteratively so that we
440 : * never need to construct \f$A\f$ globally but only need \f$Ax\f$ that can be
441 : * evaluated locally by virtue of the DG formulation. This action of the
442 : * operator is what we have to supply in each step of the iterative algorithms
443 : * implemented here. It is where most of the computational cost goes and usually
444 : * involves computing a volume contribution for each element and communicating
445 : * fluxes with neighboring elements. Since the iterative algorithms typically
446 : * scale badly with increasing grid size, a preconditioner \f$P\f$ is needed
447 : * in order to make \f$P^{-1}A\f$ easier to invert.
448 : *
449 : * \note The smallest possible residual magnitude the linear solver can reach is
450 : * the product between the machine epsilon and the condition number of the
451 : * linear operator that is being inverted. Smaller residuals are numerical
452 : * artifacts. Requiring an absolute or relative residual below this limit will
453 : * likely make the linear solver run until it reaches its maximum number of
454 : * iterations.
455 : *
456 : * \note Remember that when the linear operator \f$A\f$ corresponds to a PDE
457 : * discretization, decreasing the linear solver residual below the
458 : * discretization error will not improve the numerical solution any further.
459 : * I.e. the error \f$e_k=x_k-x_\mathrm{analytic}\f$ to an analytic solution
460 : * will be dominated by the linear solver residual at first, but even if the
461 : * discretization \f$Ax_k=b\f$ was exactly solved after some iteration \f$k\f$,
462 : * the discretization residual
463 : * \f$Ae_k=b-Ax_\mathrm{analytic}=r_\mathrm{discretization}\f$ would still
464 : * remain. Therefore, ideally choose the absolute or relative residual criteria
465 : * based on an estimate of the discretization residual.
466 : *
467 : * In the iterative algorithms we usually don't work with the physical field
468 : * \f$x\f$ directly. Instead we need to apply the operator to an internal
469 : * variable defined by the respective algorithm. This variable is exposed as the
470 : * `LinearSolver::Tags::Operand` prefix, and the algorithm expects that the
471 : * computed operator action is written into
472 : * `db::add_tag_prefix<LinearSolver::Tags::OperatorAppliedTo,
473 : * LinearSolver::Tags::Operand<...>>` in each step.
474 : */
475 :
476 : /// \defgroup LoggingGroup Logging
477 : /// \brief Functions for logging progress of running code
478 :
479 : /// \defgroup MathFunctionsGroup Math Functions
480 : /// \brief Useful analytic functions
481 :
482 : /*!
483 : * \defgroup NumericalAlgorithmsGroup Numerical Algorithms
484 : * \brief Generic numerical algorithms
485 : */
486 :
487 : /*!
488 : * \defgroup NumericalFluxesGroup Numerical Fluxes
489 : * \brief The set of available numerical fluxes
490 : */
491 :
492 : /*!
493 : * \defgroup ObserversGroup Observers
494 : * \brief Observing/writing data to disk.
495 : */
496 :
497 : /*!
498 : * \defgroup OptionGroupsGroup Option Groups
499 : * \brief Tags used for grouping input file options.
500 : *
501 : * An \ref OptionTagsGroup "option tag" can be placed in a group with other
502 : * option tags to give the input file more structure. To assign a group to an
503 : * option tag, set its `group` type alias to a struct that provides a help
504 : * string and may override a static `name()` function:
505 : *
506 : * \snippet Test_Options.cpp options_example_group
507 : *
508 : * A number of commonly used groups are listed here.
509 : *
510 : * See also the \ref dev_guide_option_parsing "option parsing guide".
511 : */
512 :
513 : /*!
514 : * \defgroup OptionParsingGroup Option Parsing
515 : * Things related to parsing YAML input files.
516 : */
517 :
518 : /*!
519 : * \defgroup OptionTagsGroup Option Tags
520 : * \brief Tags used for options parsed from the input file.
521 : *
522 : * These can be stored in the GlobalCache or passed to the `initialize`
523 : * function of a parallel component.
524 : */
525 :
526 : /*!
527 : * \defgroup ParallelGroup Parallelization
528 : * \brief Functions, classes and documentation related to parallelization and
529 : * Charm++
530 : *
531 : * See
532 : * \ref dev_guide_parallelization_foundations "Parallelization infrastructure"
533 : * for details.
534 : */
535 :
536 : /*!
537 : * \defgroup PeoGroup Performance, Efficiency, and Optimizations
538 : * \brief Classes and functions useful for performance optimizations.
539 : */
540 :
541 : /*!
542 : * \defgroup PrettyTypeGroup Pretty Type
543 : * \brief Pretty printing of types
544 : */
545 :
546 : /*!
547 : * \defgroup ProtocolsGroup Protocols
548 : * \brief Classes that define metaprogramming interfaces
549 : *
550 : * See the \ref protocols section of the dev guide for details.
551 : */
552 :
553 : /*!
554 : * \defgroup PythonBindingsGroup Python Bindings
555 : * \brief Classes and functions useful when writing python bindings.
556 : *
557 : * See the \ref spectre_writing_python_bindings "Writing Python Bindings"
558 : * section of the dev guide for details on how to write python bindings.
559 : */
560 :
561 : /*!
562 : * \defgroup SpecialRelativityGroup Special Relativity
563 : * \brief Contains functions used in special relativity calculations
564 : */
565 :
566 : /*!
567 : * \defgroup SpectralGroup Spectral
568 : * Things related to spectral transformations.
569 : */
570 :
571 : // Note: this group is ordered by how it appears in the rendered Doxygen pages
572 : // (i.e., "Spin-weighted..."), rather than the group's name (i.e., "Swsh...").
573 : /*!
574 : * \defgroup SwshGroup Spin-weighted spherical harmonics
575 : * Utilities, tags, and metafunctions for using and manipulating spin-weighted
576 : * spherical harmonics
577 : */
578 :
579 : /*!
580 : * \defgroup SurfacesGroup Surfaces
581 : * Things related to surfaces.
582 : */
583 :
584 : /*!
585 : * \defgroup TensorGroup Tensor
586 : * Tensor use documentation.
587 : */
588 :
589 : /*!
590 : * \defgroup TensorExpressionsGroup Tensor Expressions
591 : * Tensor Expressions allow writing expressions of
592 : * tensors in a way similar to what is used with pen and paper.
593 : *
594 : * Tensor expressions are implemented using (smart) expression templates. This
595 : * allows a domain specific language making expressions such as
596 : * \code
597 : * auto T = evaluate<Indices::_a_t, Indices::_b_t>(F(Indices::_b,
598 : * Indices::_a));
599 : * \endcode
600 : * possible.
601 : */
602 :
603 : /*!
604 : * \defgroup TestingFrameworkGroup Testing Framework
605 : * \brief Classes, functions, macros, and instructions for developing tests
606 : *
607 : * \details
608 : *
609 : * SpECTRE uses the testing framework
610 : * [Catch](https://github.com/philsquared/Catch). Catch supports a variety of
611 : * different styles of tests including BDD and fixture tests. The file
612 : * `cmake/SpectreAddCatchTests.cmake` parses the source files and adds the found
613 : * tests to ctest with the correct properties specified by tags and attributes.
614 : *
615 : * ### Usage
616 : *
617 : * To run the tests, type `ctest` in the build directory. You can specify
618 : * a regex to match the test name using `ctest -R Unit.Blah`, or run all
619 : * tests with a certain tag using `ctest -L tag`.
620 : *
621 : * ### Comparing double-precision results
622 : *
623 : * To compare two floating-point numbers that may differ by round-off, use the
624 : * helper object `approx`. This is an instance of Catch's comparison class
625 : * `Approx` in which the relative tolerance for comparisons is set to roughly
626 : * \f$10^{-14}\f$ (i.e. `std::numeric_limits<double>::%epsilon()*100`).
627 : * When possible, we recommend using `approx` for fuzzy comparisons as follows:
628 : * \example
629 : * \snippet Test_TestingFramework.cpp approx_default
630 : *
631 : * For checks that need more control over the precision (e.g. an algorithm in
632 : * which round-off errors accumulate to a higher level), we recommend using
633 : * the `approx` helper with a one-time tolerance adjustment. A comment
634 : * should explain the reason for the adjustment:
635 : * \example
636 : * \snippet Test_TestingFramework.cpp approx_single_custom
637 : *
638 : * For tests in which the same precision adjustment is re-used many times, a new
639 : * helper object can be created from Catch's `Approx` with a custom precision:
640 : * \example
641 : * \snippet Test_TestingFramework.cpp approx_new_custom
642 : *
643 : * Note: We provide the `approx` object because Catch's `Approx` defaults to a
644 : * very loose tolerance (`std::numeric_limits<float>::%epsilon()*100`, or
645 : * roughly \f$10^{-5}\f$ relative error), and so is poorly-suited to checking
646 : * many numerical algorithms that rely on double-precision accuracy. By
647 : * providing a tighter tolerance with `approx`, we avoid having to redefine the
648 : * tolerance in every test.
649 : *
650 : * ### Attributes
651 : *
652 : * Attributes allow you to modify properties of the test. Attributes are
653 : * specified as follows:
654 : * \code
655 : * // [[TimeOut, 10]]
656 : * // [[OutputRegex, The error message expected from the test]]
657 : * SPECTRE_TEST_CASE("Unit.Blah", "[Unit]") {
658 : * \endcode
659 : *
660 : * Available attributes are:
661 : *
662 : * <table class="doxtable">
663 : * <tr>
664 : * <th>Attribute </th><th>Description </th>
665 : * </tr>
666 : * <tr>
667 : * <td>TimeOut </td>
668 : * <td>override the default timeout and set the timeout to N seconds. This
669 : * should be set very sparingly since unit tests are designed to be
670 : * short. If your test is too long you should consider testing smaller
671 : * portions of the code if possible, or writing an integration test instead.
672 : * </td>
673 : * </tr>
674 : * <tr>
675 : * <td>OutputRegex </td>
676 : * <td>
677 : * When testing failure modes the exact error message must be tested, not
678 : * just that the test failed. Since the string passed is a regular
679 : * expression you must escape any regex tokens. For example, to match
680 : * `some (word) and` you must specify the string `some \(word\) and`.
681 : * If your error message contains a newline, you can match it using the
682 : * dot operator `.`, which matches any character.
683 : * </td>
684 : * </tr>
685 : * </table>
686 : *
687 : * ### Debugging Tests in GDB or LLDB
688 : *
689 : * Several tests fail intentionally at the executable level to test error
690 : * handling like ASSERT statements in the code. CTest is aware of which
691 : * should fail and passes them. If you want to debug an individual test
692 : * in a debugger you must specify the name of the test as the first argument to
693 : * the test executable. For example, if you want to debug the "Unit.Gradient"
694 : * test: Launch the debugger, for example if you're using LLDB then run `lldb
695 : * ./bin/Test_LinearOperators`. Then run the test with `run Unit.Gradient`
696 : * inside the debugger.
697 : */
698 :
699 : /*!
700 : * \defgroup TimeGroup Time
701 : * \brief Code related to the representation of time during simulations.
702 : *
703 : * The time covered by a simulation is divided up into a sequence of
704 : * adjacent, non-overlapping (except at endpoints) intervals referred
705 : * to as "slabs". The boundaries between slabs can be placed at
706 : * arbitrary times. Slabs, as represented in the code as the Slab
707 : * class, provide comparison operators comparing slabs agreeing with
708 : * the definition as a sequence of intervals. Slabs that do not
709 : * jointly belong to any such sequence should not be compared.
710 : *
711 : * The specific time is represented by the Time class, which encodes
712 : * the slab containing the time and the fraction of the slab that has
713 : * elapsed as an exact rational. Times are comparable according to
714 : * their natural time ordering, except for times belonging to
715 : * incomparable slabs.
716 : *
717 : * Differences in time within a slab are represented as exact
718 : * fractions of that slab by the TimeDelta class. TimeDeltas are only
719 : * meaningful within a single slab, with the exception that the ratio
720 : * of objects with different slabs may be taken, resulting in an
721 : * inexact floating-point result. Longer intervals of time are
722 : * represented using floating-point values.
723 : */
724 :
725 : /*!
726 : * \defgroup TimeSteppersGroup Time Steppers
727 : * A collection of ODE integrators primarily used for time stepping.
728 : */
729 :
730 : /*!
731 : * \defgroup TypeTraitsGroup Type Traits
732 : * A collection of useful type traits, including C++14 and C++17 additions to
733 : * the standard library.
734 : */
735 :
736 : /*!
737 : * \defgroup UtilitiesGroup Utilities
738 : * \brief A collection of useful classes, functions and metafunctions.
739 : */
740 :
741 : /*!
742 : * \defgroup VariableFixingGroup Variable Fixing
743 : * \brief A collection of different variable fixers ranging in sophistication.
744 : *
745 : * Build-up of numerical error can cause physical quantities to evolve
746 : * toward non-physical values. For example, pressure and density may become
747 : * negative. This will subsequently lead to failures in numerical inversion
748 : * schemes to recover the corresponding convervative values. A rough fix that
749 : * enforces physical quantities stay physical is to simply change them by hand
750 : * when needed. This can be done at various degrees of sophistication, but in
751 : * general the fixed quantities make up a negligible amount of the physics of
752 : * the simulation; a rough fix is vastly preferred to a simulation that fails
753 : * to complete due to nonphysical quantities.
754 : */
|