Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 566665f

Browse files
committed
[Doc] Update some cloning docs / deprecation / TODO notes
1 parent 4a88000 commit 566665f

11 files changed

Lines changed: 57 additions & 8 deletions

File tree

doc/sphinx/yaml/phases.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ are:
113113
- `surface` ({ct}`details <InterfaceKinetics>`)
114114
- `edge` ({ct}`details <EdgeKinetics>`)
115115

116+
(sec-yaml-rate-multipliers)=
117+
`rate-multipliers`
118+
: A mapping of reaction indices and multipliers applied to the forward rate
119+
constants. The key `default` is used to specify the default rate multiplier, which is
120+
used for reactions not specified in the mapping.
121+
116122
(sec-yaml-phase-reactions)=
117123
`reactions`
118124
: Source of reactions to include in the phase, if a kinetics model has been specified.

include/cantera/base/Solution.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,19 @@ class Solution : public std::enable_shared_from_this<Solution>
5555
return shared_ptr<Solution>( new Solution );
5656
}
5757

58-
//! Create a new Solution object with cloned ThermoPhase and Kinetics objects that
59-
//! use the same species definitions, thermodynamic parameters, and reactions as
60-
//! this one.
58+
//! Create a new Solution object with cloned ThermoPhase, Kinetics, and Transport
59+
//! objects that use the same species definitions, thermodynamic parameters, and
60+
//! reactions as this one.
6161
//! @param adjacent For surface phases, an optional list of new adjacent phases
6262
//! to link to the InterfaceKinetics object. Any adjacent phases not provided
6363
//! will have their ThermoPhase model automatically cloned.
6464
//! @param withKinetics Flag indicating whether to clone the Kinetics object
65-
//! associated with this phase
65+
//! associated with this phase. If `false`, the cloned Solution will not include
66+
//! a kinetics manager.
6667
//! @param withTransport Flag indicating whether to clone the Transport object
67-
//! associated with this phase
68+
//! associated with this phase. If `false`, the cloned Solution will not include
69+
//! a transport property manager.
70+
//! @since New in %Cantera 3.2.
6871
shared_ptr<Solution> clone(const vector<shared_ptr<Solution>>& adjacent={},
6972
bool withKinetics=true, bool withTransport=true) const;
7073

include/cantera/kinetics/Kinetics.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class Kinetics
142142
//! @param phases Phases used to specify the state for the newly cloned Kinetics
143143
//! object. These can be created from the phases used by this object using the
144144
//! ThermoPhase::clone() method.
145+
//! @since New in %Cantera 3.2.
145146
shared_ptr<Kinetics> clone(const vector<shared_ptr<ThermoPhase>>& phases) const;
146147

147148
//! Identifies the Kinetics manager type.

include/cantera/thermo/ThermoPhase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ class ThermoPhase : public Phase
398398

399399
//! Create a new ThermoPhase object using the same species definitions,
400400
//! thermodynamic parameters, and state as this one.
401+
//! @since New in %Cantera 3.2.
401402
shared_ptr<ThermoPhase> clone() const;
402403

403404
//! @name Information Methods

include/cantera/transport/Transport.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ class Transport
8686
Transport(const Transport&) = delete;
8787
Transport& operator=(const Transport&) = delete;
8888

89+
//! Create a new Transport object using the same transport model and species
90+
//! transport properties as this one.
91+
//! @param phase ThermoPhase used to specify the state for the newly cloned
92+
//! Transport object. Can be created from the phase used by the current
93+
//! Transport object using the ThermoPhase::clone() method.
94+
//! @since New in %Cantera 3.2.
8995
shared_ptr<Transport> clone(shared_ptr<ThermoPhase> thermo) const;
9096

9197
//! Identifies the model represented by this Transport object. Each derived class

include/cantera/zeroD/Reactor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class Reactor : public ReactorBase
4848
public:
4949
Reactor(shared_ptr<Solution> sol, const string& name="(none)");
5050
Reactor(shared_ptr<Solution> sol, bool clone, const string& name="(none)");
51+
//! TODO: Remove after %Cantera 3.2 -- all derived classes should use Solution-based
52+
//! constructors.
5153
using ReactorBase::ReactorBase; // inherit constructors
5254

5355
string type() const override {

include/cantera/zeroD/ReactorBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct SensitivityParameter
4848
class ReactorBase
4949
{
5050
public:
51+
//! @deprecated After %Cantera 3.2, this constructor will become protected
5152
explicit ReactorBase(const string& name="(none)");
5253

5354
//! Instantiate a ReactorBase object with Solution contents.

include/cantera/zeroD/ReactorFactory.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,42 @@ shared_ptr<ReactorBase> newReactor(
6161
const string& model, shared_ptr<Solution> contents, const string& name="(none)");
6262

6363
//! Create a Reactor object of the specified type and contents
64+
//! @param model Reactor type to be created. See [this list of reactor
65+
//! types](../reference/reactors/index.html) for available options.
66+
//! @param contents Solution object to model the thermodynamic properties and
67+
//! reactions occurring in the reactor
68+
//! @param clone Determines whether to clone `sol` so that the internal state of this
69+
//! reactor is independent of the original Solution object and any Solution objects
70+
//! used by other reactors in the network.
71+
//! @param name Name of the reactor.
6472
//! @since New in %Cantera 3.2. Transitional method returning a `Reactor` object.
6573
shared_ptr<Reactor> newReactor4(
6674
const string& model, shared_ptr<Solution> contents, bool clone=true,
6775
const string& name="(none)");
6876

6977
//! Create a Reservoir object with the specified contents
78+
//! @param contents Solution object to model the contents of this reservoir
79+
//! @param clone Determines whether to clone `sol` so that the internal state of this
80+
//! reservoir is independent of the original Solution object and any Solution
81+
//! objects used by other reactors in the network.
82+
//! @param name Name of the reservoir.
7083
//! @since New in %Cantera 3.2.
7184
shared_ptr<Reservoir> newReservoir(
7285
shared_ptr<Solution> contents, bool clone=true, const string& name="(none)");
7386

7487
//! Create a ReactorSurface object with the specified contents and adjacent reactors
7588
//! participating in surface reactions.
89+
//! @param contents Solution (Interface) object to model the thermodynamic properties
90+
//! and reactions occurring in the reactor
91+
//! @param reactors List of Reactors adjacent to this surface, whose contents
92+
//! participate in reactions occurring on this surface.
93+
//! @param clone Determines whether to clone `sol` so that the internal state of this
94+
//! surface is independent of the original Interface object and any Solution objects
95+
//! used by other reactors in the network except those in the `reactors` list.
96+
//! @param name Name of the reactor surface.
7697
//! @since New in %Cantera 3.2.
7798
shared_ptr<ReactorSurface> newReactorSurface(
78-
shared_ptr<Solution> soln, const vector<shared_ptr<ReactorBase>>& reactors,
99+
shared_ptr<Solution> contents, const vector<shared_ptr<ReactorBase>>& reactors,
79100
bool clone=true, const string& name="(none)");
80101

81102
//! @}

src/zeroD/Reactor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ namespace bmt = boost::math::tools;
2222
namespace Cantera
2323
{
2424

25+
// TODO: After Cantera 3.2, this method can be replaced by delegating to
26+
// Reactor::Reactor(sol, true, name)
2527
Reactor::Reactor(shared_ptr<Solution> sol, const string& name)
2628
: ReactorBase(sol, name)
2729
{

src/zeroD/ReactorBase.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ ReactorBase::ReactorBase(const string& name) : m_name(name)
1717
{
1818
}
1919

20+
// TODO: After Cantera 3.2, this method can be replaced by delegating to
21+
// ReactorBase::ReactorBase(sol, true, name)
2022
ReactorBase::ReactorBase(shared_ptr<Solution> sol, const string& name)
2123
: ReactorBase(name)
2224
{

0 commit comments

Comments
 (0)