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

📄 gm_bdrycond.m

📁 matlab有限元分析工具,比经较全面的一个手册,请大家下载呀
💻 M
字号:
function bdryval = gm_bdrycond(proc, userdata, points)
%  bdryval = gm_bdrycond(proc, userdata, points)
% This routine computes boundary conditions.  proc is a string
% that defines the function (see the documentation).  points (a zba)
% is the points to evaluate the function at.  This routine
% is usually invoked by gmfem.
% Returns a zba

proc = gm_strim(proc);
if proc(1) ~= '('
  error('boundary-cond procedure must start with a parenthesis')
end
if proc(length(proc)) ~= ')'
  error('Unbalanced parentheses in boundary-cond 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')
  bdryval = zba(str2num(rest) * ones(n,1));
elseif strcmp(first, 'vecformula') 
  formula = gm_percentsub(rest, 'double(points(:,', '))');
  bdryval = zba(eval(formula));
elseif strcmp(first, 'formula')
  formula = gm_percentsub(rest, 'double(points(i,', '))');
  bdryval = zba(-ones(n,1));
  for i = 1 : n
    bdryval(i) = eval(formula);
  end
else
  error('Unknown boundary-condition 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 + -