rbmatlab 0.10.01
datafunc/diffusivity/diffusivity_homogeneous.m
00001 function diffusivity = diffusivity_homogeneous(glob, U, params)
00002 % function diffusivity = diffusivity_homogeneous(glob, U, params)
00003 %
00004 % function computing the diffusivity pointwise evaluation in the point
00005 % sequences indicated by global coordinates in the columns of the matrix glob.
00006 % It returns a homogeneous diffusion coefficient.
00007 %
00008 % required fields of params:
00009 %       k : scalar scaling factor
00010 %
00011 % generated fields of diffusivity:
00012 %     epsilon: upper bound on diffusivity value
00013 %     K: vector with diffusivity values
00014 
00015 % glob column check
00016 if params.debug
00017   if ~isempty(glob) && size(glob,1) < size(glob,2)
00018     warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
00019     if params.debug > 2
00020       keyboard;
00021     end
00022   end
00023 end
00024 decomp_mode = params.decomp_mode;
00025 diffusivity = [];
00026 diffusivity.epsilon = 0;
00027 
00028 if decomp_mode == 2 % decomp_mode ==2, single component
00029   diffusivity = params.k;
00030 elseif decomp_mode == 0
00031   diffusivity.epsilon = params.k;
00032   diffusivity.K = params.k * ones(length(glob),1);
00033 elseif decomp_mode == 1
00034   d = [];
00035   % single component independent whether k in mu
00036   d.epsilon = params.k;
00037   d.K = ones(length(glob),1);
00038   diffusivity = {d};
00039 else
00040   error('unknown decomp mode');
00041 end;
00042 %| \docupdate 
 All Classes Namespaces Files Functions Variables