Skip to content

Commit

Permalink
[MATLAB] Update API & docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Aug 8, 2024
1 parent 50f4234 commit 28c3444
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 31 deletions.
9 changes: 4 additions & 5 deletions interfaces/matlab_experimental/Reactor/ConstPressureReactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
%
% .. code-block:: matlab
%
% r1 = ConstPressureReactor % an empty reactor
% r2 = ConstPressureReactor(contents) % a reactor containing contents
%
% See also: :mat:class:`Reactor`
Expand All @@ -22,14 +21,14 @@

methods

function r = ConstPressureReactor(contents)
function r = ConstPressureReactor(contents, name)
% Constructor

if nargin == 0
contents = 0;
if nargin < 2
name = '(none)'
end

r@Reactor(contents, 'ConstPressureReactor');
r@Reactor(contents, 'ConstPressureReactor', name);
end

end
Expand Down
11 changes: 6 additions & 5 deletions interfaces/matlab_experimental/Reactor/FlowReactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@
%
% .. code-block:: matlab
%
% r1 = FlowReactor % an empty reactor
% r2 = FlowReactor(gas) % a reactor containing a gas
%
% See also: :mat:class:`Reactor`
%
% :param contents:
% Cantera :mat:class:`Solution` to be set as the contents of the reactor.
% :param name:
% Reactor name (optional; default is ``(none)``).
% :return:
% Instance of class :mat:class:`FlowReactor`.

methods

function r = FlowReactor(contents)
function r = FlowReactor(contents, name)
% Constructor

if nargin == 0
contents = 0;
if nargin < 2
name = '(none)'
end

r@Reactor(contents, 'FlowReactor');
r@Reactor(contents, 'FlowReactor', name);
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
%
% .. code-block:: matlab
%
% r1 = IdealGasConstPressureReactor % an empty reactor
% r2 = IdealGasConstPressureReactor(gas) % a reactor containing a gas
%
% See also: :mat:class:`Reactor`
Expand All @@ -25,14 +24,14 @@

methods

function r = IdealGasConstPressureReactor(contents)
function r = IdealGasConstPressureReactor(contents, name)
% Constructor

if nargin == 0
contents = 0;
if nargin < 2
name = '(none)';
end

r@Reactor(contents, 'IdealGasConstPressureReactor');
r@Reactor(contents, 'IdealGasConstPressureReactor', name);
end

end
Expand Down
9 changes: 4 additions & 5 deletions interfaces/matlab_experimental/Reactor/IdealGasReactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
%
% .. code-block:: matlab
%
% r1 = IdealGasReactor % an empty reactor
% r2 = IdealGasReactor(gas) % a reactor containing a gas
%
% See also: :mat:class:`Reactor`
Expand All @@ -21,14 +20,14 @@

methods

function r = IdealGasReactor(contents)
function r = IdealGasReactor(contents, name)
% Constructor

if nargin == 0
contents = 0;
if nargin < 2
name = '(none)';
end

r@Reactor(contents, 'IdealGasReactor');
r@Reactor(contents, 'IdealGasReactor', name);
end

end
Expand Down
12 changes: 9 additions & 3 deletions interfaces/matlab_experimental/Reactor/MassFlowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@
% Upstream :mat:class:`Reactor` or :mat:class:`Reservoir`.
% :param downstream:
% Downstream :mat:class:`Reactor` or :mat:class:`Reservoir`.
% :param name:
% Flow device name (optional; default is ``(none)``).
% :return:
% Instance of class :mat:class:`FlowDevice`.

methods

function m = MassFlowController(upstream, downstream)
function m = MassFlowController(upstream, downstream, name)
% Constructor

m@FlowDevice('MassFlowController');
if nargin < 3
name = '(none)';
end

m@FlowDevice('MassFlowController', name);

if nargin == 2
if nargin >= 2
m.install(upstream, downstream)
end

Expand Down
11 changes: 6 additions & 5 deletions interfaces/matlab_experimental/Reactor/Reservoir.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
%
% .. code-block:: matlab
%
% r1 = Reservoir % an empty reservoir
% r2 = Reservoir(gas) % a reservoir containing a gas
%
% See also: :mat:class:`Reactor`
%
% :param contents:
% Cantera :mat:class:`Solution` to be set as the contents of the reactor.
% :param name:
% Reservoir name (optional; default is ``(none)``).
% :return:
% Instance of class :mat:class:`Reactor`.

methods

function r = Reservoir(contents)
function r = Reservoir(contents, name)
% Constructor

if nargin == 0
contents = 0;
if nargin < 2
name = '(none)';
end

r@Reactor(contents, 'Reservoir');
r@Reactor(contents, 'Reservoir', name);
end

end
Expand Down
11 changes: 8 additions & 3 deletions interfaces/matlab_experimental/Reactor/Valve.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,22 @@
% Upstream reactor or reservoir.
% :param downstream:
% Downstream Reactor or reservoir.
% :param name:
% Valve name (optional; default is ``(none)``).
% :return:
% Instance of class :mat:class:`FlowDevice`.

methods

function v = Valve(upstream, downstream)
function v = Valve(upstream, downstream, name)
% Constructor

v@FlowDevice('Valve');
if nargin < 3
name = '(none)';
end
v@FlowDevice('Valve', name);

if nargin == 2
if nargin >= 2
v.install(upstream, downstream)
end

Expand Down
2 changes: 2 additions & 0 deletions interfaces/matlab_experimental/Reactor/Wall.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
% :param r:
% Instance of class :mat:class:`Reactor` to be used as the bulk phase
% on the right side of the wall.
% :param name:
% Wall name (optional; default is ``(none)``).
% :return:
% Instance of class :mat:class:`Wall`.

Expand Down

0 comments on commit 28c3444

Please sign in to comment.