getinitval.m

来自「解决麦克斯韦的matlab源文件」· M 代码 · 共 28 行

M
28
字号
function [nv,ev] = getinitval(mesh,vectfld)% get interpolant of initial vectorfield E0%% mesh -> 2D unstructured mesh% vectfld -> string designating the routine providing the initial vectorfield% % Results:% nv -> column vector of length #of active vertices% ev -> column vector of length #of active vertices%% Plain nodal interpolation for vertex based elementsv_vals = p1_interpolate(vectfld,mesh);n_act = Nactidx(mesh);nv = v_vals(n_act);% Interpolation + projection for edge elementse_vals = ed_interpolate(vectfld,mesh);e_act = Eactidx(mesh);ev = e_vals(e_act);G_all = Gradmat(mesh);v_act = Vactidx(mesh);G = G_all(e_act,v_act);ev = ev - G*((G'*G)\(G'*ev));

⌨️ 快捷键说明

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