Dear @jbwei

Thank you for reaching out.

Before I answer the question, let’s see where we used *fiber analysis*. If you chosee model from object tree and click on the edit button under Analysis-> variables you will see two Parameters: *output* and *fiber analysis* and on the Results section we have S, T, and T-avg and under Analysis->Script we have this script:

```
T = getresult("waveguide","expansion for T");
?T;
Tfund = -T.getattribute("T_backward");
lambda = T.lambda;
?T_avg = integrate(Tfund,1,lambda)/integrate(matrix(length(lambda))+1,1,lambda);
if(!%fiber analysis%) {
break;
}
if(havedata("fiber::top")) { # fiber turned on
fiber = getresult("fiber::fiber modes","expansion for top");
}
S = matrixdataset;
S.addparameter("lambda",T.lambda,"f",T.f);
if(output) {
S22 = T.b/T.a;
S12 = fiber.a*sqrt(fiber.N)/(T.a*sqrt(T.N));
S.addattribute("S22",S22);
S.addattribute("S12",S12);
} else {
S11 = fiber.a/fiber.b;
S21 = (T.b*sqrt(T.N))/(fiber.b*sqrt(fiber.N));
S.addattribute("S11",S11);
S.addattribute("S21",S21);
}
```

In the script, you can see how we defined T, T-avg and S as well as two parameters (*fiber analysis* and *output*). When you set *fiber analysis* to *0*, the calculations will stop at line 8, and it won’t calculate the S parameters. For the sweeping purposes, since we are only interested to get the T-avg data not the S parameters, we ask the simulation to set this parameter to zero every time to speed up the sweep. Set this value to 0 and run the simulation, if you try to calculate S by clicking on the model-> Result View window, it will return a message box of “Failed to calculate results!”. However, it will give you the results if it is set to 1. I hope this clarifies the purpose of having the parameter.

The *output* is used in parameter-extraction-2D.lsf script file since we are dealing with two cases *fiber in* or *waveguide in* and bases on output value (1 or 0), it will calculate the S parameter differently.

Regarding your second question, every material has a mesh order which defines the ordering of devices in your geometry. You can read more about it here. If you want to see which geometries you are simulating, you can use a Refractive Index monitor which will give you a colour plot bases on the material refractive index. So, to summarize, even if it looks like it is crossing the geometry, in simulation it is ignored because of high mesh order.

Best of luck using Lumerical!