	Angled Facet
      ----------------

Introduction
------------

This example shows how to find the optimum placement for an angled mirror at a waveguide bend. This is done using the FIMMPROP Scanner. This is a Quasi-2D propagation in X/Z. The device is represented by a FIMMPROP Layout node that is generated by the script AngledFacet.py. 

* Start FIMMWAVE
* Open the project: AngledFacet.prj

The project consists of two FIMMPROP Layout Nodes; Layout_start, and Layout_end. These are the start and end devices for the FIMMPROP Scanner:

* From the list of components on the main panel of FIMMWAVE, select the FIMMPROP Scanner.

* select the Edit button for both the start and end devices of the scan, it should be obvious that this project has been set up to determine the maximum transmission as a function of the penetration of the angled mirror into the waveguide at the bends.

* To define the model accurately we need to discretise it into a large number of sections with uniform cross sections so that the shape is retained accurately. On the toolbar of either Layout Node select the "Show/Hide Calc data" button. The structure you now see is the discretised structure that is modelled internally by the program. If you wish to view or change the discretised options then: Layout Solver Options/Edit Solver Parms/Generator Options

* To plot the field of either of the start or end devices, click on the "View field profile" button on the Layout Node toolbar. After a few minutes the field plot will appear, it is obvious that neither the start or end configuration have high transmission. Notice that at the boundary edges we have NOT used an absorbing layer (PML)- the light escaping the waveguide does not disappear from the calculation but is reflected. In some models this will spuriously effect the results, however in this case the optimum configuration will be obvious even with these spurious reflections. Thus we are able to use the Real Eff. Inx. Solver which is slightly quicker than its Complex counterpart.

The FIMMPROP Scanner can be set up to perform a scan of the transmission as a function of the fraction that the angled facet penetrates into the waveguide.

* Select Scan\Start from the FIMMPROP Scanner panel
* When the mode coefficients panel appears, remove all the second item in the Plot list.
* Press Ok. The scan will now start.

The scan will take around 40 minutes depending on processor speed. (However you may stop the scan and plot the results at any time by pressing the "kill" button)

You should be able to see a peak for the configuration with a MirrorFrac of around 0.5. Plotting the field at this point can be done one of two ways: 

1) On the Scanner Node select Edit/Intermediate device. Enter the optimum MirrorFrac for this node and a name for the new device to be created. Plot the field of this device by clicking on the "View Field Profile" button on the toolbar.

2) From the Fimmwave Main Window select Scripts/run a script/ AngledFacet.py. Enter the mirrorfrac and a name for the new project file. Plot the field of this device by clicking on the "View Field Profile" button on the toolbar.
(Fimmwave needs to be started on port number 101 for the Python script to be able to connect to the program, you will also need to have installed Python version 1.6 or later)
