4#ifndef FOURIER_INTERPOLATION_H
5#define FOURIER_INTERPOLATION_H
11#include "Core/Exception.h"
206 const Array<double> &fourier_coefficients_real,
207 const Array<double> &fourier_coefficients_imaginary,
208 double initial_time,
double period);
237 unsigned int n_components);
297 unsigned int frequency)
const;
302 unsigned int frequency)
const;
328 void evaluate_internal(
double time,
bool evaluate_derivative,
338 bool use_ramp =
false;
343 unsigned int n_fourier_coefficients = 0;
348 unsigned int n_components = 0;
379 double initial_time = 0.0;
387 Array<double> fourier_coefficients_real;
395 Array<double> fourier_coefficients_imaginary;
Exception hierarchy for error handling in the FE library.
The CmMod class duplicates the data structures in the Fortran CMMOD module defined in COMU....
Definition CmMod.h:36
Fourier interpolation of time dependent data.
Definition FourierInterpolation.h:113
std::pair< Vector< double >, Vector< double > > value_and_derivative(double time) const
Return the interpolated value and its time derivative at a given time.
Definition FourierInterpolation.cpp:446
void distribute(const CmMod &cm_mod, const cmType &cm)
Distribute the data to all parallel processes.
Definition FourierInterpolation.cpp:405
static FourierInterpolation from_time_series_file(const std::string &file_name, unsigned int n_components, bool use_ramp)
Read a time series from file and return the corresponding instance of FourierInterpolation.
Definition FourierInterpolation.cpp:176
double get_coefficient_real(unsigned int component, unsigned int frequency) const
Get the real part of the Fourier coefficients for one component.
Definition FourierInterpolation.cpp:501
FourierInterpolation()=default
Default constructor.
unsigned int get_n_fourier_coefficients() const
Get the number of Fourier coefficients used by this object.
Definition FourierInterpolation.cpp:463
double get_coefficient_imaginary(unsigned int component, unsigned int frequency) const
Get the imaginary part of the Fourier coefficients for one component.
Definition FourierInterpolation.cpp:523
static FourierInterpolation from_time_series(const unsigned int n_fourier_coefficients, const Vector< double > ×, const Array< double > &values, bool use_ramp)
Construct a FourierInterpolation from a time series.
Definition FourierInterpolation.cpp:67
double get_linear_trend_slope(unsigned int component) const
Get the slope of the linear trend part for one component.
Definition FourierInterpolation.cpp:485
static FourierInterpolation from_fourier_coefficients_file(const std::string &file_name, unsigned int n_components)
Read Fourier coefficients from file and return the corresponding FourierInterpolation instance.
Definition FourierInterpolation.cpp:302
bool defined() const
Return whether this object has been initialized.
Definition FourierInterpolation.cpp:455
Vector< double > value(double time) const
Return the interpolated value at a given time.
Definition FourierInterpolation.cpp:436
static FourierInterpolation from_fourier_coefficients(const Vector< double > &linear_trend_initial_values, const Vector< double > &linear_trend_slopes, const Array< double > &fourier_coefficients_real, const Array< double > &fourier_coefficients_imaginary, double initial_time, double period)
Construct a FourierInterpolation from Fourier coefficients.
Definition FourierInterpolation.cpp:245
double get_linear_trend_initial_value(unsigned int component) const
Get the initial value of the linear trend part for one component.
Definition FourierInterpolation.cpp:467
unsigned int get_n_components() const
Get the dimension of the data interpolated by this object.
Definition FourierInterpolation.cpp:459
The Vector template class is used for storing int and double data.
Definition Vector.h:26
The cmType class stores data and defines methods used for mpi communication.
Definition CmMod.h:56