SEThermalCompartmentLink.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/circuit/thermal/SEThermalCircuitPath.h>
15 #include <biogears/cdm/compartment/SECompartmentLink.h>
16 #include <biogears/cdm/compartment/thermal/SEThermalCompartment.h>
17 #include <biogears/cdm/substance/SESubstanceTransport.h>
18 #include <biogears/schema/cdm/Compartment.hxx>
19 
20 namespace biogears {
21 class SECompartmentManager;
22 class BIOGEARS_API SEThermalCompartmentLink : public SECompartmentLink {
23  friend class SECompartmentManager;
24 
25 protected:
27  SEThermalCompartmentLink(SEThermalCompartment& src, SEThermalCompartment& tgt, const std::string& name);
28 
29 public:
30  virtual ~SEThermalCompartmentLink();
31 
32  virtual void Clear() override;
33 
34  virtual bool Load(const CDM::ThermalCompartmentLinkData& in, SECircuitManager* circuits = nullptr);
35  virtual CDM::ThermalCompartmentLinkData* Unload() override;
36 
37 protected:
38  virtual void Unload(CDM::ThermalCompartmentLinkData& data);
39 
40 public:
41  virtual const SEScalar* GetScalar(const char* name) override;
42  virtual const SEScalar* GetScalar(const std::string& name) override;
43 
44  virtual bool HasHeatTransferRate() const;
45  virtual SEScalarPower& GetHeatTransferRate();
46  virtual double GetHeatTransferRate(const PowerUnit& unit) const;
47 
48  virtual SEThermalCompartment& GetSourceCompartment() { return m_SourceCmpt; }
49  virtual SEThermalCompartment& GetTargetCompartment() { return m_TargetCmpt; }
50 
51  virtual bool HasPath() { return m_Path != nullptr; }
52  virtual SEThermalCircuitPath* GetPath() { return m_Path; }
53  virtual void RemovePath() { m_Path = nullptr; }
54  virtual void MapPath(SEThermalCircuitPath& path)
55  {
56  Clear();
57  m_Path = &path;
58  }
59 
60 protected:
65 };
66 }
67 
68 #include <biogears/cdm/compartment/SECompartmentGraph.h>
69 namespace biogears {
70 class SEThermalCompartmentGraph : public SECompartmentGraph<SEThermalCompartment, SEThermalCompartmentLink> {
71 public:
72  SEThermalCompartmentGraph(const char* name, Logger* logger);
73  SEThermalCompartmentGraph(const std::string& name, Logger* logger);
74  virtual ~SEThermalCompartmentGraph() override;
75 };
76 }
Definition: SEThermalCircuitPath.h:25
Definition: SEScalar.h:33
virtual ~SEThermalCompartmentGraph() override
Definition: SEThermalCompartmentLink.cpp:132
Definition: SEThermalCompartment.h:26
Definition: SECompartmentManager.h:32
Definition: SEThermalCompartmentLink.h:70
SEThermalCompartmentGraph(const char *name, Logger *logger)
Definition: SEThermalCompartmentLink.cpp:124
Definition: Logger.h:75
Definition: SEScalarPower.h:38
Definition: SEScalarPower.h:18
Definition: SECompartmentGraph.h:25
Definition: SEElectricalCircuit.h:18
Definition: SECircuitManager.h:53