Topics related to Lumerical and more

export of refractive index profile into array of specific size

    • Nirvan Gajadharsingh


      I have found the eigen modes for my ridge waveguide geometry, and now I want to integrate the electric field over the entire profile to get the total electric flux outside the waveguide expressed as a ratio to the total electric flux in the entire simulation domain. This is expressed as: 

      ∫ExEzdxdz (air) / ∫ExEzdxdz(total)

      I can perform this integration easily in python using the pinch command to grab the 2D data and placing it into an array. I would now like to specify boundaries over the simulation domain to just integrate the E-field contained in air. From the picture attached, you can see the 3 regions of the simulation domain, air in dark blue, LibNO3 in red and glass in sky blue.

      1)How can I export the refractive index information into an array which has the same dimensions as that of the array used to store the fields Ex, Ey or Ez. This way all points associated with air has the refractive index 1, all points associated with LibNO3 and glass have the corresponding refractive index associated with that point.

      2)Can this be done directly in lumerical without using python or matlab? If yes what commands will be useful


    • Guilin Sun
      Ansys Employee

      A1: Unfortunately FDE cannot output the refractive index profile. You may file a feature request by referring this post: 

      New Feature vote:   Vote new features, and file your feature request

      A2: you can either directly calcualte the integration by specifying the region in GUI:

      or you can use script:





      You specify the coordinates of the region.

      setanalysis("integration shape","rectangular");



      area=getanalysis("fraction integrated");


      You can do a loop or two region integration to get the ratio.

    • Nirvan Gajadharsingh



      Thanks, that does help but on my version of Lumerical Mode there are only 2 geometries available for use with the integrate function, rectangular and circular, neither of these allows me to select the profile shape accurately along the air/LbNO3 boundary of my ridge waveguide(ridge is at an angle). Is there another way to get this done? I used a rectangle and a polygon to build my structure and the integrate "solid" specification is not available.

    • Guilin Sun
      Ansys Employee

      You can either use the "rectangular", or export the data, use whatever the window function you want and do the integration. you can use script:




      H1 = getresult( "mode1", "H" );






      then you can use a window function to further process the data.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.