SEGasCompartment.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/compartment/fluid/SEFluidCompartment.h"
6#include "cdm/compartment/fluid/SEGasCompartmentLink.h"
7#include "cdm/compartment/substances/SEGasSubstanceQuantity.h"
8#include "cdm/substance/SESubstanceTransport.h"
9class SEGasBlackBox;
10
11enum class BalanceGasBy { Volume, VolumeFraction };
12
13class CDM_DECL SEGasCompartment : public SEFluidCompartment<SEGasCompartmentLink, SEGasTransportVertex, SEGasTransportSubstance, SEGasSubstanceQuantity>
14{
15 friend class PBCompartment;//friend the serialization class
17protected:
18 SEGasCompartment(const std::string& name, Logger* logger);
19public:
20 virtual ~SEGasCompartment();
21
22 void Clear() override;
23
24 const SEScalar* GetScalar(const std::string& name) override;
25
26 void StateChange() override;
27
28 virtual void Balance(BalanceGasBy e);
29
30 virtual bool HasDiffusionSurfaceArea() const;
31 virtual SEScalarArea& GetDiffusionSurfaceArea();
32 virtual double GetDiffusionSurfaceArea(const AreaUnit& unit) const;
33
34 virtual bool HasVentilation() const;
35 virtual SEScalarVolumePerTime& GetVentilation();
36 virtual double GetVentilation(const VolumePerTimeUnit& unit) const;
37
38 virtual bool HasVentilationPerfusionRatio() const;
39 virtual SEScalar& GetVentilationPerfusionRatio();
40 virtual double GetVentilationPerfusionRatio() const;
41
42 virtual void AddChild(SEGasCompartment& child);
43 virtual const std::vector<SEGasCompartment*>& GetChildren() { return m_Children; }
44 virtual const std::vector<SEGasCompartment*>& GetLeaves() { return m_Leaves; }
45
46protected:
47 virtual SEGasSubstanceQuantity& CreateSubstanceQuantity(SESubstance& substance, bool zeroOut=true);
48
52
53 std::vector<SEGasCompartment*> m_Children;
54 std::vector<SEGasCompartment*> m_Leaves;
55};
Definition: SEScalarArea.h:8
Definition: Logger.h:71
Definition: PBCompartment.h:28
virtual void StateChange()=0
Definition: SECompartmentManager.h:25
Definition: SEFluidCompartment.h:19
void Clear() override
Definition: SEFluidCompartment.cpp:32
const SEScalar * GetScalar(const std::string &name) override
Definition: SEFluidCompartment.cpp:51
Definition: SEGasBlackBox.h:11
Definition: SEGasCompartment.h:14
SEScalarArea * m_DiffusionSurfaceArea
Definition: SEGasCompartment.h:49
std::vector< SEGasCompartment * > m_Leaves
Definition: SEGasCompartment.h:54
std::vector< SEGasCompartment * > m_Children
Definition: SEGasCompartment.h:53
SEScalar * m_VentilationPerfusionRatio
Definition: SEGasCompartment.h:51
virtual const std::vector< SEGasCompartment * > & GetChildren()
Definition: SEGasCompartment.h:43
virtual const std::vector< SEGasCompartment * > & GetLeaves()
Definition: SEGasCompartment.h:44
SEScalarVolumePerTime * m_Ventilation
Definition: SEGasCompartment.h:50
Definition: SEGasSubstanceQuantity.h:10
Definition: SEScalarArea.h:25
Definition: SEScalar.h:19
Definition: SEScalarVolumePerTime.h:32
Definition: SESubstance.h:15
Definition: SEScalarVolumePerTime.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.