Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed names of functions handling loading and unloading Cantera.
- Loading branch information
Showing
9 changed files
with
62 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
% :return: | ||
% Instance of class :mat:class:`fplus` | ||
% | ||
|
||
methods | ||
|
||
function f = fplus(a, b) | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function ctCleanUp() | ||
% Delete all stored Cantera objects and reclaim memory. | ||
% | ||
ctIsLoaded; | ||
|
||
classList = {'Domain1D', 'Sim1D', 'Func', 'Kinetics', ... | ||
'Interface', 'Mixture', 'Solution', 'FlowDevice', 'Reactor', ... | ||
'Wall', 'ReactorNet', 'ReactorSurface', 'ThermoPhase', 'Transport'}; | ||
|
||
varList = evalin('base', 'whos'); | ||
|
||
for i = 1:length(varList) | ||
for j = 1:length(classList) | ||
if isa(evalin('base', ['eval("', varList(i).name, '")']), ... | ||
classList{j}); | ||
evalin('base', ['clear ', varList(i).name]); | ||
break | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function ctLoad() | ||
% Load the Cantera C Library into Memory | ||
% | ||
if ispc | ||
ctName = '/Lib/cantera_shared.dll'; | ||
elseif ismac | ||
ctName = '/Lib/libcantera_shared.dylib'; | ||
elseif isunix | ||
ctName = '/lib/libcantera_shared.so'; | ||
else | ||
error('Operating System Not Supported!'); | ||
return; | ||
end | ||
|
||
if ~libisloaded(ctSharedLibrary) | ||
[~, warnings] = loadlibrary([ctRoot, ctName], ... | ||
[ctRoot, '/include/cantera/clib/ctmatlab.h'], ... | ||
'includepath', [ctRoot '/include'], ... | ||
'addheader', 'ct', 'addheader', 'ctfunc', ... | ||
'addheader', 'ctmultiphase', 'addheader', ... | ||
'ctonedim', 'addheader', 'ctreactor', ... | ||
'addheader', 'ctrpath', 'addheader', 'ctsurf'); | ||
end | ||
|
||
disp(sprintf('Cantera %s is ready for use.', ctVersion)) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function output = ctRoot() | ||
output = '/home/ssun30/anaconda3/envs/ct-matlab'; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function ctUnload() | ||
% Unload the Cantear C Library from the Memory | ||
% | ||
if libisloaded(ctSharedLibrary) | ||
ctCleanUp; | ||
unloadlibrary(ctSharedLibrary); | ||
end | ||
|
||
disp('Cantera has been unloaded'); | ||
end |