Skip to main content

System Coupling C++ library 2025 R1

Region

Last update: 17.07.2025
1 /*
2 * Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
3 */
4 
5 #pragma once
6 
7 #include "SystemCouplingParticipant/LibraryType.hpp"
8 
9 #include "SystemCouplingParticipant/CommonTypes.hpp"
10 #include "SystemCouplingParticipant/Variable.hpp"
11 
12 #include <cstddef>
13 #include <map>
14 #include <string>
15 #include <vector>
16 
17 namespace sysc {
18 
30 class SYSTEM_COUPLING_PARTICIPANT_DLL Region {
31 public:
43  Region(const RegionName& name);
44 
56  const RegionName& name,
57  enum Topology topology);
58 
69  const RegionName& name,
70  enum Topology topology,
71  const DisplayName& displayName);
72 
84  const RegionName& name,
85  enum Topology topology,
86  enum RegionDiscretizationType regionDiscretizationType);
87 
97  const RegionName& name,
98  enum Topology topology,
99  const DisplayName& displayName,
100  enum RegionDiscretizationType regionDiscretizationType);
101 
123  void addInputVariable(const Variable& variable);
124 
147  void addOutputVariable(const Variable& variable);
148 
154  const RegionName& getName() const noexcept;
155 
161  Topology getTopology() const noexcept;
162 
168  const DisplayName& getDisplayName() const noexcept;
169 
175  RegionDiscretizationType getRegionDiscretizationType() const noexcept;
176 
183  const Variable& getInputVariable(const VariableName& name) const;
184 
191  const Variable& getOutputVariable(const VariableName& name) const;
192 
194  std::size_t getNumOutputVariables() const noexcept;
195 
197  std::size_t getNumInputVariables() const noexcept;
198 
200  const Variable& getOutputVariable(std::size_t index) const;
201 
203  const Variable& getInputVariable(std::size_t index) const;
204 
205 private:
206  RegionName m_name;
207  Topology m_topology;
208  RegionDiscretizationType m_regionDiscretizationType;
209  DisplayName m_displayName;
210 
211  std::vector<Region> m_side0Regions;
212  std::vector<Region> m_side1Regions;
213 
214  std::vector<Variable> m_inputVariables;
215  std::map<VariableName, std::size_t> m_inputVarNameToIndex;
216 
217  std::vector<Variable> m_outputVariables;
218  std::map<VariableName, std::size_t> m_outputVarNameToIndex;
219 };
220 
221 } // namespace sysc
Provide a class for a System Coupling region.
Definition: Region.hpp:30
void addInputVariable(const Variable &variable)
Provide a method to add an input variable to the region.
const RegionName & getName() const noexcept
Get the region's name.
Region(const RegionName &name, enum Topology topology, enum RegionDiscretizationType regionDiscretizationType)
Create region to be used in a coupled analysis.
Region(const RegionName &name, enum Topology topology)
Create region to be used in a coupled analysis.
void addOutputVariable(const Variable &variable)
Provide a method to add an output variable to the region.
Region(const RegionName &name)
Create region to be used in a coupled analysis.
Region(const RegionName &name, enum Topology topology, const DisplayName &displayName, enum RegionDiscretizationType regionDiscretizationType)
Create region to be used in a coupled analysis.
Region(const RegionName &name, enum Topology topology, const DisplayName &displayName)
Create region to be used in a coupled analysis.
Provide a class for a System Coupling variable.
Definition: Variable.hpp:21
std::string VariableName
RegionDiscretizationType
Provide enum for region discretization types.
std::string DisplayName
std::string RegionName
Topology
Provide enum for region topologies.

Connect with Ansys