lymph
ImportLymphPaths.m
Go to the documentation of this file.
1 %% Check if lymph is running on the online version of Matlab or on an installed
2 %% app (if so, clear the path)
3 if ~strcmp(matlabroot, '/MATLAB')
4  restoredefaultpath;
5 end
6 
7 %% Import the necessary lymph paths for the problem resolution and print lymph header
8 
9 % LymphFolder is the parent of the one containing this file
10 % (LymphFolder/Physics/ImportLymphPaths.m)
11 [LymphFolder, ~, ~] = fileparts(fileparts(mfilename('fullpath')));
12 PathCore = fullfile(LymphFolder,'Core');
13 
14 % Check if Polymesher is available and possibly download it.
15 PathPolymesher = fullfile(PathCore,'/MeshGeneration/PolyMesh/Polymesher');
16 PathOriginalPolyMesher = fullfile(PathPolymesher, 'SMO_12_PolyMesher_matlabcode_v1.1');
17 if ~exist(PathOriginalPolyMesher, 'dir')
18  currentPath = pwd;
19  cd(PathPolymesher);
20 
21  % Download and extract the original PolyMesher code - version 1.1
22  websave(strcat(PathOriginalPolyMesher,'.zip'),'http://paulino.princeton.edu/journal_papers/2012/SMO_12_PolyMesher_matlabcode_v1.1.zip');
23  unzip(strcat(PathOriginalPolyMesher,'.zip'), PathOriginalPolyMesher);
24  delete(strcat(PathOriginalPolyMesher,'.zip'));
25 
26  % Delete original version of PolyMesher.m: lymph has its own modified implementation.
27  delete(fullfile(PathOriginalPolyMesher, 'PolyMesher', 'PolyMesher.m'));
28 
29  cd(currentPath);
30 end
31 
32 addpath(genpath(PathCore));
function PolyMesher(in Domain, in NElem, in MaxIter, in P)