-
Notifications
You must be signed in to change notification settings - Fork 0
/
bem0_load_model.m
49 lines (40 loc) · 1.49 KB
/
bem0_load_model.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% This script loads mesh data into the MATLAB workspace. The data include
% surface meshes and the potential integrals. It also computes useful
% sparse matrices for GMRES speed up
%
% Copyright SNM/WAW 2017-2020
%% Add path (Windows/Linux commands are different)
% clear all; close all; %#ok<CLALL>
s = pwd;
if(~isunix)
slash = '\';
else
slash = '/';
end
% If a simulation has already been run with a different model,
% that model's path may have been loaded, and the desired model's
% files would then be shadowed by the files on the old model path
warning off; rmpath(genpath(s)); warning on;
engine_path = [s, slash, 'Engine'];
model_path = [s, slash, 'Model']; % This line controls which model is loaded
coil_path = [s, slash, 'Coil'];
addpath(engine_path);
addpath(model_path);
addpath(coil_path);
%% Define EM constants
eps0 = 8.85418782e-012; % Dielectric permittivity of vacuum(~air)
mu0 = 1.25663706e-006; % Magnetic permeability of vacuum(~air)
%% Import geometry and electrode data. Create useful sparse matrices. Import existing solution (if any)
tic
h = waitbar(0.5, 'Please wait - loading model data and existing solution (if any)');
load CombinedMesh;
load CombinedMeshP;
%% Import saved solution (if exists)
if exist('output_charge_solution.mat', 'file')
load output_charge_solution.mat
end
if exist('output_field_solution.mat', 'file')
load output_field_solution.mat
end
close(h);
LoadTime = toc