Guilin Sun
Ansys Employee
我测试发现单波长是工作的,但是对于多波长,即使网上的例子,也不工作。
数据是有的,很可能是Dataset有问题,我把它改为矢量Dataset,是工作的,当然坐标不对,你知道就可以了:
clear;closeall;
ux=getdata("far_field_change_index","ux");
uy=getdata("far_field_change_index","uy");
f=getdata("far_field_change_index","f");
E2far1=getdata("far_field_change_index","E2far1");
E2far2=getdata("far_field_change_index","E2far2");
ux2=getdata("far_field_change_index","ux2");
uy2=getdata("far_field_change_index","uy2");
E2far2=interp(E2far2,ux2,uy2,f,ux,uy,f);
E2 = matrixdataset("E2");
E2.addparameter("ux",ux);
E2.addparameter("uy",uy);
E2.addparameter("lambda",c/f(1),"f",f(1));
E2.addattribute("E2far1",E2far1(:,:,1));
E2.addattribute("E2far2",E2far2(:,:,1));
visualize(E2);
visualize(E2far1);
visualize(E2far2);

E=getresult("far_field_change_index::field","E");
E1= matrixdataset("E");
E1.addparameter("ux",E.x);
E1.addparameter("uy",E.y);
E1.addparameter("uz",E.z);
E1.addparameter("lambda",c/f,"f",f);
E1.addattribute("Ex1",E.Ex);
visualize(E1);

uz=0;
E2far10=matrix(201,201,1,30);
for(n=1:201){
for(m=1:201){
E2far10(n,m,1,:)=E2far1(n,m,:);

}}
x=ux;
y=uy;
z=uz;
Efar2=rectilineardataset("Efar2",x,y,z);
Efar2.addparameter("lambda",c/f,"f",f);
Efar2.addattribute("E2far",E2far10);
# Efar2.addattribute("E2far2",E2far20);
visualize(Efar2);
需要输出