# Vector plot

#1

Dear Lumerical team,
I am using lumerical mode for generating modes in fiber and waveguide. My query is when I am plotting vector plot and editing plot settings such nx,ny (increasing nx, ny), the vector plot is diapering… But in the last year version I plotted by using the same method so many vector plots but this time I am facing problem in creating the vector plots any advance feature in the latest version.

kindly let me how to do this

with advance thanks

Down sample problem
#2

Dear @Nanda

Sorry for any inconvenience. This has been reported by another user and it is a bug in the new release and our team is looking into it.

Thank you for your patience.

#3

thank you bkhanaliloo.

#4

Dear bkhanaliloo,
I have updated the latest version 2017-03-03 and in that also the same vector plot problem is coming can you kindly let me any help

With advance thanks

#5

Dear @Nanda

I am sorry to say that unfortunately it has not been resolved yet. I am asking our developers to give this a priority.

I am very sorry for the inconvenience.

Vector plot for circular polarization
#6

Thank you and I am looking for your next update soon…

#7

Hi @Nanda,

I think I came up with a workaround that should solve the problem momentarily. If you are using a 3D monitor, you can use vectorplot command, and set the resolution based on down sampling parameter:

# Specify the resolution of the plot (change their value based on downsampling parameters)
res_x=20;   #(you can choose any value)
res_y=20;
res_z=20;

Ex=getdata("monitor","Ex");
Ey=getdata("monitor","Ey");
Ez=getdata("monitor","Ez");

x=getdata("monitor","x");
y=getdata("monitor","y");
z=getdata("monitor","z");

# Choose a frequency point ( the first one )
Ex=pinch(Ex,4,1);
Ey=pinch(Ey,4,1);
Ez=pinch(Ez,4,1);

# Define uniform vectors
x2=linspace(x(1),x(length(x)),res_x);
y2=linspace(y(1),y(length(y)),res_y);
z2=linspace(z(1),z(length(z)),res_z);

xmesh = meshgrid3dx(x2,y2,z2);
ymesh = meshgrid3dy(x2,y2,z2);
zmesh = meshgrid3dz(x2,y2,z2);

# Interpolate fields on new uniform vectors
Ex=interp(Ex, x, y, z, x2, y2, z2);
Ey=interp(Ey, x, y, z, x2, y2, z2);
Ez=interp(Ez, x, y, z, x2, y2, z2);

E = rectilineardataset("E",x2,y2,z2);
E.addattribute("E",Ex,Ey,Ez);
vectorplot(E);


Vectorplot_test.fsp (274.3 KB)

Sorry that this is not very convenient, but hopefully will be of a help.

Thanks

#8

Dear bkhanaliloo
I have started the script for my file. my file is 2d file (x, y coordinates) (I am using Lumerical MODE solutions).
(1)First I removed z values from the script and I run the file I got the error such as "Try the command ‘?getdata;’ to see which d-cards are available."
for that I run the file and select the mode to dcard and changed name to monitor. (let me the procedure is correct?)
(2)I also changed meshgrid3dx to meshgridx
(3) next by running I got another error such as "Ex=interp(Ex, x, y, x2, y2);"the first argument of 2D interp must be a 2D matrix. I guess that Ex it is not the 2D matrix.
kindly let me

    # Specify the resolution of the plot (change their value based on down sampling parameters)
res_x=20;   #(you can choose any value)
res_y=20;
#res_z=20;

Ex=getdata("monitor","Ex");
Ey=getdata("monitor","Ey");
#Ez=getdata("monitor","Ez");

x=getdata("monitor","x");
y=getdata("monitor","y");
#z=getdata("monitor","z");

# Choose a frequency point ( the first one )
Ex=pinch(Ex,4,1);
Ey=pinch(Ey,4,1);
#Ez=pinch(Ez,4,1);

# Define uniform vectors
x2=linspace(x(1),x(length(x)),res_x);
y2=linspace(y(1),y(length(y)),res_y);
#z2=linspace(z(1),z(length(z)),res_z);

xmesh = meshgridx(x2,y2);
ymesh = meshgridy(x2,y2);
#zmesh = meshgrid3dz(x2,y2,z2);

# Interpolate fields on new uniform vectors
Ex=interp(Ex, x, y, x2, y2);
Ey=interp(Ey, x, y, x2, y2);
#Ez=interp(Ez, x, y, z, x2, y2, z2);

E = rectilineardataset("E",x2,y2);
E.addattribute("E",Ex,Ey);
vectorplot(E);


kindly let me for 2d and I will try for my file, actually I want to see more than 15 modes data

with many many thanks

#9

Dear @Nanda

The script I provided above should work for 2D FDTD simulations by simply setting res_z=1 (and for 2D monitors). For MODE simulations, this should just do the work for you:

clear;

num_modes = 2; # number of modes to export data for

for(i=1:num_modes){ # loop through num
findmodes;
E=getresult("FDE::data::mode"+num2str(i),"E");

# Specify the resolution of the plot (change their value based on downsampling parameters)
res_x=20;   #(you can choose any value)
res_y=20;

Ex=pinch(E.Ex);
Ey=pinch(E.Ey);
Ez=pinch(E.Ez);

x=E.x;
y=E.y;
z=E.z;

# Define uniform vectors
x2=linspace(x(1),x(length(x)),res_x);
y2=linspace(y(1),y(length(y)),res_y);
z2=z;

xmesh = meshgridx(x2,y2);
ymesh = meshgridy(x2,y2);
#zmesh = meshgrid3dz(x2,y2,z2);

# Interpolate fields on new uniform vectors
Ex=interp(Ex, x, y, x2, y2);
Ey=interp(Ey, x, y, x2, y2);
Ez=interp(Ez, x, y, x2, y2);

E = rectilineardataset("E",x2,y2,z2);
E.addattribute("E",Ex,Ey,Ez);
vectorplot(E);
}
`

I noticed that you have also a similar post that one of my colleagues is working with you, and might be a good idea for other users to take a look at as well.

Thanks

#10

hi bkhanaliloo, yes I received good script from nlui and we can save in in matlab for many modes at a time.
Anyhow thank you for your support bkhanaliloo and I will try your script also.
with many many thanks

#11

Dear @Nanda

Thank you for your patience.

This bug is fixed in the latest Beta release and is available for download. There might be some other visualizer bugs (in the beta version) which we are still working to fix them. A more stable version will be ready in the upcoming weeks.

We had a great push on fixing many reported bugs, thanks to our R&D and developers.

Thanks