calc_system_mat

PURPOSE ^

CALC_SYSTEM_MAT: calculate FEM system matrix from fwd_model and image

SYNOPSIS ^

function system_mat = calc_system_mat( fwd_model, img)

DESCRIPTION ^

 CALC_SYSTEM_MAT: calculate FEM system matrix from fwd_model and image
 
    system_mat= calc_system_mat( fwd_model, image)
 OR
    system_mat= calc_system_mat( image)

 it will call the fwd_model.solve

 system_mat  
   system_mat.E    is FEM system_matrix
   system_mat.perm is permutation of E  i.e. E(perm,perm)
 fwd_model is a fwd_model structure
 image     is an image structure

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function system_mat = calc_system_mat( fwd_model, img)
0002 % CALC_SYSTEM_MAT: calculate FEM system matrix from fwd_model and image
0003 %
0004 %    system_mat= calc_system_mat( fwd_model, image)
0005 % OR
0006 %    system_mat= calc_system_mat( image)
0007 %
0008 % it will call the fwd_model.solve
0009 %
0010 % system_mat
0011 %   system_mat.E    is FEM system_matrix
0012 %   system_mat.perm is permutation of E  i.e. E(perm,perm)
0013 % fwd_model is a fwd_model structure
0014 % image     is an image structure
0015 
0016 % (C) 2005 Andy Adler. License: GPL version 2 or version 3
0017 % $Id: calc_system_mat.html 2819 2011-09-07 16:43:11Z aadler $
0018 
0019 if nargin==1
0020    img = fwd_model;
0021    fwd_model = img.fwd_model;
0022 end
0023 
0024 cache_obj= {fwd_model, img.elem_data};
0025 system_mat= eidors_obj('get-cache', cache_obj, 'system_mat');
0026 if ~isempty(system_mat)
0027    eidors_msg('system_mat: using cached value', 3);
0028    return
0029 end
0030 
0031 system_mat= feval(fwd_model.system_mat, fwd_model, img);
0032 
0033 eidors_obj('set-cache', cache_obj, 'system_mat', system_mat);
0034 eidors_msg('calc_system_mat: setting cached value', 3);
0035

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