Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Photonics Metalens-Optical Power Reply To: Metalens-Optical Power

Guilin Sun
Ansys Employee

Sorry to reply you late. Somehow your reply is passed without notification.

First, you need to get H field from farfieldexact https://optics.ansys.com/hc/en-us/articles/360034930733-farfieldexact3d-Script-command by following the example. Once you have the field components, the integration is relatively easy. When it is in the xy plane:

Poyn=Ex*conj(Hy)-Ey*conj(Hx);

Pf=0.5*real(integrate(Poyn,[1:2],x,y);

integrate - Script command

You may need to pinch some singuletones: pinch - Script command 

Please try and let me know if you have questions in scripting.

[bingo_chatbox]