NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD_OutputDefinition.h
1 /* The NANDRAD data model library.
2 
3  Copyright (c) 2012-today, Institut für Bauklimatik, TU Dresden, Germany
4 
5  Primary authors:
6  Andreas Nicolai <andreas.nicolai -[at]- tu-dresden.de>
7  Anne Paepcke <anne.paepcke -[at]- tu-dresden.de>
8 
9  This library is part of SIM-VICUS (https://github.com/ghorwin/SIM-VICUS)
10 
11  This library is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 */
21 
22 #ifndef NANDRAD_OutputDefinitionH
23 #define NANDRAD_OutputDefinitionH
24 
25 #include <string>
26 
27 #include "NANDRAD_CodeGenMacros.h"
28 
29 namespace NANDRAD {
30 
31 class ObjectList;
32 class OutputGrid;
33 
34 /*! The output definition class selects quantities to be logged. They are specified
35  by a unique variable name and an object list with models containing
36  the requested quantity.
37  In the case of a vector-valued quantity the id or index must be given in brackets.
38  \code
39  quantity = name[<id or index>]
40  \endcode
41  The extracted quantity will be treated like a scalar quantity.
42 */
44 public:
45 
46  /*! Different options to handle time averaging/integration. */
47  enum timeType_t {
48  /*! Write outputs as calculated at output time points. */
49  OTT_NONE, // Keyword: None 'Write values as calculated at output times.'
50  /*! Average value in last output interval. */
51  OTT_MEAN, // Keyword: Mean 'Average values in time (mean value in output step).'
52  /*! Time integral of output value. */
53  OTT_INTEGRAL, // Keyword: Integral 'Integrate values in time.'
54  NUM_OTT
55  };
56 
57  // *** PUBLIC MEMBER FUNCTIONS ***
58 
59  NANDRAD_READWRITE
60  NANDRAD_COMP(OutputDefinition)
61 
62  // *** PUBLIC MEMBER VARIABLES ***
63 
64  /*! Filename (if empty then filename is generated automatically). */
65  std::string m_fileName; // XML:E
66 
67  /*! Quantity id (for example, "AirTemperature"). */
68  std::string m_quantity; // XML:E:required
69 
70  /*! Time output type (defaults to OTT_NONE). */
71  timeType_t m_timeType = NUM_OTT; // XML:E
72 
73  /*! Name of the object list. */
74  std::string m_objectListName; // XML:E:required
75 
76  /*! Rerefence name of output grid (corresponds to OutputGrid::m_name). */
77  std::string m_gridName; // XML:E:required
78 
79 
80  // *** Variables used only during simulation ***
81 
82  /*! Pointer to output grid, assigned during project initialization within solver for fast access. */
83  const OutputGrid *m_gridRef = nullptr;
84 
85  /*! Pointer to object list, assigned during project initialization within solver for fast access. */
86  const ObjectList *m_objectListRef = nullptr;
87 };
88 
89 } // namespace NANDRAD
90 
91 #endif // NANDRAD_OutputDefinitionH
const ObjectList * m_objectListRef
Pointer to object list, assigned during project initialization within solver for fast access...
std::string m_objectListName
Name of the object list.
std::string m_gridName
Rerefence name of output grid (corresponds to OutputGrid::m_name).
const OutputGrid * m_gridRef
Pointer to output grid, assigned during project initialization within solver for fast access...
Average value in last output interval.
An OutputGrid defines time intervals with a given output step size per interval.
Write outputs as calculated at output time points.
NANDRAD_READWRITE std::string m_fileName
Filename (if empty then filename is generated automatically).
An ObjectList is used to select model instances based on reference type and ids.
The output definition class selects quantities to be logged.
timeType_t
Different options to handle time averaging/integration.
The namespace NANDRAD contains the data model classes that make up the NANDRAD solver input data...
timeType_t m_timeType
Time output type (defaults to OTT_NONE).
std::string m_quantity
Quantity id (for example, "AirTemperature").