Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
ConnectorNode.h
Go to the documentation of this file.
1
//! @file ConnectorNode.h
2
3
// This file is part of Cantera. See License.txt in the top-level directory or
4
// at https://cantera.org/license.txt for license and copyright information.
5
6
#ifndef CT_CONNECTOR_H
7
#define CT_CONNECTOR_H
8
9
#include "
cantera/base/ct_defs.h
"
10
#include "
cantera/base/global.h
"
11
12
namespace
Cantera
13
{
14
class
ReactorBase
;
15
16
/**
17
* Base class for walls and flow devices connecting reactors.
18
* In a reactor network, walls and flow devices (e.g., valves, pressure regulators)
19
* represent nodes in a directed bipartite graph - a graph whose vertices can be
20
* divided into two disjoint sets such that no two vertices within the same set are
21
* adjacent - with reactors forming the second set of nodes.
22
*
23
* @since New in %Cantera 3.2.
24
*
25
* @ingroup connectorGroup
26
*/
27
class
ConnectorNode
28
{
29
public
:
30
//! Transitional constructor.
31
//! @todo Implement deprecation warning.
32
ConnectorNode
(
const
string
&
name
=
"(none)"
) :
m_name
(
name
) {}
33
34
//! Instantiate a ConnectorNode object with associated ReactorBase objects.
35
//! @param r0 First reactor.
36
//! @param r1 Second reactor.
37
//! @param name Name of the connector.
38
ConnectorNode
(shared_ptr<ReactorBase> r0, shared_ptr<ReactorBase> r1,
39
const
string
&
name
=
"(none)"
) :
m_nodes
({r0, r1}),
m_name
(
name
) {}
40
41
virtual
~ConnectorNode() =
default
;
42
ConnectorNode
(
const
ConnectorNode
&) =
delete
;
43
ConnectorNode
& operator=(
const
ConnectorNode
&) =
delete
;
44
45
//! String indicating the connector implemented. Usually
46
//! corresponds to the name of the derived class.
47
virtual
string
type
()
const
{
48
return
"ConnectorNode"
;
49
}
50
51
//! Retrieve connector name.
52
string
name
()
const
{
53
return
m_name
;
54
}
55
56
//! Set connector name.
57
void
setName
(
const
string
&
name
) {
58
m_name
=
name
;
59
}
60
61
//! Set the default name of a connector. Returns `false` if it was previously set.
62
void
setDefaultName
(map<string, int>& counts);
63
64
protected
:
65
//! Pair of reactors forming end points of the connector.
66
pair<shared_ptr<ReactorBase>, shared_ptr<ReactorBase>>
m_nodes
;
67
68
string
m_name
;
//!< ConnectorNode name.
69
bool
m_defaultNameSet
=
false
;
//!< `true` if default name has been previously set.
70
};
71
72
}
73
74
#endif
Cantera::ConnectorNode::ConnectorNode
ConnectorNode(shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name="(none)")
Instantiate a ConnectorNode object with associated ReactorBase objects.
Definition
ConnectorNode.h:38
Cantera::ConnectorNode::m_defaultNameSet
bool m_defaultNameSet
true if default name has been previously set.
Definition
ConnectorNode.h:69
Cantera::ConnectorNode::setDefaultName
void setDefaultName(map< string, int > &counts)
Set the default name of a connector. Returns false if it was previously set.
Definition
ConnectorNode.cpp:12
Cantera::ConnectorNode::type
virtual string type() const
String indicating the connector implemented.
Definition
ConnectorNode.h:47
Cantera::ConnectorNode::setName
void setName(const string &name)
Set connector name.
Definition
ConnectorNode.h:57
Cantera::ConnectorNode::m_nodes
pair< shared_ptr< ReactorBase >, shared_ptr< ReactorBase > > m_nodes
Pair of reactors forming end points of the connector.
Definition
ConnectorNode.h:66
Cantera::ConnectorNode::m_name
string m_name
ConnectorNode name.
Definition
ConnectorNode.h:68
Cantera::ConnectorNode::name
string name() const
Retrieve connector name.
Definition
ConnectorNode.h:52
Cantera::ConnectorNode::ConnectorNode
ConnectorNode(const string &name="(none)")
Transitional constructor.
Definition
ConnectorNode.h:32
Cantera::ReactorBase
Base class for reactor objects.
Definition
ReactorBase.h:51
ct_defs.h
This file contains definitions of constants, types and terms that are used in internal routines and a...
global.h
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
include
cantera
zeroD
ConnectorNode.h
Generated by
1.17.0