⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gm_conductivity.m

📁 matlab有限元分析工具,比经较全面的一个手册,请大家下载呀
💻 M
字号:
function conducval = gm_conductivity(proc, userdata, points)
%% conducval = gm_conductivity(proc, userdata, points)
%% called by gmfem to evaluated conductivity function
%% see the documentation.
%% Last argument is a zba of coordinates.
%% Should return a zba.

proc = gm_strim(proc);
if proc(1) ~= '('
  error('conductivity procedure must start with a parenthesis')
end
if proc(length(proc)) ~= ')'
  error('Unbalanced parentheses in conductivity procedure');
end

proc(1) = ' ';
proc(length(proc)) = ' ';
proc = gm_strim(proc);
[first, rest] = strtok(proc);
first = gm_strim(first);
rest = gm_strim(rest);
[n,di] = size(points);
if strcmp(first, 'const')
  conducval = zba(str2num(rest) * ones(n,1));
elseif strcmp(first, 'vecformula') 
  formula = gm_percentsub(rest, 'double(points(:,', '))');
  conducval = zba(eval(formula));
elseif strcmp(first, 'formula')
  formula = gm_percentsub(rest, 'double(points(i,', '))');
  conducval = zba(-ones(n,1));
  for i = 0 : n - 1
    conducval(i) = eval(formula);
  end
else
  error('Unknown conductivity keyword');
end


% ------------------------------------------------------------------
% Copyright (c) 1998 by Cornell University.  All rights reserved.
% See the accompanying file 'Copyright' for authorship information,
% the terms of the license governing this software, and disclaimers
% concerning this software.
% ------------------------------------------------------------------
% This file is part of the QMG software.  
% Version 2.0 of QMG, release date RELDATE
% ------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -