Class ModelMetadata

Class Documentation

class ModelMetadata

A class to hold the metadata pertaining to the model as a whole, both constant and time varying values. Especially values required for data file output.

Public Functions

void setDimensionsFromFile(const std::string &filename)

Set dimensions information based on the contents of an input file.

If an input file hasn’t been read yet, the dimensions are read from the file and set. Otherwise, a consistency check is made against the dimensions read from file and already set.

Parameters:

filename – the name of the file

void setTimes(const TimePoint &start, const TimePoint &stop, const Duration &step)

Sets the model start, stop and step times directly.

Parameters:
  • start. – The model initial TimePoint.

  • stop. – The model final TimePoint.

  • step. – The model advection/thermodynamics step Duration.

void setTimes(const TimePoint &start, const Duration &runLength, const Duration &step)

Sets the model start, stop and step times from a run length.

Parameters:
  • start. – The model initial TimePoint.

  • runLength. – The model run Duration.

  • step. – The model advection/thermodynamics step Duration.

void setTime(const TimePoint &time)

Sets the initial or current model time.

Parameters:

timeTimePoint instance encoding the current time.

void incrementTime(const Duration &step)

Increments the model time metadata value.

Parameters:

stepDuration of the time increment to add.

inline const TimePoint &time() const

Returns the current model time.

inline const TimePoint &startTime() const

Returns the model start time.

inline const TimePoint &stopTime() const

Returns the model stop time.

inline const Duration &stepLength() const

Returns the model step length.

inline const Duration &runLength() const

Returns the model run length.

const std::string &structureName() const

Returns the string description of the model grid structure.

inline void setConfig(const ConfigMap &config)

Sets the configuration metadata.

Parameters:

config – The configuration metadata

const ModelState &extractCoordinates(const ModelState &state)

Extracts and sets the coordinate metadata from the given ModelState.

Parameters:

state – The given ModelState.

ModelState &affixCoordinates(ModelState &state) const

Adds the coordinate metadata to the given ModelState.

Parameters:

state – The given ModelState.

Public Members

friend CommonRestartMetadata
std::string initialFileName
std::string finalFileName
Duration restartPeriod

Public Static Functions

static inline ModelMetadata &getInstance()
static void finalize()