SEEnvironmentalConditions.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "system/SESystem.h"
6 class SESubstance;
10 
11 // Keep enums in sync with appropriate schema/cdm/EnvironmentEnums.proto file !!
12 enum class eSurroundingType { NullSurrounding = 0, Air, Water };
13 extern const std::string& eSurroundingType_Name(eSurroundingType m);
14 
15 class CDM_DECL SEEnvironmentalConditions : public Loggable
16 {
17  friend class PBEnvironment;//friend the serialization class
18  friend class SEEnvironment;
21 public:
22 
24  virtual ~SEEnvironmentalConditions();
25 
26  virtual void Clear();
27  virtual void Copy(const SEEnvironmentalConditions&);
28 
29  bool SerializeToString(std::string& output, SerializationFormat m) const;
30  bool SerializeToFile(const std::string& filename, SerializationFormat m) const;
31  bool SerializeFromString(const std::string& src, SerializationFormat m);
32  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
33 
34  virtual void Merge(const SEEnvironmentalConditions& from);
35 
36  virtual const SEScalar* GetScalar(const std::string& name);
37 
38  virtual eSurroundingType GetSurroundingType() const;
39  virtual void SetSurroundingType(eSurroundingType name);
40 
41  virtual bool HasAirDensity() const;
42  virtual SEScalarMassPerVolume& GetAirDensity();
43  virtual double GetAirDensity(const MassPerVolumeUnit& unit) const;
44 
45  virtual bool HasAirVelocity() const;
46  virtual SEScalarLengthPerTime& GetAirVelocity();
47  virtual double GetAirVelocity(const LengthPerTimeUnit& unit) const;
48 
49  virtual bool HasAmbientTemperature() const;
50  virtual SEScalarTemperature& GetAmbientTemperature();
51  virtual double GetAmbientTemperature(const TemperatureUnit& unit) const;
52 
53  virtual bool HasAtmosphericPressure() const;
54  virtual SEScalarPressure& GetAtmosphericPressure();
55  virtual double GetAtmosphericPressure(const PressureUnit& unit) const;
56 
57  virtual bool HasClothingResistance() const;
58  virtual SEScalarHeatResistanceArea& GetClothingResistance();
59  virtual double GetClothingResistance(const HeatResistanceAreaUnit& unit) const;
60 
61  virtual bool HasEmissivity() const;
62  virtual SEScalar0To1& GetEmissivity();
63  virtual double GetEmissivity() const;
64 
65  virtual bool HasMeanRadiantTemperature() const;
66  virtual SEScalarTemperature& GetMeanRadiantTemperature();
67  virtual double GetMeanRadiantTemperature(const TemperatureUnit& unit) const;
68 
69  virtual bool HasRelativeHumidity() const;
70  virtual SEScalar0To1& GetRelativeHumidity();
71  virtual double GetRelativeHumidity() const;
72 
73  virtual bool HasRespirationAmbientTemperature() const;
74  virtual SEScalarTemperature& GetRespirationAmbientTemperature();
75  virtual double GetRespirationAmbientTemperature(const TemperatureUnit& unit) const;
76 
77  bool HasAmbientGas() const;
78  bool HasAmbientGas(const SESubstance& substance) const;
79  const std::vector<SESubstanceFraction*>& GetAmbientGases();
80  const std::vector<const SESubstanceFraction*>& GetAmbientGases() const;
81  SESubstanceFraction& GetAmbientGas(SESubstance& substance);
82  const SESubstanceFraction* GetAmbientGas(const SESubstance& substance) const;
83  void RemoveAmbientGas(const SESubstance& substance);
84  void RemoveAmbientGases();
85 
86  bool HasAmbientAerosol() const;
87  bool HasAmbientAerosol(const SESubstance& substance) const;
88  const std::vector<SESubstanceConcentration*>& GetAmbientAerosols();
89  const std::vector<const SESubstanceConcentration*>& GetAmbientAerosols() const;
90  SESubstanceConcentration& GetAmbientAerosol(SESubstance& substance);
91  const SESubstanceConcentration* GetAmbientAerosol(const SESubstance& substance) const;
92  void RemoveAmbientAerosol(const SESubstance& substance);
93  void RemoveAmbientAerosols();
94 
95 protected:
96 
97  eSurroundingType m_SurroundingType;
98 
108 
109  std::vector<SESubstanceFraction*> m_AmbientGases;
110  std::vector<const SESubstanceFraction*> m_cAmbientGases;
111 
112  std::vector<SESubstanceConcentration*> m_AmbientAerosols;
113  std::vector<const SESubstanceConcentration*> m_cAmbientAerosols;
114 
116 };
Definition: SESubstanceManager.h:8
virtual void Copy(const SEInitialEnvironmentConditions &src)
Definition: SEInitialEnvironmentConditions.cpp:38
Definition: SEInitialEnvironmentConditions.h:7
Definition: SESubstanceFraction.h:10
SEScalarPressure * m_AtmosphericPressure
Definition: SEEnvironmentalConditions.h:102
virtual void Clear()
Definition: SEInitialEnvironmentConditions.cpp:31
Definition: SEScalar.h:19
SEScalarTemperature * m_MeanRadiantTemperature
Definition: SEEnvironmentalConditions.h:105
Definition: SEScalarHeatResistanceArea.h:7
SEScalar0To1 * m_RelativeHumidity
Definition: SEEnvironmentalConditions.h:106
SESubstanceManager & m_Substances
Definition: SEEnvironmentalConditions.h:115
Definition: SEScalarMassPerVolume.h:32
SEScalarTemperature * m_RespirationAmbientTemperature
Definition: SEEnvironmentalConditions.h:107
Definition: SEScalarPressure.h:23
Definition: SEScalarMassPerVolume.h:7
SEScalarHeatResistanceArea * m_ClothingResistance
Definition: SEEnvironmentalConditions.h:103
eSurroundingType m_SurroundingType
Definition: SEEnvironmentalConditions.h:97
std::vector< const SESubstanceFraction * > m_cAmbientGases
Definition: SEEnvironmentalConditions.h:110
Definition: Logger.h:11
Definition: SEScalarTemperature.h:22
Definition: SEScalarPressure.h:7
Definition: SEScalarLengthPerTime.h:24
Definition: SESubstanceConcentration.h:10
std::vector< SESubstanceFraction * > m_AmbientGases
Definition: SEEnvironmentalConditions.h:109
std::vector< SESubstanceConcentration * > m_AmbientAerosols
Definition: SEEnvironmentalConditions.h:112
Definition: SEChangeEnvironmentConditions.h:8
SEScalarMassPerVolume * m_AirDensity
Definition: SEEnvironmentalConditions.h:99
SEScalarTemperature * m_AmbientTemperature
Definition: SEEnvironmentalConditions.h:101
SEScalar0To1 * m_Emissivity
Definition: SEEnvironmentalConditions.h:104
Definition: SEScalarTemperature.h:7
Definition: SEScalarLengthPerTime.h:7
Definition: SEEnvironment.h:12
SEScalarLengthPerTime * m_AirVelocity
Definition: SEEnvironmentalConditions.h:100
std::vector< const SESubstanceConcentration * > m_cAmbientAerosols
Definition: SEEnvironmentalConditions.h:113
Definition: PBEnvironment.h:10
Definition: SEScalarHeatResistanceArea.h:22
Definition: SESubstance.h:14
Definition: SEEnvironmentalConditions.h:15
Definition: SEScalar0To1.h:7