SpECTRE  v2022.08.01
domain::FunctionsOfTime Namespace Reference

Contains functions of time to support the dual frame system. More...

Classes

class  FixedSpeedCubic
 Sets \(f(t)\) and derivatives using cubic rational functions, such that the first derivative approaches a constant and the second derivative approaches zero. More...
 
class  FunctionOfTime
 Base class for FunctionsOfTime. More...
 
class  PiecewisePolynomial
 A function that has a piecewise-constant MaxDerivth derivative. More...
 
class  QuaternionFunctionOfTime
 A FunctionOfTime that stores quaternions for the rotation map. More...
 
class  SettleToConstant
 Given an initial function of time, transitions the map to a constant-in-time value. More...
 

Functions

bool operator!= (const FixedSpeedCubic &lhs, const FixedSpeedCubic &rhs)
 
template<size_t MaxDeriv>
bool operator!= (const PiecewisePolynomial< MaxDeriv > &lhs, const PiecewisePolynomial< MaxDeriv > &rhs)
 
template<size_t MaxDeriv>
bool operator!= (const QuaternionFunctionOfTime< MaxDeriv > &lhs, const QuaternionFunctionOfTime< MaxDeriv > &rhs)
 
template<template< size_t > class FoTType, size_t MaxDeriv>
void read_spec_piecewise_polynomial (gsl::not_null< std::unordered_map< std::string, FoTType< MaxDeriv > > * > spec_functions_of_time, const std::string &file_name, const std::map< std::string, std::string > &dataset_name_map, const bool quaternion_rotation=false)
 Import SpEC FunctionOfTime data from an H5 file. More...
 
void override_functions_of_time (const gsl::not_null< std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > * > functions_of_time, const std::string &function_of_time_file, const std::map< std::string, std::string > &function_of_time_name_map)
 Replace the functions of time from the domain_creator with the ones read in from function_of_time_file. More...
 
void register_derived_with_charm ()
 
bool operator!= (const SettleToConstant &lhs, const SettleToConstant &rhs)
 

Detailed Description

Contains functions of time to support the dual frame system.

Function Documentation

◆ override_functions_of_time()

void domain::FunctionsOfTime::override_functions_of_time ( const gsl::not_null< std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > * >  functions_of_time,
const std::string function_of_time_file,
const std::map< std::string, std::string > &  function_of_time_name_map 
)

Replace the functions of time from the domain_creator with the ones read in from function_of_time_file.

Note
Currently, only support order 2 or 3 piecewise polynomials. This could be generalized later, but the SpEC functions of time that we will read in with this action will always be 2nd-order or 3rd-order piecewise polynomials

◆ read_spec_piecewise_polynomial()

template<template< size_t > class FoTType, size_t MaxDeriv>
void domain::FunctionsOfTime::read_spec_piecewise_polynomial ( gsl::not_null< std::unordered_map< std::string, FoTType< MaxDeriv > > * >  spec_functions_of_time,
const std::string file_name,
const std::map< std::string, std::string > &  dataset_name_map,
const bool  quaternion_rotation = false 
)

Import SpEC FunctionOfTime data from an H5 file.

Columns in the file to be read must have the following form:

  • 0 = time
  • 1 = time of last update
  • 2 = number of components
  • 3 = maximum derivative order
  • 4 = version
  • 5 = function
  • 6 = d/dt (function)
  • 7 = d^2/dt^2 (function)
  • 8 = d^3/dt^3 (function)

If the function has more than one component, columns 5-8 give the first component and its derivatives, columns 9-12 give the second component and its derivatives, etc.

Currently, only support order 2 and 3 piecewise polynomials and order 3 quaternion functions of time. This could be generalized later, but the SpEC functions of time that we will read in with this action will always be 3rd-order piecewise polynomials.