np_calc_system_mat

PURPOSE ^

NP_CALC_SYSTEM_MAT: s_mat= np_calc_system_mat( fwd_model, img)

SYNOPSIS ^

function s_mat= np_calc_system_mat( fwd_model, img)

DESCRIPTION ^

 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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.html 2819 2011-09-07 16:43:11Z aadler $
0014 
0015 s_mat = eidors_obj('get-cache', fwd_model, 'np_system_mat', img);
0016 
0017 if ~isempty(s_mat)
0018    eidors_msg('np_calc_system_mat: using cached value', 3);
0019    return
0020 end
0021 
0022 p= np_fwd_parameters( fwd_model );
0023 
0024 %Set the tolerance for the forward solver
0025 tol = 1e-5;
0026 
0027 [Eref,D,Ela,ppr] = fem_master_full( p.vtx, p.simp, ...
0028                 img.elem_data(:), ...
0029                 p.gnd_ind, p.elec, p.zc, p.perm_sym );
0030 
0031 s_mat.E     = Eref;
0032 s_mat.Ela   = Ela;
0033 s_mat.D     = D;
0034 s_mat.Vols  = Ela;
0035 s_mat.perm  = ppr;
0036 
0037 eidors_obj('set-cache', fwd_model, 'np_system_mat', s_mat, img);
0038 eidors_msg('np_calc_system_mat: setting cached value', 3);

Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005