NP_CALC_SYSTEM_MAT: s_mat= np_calc_system_mat( fwd_model, img) Fwd solver for Nick Polydorides EIDORS3D code s_mat.E = FEM system matrix s_mat.Ela = Normalised volumes of the elements s_mat.D = The sgradients of the shape functions over each element. s_mat.Vols= Normalised volums of the elements s_mat.perm= permutation of system matrix fwd_model = forward model img = image background for system matrix calc
0001 function s_mat= np_calc_system_mat( fwd_model, img) 0002 % NP_CALC_SYSTEM_MAT: s_mat= np_calc_system_mat( fwd_model, img) 0003 % Fwd solver for Nick Polydorides EIDORS3D code 0004 % s_mat.E = FEM system matrix 0005 % s_mat.Ela = Normalised volumes of the elements 0006 % s_mat.D = The sgradients of the shape functions over each element. 0007 % s_mat.Vols= Normalised volums of the elements 0008 % s_mat.perm= permutation of system matrix 0009 % fwd_model = forward model 0010 % img = image background for system matrix calc 0011 0012 % (C) 2005 Andy Adler. License: GPL version 2 or version 3 0013 % $Id: np_calc_system_mat.m 5394 2017-04-12 15:10:30Z aadler $ 0014 0015 warning('EIDORS:deprecated','NP_CALC_SYSTEM_MAT is deprecated as of 07-Jun-2012. Use SYSTEM_MAT_1ST_ORDER instead.'); 0016 0017 if nargin==1 %normally takes one parameter 0018 img = fwd_model; 0019 fwd_model = img.fwd_model; 0020 end 0021 0022 0023 s_mat = eidors_obj('get-cache', {fwd_model, img}, 'np_calc_system_mat'); 0024 0025 if ~isempty(s_mat) 0026 eidors_msg('np_calc_system_mat: using cached value', 3); 0027 return 0028 end 0029 0030 p= np_fwd_parameters( fwd_model ); 0031 0032 %Set the tolerance for the forward solver 0033 tol = 1e-5; 0034 0035 [Eref,D,Ela,ppr] = fem_master_full( p.vtx, p.simp, ... 0036 img.elem_data(:), ... 0037 p.gnd_ind, p.elec, p.zc, p.perm_sym ); 0038 0039 s_mat.E = Eref; 0040 s_mat.Ela = Ela; 0041 s_mat.D = D; 0042 s_mat.Vols = Ela; 0043 s_mat.perm = ppr; 0044 0045 eidors_obj('set-cache', {fwd_model, img}, 'np_system_mat', s_mat); 0046 eidors_msg('np_calc_system_mat: setting cached value', 3);