Guilin Sun
Ansys Employee
In this case, you have a clear definition. SO what you can do is to get the monitor data for the Poynting Vector from the monitor on the focus plane, extract the Poynting vector along the propagation axis, and then integrate only the part inside FWHM. To simplify your script, you can create a window function (Suppose you have Pz):

Define

Xr and Yr as half of the FWHM in xy, and then

X=meshgridx(x,y);

Y=meshgridy(x,y);

windows=X*0;

window=( (X>-Xr)*(X-Yr)*(Y
image(x,y,window);

So you get the window to filter only the interested area.

Suppose you have Pz, Then

PowerZ=0.5*integrate(Pz*window,x,y,1:2);

Efficiency=PowerZ/sourcepower(f)

where f is the frequency.

Please refer this tested script:

clear;

f=getdata("monitor","f");

E=getresult("monitor","E");

Pz=pinch(getdata("monitor","Pz"));

x=E.x;

y=E.y;

Xr=Yr=FWHM/2;

X=meshgridx(x,y);

Y=meshgridy(x,y);

window=( (X>-Xr)*(X-Yr)*(Y
image(x,y,window);

PowerZ=real(0.5*integrate(Pz*window,1:2,x,y));

Efficiency=PowerZ/sourcepower(f);

This uses the power ratio. I am not sure how do you get the energy ratio and if it is meaningful. Please refer Ansys Insight: 光学强度、功率、电场强度平方的关系以及电磁能量