2.3.17. swTimeSeries

Defined in swCore/swCore.h

class swTimeSeries

The swTimeSeries class to read fields values from the boundary conditions file.

Public Functions

swTimeSeries(swParam *param, QString Type)

Read fields values from the boundary conditions file.

Find the correct time and interpolate

Format:

  • Lines 1-2 : user’s comments

  • Line 3 : number of BC fields to be read

  • Lines 4-5: user’s comments

  • Line 6 : Strings containing BC types (as many as no. BC fileds read above)

  • Lines 7-8: user’s comments

  • Lines 9- : t, BC numerical values (one column per value) Only works with < double > fields

Read fields values from the boundary conditions file.

Find the correct time and interpolate

Format:

  • Lines 1-2 : user’s comments

  • Line 3 : number of BC fields to be read

  • Lines 4-5: user’s comments

  • Line 6 : Strings containing BC types (as many as no. BC fileds read above)

  • Lines 7-8: user’s comments

  • Lines 9- : t, BC numerical values (one column per value)

Parameters
  • settings: pointer to Settings structure

  • Type: type of time series: “bc” (boundary conditions), “prec” (precipitation)

Only works with < double > fields

~swTimeSeries()

Desctructor.

bool timeSerie(double time, xt::xarray<double> &bc_val)

Compute, in a given instant, a value defined by a time series.

Return

boolean indicating that the time series contains the given time and computation has succeded.

Parameters
  • time: the given instant

  • bc_val: (output) array with size equal to the number of time series; contains the computed value for each one of them in the given instants

bool timeSerieWind(double time, xt::xarray<double> &wind_x, xt::xarray<double> &wind_y)
bool timeSerieWind(double time, xt::xarray<double> &wind_val)
void setTypes(const std::vector<QChar> &types)

Set time series types defined in time series file (used for boundary conditions time series)

Parameters
  • types: array containing the type of each boundary condition

const std::vector<QChar> &types(void)

Get the types of boundary conditions.

Return

array containing the type of each boundary condition

Private Functions

bool checkTimeSeriesValues(int start_line, const QString &filename)

Private Members

QFile *file
std::size_t nseries
QString time_series_type
std::vector<QChar> bc_types
double previous_t_request
double t_0
double t_inf
double t_sup
bool at_eof
xt::xarray<double> inf_vals
xt::xarray<double> sup_vals
xt::xarray<double> inf_vals_x
xt::xarray<double> inf_vals_y
xt::xarray<double> sup_vals_x
xt::xarray<double> sup_vals_y