GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 60.0% 9 / 0 / 15
Functions: 69.2% 9 / 0 / 13
Branches: 0.0% 0 / 0 / 2

src/airflow/contam/PrjObjects.hpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #ifndef AIRFLOW_CONTAM_PRJOBJECTS_HPP
7 #define AIRFLOW_CONTAM_PRJOBJECTS_HPP
8
9 #include "PrjDefines.hpp"
10 #include "PrjObjectsImpl.hpp"
11 #include "ContamEnums.hpp"
12 #include "../AirflowAPI.hpp"
13
14 namespace openstudio {
15 namespace contam {
16
17 class Reader;
18 namespace detail {
19 class ZoneImpl;
20 class SpeciesImpl;
21 class AhsImpl;
22 class AirflowPathImpl;
23 class RunControlImpl;
24 class LevelImpl;
25 class DayScheduleImpl;
26 class WeekScheduleImpl;
27 class WindPressureProfileImpl;
28 } // namespace detail
29
30 /** The Zone object stores the data that describes an airflow zone. */
31 class AIRFLOW_API Zone
32 {
33 public:
34 /** @name Constructors and Destructors */
35 //@{
36
37 /** Create a new object with default values. */
38 Zone();
39 /** Create a new object. */
40 Zone(unsigned flags, std::string Vol, std::string T0, std::string name);
41 /** Create a new object. */
42 Zone(unsigned flags, double Vol, double T0, std::string name);
43 /** Create a new object. */
44 Zone(int nr, unsigned int flags, int ps, int pc, int pk, int pl, std::string relHt, std::string Vol, std::string T0, std::string P0,
45 std::string name, int color, int u_Ht, int u_V, int u_T, int u_P, int cdaxis, int cfd, std::string cfdname, std::string X1, std::string Y1,
46 std::string H1, std::string X2, std::string Y2, std::string H2, std::string celldx, std::string axialD, int u_aD, int u_L);
47 /** Create a new object. */
48 Zone(int nr, unsigned int flags, int ps, int pc, int pk, int pl, double relHt, double Vol, double T0, double P0, std::string name, int color,
49 int u_Ht, int u_V, int u_T, int u_P, int cdaxis, int cfd, std::string cfdname, double X1, double Y1, double H1, double X2, double Y2,
50 double H2, double celldx, double axialD, int u_aD, int u_L);
51 /** Create a new object from another object. */
52 Zone(const Zone& other);
53 /** Destroy the object. */
54 328 ~Zone() = default;
55
56 //@}
57 /** @name Operators */
58 //@{
59
60 /** Copy operator */
61 Zone& operator=(const Zone& other);
62 /** Equality operator */
63 bool operator==(const Zone& other) const;
64 /** Inequality operator */
65 bool operator!=(const Zone& other) const;
66
67 //@}
68 /** @name Input and Output */
69 //@{
70
71 /** Read an object from a Reader. */
72 void read(Reader& input);
73 /** Write the object to a string. */
74 std::string write();
75
76 //@}
77 /** @name Getters and Setters */
78 //@{
79
80 /** Returns the zone number, in order from 1 to the number of zones. */
81 int nr() const;
82 /** Sets the zone number. This should only be done with care. */
83 void setNr(const int nr);
84 /** Returns the zones flags. See the ZoneFlags enum for more information. */
85 unsigned int flags() const;
86 /** Set the zones flags. See the ZoneFlags enum for more information. */
87 void setFlags(const unsigned int flags);
88 /** Returns the week schedule index. It is converted to pointer by CONTAM. */
89 int ps() const;
90 /** Sets the week schedule index. It is converted to pointer by CONTAM. */
91 void setPs(const int ps);
92 /** Returns the control node index. It is converted to pointer by CONTAM. */
93 int pc() const;
94 /** Sets the control node index. It is converted to pointer by CONTAM. */
95 void setPc(const int pc);
96 /** Returns the kinetic reaction index. It is converted to pointer by CONTAM. */
97 int pk() const;
98 /** Sets the kinetic reaction index. It is converted to pointer by CONTAM. */
99 void setPk(const int pk);
100 /** Returns the building level index. It is converted to pointer by CONTAM. */
101 int pl() const;
102 /** Sets the building level index. It is converted to pointer by CONTAM. */
103 void setPl(const int pl);
104 /** Returns the zone height [m]. */
105 double relHt() const;
106 /** Sets the zone height [m]. */
107 bool setRelHt(const double relHt);
108 /** Sets the zone height [m]. */
109 bool setRelHt(const std::string& relHt);
110 /** Returns the zone volume [m^3]. */
111 double Vol() const;
112 /** Sets the zone volume [m^3]. */
113 bool setVol(const double Vol);
114 /** Sets the zone volume [m^3]. */
115 bool setVol(const std::string& Vol);
116 /** Returns the initial zone temperature [K]. */
117 double T0() const;
118 /** Sets the initial zone temperature [K]. */
119 bool setT0(const double T0);
120 /** Sets the initial zone temperature [K]. */
121 bool setT0(const std::string& T0);
122 /** Returns the initial zone pressure [Pa]. */
123 double P0() const;
124 /** Sets the initial zone pressure [Pa]. */
125 bool setP0(const double P0);
126 /** Sets the initial zone pressure [Pa]. */
127 bool setP0(const std::string& P0);
128 /** Returns the zone name. */
129 std::string name() const;
130 /** Sets the zone name. */
131 void setName(const std::string& name);
132 /** Returns the zone fill color. */
133 int color() const;
134 /** Sets the zone fill color. */
135 void setColor(const int color);
136 /** Returns the units of height. */
137 int u_Ht() const;
138 /** Sets the units of height. */
139 void setU_Ht(const int u_Ht);
140 /** Returns the units of volume. */
141 int u_V() const;
142 /** Sets the units of volume. */
143 void setU_V(const int u_V);
144 /** Returns the units of temperature. */
145 int u_T() const;
146 /** Sets the units of temperature. */
147 void setU_T(const int u_T);
148 /** Returns the units of pressure. */
149 int u_P() const;
150 /** sets the units of pressure. */
151 void setU_P(const int u_P);
152 /** Returns the convection/diffusion axis flag (0=no cd, 1-4 => cd axis direction). */
153 int cdaxis() const;
154 /** Sets the convection/diffusion axis flag (0=no cd, 1-4 => cd axis direction). */
155 void setCdaxis(const int cdaxis);
156 /** Returns the CFD zone flag (0=no, 1=yes). */
157 int cfd() const;
158 /** Sets the cfd zone flag (0=no, 1=yes). */
159 void setCfd(const int cfd);
160 /** Returns the CFD zone name. */
161 std::string cfdname() const;
162 /** Sets the CFD zone name. */
163 void setCfdname(const std::string& cfdname);
164 /** Returns the X coordinate of one end of the cdaxis. */
165 double X1() const;
166 /** Sets the X coordinate of one end of the cdaxis. */
167 bool setX1(const double X1);
168 /** Sets the X coordinate of one end of the cdaxis. */
169 bool setX1(const std::string& X1);
170 /** Returns the Y coordinate of one end of the cdaxis. */
171 double Y1() const;
172 /** Sets the Y coordinate of one end of the cdaxis. */
173 bool setY1(const double Y1);
174 /** Sets the Y coordinate of one end of the cdaxis. */
175 bool setY1(const std::string& Y1);
176 /** Returns the relative height of one end of the cdaxis. */
177 double H1() const;
178 /** Sets the relative height of one end of the cdaxis. */
179 bool setH1(const double H1);
180 /** Sets the relative height of one end of the cdaxis. */
181 bool setH1(const std::string& H1);
182 /** Returns the X coordinate of the other end of the cdaxis. */
183 double X2() const;
184 /** Sets the X coordinate of the other end of the cdaxis. */
185 bool setX2(const double X2);
186 /** Sets the X coordinate of the other end of the cdaxis. */
187 bool setX2(const std::string& X2);
188 /** Returns the Y coordinate of the other end of the cdaxis. */
189 double Y2() const;
190 /** Sets the Y coordinate of the other end of the cdaxis. */
191 bool setY2(const double Y2);
192 /** Sets the Y coordinate of the other end of the cdaxis. */
193 bool setY2(const std::string& Y2);
194 /** Returns the relative height of the other end of the cdaxis. */
195 double H2() const;
196 /** Sets the relative height of the other end of the cdaxis. */
197 bool setH2(const double H2);
198 /** Sets the relative height of the other end of the cdaxis. */
199 bool setH2(const std::string& H2);
200 /** Returns the convection/diffusion cell length [m]. */
201 double celldx() const;
202 /** Returns the convection/diffusion cell length [m]. */
203 bool setCelldx(const double celldx);
204 /** Returns the convection/diffusion cell length [m]. */
205 bool setCelldx(const std::string& celldx);
206 /** Returns the axial diffusion coeff [m^2/s]. */
207 double axialD() const;
208 /** Sets the axial diffusion coeff [m^2/s]. */
209 bool setAxialD(const double axialD);
210 /** Sets the axial diffusion coeff [m^2/s]. */
211 bool setAxialD(const std::string& axialD);
212 /** Returns the display units of axial diffusion. */
213 int u_aD() const;
214 /** Sets the display units of axial diffusion. */
215 void setU_aD(const int u_aD);
216 /** Returns the c/d axis limit display units. */
217 int u_L() const;
218 /** Sets the c/d axis limit display units. */
219 void setU_L(const int u_L);
220 /** Returns true if the zone is a variable pressure zone. */
221 bool variablePressure() const;
222 /** Set the zone pressure behavior. */
223 void setVariablePressure(bool b);
224 /** Returns true if the zone is a variable contaminant zone. */
225 bool variableContaminants() const;
226 /** Set the zone contaminant behavior. */
227 void setVariableContaminants(bool b);
228 /** Returns true if the zone is a system zone. */
229 bool system() const;
230 /** Set the zone system flag. */
231 void setSystem(bool b);
232 /** Returns the initial condition of contaminant i. */
233 double ic(const int i) const;
234 /** Returns the contaminant initial conditions as a vector. */
235 std::vector<double> ic() const;
236 /** Sets the initial condition of contaminant i. */
237 bool setIc(const int i, const double value);
238 /** Sets the initial condition of contaminant i. */
239 bool setIc(const int i, const std::string& value);
240 /** Sets the contaminant initial condition vector. */
241 bool setIc(std::vector<double>& ic);
242 /** Sets the contaminant initial condition vector. */
243 bool setIc(std::vector<std::string>& ic);
244 //@}
245
246 private:
247 std::shared_ptr<detail::ZoneImpl> m_impl;
248 };
249
250 /** The Species object contains descriptive information about contaminants in
251 * a CONTAM model. */
252 class AIRFLOW_API Species
253 {
254 public:
255 /** @name Constructors and Destructors */
256 //@{
257
258 /** Create a new object with default values. */
259 Species();
260 /** Create a new gaseous species object. */
261 Species(std::string molwt, std::string Dm, std::string ccdef, std::string Cp, std::string name, std::string desc);
262 /** Create a new gaseous species object. */
263 Species(double molwt, double Dm, double ccdef, double Cp, std::string name, std::string desc);
264 /** Create a new object. */
265 Species(int nr, int sflag, int ntflag, std::string molwt, std::string mdiam, std::string edens, std::string decay, std::string Dm,
266 std::string ccdef, std::string Cp, int uc, int umd, int ued, int udm, int ucp, std::string name, std::string desc);
267 /** Create a new object. */
268 Species(int nr, int sflag, int ntflag, double molwt, double mdiam, double edens, double decay, double Dm, double ccdef, double Cp, int ucc,
269 int umd, int ued, int udm, int ucp, std::string name, std::string desc);
270 /** Create a new object from another object. */
271 Species(const Species& other);
272 /** Destroy the object. */
273 49 ~Species() = default;
274
275 //@}
276 /** @name Operators */
277 //@{
278
279 /** Copy operator */
280 Species& operator=(const Species& other);
281 /** Equality operator */
282 bool operator==(const Species& other) const;
283 /** Inequality operator */
284 bool operator!=(const Species& other) const;
285
286 //@}
287 /** @name Input and Output */
288 //@{
289
290 /** Read an object from a Reader. */
291 void read(Reader& input);
292 /** Write the object to a string. */
293 std::string write();
294
295 //@}
296 /** @name Getters and Setters */
297 //@{
298
299 /** Returns the species number, in order from 1 to the number of species. */
300 int nr() const;
301 /** Sets the species number. This should only be done with care. */
302 void setNr(const int nr);
303 /** Returns the simulation flag: true = simulated, false = unsimulated species. */
304 bool sflag() const;
305 /** Sets the simulation flag: true = simulated, false = unsimulated species. */
306 void setSflag(const bool sflag);
307 /** Returns the non-trace contaminant flag: true = non-trace, false = trace species. */
308 bool ntflag() const;
309 /** Sets the non-trace contaminant flag: true = non-trace, false = trace species. */
310 void setNtflag(const bool ntflag);
311 /** Returns the molar mass [kg/kmol] for gas contaminants. */
312 double molwt() const;
313 /** Sets the molar mass [kg/kmol] for gas contaminants. */
314 bool setMolwt(const double molwt);
315 /** Sets the molar mass [kg/kmol] for gas contaminants. */
316 bool setMolwt(const std::string& molwt);
317 /** Returns the mean diameter [m] for particle contaminants. */
318 double mdiam() const;
319 /** Sets the mean diameter [m] for particle contaminants. */
320 bool setMdiam(const double mdiam);
321 /** Sets the mean diameter [m] for particle contaminants. */
322 bool setMdiam(const std::string& mdiam);
323 /** Returns the effective density [kg/m^3] for particle contaminants. */
324 double edens() const;
325 /** Sets the effective density [kg/m^3] for particle contaminants. */
326 bool setEdens(const double edens);
327 /** Sets the effective density [kg/m^3] for particle contaminants. */
328 bool setEdens(const std::string& edens);
329 /** Returns the contaminant decay constant [1/s]. */
330 double decay() const;
331 /** Sets the contaminant decay constant [1/s]. */
332 bool setDecay(const double decay);
333 /** Sets the contaminant decay constant [1/s]. */
334 bool setDecay(const std::string& decay);
335 /** Returns the contaminant molecular diffusion coefficient [m^2/s]. */
336 double Dm() const;
337 /** Sets the contaminant molecular diffusion coefficient [m^2/s]. */
338 bool setDm(const double Dm);
339 /** Sets the contaminant molecular diffusion coefficient [m^2/s]. */
340 bool setDm(const std::string& Dm);
341 /** Returns the default contaminant concentration [kg/kg air]. */
342 double ccdef() const;
343 /** Sets the default contaminant concentration [kg/kg air]. */
344 bool setCcdef(const double ccdef);
345 /** Sets the default contaminant concentration [kg/kg air]. */
346 bool setCcdef(const std::string& ccdef);
347 /** Returns the contaminant specific heat at constant pressure [J/kgK]. This is not used by CONTAM. */
348 double Cp() const;
349 /** Sets the contaminant specific heat at constant pressure [J/kgK]. This is not used by CONTAM. */
350 bool setCp(const double Cp);
351 /** Sets the contaminant specific heat at constant pressure [J/kgK]. This is not used by CONTAM. */
352 bool setCp(const std::string& Cp);
353 /** Returns the concentration display units. */
354 int ucc() const;
355 /** Sets the concentration display units. */
356 void setUcc(const int ucc);
357 /** Returns the mean diameter display units. */
358 int umd() const;
359 /** Sets the mean diameter display units. */
360 void setUmd(const int umd);
361 /** Returns the effective density display units. */
362 int ued() const;
363 /** Sets the effective density display units. */
364 void setUed(const int ued);
365 /** Returns the diffusion coefficient display units. */
366 int udm() const;
367 /** Sets the diffusion coefficient display units. */
368 void setUdm(const int udm);
369 /** Returns the specific heat display units. */
370 int ucp() const;
371 /** Sets the specific heat display units. */
372 void setUcp(const int ucp);
373 /** Returns the species name. */
374 std::string name() const;
375 /** Sets the species name. */
376 void setName(const std::string& name);
377 /** Returns the species description. */
378 std::string desc() const;
379 /** Sets the species description. */
380 void setDesc(const std::string& desc);
381 //@}
382 private:
383 std::shared_ptr<detail::SpeciesImpl> m_impl;
384 };
385
386 /** Ahs is a class that represents CONTAM's simple air handling system. These
387 * objects should be constructed after all paths have been added to the
388 * model. */
389 class AIRFLOW_API Ahs
390 {
391 public:
392 /** @name Constructors and Destructors */
393 //@{
394
395 /** Create a new object with default values. */
396 Ahs();
397 /** Create a new object. */
398 Ahs(int nr, int zone_r, int zone_s, int path_r, int path_s, int path_x, std::string name, std::string desc);
399 /** Create a new object from another object. */
400 Ahs(const Ahs& other);
401 /** Destroy the object. */
402 40 ~Ahs() = default;
403
404 //@}
405 /** @name Operators */
406 //@{
407
408 /** Copy operator */
409 Ahs& operator=(const Ahs& other);
410 /** Equality operator */
411 bool operator==(const Ahs& other) const;
412 /** Inequality operator */
413 bool operator!=(const Ahs& other) const;
414
415 //@}
416 /** @name Input and Output */
417 //@{
418
419 /** Read an object from a Reader. */
420 void read(Reader& input);
421 /** Write the object to a string. */
422 std::string write();
423
424 //@}
425 /** @name Getters and Setters */
426 //@{
427
428 /** Returns the AHS number, in order from 1 to the number of systems. */
429 int nr() const;
430 /** Sets the AHS number. This should only be done with care. */
431 void setNr(const int nr);
432 /** Returns the return zone number. */
433 int zone_r() const;
434 /** Sets the return zone number. */
435 void setZone_r(const int zone_r);
436 /** Returns the supply zone number. */
437 int zone_s() const;
438 /** Sets the supply zone number. */
439 void setZone_s(const int zone_s);
440 /** Returns the recirculation air path number. */
441 int path_r() const;
442 /** Sets the recirculation air path number. */
443 void setPath_r(const int path_r);
444 /** Returns the outdoor air path number. */
445 int path_s() const;
446 /** Sets the outdoor air path number. */
447 void setPath_s(const int path_s);
448 /** Returns the exhaust path number. */
449 int path_x() const;
450 /** Sets the exhaust path number. */
451 void setPath_x(const int path_x);
452 /** Returns the AHS name. */
453 std::string name() const;
454 /** Sets the AHS name. */
455 void setName(const std::string& name);
456 /** Returns the AHS description. */
457 std::string desc() const;
458 /** Sets the AHS description. */
459 void setDesc(const std::string& desc);
460 //@}
461 private:
462 std::shared_ptr<detail::AhsImpl> m_impl;
463 };
464
465 /** The AirflowPath object stores one flow linkage in the airflow network. */
466 class AIRFLOW_API AirflowPath
467 {
468 public:
469 /** @name Constructors and Destructors */
470 //@{
471
472 /** Create a new object with default values. */
473 AirflowPath();
474 /** Create a new (exterior wall type) object. */
475 AirflowPath(int flags, int pzn, int pe, int pw, int pld, std::string relHt, std::string mult, std::string wPset, std::string wPmod,
476 std::string wazm, unsigned int icon);
477 /** Create a new (exterior wall type) object. */
478 AirflowPath(int flags, int pzn, int pe, int pw, int pld, double relHt, double mult, double wPset, double wPmod, double wazm, unsigned int icon);
479 /** Create a new (interior wall type) object. */
480 AirflowPath(int flags, int pzn, int pzm, int pe, int pld, std::string relHt, std::string mult, unsigned int icon);
481 /** Create a new (interior wall type) object. */
482 AirflowPath(int flags, int pzn, int pzm, int pe, int pld, double relHt, double mult, unsigned int icon);
483 /** Create a new object. */
484 AirflowPath(int nr, int flags, int pzn, int pzm, int pe, int pf, int pw, int pa, int ps, int pc, int pld, std::string X, std::string Y,
485 std::string relHt, std::string mult, std::string wPset, std::string wPmod, std::string wazm, std::string Fahs, std::string Xmax,
486 std::string Xmin, unsigned int icon, unsigned int dir, int u_Ht, int u_XY, int u_dP, int u_F, int cfd, std::string cfd_name,
487 int cfd_ptype, int cfd_btype, int cfd_capp);
488 /** Create a new object. */
489 AirflowPath(int nr, int flags, int pzn, int pzm, int pe, int pf, int pw, int pa, int ps, int pc, int pld, double X, double Y, double relHt,
490 double mult, double wPset, double wPmod, double wazm, double Fahs, double Xmax, double Xmin, unsigned int icon, unsigned int dir,
491 int u_Ht, int u_XY, int u_dP, int u_F, int cfd, std::string cfd_name, int cfd_ptype, int cfd_btype, int cfd_capp);
492 /** Create a new object from another object. */
493 AirflowPath(const AirflowPath& other);
494 /** Destroy the object. */
495 927 ~AirflowPath() = default;
496
497 //@}
498 /** @name Operators */
499 //@{
500
501 /** Copy operator */
502 AirflowPath& operator=(const AirflowPath& other);
503 /** Equality operator */
504 bool operator==(const AirflowPath& other) const;
505 /** Inequality operator */
506 bool operator!=(const AirflowPath& other) const;
507
508 //@}
509 /** @name Input and Output */
510 //@{
511
512 /** Read an object from a Reader. */
513 void read(Reader& input);
514 /** Write the object to a string. */
515 std::string write();
516
517 //@}
518 /** @name Getters and Setters */
519 //@{
520
521 /** Returns the path number, in order from 1 to the number of paths. */
522 int nr() const;
523 /** Sets the path number. This should only be done with care. */
524 void setNr(const int nr);
525 /** Returns the airflow path flag value. */
526 int flags() const;
527 /** Sets the airflow path flag value. */
528 void setFlags(const int flags);
529 /** Returns the zone N index, with positive flow from N to M. It is converted to pointer by CONTAM. */
530 int pzn() const;
531 /** Sets the zone N index, with positive flow from N to M. It is converted to pointer by CONTAM. */
532 void setPzn(const int pzn);
533 /** Returns the zone M index, with positive flow from N to M. It is converted to pointer by CONTAM. */
534 int pzm() const;
535 /** Sets the zone M index, with positive flow from N to M. It is converted to pointer by CONTAM. */
536 void setPzm(const int pzm);
537 /** Returns the flow element index. It is converted to pointer by CONTAM. */
538 int pe() const;
539 /** Sets the flow element index. It is converted to pointer by CONTAM. */
540 void setPe(const int pe);
541 /** Returns the filter index. It is converted to pointer by CONTAM. */
542 int pf() const;
543 /** Sets the filter index. It is converted to pointer by CONTAM. */
544 void setPf(const int pf);
545 /** Returns the wind coefficients index. It is converted to pointer by CONTAM. */
546 int pw() const;
547 /** Sets the wind coefficients index. It is converted to pointer by CONTAM. */
548 void setPw(const int pw);
549 /** Returns the AHS index. It is converted to pointer by CONTAM. */
550 int pa() const;
551 /** Sets the AHS index. It is converted to pointer by CONTAM. */
552 void setPa(const int pa);
553 /** Returns the schedule index. It is converted to pointer by CONTAM. */
554 int ps() const;
555 /** Sets the schedule index. It is converted to pointer by CONTAM. */
556 void setPs(const int ps);
557 /** Returns the control node index. It is converted to pointer by CONTAM. */
558 int pc() const;
559 /** Sets the control node index. It is converted to pointer by CONTAM. */
560 void setPc(const int pc);
561 /** Returns the level index. It is converted to pointer by CONTAM. */
562 int pld() const;
563 /** Sets the level index. It is converted to pointer by CONTAM. */
564 void setPld(const int pld);
565 /** Returns the X-coordinate of an envelope path [m] if set. */
566 double X() const;
567 /** Sets the X-coordinate of an envelope path [m]. */
568 bool setX(const double X);
569 /** Sets the X-coordinate of an envelope path [m]. */
570 bool setX(const std::string& X);
571 /** Returns the Y-coordinate of an envelope path [m] if set. */
572 double Y() const;
573 /** Sets the Y-coordinate of an envelope path [m]. */
574 bool setY(const double Y);
575 /** Sets the Y-coordinate of an envelope path [m]. */
576 bool setY(const std::string& Y);
577 /** Returns the height relative to current level [m]. */
578 double relHt() const;
579 /** Sets the height relative to current level [m]. */
580 bool setRelHt(const double relHt);
581 /** Sets the height relative to current level [m]. */
582 bool setRelHt(const std::string& relHt);
583 /** Return the element multiplier. */
584 double mult() const;
585 /** Sets the element multiplier. */
586 bool setMult(const double mult);
587 /** Sets the element multiplier. */
588 bool setMult(const std::string& mult);
589 /** Returns the constant wind pressure [Pa] (pw==NULL). */
590 double wPset() const;
591 /** Sets the constant wind pressure [Pa] (pw==NULL). */
592 bool setWPset(const double wPset);
593 /** Sets the constant wind pressure [Pa] (pw==NULL). */
594 bool setWPset(const std::string& wPset);
595 /** Returns the wind speed modifier (pw!=NULL). */
596 double wPmod() const;
597 /** Sets the wind speed modifier (pw!=NULL). */
598 bool setWPmod(const double wPmod);
599 /** Sets the wind speed modifier (pw!=NULL). */
600 bool setWPmod(const std::string& wPmod);
601 /** Returns the wall azimuth angle in degrees (pw!=NULL). */
602 double wazm() const;
603 /** Sets the wall azimuth angle in degrees (pw!=NULL). */
604 bool setWazm(const double wazm);
605 /** Sets the wall azimuth angle in degrees (pw!=NULL). */
606 bool setWazm(const std::string& wazm);
607 /** Returns the AHS path flow rate [kg/s] (pw==NULL). */
608 double Fahs() const;
609 /** Sets the AHS path flow rate [kg/s] (pw==NULL). */
610 bool setFahs(const double Fahs);
611 /** Sets the AHS path flow rate [kg/s] (pw==NULL). */
612 bool setFahs(const std::string& Fahs);
613 /** Returns the flow or pressure maximum. */
614 double Xmax() const;
615 /** Sets the flow or pressure maximum. */
616 bool setXmax(const double Xmax);
617 /** Sets the flow or pressure maximum. */
618 bool setXmax(const std::string& Xmax);
619 /** Returns the flow or pressure minimum. */
620 double Xmin() const;
621 /** Sets the flow or pressure minimum. */
622 bool setXmin(const double Xmin);
623 /** Sets the flow or pressure minimum. */
624 bool setXmin(const std::string& Xmin);
625 /** Returns the icon used to represent flow path. */
626 unsigned int icon() const;
627 /** Sets the icon used to represent flow path. */
628 void setIcon(const unsigned int icon);
629 /** Returns the positive flow direction on the sketchpad. */
630 unsigned int dir() const;
631 /** Sets the positive flow direction on the sketchpad. */
632 void setDir(const unsigned int dir);
633 /** Returns the height display units. */
634 int u_Ht() const;
635 /** Sets the height display units. */
636 void setU_Ht(const int u_Ht);
637 /** Returns the X and Y display units. */
638 int u_XY() const;
639 /** Sets the X and Y display units. */
640 void setU_XY(const int u_XY);
641 /** Returns the pressure difference display units. */
642 int u_dP() const;
643 /** Sets the pressure difference display units. */
644 void setU_dP(const int u_dP);
645 /** Returns the flow display units. */
646 int u_F() const;
647 /** Sets the flow display units. */
648 void setU_F(const int u_F);
649 /** Returns the CFD path flag (0=no, 1=yes). */
650 int cfd() const;
651 /** Sets the CFD path flag (0=no, 1=yes). */
652 void setCfd(const int cfd);
653 /** Returns the CFD path id. */
654 std::string cfd_name() const;
655 /** Sets the CFD path id. */
656 void setCfd_name(const std::string& cfd_name);
657 /** Returns the CFD boundary condition type (0=mass flow, 1=pressure). */
658 int cfd_ptype() const;
659 /** Sets the CFD boundary condition type (0=mass flow, 1=pressure). */
660 void setCfd_ptype(const int cfd_ptype);
661 /** Returns the pressure bc type (if ptype = 1, 0=linear, 1=stagnation pressure). */
662 int cfd_btype() const;
663 /** Sets the pressure bc type (if ptype = 1, 0=linear, 1=stagnation pressure). */
664 void setCfd_btype(const int cfd_btype);
665 /** Returns the coupling approach (1=pressure-pressure). */
666 int cfd_capp() const;
667 /** Sets the coupling approach (1=pressure-pressure). */
668 void setCfd_capp(const int cfd_capp);
669
670 /** Returns true if wind pressure is applied to the path. */
671 bool windPressure();
672 /** Sets the path's wind pressure flag. */
673 void setWindPressure(bool b);
674 /** Returns true if the path is a HVAC system path. */
675 bool system();
676 /** Sets the path's system flag. */
677 void setSystem(bool b);
678 /** Returns true if the path is an exhaust path. */
679 bool exhaust();
680 /** Sets the path's exhaust flag. */
681 void setExhaust(bool b);
682 /** Returns true if the path is a recirculation path. */
683 bool recirculation();
684 /** Sets the path's recirculation flag. */
685 void setRecirculation(bool b);
686 /** Returns true if the path is an outside air path. */
687 bool outsideAir();
688 /** Sets the path's outside air flag. */
689 void setOutsideAir(bool b);
690 //@}
691
692 private:
693 std::shared_ptr<detail::AirflowPathImpl> m_impl;
694 };
695
696 /** The RunControl object stores most of the information related to how CONTAM solves the airflow network
697 * problem. */
698 class AIRFLOW_API RunControl
699 {
700 public:
701 /** @name Constructors and Destructors */
702 //@{
703
704 /** Create a new object with default values. */
705 RunControl();
706 /* Create a new object.
707 RunControl(int sim_af,int afcalc,int afmaxi,double afrcnvg,double afacnvg,double afrelax,int uac2,
708 double Pres,int uPres,int afslae,int afrseq,int aflmaxi,double aflcnvg,int aflinit,int Tadj,
709 int sim_mf,int ccmaxi,double ccrcnvg,double ccacnvg,double ccrelax,int uccc,int mfnmthd,
710 int mfnrseq,int mfnmaxi,double mfnrcnvg,double mfnacnvg,double mfnrelax,double mfngamma,
711 int uccn,int mftmthd,int mftrseq,int mftmaxi,double mftrcnvg,double mftacnvg,double mftrelax,
712 double mftgamma,int ucct,int mfvmthd,int mfvrseq,int mfvmaxi,double mfvrcnvg,double mfvacnvg,
713 double mfvrelax,int uccv,int mf_solver,int sim_1dz,int sim_1dd,double celldx,int sim_vjt,
714 int udx,int cvode_mth,double cvode_rcnvg,double cvode_acnvg,double cvode_dtmax,int tsdens,
715 double tsrelax,int tsmaxi,int cnvgSS,int densZP,int stackD,int dodMdt,std::string date_st,
716 std::string time_st,std::string date_0,std::string time_0,std::string date_1,std::string time_1,std::string time_step,
717 std::string time_list,std::string time_scrn,int restart,std::string rstdate,std::string rsttime,int list,
718 int doDlg,int pfsave,int zfsave,int zcsave,int achvol,int achsave,int abwsave,int cbwsave,
719 int expsave,int ebwsave,int zaasave,int zbwsave,int rzfsave,int rzmsave,int rz1save,
720 int csmsave,int srfsave,int logsave,std::vector<int> save,std::vector<double> rvals,int BldgFlowZ,
721 int BldgFlowD,int BldgFlowC,int cfd_ctype,double cfd_convcpl,int cfd_var,int cfd_zref,
722 int cfd_imax,int cfd_dtcmo);*/
723 /** Create a new object.
724 RunControl(int sim_af,int afcalc,int afmaxi,std::string afrcnvg,std::string afacnvg,std::string afrelax,int uac2,
725 std::string Pres,int uPres,int afslae,int afrseq,int aflmaxi,std::string aflcnvg,int aflinit,int Tadj,
726 int sim_mf,int ccmaxi,std::string ccrcnvg,std::string ccacnvg,std::string ccrelax,int uccc,int mfnmthd,
727 int mfnrseq,int mfnmaxi,std::string mfnrcnvg,std::string mfnacnvg,std::string mfnrelax,std::string mfngamma,
728 int uccn,int mftmthd,int mftrseq,int mftmaxi,std::string mftrcnvg,std::string mftacnvg,std::string mftrelax,
729 std::string mftgamma,int ucct,int mfvmthd,int mfvrseq,int mfvmaxi,std::string mfvrcnvg,std::string mfvacnvg,
730 std::string mfvrelax,int uccv,int mf_solver,int sim_1dz,int sim_1dd,std::string celldx,int sim_vjt,
731 int udx,int cvode_mth,std::string cvode_rcnvg,std::string cvode_acnvg,std::string cvode_dtmax,int tsdens,
732 std::string tsrelax,int tsmaxi,int cnvgSS,int densZP,int stackD,int dodMdt,std::string date_st,
733 std::string time_st,std::string date_0,std::string time_0,std::string date_1,std::string time_1,std::string time_step,
734 std::string time_list,std::string time_scrn,int restart,std::string rstdate,std::string rsttime,int list,
735 int doDlg,int pfsave,int zfsave,int zcsave,int achvol,int achsave,int abwsave,int cbwsave,
736 int expsave,int ebwsave,int zaasave,int zbwsave,int rzfsave,int rzmsave,int rz1save,
737 int csmsave,int srfsave,int logsave,std::vector<int> save,std::vector<std::string> rvals,int BldgFlowZ,
738 int BldgFlowD,int BldgFlowC,int cfd_ctype,std::string cfd_convcpl,int cfd_var,int cfd_zref,
739 int cfd_imax,int cfd_dtcmo);*/
740 /** Create a new object from another object. */
741 RunControl(const RunControl& other);
742 /** Destroy the object. */
743 13 ~RunControl() = default;
744
745 //@}
746 /** @name Operators */
747 //@{
748
749 /** Copy operator */
750 RunControl& operator=(const RunControl& other);
751 /** Equality operator */
752 bool operator==(const RunControl& other) const;
753 /** Inequality operator */
754 bool operator!=(const RunControl& other) const;
755
756 //@}
757 /** @name Input and Output */
758 //@{
759
760 /** Read an object from a Reader. */
761 void read(Reader& input);
762 /** Write the object to a string. */
763 std::string write();
764
765 //@}
766 /** @name Getters and Setters */
767 //@{
768
769 /** Returns the airflow simulation flag: 0 = steady, 1 = dynamic. */
770 int sim_af() const;
771 /** Sets the airflow simulation flag: 0 = steady, 1 = dynamic. */
772 void setSim_af(const int sim_af);
773 /** Returns the N-R method for non-linear eqns: 0 = SUR, 1 = STR. */
774 int afcalc() const;
775 /** Sets the N-R method for non-linear eqns: 0 = SUR, 1 = STR. */
776 void setAfcalc(const int afcalc);
777 /** Returns the maximum number of N-R iterations. */
778 int afmaxi() const;
779 /** Sets the maximum number of N-R iterations. */
780 void setAfmaxi(const int afmaxi);
781 /** Returns the relative airflow convergence factor. */
782 double afrcnvg() const;
783 /** Sets the relative airflow convergence factor. */
784 bool setAfrcnvg(const double afrcnvg);
785 /** Sets the relative airflow convergence factor. */
786 bool setAfrcnvg(const std::string& afrcnvg);
787 /** Returns the absolute airflow convergence factor [1/s]. */
788 double afacnvg() const;
789 /** Sets the absolute airflow convergence factor [1/s]. */
790 bool setAfacnvg(const double afacnvg);
791 /** Sets the absolute airflow convergence factor [1/s]. */
792 bool setAfacnvg(const std::string& afacnvg);
793 /** Returns the flow under-relaxation coefficient (for SUR). */
794 double afrelax() const;
795 /** Sets the flow under-relaxation coefficient (for SUR). */
796 bool setAfrelax(const double afrelax);
797 /** Sets the flow under-relaxation coefficient (for SUR). */
798 bool setAfrelax(const std::string& afrelax);
799 /** Returns the display units for afacnvg. */
800 int uac2() const;
801 /** Sets the display units for afacnvg. */
802 void setUac2(const int uac2);
803 /** Returns the pressure test pressure. */
804 double Pres() const;
805 /** Sets the pressure test pressure. */
806 bool setPres(const double Pres);
807 /** Sets the pressure test pressure. */
808 bool setPres(const std::string& Pres);
809 /** Returns the display units of pressure test pressure. */
810 int uPres() const;
811 /** Sets the pressure test pressure. */
812 void setUPres(const int uPres);
813 /** Returns the method for linear equations: 0 = SKY, 1 = PCG. */
814 int afslae() const;
815 /** Sets the method for linear equations: 0 = SKY, 1 = PCG. */
816 void setAfslae(const int afslae);
817 /** Returns the linear equation resequence flag: 0 = don't resequence, 1 = resequence. */
818 int afrseq() const;
819 /** Sets the linear equation resequence flag: 0 = don't resequence, 1 = resequence. */
820 void setAfrseq(const int afrseq);
821 /** Returns the maximum number of iterations (PCG). */
822 int aflmaxi() const;
823 /** Sets the maximum number of iterations (PCG). */
824 void setAflmaxi(const int aflmaxi);
825 /** Returns the relative convergence factor for (PCG). */
826 double aflcnvg() const;
827 /** Sets the relative convergence factor for (PCG). */
828 bool setAflcnvg(const double aflcnvg);
829 /** Sets the relative convergence factor for (PCG). */
830 bool setAflcnvg(const std::string& aflcnvg);
831 /** Returns the linear airflow initialization flag: 0 = don't use, 1 = use. */
832 int aflinit() const;
833 /** Sets the linear airflow initialization flag: 0 = don't use, 1 = use. */
834 void setAflinit(const int aflinit);
835 /** Returns the temperature adjustment flag: 0 = don't use, 1 = use. */
836 int Tadj() const;
837 /** Sets the temperature adjustment flag: 0 = don't use, 1 = use. */
838 void setTadj(const int Tadj);
839 /** Returns the mass fraction (contaminant) simulation method: 0 = none, 1 = steady, 2 = transient, 3 = cyclic. */
840 int sim_mf() const;
841 /** Sets the mass fraction (contaminant) simulation method: 0 = none, 1 = steady, 2 = transient, 3 = cyclic. */
842 void setSim_mf(const int sim_mf);
843 /** Returns the maximum number of cyclic iterations. */
844 int ccmaxi() const;
845 /** Sets the maximum number of cyclic iterations. */
846 void setCcmaxi(const int ccmaxi);
847 /** Returns the cyclic relative convergence factor. */
848 double ccrcnvg() const;
849 /** Sets the cyclic relative convergence factor. */
850 bool setCcrcnvg(const double ccrcnvg);
851 /** Sets the cyclic relative convergence factor. */
852 bool setCcrcnvg(const std::string& ccrcnvg);
853 /** Returns the cyclic absolute convergence factor [kg/kg]. */
854 double ccacnvg() const;
855 /** Sets the cyclic absolute convergence factor [kg/kg]. */
856 bool setCcacnvg(const double ccacnvg);
857 /** Sets the cyclic absolute convergence factor [kg/kg]. */
858 bool setCcacnvg(const std::string& ccacnvg);
859 /** Returns the cyclic (unused) over-relaxation coefficient. */
860 double ccrelax() const;
861 /** Sets the cyclic (unused) over-relaxation coefficient. */
862 bool setCcrelax(const double ccrelax);
863 /** Sets the cyclic (unused) over-relaxation coefficient. */
864 bool setCcrelax(const std::string& ccrelax);
865 /** Returns the display units for ccacnvg. */
866 int uccc() const;
867 /** Sets the display units for ccacnvg. */
868 void setUccc(const int uccc);
869 /** Returns the non-trace contaminant simulation method: 0 = SKY, 1 = BCG, 2 = SOR, 3 = LU. */
870 int mfnmthd() const;
871 /** Sets the non-trace contaminant simulation method: 0 = SKY, 1 = BCG, 2 = SOR, 3 = LU. */
872 void setMfnmthd(const int mfnmthd);
873 /** Returns the non-trace contaminant resequence flag: 0 = don't resequence, 1 = resequence. */
874 int mfnrseq() const;
875 /** Sets the non-trace contaminant resequence flag: 0 = don't resequence, 1 = resequence. */
876 void setMfnrseq(const int mfnrseq);
877 /** Returns the non-trace contaminant maximum iterations. */
878 int mfnmaxi() const;
879 /** Sets the non-trace contaminant maximum iterations. */
880 void setMfnmaxi(const int mfnmaxi);
881 /** Returns the non-trace contaminant relative convergence factor. */
882 double mfnrcnvg() const;
883 /** Sets the non-trace contaminant relative convergence factor. */
884 bool setMfnrcnvg(const double mfnrcnvg);
885 /** Sets the non-trace contaminant relative convergence factor. */
886 bool setMfnrcnvg(const std::string& mfnrcnvg);
887 /** Returns the non-trace contaminant absolute convergence factor. */
888 double mfnacnvg() const;
889 /** Sets the non-trace contaminant absolute convergence factor. */
890 bool setMfnacnvg(const double mfnacnvg);
891 /** Sets the non-trace contaminant absolute convergence factor. */
892 bool setMfnacnvg(const std::string& mfnacnvg);
893 /** Returns the non-trace contaminant relaxation coefficient. */
894 double mfnrelax() const;
895 /** Sets the non-trace contaminant relaxation coefficient. */
896 bool setMfnrelax(const double mfnrelax);
897 /** Sets the non-trace contaminant relaxation coefficient. */
898 bool setMfnrelax(const std::string& mfnrelax);
899 /** Returns the non-trace contaminant trapezoidal integration factor. */
900 double mfngamma() const;
901 /** Sets the non-trace contaminant trapezoidal integration factor. */
902 bool setMfngamma(const double mfngamma);
903 /** Sets the non-trace contaminant trapezoidal integration factor. */
904 bool setMfngamma(const std::string& mfngamma);
905 /** Returns the display units for mfnacnvg. */
906 int uccn() const;
907 /** Sets the display units for mfnacnvg. */
908 void setUccn(const int uccn);
909 /** Returns the trace contaminant simulation method: 0 = SKY, 1 = BCG, 2 = SOR, 3 = LU. */
910 int mftmthd() const;
911 /** Sets the trace contaminant simulation method: 0 = SKY, 1 = BCG, 2 = SOR, 3 = LU. */
912 void setMftmthd(const int mftmthd);
913 /** Returns the trace contaminant resequence flag: 0 = don't resequence, 1 = resequence. */
914 int mftrseq() const;
915 /** Sets the trace contaminant resequence flag: 0 = don't resequence, 1 = resequence. */
916 void setMftrseq(const int mftrseq);
917 /** Returns the trace contaminant maximum iterations. */
918 int mftmaxi() const;
919 /** Sets the trace contaminant maximum iterations. */
920 void setMftmaxi(const int mftmaxi);
921 /** Returns the trace contaminant relative convergence factor. */
922 double mftrcnvg() const;
923 /** Sets the trace contaminant relative convergence factor. */
924 bool setMftrcnvg(const double mftrcnvg);
925 /** Sets the trace contaminant relative convergence factor. */
926 bool setMftrcnvg(const std::string& mftrcnvg);
927 /** Returns the trace contaminant absolute convergence factor. */
928 double mftacnvg() const;
929 /** Sets the trace contaminant absolute convergence factor. */
930 bool setMftacnvg(const double mftacnvg);
931 /** Sets the trace contaminant absolute convergence factor. */
932 bool setMftacnvg(const std::string& mftacnvg);
933 /** Returns the trace contaminant relaxation coefficient. */
934 double mftrelax() const;
935 /** Sets the trace contaminant relaxation coefficient. */
936 bool setMftrelax(const double mftrelax);
937 /** Sets the trace contaminant relaxation coefficient. */
938 bool setMftrelax(const std::string& mftrelax);
939 /** Returns the trace contaminant trapezoidal integration factor. */
940 double mftgamma() const;
941 /** Sets the trace contaminant trapezoidal integration factor. */
942 bool setMftgamma(const double mftgamma);
943 /** Sets the trace contaminant trapezoidal integration factor. */
944 bool setMftgamma(const std::string& mftgamma);
945 /** Returns the display units for mfnacnvg. */
946 int ucct() const;
947 /** Sets the display units for mfnacnvg. */
948 void setUcct(const int ucct);
949 /** Returns the CVODE contaminant solver method: 0 = SKY, 2 = SOR, 3 = LU. */
950 int mfvmthd() const;
951 /** Sets the CVODE contaminant solver method: 0 = SKY, 2 = SOR, 3 = LU. */
952 void setMfvmthd(const int mfvmthd);
953 /** Returns the CVODE contaminant solver resequence flag: 0 = don't resequence, 1 = resequence. */
954 int mfvrseq() const;
955 /** Sets the CVODE contaminant solver resequence flag: 0 = don't resequence, 1 = resequence. */
956 void setMfvrseq(const int mfvrseq);
957 /** Returns the CVODE contaminant solver maximum iterations. */
958 int mfvmaxi() const;
959 /** Sets the CVODE contaminant solver maximum iterations. */
960 void setMfvmaxi(const int mfvmaxi);
961 /** Returns the CVODE contaminant solver relative convergence factor. */
962 double mfvrcnvg() const;
963 /** Sets the CVODE contaminant solver relative convergence factor. */
964 bool setMfvrcnvg(const double mfvrcnvg);
965 /** Sets the CVODE contaminant solver relative convergence factor. */
966 bool setMfvrcnvg(const std::string& mfvrcnvg);
967 /** Returns the CVODE contaminant solver absolute convergence factor. */
968 double mfvacnvg() const;
969 /** Sets the CVODE contaminant solver absolute convergence factor. */
970 bool setMfvacnvg(const double mfvacnvg);
971 /** Sets the CVODE contaminant solver absolute convergence factor. */
972 bool setMfvacnvg(const std::string& mfvacnvg);
973 /** Returns the CVODE contaminant solver relaxation coefficient. */
974 double mfvrelax() const;
975 /** Sets the CVODE contaminant solver relaxation coefficient. */
976 bool setMfvrelax(const double mfvrelax);
977 /** Sets the CVODE contaminant solver relaxation coefficient. */
978 bool setMfvrelax(const std::string& mfvrelax);
979 /** Returns the display units for mfvacnvg. */
980 int uccv() const;
981 /** Sets the display units for mfvacnvg. */
982 void setUccv(const int uccv);
983 /** Returns the mass fraction integration method: 0 = trapezoid, 1 = STS, 2 = CVODE. */
984 int mf_solver() const;
985 /** Sets the mass fraction integration method: 0 = trapezoid, 1 = STS, 2 = CVODE. */
986 void setMf_solver(const int mf_solver);
987 /** Returns the 1D zone flag: 0 = don't use, 1 = use. */
988 int sim_1dz() const;
989 /** Sets the 1D zone flag: 0 = don't use, 1 = use. */
990 void setSim_1dz(const int sim_1dz);
991 /** Returns the 1D duct flag: 0 = don't use, 1 = use. */
992 int sim_1dd() const;
993 /** Sets the 1D duct flag: 0 = don't use, 1 = use. */
994 void setSim_1dd(const int sim_1dd);
995 /** Returns the default length of duct cells for C-D model [m]. */
996 double celldx() const;
997 /** Sets the default length of duct cells for C-D model [m]. */
998 bool setCelldx(const double celldx);
999 /** Sets the default length of duct cells for C-D model [m]. */
1000 bool setCelldx(const std::string& celldx);
1001 /** Returns the variable junction temperature flag: 0 = don't compute, 1 = compute. */
1002 int sim_vjt() const;
1003 /** Sets the variable junction temperature flag: 0 = don't compute, 1 = compute. */
1004 void setSim_vjt(const int sim_vjt);
1005 /** Returns the display units of celldx. */
1006 int udx() const;
1007 /** Sets the display units of celldx. */
1008 void setUdx(const int udx);
1009 /** Returns the CVODE contaminant solver multi-step method: 0 = am, 1 = bdf. */
1010 int cvode_mth() const;
1011 /** Sets the CVODE contaminant solver multi-step method: 0 = am, 1 = bdf. */
1012 void setCvode_mth(const int cvode_mth);
1013 /** Returns the CVODE contaminant solver multi-step relative convergence factor. */
1014 double cvode_rcnvg() const;
1015 /** Sets the CVODE contaminant solver multi-step relative convergence factor. */
1016 bool setCvode_rcnvg(const double cvode_rcnvg);
1017 /** Sets the CVODE contaminant solver multi-step relative convergence factor. */
1018 bool setCvode_rcnvg(const std::string& cvode_rcnvg);
1019 /** Returns the CVODE contaminant solver multi-step absolute convergence factor. */
1020 double cvode_acnvg() const;
1021 /** Sets the CVODE contaminant solver multi-step absolute convergence factor. */
1022 bool setCvode_acnvg(const double cvode_acnvg);
1023 /** Sets the CVODE contaminant solver multi-step absolute convergence factor. */
1024 bool setCvode_acnvg(const std::string& cvode_acnvg);
1025 /** Returns the CVODE contaminant solver maximum time step. */
1026 double cvode_dtmax() const;
1027 /** Sets the CVODE contaminant solver maximum time step. */
1028 bool setCvode_dtmax(const double cvode_dtmax);
1029 /** Sets the CVODE contaminant solver maximum time step. */
1030 bool setCvode_dtmax(const std::string& cvode_dtmax);
1031 /** Returns the time-varying density flag: 0 = no variation during time step, 1 = vary density during time step. */
1032 int tsdens() const;
1033 /** Sets the time-varying density flag: 0 = no variation during time step, 1 = vary density during time step. */
1034 void setTsdens(const int tsdens);
1035 /** Returns the (inactive) under-relaxation factor for calculating dM/dt. */
1036 double tsrelax() const;
1037 /** Sets the (inactive) under-relaxation factor for calculating dM/dt. */
1038 bool setTsrelax(const double tsrelax);
1039 /** Sets the (inactive) under-relaxation factor for calculating dM/dt. */
1040 bool setTsrelax(const std::string& tsrelax);
1041 /** Returns the maximum number of iterations for density changes. */
1042 int tsmaxi() const;
1043 /** Sets the maximum number of iterations for density changes. */
1044 void setTsmaxi(const int tsmaxi);
1045 /** Returns the density treatment during steady state initialization: 0 = don't converge, 1 = converge. */
1046 int cnvgSS() const;
1047 /** Sets the density treatment during steady state initialization: 0 = don't converge, 1 = converge. */
1048 void setCnvgSS(const int cnvgSS);
1049 /** Returns the density/zone pressure treatment: 0 = no requirement, 1 = require density = f(zone pressure). */
1050 int densZP() const;
1051 /** Sets the density/zone pressure treatment: 0 = no requirement, 1 = require density = f(zone pressure). */
1052 void setDensZP(const int densZP);
1053 /** Returns the hydrostatic density treatment: 0 = no hydrostatic variation, 1 = density varies hydrostatically. */
1054 int stackD() const;
1055 /** Sets the hydrostatic density treatment: 0 = no hydrostatic variation, 1 = density varies hydrostatically. */
1056 void setStackD(const int stackD);
1057 /** Returns the dM/dt treatment: 0 = don't include in airflow calculation, 1 = include in airflow calculation. */
1058 int dodMdt() const;
1059 /** Sets the dM/dt treatment: 0 = don't include in airflow calculation, 1 = include in airflow calculation. */
1060 void setDodMdt(const int dodMdt);
1061 /** Returns the day-of-year to start steady simulation [mmmdd]. */
1062 std::string date_st() const;
1063 /** Sets the day-of-year to start steady simulation [mmmdd]. */
1064 void setDate_st(const std::string& date_st);
1065 /** Returns the time-of-day to start steady simulation [hh:mm:ss]. */
1066 std::string time_st() const;
1067 /** Sets the time-of-day to start steady simulation [hh:mm:ss]. */
1068 void setTime_st(const std::string& time_st);
1069 /** Returns the day-of-year to start transient simulation [mmmdd]. */
1070 std::string date_0() const;
1071 /** Sets the day-of-year to start transient simulation [mmmdd]. */
1072 void setDate_0(const std::string& date_0);
1073 /** Returns the time-of-day to start transient simulation [hh:mm:ss]. */
1074 std::string time_0() const;
1075 /** Sets the time-of-day to start transient simulation [hh:mm:ss]. */
1076 void setTime_0(const std::string& time_0);
1077 /** Returns the day-of-year to end transient simulation [mmmdd]. */
1078 std::string date_1() const;
1079 /** Sets the day-of-year to end transient simulation [mmmdd]. */
1080 void setDate_1(const std::string& date_1);
1081 /** Returns the time-of-day to end transient simulation [hh:mm:ss]. */
1082 std::string time_1() const;
1083 /** Sets the time-of-day to end transient simulation [hh:mm:ss]. */
1084 void setTime_1(const std::string& time_1);
1085 /** Returns the simulation time step [hh:mm:ss]. */
1086 std::string time_step() const;
1087 /** Sets the simulation time step [hh:mm:ss]. */
1088 void setTime_step(const std::string& time_step);
1089 /** Returns the simulation output (results) time step [hh:mm:ss]. */
1090 std::string time_list() const;
1091 /** Sets the simulation output (results) time step [hh:mm:ss]. */
1092 void setTime_list(const std::string& time_list);
1093 /** Returns simulation status time step (up to 1 day) [hh:mm:ss]. */
1094 std::string time_scrn() const;
1095 /** Sets the simulation status time step (up to 1 day) [hh:mm:ss]. */
1096 void setTime_scrn(const std::string& time_scrn);
1097 /** Returns the restart file flag: 0 = don't use, 1 = use. */
1098 int restart() const;
1099 /** Sets the restart file flag: 0 = don't use, 1 = use. */
1100 void setRestart(const int restart);
1101 /** Returns the restart date [mmmdd]. */
1102 std::string rstdate() const;
1103 /** Sets the restart date [mmmdd]. */
1104 void setRstdate(const std::string& rstdate);
1105 /** Returns the restart time [hh:mm:ss]. */
1106 std::string rsttime() const;
1107 /** Sets the restart time [hh:mm:ss]. */
1108 void setRsttime(const std::string& rsttime);
1109 /** Returns the data dump parameter: > 0 dump matrix analysis, = 2 dump SIM file output, > 2 dump lognotes. */
1110 int list() const;
1111 /** Sets the data dump parameter: > 0 dump matrix analysis, = 2 dump SIM file output, > 2 dump lognotes. */
1112 void setList(const int list);
1113 /** Returns the ContamX dialog box flag: 0 = don't display, 1 = display. */
1114 int doDlg() const;
1115 /** Sets the ContamX dialog box flag: 0 = don't display, 1 = display. */
1116 void setDoDlg(const int doDlg);
1117 /** Returns the path flow results save flag: 0 = don't save, 1 = save to SIM file. */
1118 int pfsave() const;
1119 /** Sets the path flow results save flag: 0 = don't save, 1 = save to SIM file. */
1120 void setPfsave(const int pfsave);
1121 /** Returns zone flow results the save flag: 0 = don't save, 1 = save to SIM file. */
1122 int zfsave() const;
1123 /** Sets the zone flow results save flag: 0 = don't save, 1 = save to SIM file. */
1124 void setZfsave(const int zfsave);
1125 /** Returns the mass fraction results save flag: 0 = don't save, 1 = save to SIM file. */
1126 int zcsave() const;
1127 /** Sets the mass fraction results save flag: 0 = don't save, 1 = save to SIM file. */
1128 void setZcsave(const int zcsave);
1129 /** Returns the ACH calculation behavior: 0 = use std volumes, 1 = use true volumes. */
1130 int achvol() const;
1131 /** Sets the ACH calculation behavior: 0 = use std volumes, 1 = use true volumes. */
1132 void setAchvol(const int achvol);
1133 /** Returns building air exchange rate transient data the save flag: 0 = don't save, 1 = save. */
1134 int achsave() const;
1135 /** Sets the building air exchange rate transient data save flag: 0 = don't save, 1 = save. */
1136 void setAchsave(const int achsave);
1137 /** Returns the air exchange save flag: 0 = don't save, 1 = save. */
1138 int abwsave() const;
1139 /** Sets the air exchange save flag: 0 = don't save, 1 = save. */
1140 void setAbwsave(const int abwsave);
1141 /** Returns the contaminant box-whisker data save flag: 0 = don't save, 1 = save. */
1142 int cbwsave() const;
1143 /** Sets the contaminant box-whisker data save flag: 0 = don't save, 1 = save. */
1144 void setCbwsave(const int cbwsave);
1145 /** Returns the exposure transient data save flag: 0 = don't save, 1 = save. */
1146 int expsave() const;
1147 /** Sets the exposure transient data save flag: 0 = don't save, 1 = save. */
1148 void setExpsave(const int expsave);
1149 /** Returns the exposure box-whisker data save flag: 0 = don't save, 1 = save. */
1150 int ebwsave() const;
1151 /** Sets the exposure box-whisker data save flag: 0 = don't save, 1 = save. */
1152 void setEbwsave(const int ebwsave);
1153 /** Returns the zones age-of-air transient data save flag: 0 = don't save, 1 = save. */
1154 int zaasave() const;
1155 /** Sets the zones age-of-air transient data save flag: 0 = don't save, 1 = save. */
1156 void setZaasave(const int zaasave);
1157 /** Returns the zones age-of-air box-whisker data save flag: 0 = don't save, 1 = save. */
1158 int zbwsave() const;
1159 /** Sets the zones age-of-air box-whisker data save flag: 0 = don't save, 1 = save. */
1160 void setZbwsave(const int zbwsave);
1161 /** Returns the binary zone flow file flag: 0 = don't save, 1 = save. */
1162 int rzfsave() const;
1163 /** Sets the binary zone flow file flag: 0 = don't save, 1 = save. */
1164 void setRzfsave(const int rzfsave);
1165 /** Returns the binary avg zone mass fraction file flag: 0 = don't save, 1 = save. */
1166 int rzmsave() const;
1167 /** Sets the binary avg zone mass fraction file flag: 0 = don't save, 1 = save. */
1168 void setRzmsave(const int rzmsave);
1169 /** Returns the binary 1D zone cell mass fraction file flag: 0 = don't save, 1 = save. */
1170 int rz1save() const;
1171 /** Sets the binary 1D zone cell mass fraction file flag: 0 = don't save, 1 = save. */
1172 void setRz1save(const int rz1save);
1173 /** Returns the text contaminant summary file flag: 0 = don't save, 1 = save. */
1174 int csmsave() const;
1175 /** Sets the text contaminant summary file flag: 0 = don't save, 1 = save. */
1176 void setCsmsave(const int csmsave);
1177 /** Returns the text surface result file flag: 0 = don't save, 1 = save. */
1178 int srfsave() const;
1179 /** Sets the text surface result file flag: 0 = don't save, 1 = save. */
1180 void setSrfsave(const int srfsave);
1181 /** Returns the text controls log file flag: 0 = don't save, 1 = save. */
1182 int logsave() const;
1183 /** Sets the text controls log file flag: 0 = don't save, 1 = save. */
1184 void setLogsave(const int logsave);
1185 /** Returns the save vector - unused by CONTAM and subject to change without notice. */
1186 std::vector<int> save() const;
1187 /** Sets the save vector - unused by CONTAM and subject to change without notice. */
1188 void setSave(const std::vector<int>& save);
1189 /** Returns the mysterious rvals vector. */
1190 std::vector<double> rvals() const;
1191 /** Sets the mysterious rvals vector. */
1192 bool setRvals(const std::vector<double>& rvals);
1193 /** Sets the mysterious rvals vector. */
1194 bool setRvals(const std::vector<std::string>& rvals);
1195 /** Returns the building airflow test (zones) flag: 0 = don't output, 1 = output. */
1196 int BldgFlowZ() const;
1197 /** Sets the building airflow test (zones) flag: 0 = don't output, 1 = output. */
1198 void setBldgFlowZ(const int BldgFlowZ);
1199 /** Returns the building airflow test (ducts) flag: 0 = don't output, 1 = output. */
1200 int BldgFlowD() const;
1201 /** Sets the building airflow test (ducts) flag: 0 = don't output, 1 = output. */
1202 void setBldgFlowD(const int BldgFlowD);
1203 /** Returns the building airflow test (classified flows) flag: 0 = don't output, 1 = output. */
1204 int BldgFlowC() const;
1205 /** Sets the building airflow test (classified flows) flag: 0 = don't output, 1 = output. */
1206 void setBldgFlowC(const int BldgFlowC);
1207 /** Returns the cfd coupling method: 0 = no cfd, 1 = post, 2 = quasi, 3 = dynamic. */
1208 int cfd_ctype() const;
1209 /** Sets the cfd coupling method: 0 = no cfd, 1 = post, 2 = quasi, 3 = dynamic. */
1210 void setCfd_ctype(const int cfd_ctype);
1211 /** Returns the convergence factor for dynamic coupling. */
1212 double cfd_convcpl() const;
1213 /** Sets the convergence factor for dynamic coupling. */
1214 bool setCfd_convcpl(const double cfd_convcpl);
1215 /** Sets the convergence factor for dynamic coupling. */
1216 bool setCfd_convcpl(const std::string& cfd_convcpl);
1217 /** Returns the .var file flag: 0 = don't use, 1 = use. */
1218 int cfd_var() const;
1219 /** Sets the .var file flag: 0 = don't use, 1 = use. */
1220 void setCfd_var(const int cfd_var);
1221 /** Returns the currently unused zref value. */
1222 int cfd_zref() const;
1223 /** Sets the the currently unused zref value. */
1224 void setCfd_zref(const int cfd_zref);
1225 /** Returns the max number of dynamic coupling iterations. */
1226 int cfd_imax() const;
1227 /** Sets the max number of dynamic coupling iterations. */
1228 void setCfd_imax(const int cfd_imax);
1229 /** Returns the number of iterations between outputs to .cmo file. */
1230 int cfd_dtcmo() const;
1231 /** Sets the number of iterations between outputs to .cmo file. */
1232 void setCfd_dtcmo(const int cfd_dtcmo);
1233 //@}
1234
1235 private:
1236 std::shared_ptr<detail::RunControlImpl> m_impl;
1237 };
1238
1239 /** Level objects contain information about the levels that make up a CONTAM
1240 * model. */
1241 class AIRFLOW_API Level
1242 {
1243 public:
1244 /** @name Constructors and Destructors */
1245 //@{
1246
1247 /** Create a new object with default values. */
1248 Level();
1249 /** Create a new object. */
1250 Level(double delht, std::string name);
1251 /** Create a new object. */
1252 Level(std::string delht, std::string name);
1253 /** Create a new object. */
1254 Level(int nr, double refht, double delht, int u_rfht, int u_dlht, std::string name, std::vector<Icon> icons);
1255 /** Create a new object. */
1256 Level(int nr, std::string refht, std::string delht, int u_rfht, int u_dlht, std::string name, std::vector<Icon> icons);
1257 /** Create a new object from another object. */
1258 Level(const Level& other);
1259 /** Destroy the object. */
1260 98 ~Level() = default;
1261
1262 //@}
1263 /** @name Operators */
1264 //@{
1265
1266 /** Copy operator */
1267 Level& operator=(const Level& other);
1268 /** Equality operator */
1269 bool operator==(const Level& other) const;
1270 /** Inequality operator */
1271 bool operator!=(const Level& other) const;
1272
1273 //@}
1274 /** @name Input and Output */
1275 //@{
1276
1277 /** Read an object from a Reader. */
1278 void read(Reader& input);
1279 /** Write the object to a string. */
1280 std::string write();
1281
1282 //@}
1283 /** @name Getters and Setters */
1284 //@{
1285
1286 /** Returns the level number, in order from 1 to the number of levels. */
1287 int nr() const;
1288 /** Sets the level number. This should only be done with care. */
1289 void setNr(const int nr);
1290 /** Returns the reference elevation of level [m]. */
1291 double refht() const;
1292 /** Sets the reference elevation of level [m]. */
1293 bool setRefht(const double refht);
1294 /** Sets the reference elevation of level [m]. */
1295 bool setRefht(const std::string& refht);
1296 /** Returns the delta elevation to next level [m]. */
1297 double delht() const;
1298 /** Sets the delta elevation to next level [m]. */
1299 bool setDelht(const double delht);
1300 /** Sets the delta elevation to next level [m]. */
1301 bool setDelht(const std::string& delht);
1302 /** Returns the units of reference elevation. */
1303 int u_rfht() const;
1304 /** Returns the units of reference elevation. */
1305 void setU_rfht(const int u_rfht);
1306 /** Returns the units of delta elevation. */
1307 int u_dlht() const;
1308 /** Sets the units of delta elevation. */
1309 void setU_dlht(const int u_dlht);
1310 /** Returns the level name. */
1311 std::string name() const;
1312 /** Sets the level name. */
1313 void setName(const std::string& name);
1314 /** Returns the level's icons in a vector. */
1315 std::vector<Icon> icons() const;
1316 /** Sets the level's icon vector. */
1317 void setIcons(const std::vector<Icon>& icons);
1318 //@}
1319 private:
1320 std::shared_ptr<detail::LevelImpl> m_impl;
1321 };
1322
1323 /** The DaySchedule object contains schedule data for a single day. */
1324 class AIRFLOW_API DaySchedule
1325 {
1326 public:
1327 /** @name Constructors and Destructors */
1328 //@{
1329
1330 /** Create a new object with default values. */
1331 DaySchedule();
1332 /** Create a new object. */
1333 DaySchedule(int nr, int shape, int utyp, int ucnv, std::string name, std::string desc, std::vector<SchedulePoint> points);
1334 /** Create a new object from another object. */
1335 DaySchedule(const DaySchedule& other);
1336 /** Destroy the object. */
1337 459 ~DaySchedule() = default;
1338
1339 //@}
1340 /** @name Operators */
1341 //@{
1342
1343 /** Copy operator */
1344 DaySchedule& operator=(const DaySchedule& other);
1345 /** Equality operator */
1346 bool operator==(const DaySchedule& other) const;
1347 /** Inequality operator */
1348 bool operator!=(const DaySchedule& other) const;
1349
1350 //@}
1351 /** @name Input and Output */
1352 //@{
1353
1354 /** Read an object from a Reader. */
1355 void read(Reader& input);
1356 /** Write the object to a string. */
1357 std::string write();
1358
1359 //@}
1360 /** @name Getters and Setters */
1361 //@{
1362
1363 /** Returns the schedule number, in order from 1 to the number of schedules. */
1364 int nr() const;
1365 /** Sets the schedule number. This should only be done with care. */
1366 void setNr(const int nr);
1367 /** Returns the schedule shape: 0 = rectangular, 1 = trapezoidal. */
1368 int shape() const;
1369 /** Sets the schedule shape: 0 = rectangular, 1 = trapezoidal. */
1370 void setShape(const int shape);
1371 /** Returns the type of units. */
1372 int utyp() const;
1373 /** Sets the type of units. */
1374 void setUtyp(const int utyp);
1375 /** Returns the schedule unit conversion. */
1376 int ucnv() const;
1377 /** Sets the schedule unit conversion. */
1378 void setUcnv(const int ucnv);
1379 /** Returns the schedule name. */
1380 std::string name() const;
1381 /** Sets the schedule name. */
1382 void setName(const std::string& name);
1383 /** Returns the schedule description. */
1384 std::string desc() const;
1385 /** Sets the schedule description. */
1386 void setDesc(const std::string& desc);
1387 /** Returns the schedule points as a vector. */
1388 std::vector<SchedulePoint> points() const;
1389 /** Sets the schedule point vector. */
1390 void setPoints(const std::vector<SchedulePoint>& points);
1391 //@}
1392
1393 private:
1394 std::shared_ptr<detail::DayScheduleImpl> m_impl;
1395 };
1396
1397 /** The WeekSchedule object represents a complete week with 12 possible day
1398 * schedules. */
1399 class AIRFLOW_API WeekSchedule
1400 {
1401 public:
1402 /** @name Constructors and Destructors */
1403 //@{
1404
1405 /** Create a new object with default values. */
1406 WeekSchedule();
1407 /** Create a new object. */
1408 WeekSchedule(int nr, int utyp, int ucnv, std::string name, std::string desc, std::vector<int> j);
1409
1410 /** Create a new object from another object. */
1411 WeekSchedule(const WeekSchedule& other);
1412 /** Destroy the object. */
1413 459 ~WeekSchedule() = default;
1414
1415 //@}
1416 /** @name Operators */
1417 //@{
1418
1419 /** Copy operator */
1420 WeekSchedule& operator=(const WeekSchedule& other);
1421 /** Equality operator */
1422 bool operator==(const WeekSchedule& other) const;
1423 /** Inequality operator */
1424 bool operator!=(const WeekSchedule& other) const;
1425
1426 //@}
1427 /** @name Input and Output */
1428 //@{
1429
1430 /** Read an object from a Reader. */
1431 void read(Reader& input);
1432 /** Write the object to a string. */
1433 std::string write();
1434
1435 //@}
1436 /** @name Getters and Setters */
1437 //@{
1438
1439 /** Returns the schedule number, in order from 1 to the number of schedules. */
1440 int nr() const;
1441 /** Sets the schedule number. This should only be done with care. */
1442 void setNr(const int nr);
1443 /** Returns the type of units. */
1444 int utyp() const;
1445 /** Sets the type of units. */
1446 void setUtyp(const int utyp);
1447 /** Returns the schedule unit conversion. */
1448 int ucnv() const;
1449 /** Sets the schedule unit conversion. */
1450 void setUcnv(const int ucnv);
1451 /** Returns the schedule name. */
1452 std::string name() const;
1453 /** Sets the schedule name. */
1454 void setName(const std::string& name);
1455 /** Returns the schedule description. */
1456 std::string desc() const;
1457 /** Sets the schedule description. */
1458 void setDesc(const std::string& desc);
1459 /** Returns the vector of 12 day schedule indices. */
1460 std::vector<int> j() const;
1461 /** Sets the vector of day schedule indices. There should be 12 indices. */
1462 void setJ(const std::vector<int>& j);
1463 //@}
1464
1465 private:
1466 std::shared_ptr<detail::WeekScheduleImpl> m_impl;
1467 };
1468
1469 /** WindPressureProfile objects store pressure coefficient as a function of
1470 * angle from north. */
1471 class AIRFLOW_API WindPressureProfile
1472 {
1473 public:
1474 /** @name Constructors and Destructors */
1475 //@{
1476
1477 /** Create a new object with default values. */
1478 WindPressureProfile();
1479 /** Create a new object. */
1480 WindPressureProfile(int nr, int type, std::string name, std::string desc, std::vector<PressureCoefficientPoint> coeffs);
1481 /** Create a new object from another object. */
1482 WindPressureProfile(const WindPressureProfile& other);
1483 /** Destroy the object. */
1484 107 ~WindPressureProfile() = default;
1485
1486 //@}
1487 /** @name Operators */
1488 //@{
1489
1490 /** Copy operator */
1491 WindPressureProfile& operator=(const WindPressureProfile& other);
1492 /** Equality operator */
1493 bool operator==(const WindPressureProfile& other) const;
1494 /** Inequality operator */
1495 bool operator!=(const WindPressureProfile& other) const;
1496
1497 //@}
1498 /** @name Input and Output */
1499 //@{
1500
1501 /** Read an object from a Reader. */
1502 void read(Reader& input);
1503 /** Write the object to a string. */
1504 std::string write();
1505
1506 //@}
1507 /** @name Getters and Setters */
1508 //@{
1509
1510 /** Returns the profile number, in order from 1 to the number of profiles. */
1511 int nr() const;
1512 /** Sets the profile number. This should only be done with care. */
1513 void setNr(const int nr);
1514 /** Returns the profile type: 1 = linear, 2 = cubic spline, 3 = trigonometric. */
1515 int type() const;
1516 /** Sets the profile type: 1 = linear, 2 = cubic spline, 3 = trigonometric. */
1517 void setType(const int type);
1518 /** Returns the profile name. */
1519 std::string name() const;
1520 /** Sets the profile name. */
1521 void setName(const std::string& name);
1522 /** Returns the profile description. */
1523 std::string desc() const;
1524 /** Sets the profile description. */
1525 void setDesc(const std::string& desc);
1526 /** Returns the wind pressure coefficient data points as a vector. */
1527 std::vector<PressureCoefficientPoint> coeffs() const;
1528 /** Sets the wind pressure coefficient data point vector. */
1529 void setCoeffs(const std::vector<PressureCoefficientPoint>& coeffs);
1530 //@}
1531
1532 private:
1533 std::shared_ptr<detail::WindPressureProfileImpl> m_impl;
1534 };
1535
1536 /** The ControlNode object is the base class of all control node elements. */
1537 class AIRFLOW_API ControlNode
1538 {
1539 public:
1540 /** Destroy the object. */
1541 ✗ virtual ~ControlNode() = default;
1542 /** Write the object to a string. */
1543 virtual std::string write() = 0;
1544 /** Convert an input string into a control node type enum. */
1545 static ControlNodeType convertTag(const std::string& tag);
1546 /** Read a control node element from a Reader object. */
1547 static ControlNode* readElement(Reader& input);
1548 // virtual void recompute(){}
1549 /** Returns the node number, in order from 1 to the number of control nodes. */
1550 virtual int nr() const = 0;
1551 /** Sets the node number, in order from 1 to the number of control nodes. */
1552 virtual void setNr(const int nr) = 0;
1553 /** Returns the node data type. */
1554 virtual std::string dataType() const = 0;
1555 /** Returns the computation sequence number, which is set in ContamW. */
1556 virtual int seqnr() const = 0;
1557 /** Sets the computation sequence number. */
1558 virtual void setSeqnr(const int seqnr) = 0;
1559 /** Returns the flags for offset & scale, time constant, and 1D sensor. */
1560 virtual unsigned int flags() const = 0;
1561 /** Sets the flags for offset & scale, time constant, and 1D sensor. */
1562 virtual void setFlags(const unsigned int flags) = 0;
1563 /** Returns the number of required inputs. */
1564 virtual int inreq() const = 0;
1565 /** Sets the number of required inputs. */
1566 virtual void setInreq(const int inreq) = 0;
1567 /** Returns the SketchPad number of input node #1. */
1568 virtual int n1() const = 0;
1569 /** Sets the SketchPad number of input node #1. */
1570 virtual void setN1(const int n1) = 0;
1571 /** Returns the SketchPad number of input node #2. */
1572 virtual int n2() const = 0;
1573 /** Sets the SketchPad number of input node #2. */
1574 virtual void setN2(const int n2) = 0;
1575 /** Returns the element name. */
1576 virtual std::string name() const = 0;
1577 /** Sets the element name. */
1578 virtual void setName(const std::string& name) = 0;
1579 /** Returns the element description. */
1580 virtual std::string desc() const = 0;
1581 /** Sets the element description. */
1582 virtual void setDesc(const std::string& desc) = 0;
1583 };
1584
1585 /** The CdvDat object is the base class of the file control nodes. */
1586 class AIRFLOW_API CdvDat : public ControlNode
1587 {
1588 public:
1589 /** @name Constructors and Destructors */
1590 //@{
1591
1592 /** Create a new object with default values. */
1593 CdvDat();
1594 /** Create a new object. */
1595 CdvDat(int nr, int seqnr, unsigned int flags, int inreq, int n1, int n2, std::string name, std::string desc);
1596 /** Create a new object. */
1597 CdvDat(int nr, int seqnr, unsigned int flags, int inreq, int n1, int n2, std::string name, std::string desc, std::string valuename);
1598 /** Create a new object from another object. */
1599 CdvDat(const CdvDat& other);
1600 /** Destroy the object. */
1601 ✗ virtual ~CdvDat() override = default;
1602
1603 //@}
1604 /** @name Operators */
1605 //@{
1606
1607 /** Copy operator */
1608 CdvDat& operator=(const CdvDat& other);
1609 /** Equality operator */
1610 bool operator==(const CdvDat& other) const;
1611 /** Inequality operator */
1612 bool operator!=(const CdvDat& other) const;
1613
1614 //@}
1615 /** @name Input and Output */
1616 //@{
1617
1618 /** Read an object from a Reader. */
1619 void read(Reader& input);
1620 /** Read object details from a Reader. */
1621 void readDetails(Reader& input);
1622 /** Write the object to a string. */
1623 std::string write() override;
1624
1625 //@}
1626 /** @name Getters and Setters */
1627 //@{
1628
1629 /** Returns the node number, in order from 1 to the number of control nodes. */
1630 int nr() const override;
1631 /** Sets the element number. This should only be done with care. */
1632 void setNr(const int nr) override;
1633 /** Returns the node data type. */
1634 virtual std::string dataType() const override = 0;
1635 /** Returns the computation sequence number, which is set in ContamW. */
1636 int seqnr() const override;
1637 /** Sets the computation sequence number. */
1638 void setSeqnr(const int seqnr) override;
1639 /** Returns the flags for offset & scale, time constant, and 1D sensor. */
1640 unsigned int flags() const override;
1641 /** Sets the flags for offset & scale, time constant, and 1D sensor. */
1642 void setFlags(const unsigned int flags) override;
1643 /** Returns the number of required inputs. */
1644 int inreq() const override;
1645 /** Sets the number of required inputs. */
1646 void setInreq(const int inreq) override;
1647 /** Returns the SketchPad number of input node #1. */
1648 int n1() const override;
1649 /** Sets the SketchPad number of input node #1. */
1650 void setN1(const int n1) override;
1651 /** Returns the SketchPad number of input node #2. */
1652 int n2() const override;
1653 /** Sets the SketchPad number of input node #2. */
1654 void setN2(const int n2) override;
1655 /** Returns the element name. */
1656 std::string name() const override;
1657 /** Sets the element name. */
1658 void setName(const std::string& name) override;
1659 /** Returns the element description. */
1660 std::string desc() const override;
1661 /** Sets the element description. */
1662 void setDesc(const std::string& desc) override;
1663 /** Returns the name of the value read from the file. */
1664 std::string valuename() const;
1665 /** Sets the name of the value read from the file. */
1666 void setValuename(const std::string& valuename);
1667 //@}
1668 private:
1669 std::shared_ptr<detail::CdvDatImpl> m_impl;
1670 };
1671
1672 /** The CvfDat object represents a continuous value datas file control node. */
1673 class AIRFLOW_API CvfDat : public CdvDat
1674 {
1675 public:
1676 /** @name Constructors and Destructors */
1677 //@{
1678
1679 /** Create a new object with default values. */
1680 CvfDat();
1681 /** Create a new object. */
1682 CvfDat(int nr, int seqnr, unsigned int flags, int inreq, int n1, int n2, std::string name, std::string desc);
1683 /** Create a new object. */
1684 CvfDat(int nr, int seqnr, unsigned int flags, int inreq, int n1, int n2, std::string name, std::string desc, std::string valuename);
1685
1686 //@}
1687 /** @name Getters and Setters */
1688 //@{
1689
1690 /** Returns the node data type. */
1691 ✗ std::string dataType() const override {
1692 ✗ return "cvf";
1693 }
1694 //@}
1695 };
1696
1697 /** The DvfDat object represents a discrete values data file control node. */
1698 class AIRFLOW_API DvfDat : public CdvDat
1699 {
1700 public:
1701 /** @name Constructors and Destructors */
1702 //@{
1703
1704 /** Create a new object with default values. */
1705 DvfDat();
1706 /** Create a new object. */
1707 DvfDat(int nr, int seqnr, unsigned int flags, int inreq, int n1, int n2, std::string name, std::string desc);
1708 /** Create a new object. */
1709 DvfDat(int nr, int seqnr, unsigned int flags, int inreq, int n1, int n2, std::string name, std::string desc, std::string valuename);
1710
1711 //@}
1712 /** @name Getters and Setters */
1713 //@{
1714
1715 /** Returns the node data type. */
1716 ✗ std::string dataType() const override {
1717 ✗ return "dvf";
1718 }
1719 //@}
1720 };
1721
1722 } // namespace contam
1723 } // namespace openstudio
1724
1725 #endif // CONTAM_PRJOBJECTS_HPP
1726