SpECTRE  v2024.09.29
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Slab Class Reference

A chunk of time. Every element must reach slab boundaries exactly, no matter how it actually takes time steps to get there. The simulation can only be assumed to have global data available at slab boundaries. More...

#include <Slab.hpp>

Public Member Functions

 Slab ()=default
 Default constructor gives an invalid Slab.
 
 Slab (double start, double end)
 Construct a slab running between two times (exactly).
 
Time start () const
 
Time end () const
 
TimeDelta duration () const
 
Slab advance () const
 Create a new slab immediately following this one with the same (up to roundoff) duration.
 
Slab retreat () const
 Create a new slab immediately preceeding this one with the same (up to roundoff) duration.
 
Slab advance_towards (const TimeDelta &dt) const
 Create a slab adjacent to this one in the direction indicated by the argument, as with advance() or retreat().
 
Slab with_duration_from_start (double duration) const
 Create a new slab with the same start time as this one with the given duration (up to roundoff).
 
Slab with_duration_to_end (double duration) const
 Create a new slab with the same end time as this one with the given duration (up to roundoff).
 
bool is_followed_by (const Slab &other) const
 Check if this slab is immediately followed by the other slab.
 
bool is_preceeded_by (const Slab &other) const
 Check if this slab is immediately preceeded by the other slab.
 
bool overlaps (const Slab &other) const
 Check if slabs overlap. Abutting slabs do not overlap.
 
void pup (PUP::er &p)
 

Static Public Member Functions

static Slab with_duration_from_start (double start, double duration)
 Construct a slab with a given start time and duration. The actual duration may differ by roundoff from the supplied value.
 
static Slab with_duration_to_end (double end, double duration)
 Construct a slab with a given end time and duration. The actual duration may differ by roundoff from the supplied value.
 

Friends

class Time
 
class TimeDelta
 
bool operator== (const Slab &a, const Slab &b)
 
bool operator< (const Slab &a, const Slab &b)
 Slab comparison operators give the time ordering. Overlapping unequal slabs should not be compared (and will trigger an assertion).
 
bool operator== (const Time &a, const Time &b)
 

Detailed Description

A chunk of time. Every element must reach slab boundaries exactly, no matter how it actually takes time steps to get there. The simulation can only be assumed to have global data available at slab boundaries.


The documentation for this class was generated from the following file: