This example shows how to calculate the power absorbed in a specific material when there are two (or more) dispersive materials in a simulation and objects are of arbitrary shapes where it would be difficult to define the a spatial filter. This example applied both 2D and 3D cases.
In this example of usr_absorption_advanced_material.fsp a silver particle of arbitrary shape is embedded in a silicon substrate. Suppose we are interested in the power absorbed in the silver particle.
The advanced absorbed power monitor group returns the power absorbed as a function of space, ie Pabs(x,y,z). Once the project file is run, executing the usr_absorption_advanced_material.lsf file will multiply Pabs(x,y,z) by 1 if the (x,y,z) values are inside the silver particle and 0 if they are outside.
We can use the material properties of Silicon and Silver to tell if a specific point (x,y,z) lies inside particle or not.
The script, uses the index monitor inside the Pabs box to create the filters by comparing both the real and imaginary parts the index of every point in the simulation to those of Silver and Silicon. The figure below shows the filter generated for Silicon:
Running the script will generate the following plots for total absorption, and absorption spectra in the two materials.
This technique can be extended to 3D simulations as well.