mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Changed names of functions handling loading and unloading Cantera.
This commit is contained in:
parent
7573742c8f
commit
6279debf1e
@ -10,6 +10,7 @@ classdef fplus < Func
|
||||
% :return:
|
||||
% Instance of class :mat:class:`fplus`
|
||||
%
|
||||
|
||||
methods
|
||||
|
||||
function f = fplus(a, b)
|
||||
|
@ -1,26 +0,0 @@
|
||||
% Load the Cantera C Library into the 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(ct)
|
||||
[~, warnings] = loadlibrary([cantera_root, ctname], ...
|
||||
[cantera_root, '/include/cantera/clib/ctmatlab.h'], ...
|
||||
'includepath', [cantera_root '/include'], ...
|
||||
'addheader', 'ct', 'addheader', 'ctfunc', ...
|
||||
'addheader', 'ctmultiphase', 'addheader', ...
|
||||
'ctonedim', 'addheader', 'ctreactor', ...
|
||||
'addheader', 'ctrpath', 'addheader', 'ctsurf');
|
||||
end
|
||||
|
||||
ct_ver = canteraVersion;
|
||||
sprintf('%s is ready for use.', ct_ver);
|
||||
clear all
|
@ -1,7 +0,0 @@
|
||||
% Unload the Cantear C Library from the Memory
|
||||
%
|
||||
if libisloaded(ct)
|
||||
unloadlibrary(ct);
|
||||
end
|
||||
|
||||
disp('Cantera has been unloaded');
|
@ -1,3 +0,0 @@
|
||||
function output = cantera_root()
|
||||
output = '';
|
||||
end
|
@ -1,12 +0,0 @@
|
||||
function cleanup()
|
||||
% Delete all stored Cantera objects and reclaim memory.
|
||||
%
|
||||
checklib;
|
||||
callct('ct_clearOneDim');
|
||||
callct('ct_clearMix');
|
||||
callct('ct_clearFunc');
|
||||
callct('ct_clearStorage');
|
||||
callct('ct_clearReactors');
|
||||
callct('ct_clearReactionPath');
|
||||
clear all
|
||||
end
|
21
interfaces/matlab_experimental/Utility/ctCleanUp.m
Normal file
21
interfaces/matlab_experimental/Utility/ctCleanUp.m
Normal file
@ -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
|
27
interfaces/matlab_experimental/Utility/ctLoad.m
Normal file
27
interfaces/matlab_experimental/Utility/ctLoad.m
Normal file
@ -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
|
3
interfaces/matlab_experimental/Utility/ctRoot.m
Normal file
3
interfaces/matlab_experimental/Utility/ctRoot.m
Normal file
@ -0,0 +1,3 @@
|
||||
function output = ctRoot()
|
||||
output = '/home/ssun30/anaconda3/envs/ct-matlab';
|
||||
end
|
10
interfaces/matlab_experimental/Utility/ctUnload.m
Normal file
10
interfaces/matlab_experimental/Utility/ctUnload.m
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user