XIAN-FEM-2026June/三维matlab代码/matlab 3D二阶基+散射边界条件+单周期边界/assembly_rbc.m

17 lines
315 B
Matlab

function solver=assembly_rbc(mesh,solver)
P=speye(solver.dof);
phi=mesh.PBCIndex(:,3)*mesh.PBCphi;
nbrPBC=length(phi);
for i=1:nbrPBC
P(mesh.PBCIndex(i,2),mesh.PBCIndex(i,1))=phi(i);
end
% tempIndex=sort([mesh.PBCIndex(:,2);mesh.origIndex]);
% P(:,tempIndex)=[];
P(:,mesh.PBCIndex(:,2))=[];
solver.P=P;
end