Skip to content

Commit

Permalink
Zip workflow
Browse files Browse the repository at this point in the history
Zip all the simulations and remove the FEM folder.
Having thousands of file in a folder is a mess (file explorer, search, etc.)
  • Loading branch information
otvam committed Apr 24, 2020
1 parent 9d1813b commit 1c89fdc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions source_inductor/inductor_fem_ann/+fem_ann/get_zip.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function get_zip(folder_fem)
% Assemble many FEM simulation into a zip file and remove the folder.
%
% Parameters:
% folder_fem (str): path of the folder where the results are stored
%
% (c) 2019-2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod

% get MATLAB file in the directory
filelist = dir([folder_fem filesep() '*.mat']);
assert(isempty(filelist)==false, 'invalid data')

% get name
file_fem = [folder_fem '.zip'];
for i=1:length(filelist)
filelist_cell{i} = [filelist(i).folder filesep() filelist(i).name];
end

% zip data
zip(file_fem, filelist_cell);

% remove folder
[s, m] = rmdir(folder_fem, 's');

end
3 changes: 3 additions & 0 deletions source_inductor/inductor_fem_ann/master_assemble.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ function master_assemble(file_assemble, folder_fem)
fprintf('assemble\n')
[diff, n_tot, n_sol, model_type, file_model, inp, out_fem] = fem_ann.get_assemble(folder_fem);

fprintf('zip\n')
fem_ann.get_zip(folder_fem);

% compute the analytical results
fprintf('approx\n')
out_approx = fem_ann.get_out_approx(model_type, inp);
Expand Down

0 comments on commit 1c89fdc

Please sign in to comment.