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

📄 extend2d.m

📁 AQUILA is a MATLAB toolbox for the one- or twodimensional simulation of %the electronic properties
💻 M
字号:
function b=extend2D(a)

%EXTEND2D extrapolate field in 2D
%
%y=extend2D(a)
%
%extrapolates a property defined between the nodes to values at the nodes
%
%a = field defining the values to be extrapolated (gridsize minus 1 in each direction)
%y = extrapolated field
%the position of the nodes are taken from the global structure definition

%Copyright 1999 Martin Rother
%
%This file is part of AQUILA.
%
%AQUILA is free software; you can redistribute it and/or modify
%it under the terms of the GNU General Public License as published by
%the Free Software Foundation; either version 2 of the License, or
%(at your option) any later version.
%
%AQUILA is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License
%along with AQUILA; if not, write to the Free Software
%Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

global aquila_structure aquila_control

nx=length(aquila_structure.xpos)-2;
ny=length(aquila_structure.ypos)-2;
bv=aquila_structure.boxvol(2:end-1,2:end-1);
b=(((aquila_structure.hy(1:ny)/2)'*(aquila_structure.hx(1:nx)/2)).*a(1:ny,1:nx)+...
   ((aquila_structure.hy(1:ny)/2)'*(aquila_structure.hx(2:nx+1)/2)).*a(1:ny,2:nx+1)+...
   ((aquila_structure.hy(2:ny+1)/2)'*(aquila_structure.hx(1:nx)/2)).*a(2:ny+1,1:nx)+...
   ((aquila_structure.hy(2:ny+1)/2)'*(aquila_structure.hx(2:nx+1)/2)).*a(2:ny+1,2:nx+1))./bv;
bv=(aquila_structure.hy(1:ny)+aquila_structure.hy(2:ny+1))';
b=[(aquila_structure.hy(1:ny)'.*a(1:ny,1)+aquila_structure.hy(2:ny+1)'.*a(2:ny+1,1))./bv b ...
      (aquila_structure.hy(1:ny)'.*a(1:ny,end)+aquila_structure.hy(2:ny+1)'.*a(2:ny+1,end))./bv];
bv=aquila_structure.hx(1:nx)+aquila_structure.hx(2:nx+1);
b=[a(1,1) (aquila_structure.hx(1:nx).*a(1,1:nx)+aquila_structure.hx(2:nx+1).*a(1,2:nx+1))./bv a(1,end);b;...
      a(end,1) (aquila_structure.hx(1:nx).*a(end,1:nx)+aquila_structure.hx(2:nx+1).*a(end,2:nx+1))./bv a(end,end)];
if aquila_control.periodic==1
   b(:,1)=(b(:,1)*aquila_structure.hx(1)+b(:,end)*aquila_structure.hx(end))./...
      (aquila_structure.hx(1)+aquila_structure.hx(end));
   b(:,end)=b(:,1);
end

⌨️ 快捷键说明

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