Guide

Structure Configuration

Structural modeling, layer stacks, and validation

Structure is the structural modeling page in Dreapex TMM. It defines the incidence medium, the optical stack itself, and the transmission medium. This page determines the object to be solved; if the structure is invalid, Run, Run Sweep, and Run Optimizer may still be visible, but the model will not produce a usable result.

This chapter defines a practical method for building valid thin-film models. It covers top-level stack editing, refractive-index models, Layer Group, surrounding media, and structure validation.

Page Structure and Setup Order

The Structure page contains four functional regions:

RegionMain contentEngineering role
Page toolbarAdd, Insert, Duplicate, Reverse, Move, Delete, RI Status, Table / 3DManage top-level structure elements, RI database status, and view mode
Incidence-medium panelIncidence MediumDefine the incoming boundary condition
Structure tableTop-level layers, groups, and parameter editorsDefine the optical stack itself
Transmission-medium panelTransmission MediumDefine the outgoing boundary condition

The footer status bar updates continuously while you edit. The correct editing rhythm is: make one round of changes, then check the footer once, rather than making many changes and debugging them only at the end.

Structure setup order:

  1. Confirm Incidence Medium first.
  2. Edit normal layers or create a Layer Group.
  3. Adjust the stack order if needed.
  4. Configure Transmission Medium last.
  5. Move to Optics only after the footer status returns to passed.

This order reduces rework because index models, incoherent settings, surrounding-medium absorption rules, and layer order all interact.

Top-Level Editing: Toolbar and Structure Table

The page toolbar only controls the top-level structure table. It does not control the internal table inside the Layer Group dialog.

ControlPurposeRequirementPractical recommendation
AddAppend a normal layer to the endParameters must not be lockedUse it to extend the stack
Add > Layer GroupAppend a layer group to the endParameters must not be lockedUse it for periodic units or repeated blocks
InsertInsert a normal layer after the selected rowA row must be selectedUse it when adding a transition layer at a specific position
Insert > Layer GroupInsert a layer group after the selected rowA row must be selectedUse it when inserting a periodic block mid-stack
DuplicateCopy the selected rowA row must be selectedUse it to reuse similar settings quickly
ReverseReverse the top-level orderThe top-level structure must be non-emptyUseful for checking reversed incidence order
Move Up / Move DownMove the selected row by one positionA row must be selectedUse it for fine ordering changes
DeleteRemove the selected rowA row must be selectedConfirm that the selected row is the intended top-level target
Table / 3DSwitch between table and 3D viewPage must be editableUse 3D to inspect order; keep table view as the main editing mode

If Insert, Duplicate, Move Up, Move Down, or Delete is disabled, the first thing to check is whether the target row is selected.

Click the 3D button in the toolbar to switch to 3D visualization. The 3D view provides camera presets (Front/Isometric/Dimetric/Trimetric), shape (Square/Circle), display options (Lighting/Names/Thickness/Incident Ray/Explode), and image export.

Each row in the structure table is one top-level structure element. A row can be either a normal Layer or a Layer Group. The key columns are:

ColumnMeaningKey rule
CheckboxEnable or disable the top-level element in the current calculationAt least 1 top-level element must remain enabled
TypeIndicates whether the row is a Layer or GroupRead-only; used only for identification
NameName of the top-level elementRequired; top-level names must be unique
Thickness / RepeatThickness for normal layers; repeat count for groupsThickness must be > 0; repeat count must be a positive integer
Refractive IndexNormal layers show the index model; groups show Edit Layer GroupGroup internals must be edited in the dialog
Parameter editorChanges with the current index modelParameters must match the chosen model
TransparencyTransparency flag for a normal layerAvailable only for normal layers
IncoherentIncoherent flag for a normal layerAvailable only for normal layers and restricted with birefringence
DeleteDelete the current top-level rowRemoves the top-level element, not an internal group layer

In practical use, the structure table is governed by four rules that matter most:

  1. Not all top-level elements may be disabled.
  2. Top-level names must be unique; duplicated rows should be renamed immediately.
  3. Normal-layer thickness must be strictly greater than 0; if a layer should be excluded temporarily, disable it instead of setting thickness to 0.
  4. Incoherent applies only to normal layers; once enabled, that layer should not be configured as a birefringent material.

Transparency can be used to express the intended modeling role of a layer, but it does not replace physical material parameters. A transparent layer still requires valid refractive-index inputs.

Refractive-Index Model Selection

For normal layers, the parameter editor changes with the selected refractive-index model. Choosing the correct model is one of the central structural decisions on this page.

ModelSuitable useRequired parametersKey restriction
ConstantConstant-index approximation, concept checks, rapid prototypingn, kn > 0, k >= 0
Const. BirefringenceConstant birefringent approximation, anisotropic sensitivity studiesno, ko, ne, keAll four values must be valid; cannot be combined with incoherent mode
FileReal wavelength-dependent material dataA file or a database materialFile contents must be consistent with the selected material type

For most work, the correct choice can be made as follows:

  1. For concept checks or rapid reference models, start with Constant.
  2. For anisotropic studies without external data, use Const. Birefringence.
  3. For realistic dispersion, use File.

When switching to Const. Birefringence, the parameter area expands from two inputs to four. This is the clearest visual indicator that the index model changed.

In File mode, the editor exposes six controls:

ControlPurpose
Upload (paperclip icon)Upload a local .nk / .txt refractive-index file
DatabaseOpen the refractive-index database dialog
Clear (trash icon)Clear the current refractive-index file (requires confirmation)
File name displayRead-only; shows the name of the currently loaded file
Preview (magnifying-glass icon)Open the refractive-index chart preview dialog
InterpolationSelect interpolation method: Linear / PCHIP / Cubic Spline

The recommended sequence is fixed: check the database first, import a local file only if needed, preview the curve before continuing, and clear the current file before replacing it.

Layer Group: Periodic Structure Modeling

When the stack contains a repeated unit, Layer Group should be used instead of manually duplicating a large number of normal layers. Typical examples are DBRs, repeated bilayers, and periodic functional units.

There are two entry points:

  1. Add > Layer Group: append a group to the end of the top-level stack.
  2. Insert > Layer Group: insert a group after the currently selected top-level row.

The editor is identical in both cases; only the insertion position changes.

The dialog can be divided into four parts:

AreaContentFunction
Basic informationName, Repeat Count, DescriptionDefine the identity and multiplicity of the group
Internal toolbarAdd, Insert, Duplicate, Reverse, move, deleteManage internal sub-layers
Internal tableNames, thicknesses, index models, and parameters of sub-layersDefine one repeated unit
Preview summaryInternal layer count, repeated total layer count, total thicknessQuickly assess group scale

The most important rules for a group are:

FieldRuleEngineering recommendation
NameRequired; as a top-level element it must not duplicate another top-level nameUse a structural name such as DBR Pair
Repeat CountMust be a positive integerValidate with a small value first, then increase
DescriptionOptionalUse it to record the design purpose or periodic meaning

One implementation detail must be remembered clearly:

  1. Inside the Layer Group dialog, the Repeat Count control is limited to 1-100 by the UI.
  2. After returning to the top-level structure table, the repeat count can be increased further to 1-1000.
  3. The underlying validation logic accepts positive integers in the range 1-1000.

Therefore, if the target repeat count is above 100, the correct procedure is to create the group first and then increase the repeat count from the top-level table.

Internal editing behaves like top-level editing, but only within the current group. Internal sub-layers must still satisfy the same core rules: non-empty names, names unique within the group, thickness greater than 0, and parameters consistent with the selected index model.

Three differences matter in practice:

  1. Internal sub-layers expose Transparency, but not Incoherent.
  2. Internal reordering changes only the current group, not the top-level stack order.
  3. Changes are written back only when Save is clicked; Cancel discards the current dialog edits.

If coherent/incoherent switching is expected to happen often, normal top-level layers are usually a better choice than putting those layers inside a Layer Group.

Surrounding-Medium Configuration

The Structure page provides Incidence Medium above the stack and Transmission Medium below it. These are boundary conditions for the stack, not layers inside the stack.

Both panels share the same baseline rules:

  1. The name cannot be empty.
  2. Only Constant and File are supported as index models.
  3. Birefringent constant mode is not supported for surrounding media.
  4. Birefringent refractive-index files are also not supported for surrounding media.

The practical differences are:

ItemIncidence MediumTransmission Medium
Physical roleDefines the incoming boundary conditionDefines the outgoing boundary condition
Editable fieldsName, Index Type, n, or a file input blockName, Index Type, n, k, or a file input block
Absorption ruleMust remain non-absorbing, effectively k = 0May be non-absorbing or absorbing
Database usageNot the main database entry pointCan use the refractive-index database directly in File mode

The most important engineering restriction is that the incidence medium must remain non-absorbing. Even in file mode, every value in the imported k column must remain 0, otherwise validation fails.

The transmission medium is the natural place to model substrates or output media. In constant mode it accepts an explicit k; in file mode it can load a material directly from the refractive-index database. Absorbing substrates and lossy output media should therefore usually be modeled on the transmission side.

Refractive-Index Database

When a normal layer or a surrounding medium uses File mode, the Database button opens the refractiveindex.info Database dialog, which provides access to the built-in refractive-index material catalog.

Dialog Layout

The dialog is divided into two panels:

RegionContentPurpose
Left panelMaterial tree browser (Shelf > Book > Material hierarchy) or search result listLocate materials by category or search
Right panelSelected Material metadata + refractive-index curve previewVerify material identity and curve shape before applying

The search bar at the top accepts material names, materialId values, or database source paths. Press Enter to jump directly to the matched material and load its preview.

Material Metadata

After selecting a material, the right panel displays:

FieldMeaning
Material IDUnique identifier in the database
VersionMaterial data version number
Ordinary PathDatabase path for the ordinary-ray data
Extraordinary PathDatabase path for the extraordinary-ray data (shown only for birefringent materials)

Selection Workflow

  1. Expand Shelf > Book > Material in the left-panel tree, or type a keyword in the search bar and press Enter.
  2. Click a material entry; the right panel loads the refractive-index curve preview automatically.
  3. Verify the metadata and curve, then click Confirm to apply the material to the current layer or surrounding medium.
  4. To cancel, click Cancel or close the dialog.

After confirmation, the layer row shows the material file name. The chart preview dialog will display a Linked to Database tag, indicating that the current data originates from the database.

For rapid iteration, use the database first; switch to local file upload only when a fully controlled dataset is required.

Interpolation Method

When a layer or surrounding medium uses File mode, an Interpolation dropdown appears at the end of the layer row. It controls how refractive-index data are interpolated between data points.

OptionDescription
LinearLinear interpolation (default)
PCHIPPiecewise Cubic Hermite Interpolating Polynomial; preserves monotonicity
Cubic SplineCubic spline interpolation; smoother curves but may overshoot

Before running, the software checks for layers and surrounding media still using Linear interpolation and recommends switching to PCHIP. With sparse data points, Linear interpolation may produce insufficiently smooth refractive-index curves that affect calculation accuracy.

RI Status Check

The RI Status button in the page toolbar checks whether all database-linked layers have up-to-date refractive-index data.

Check Workflow

Clicking RI Status compares each database-linked layer against the remote database version. A toast message displays one of three states:

StateDisplay
CheckingSpinner icon + "Checking N database-linked layer(s)..."
All up to dateGreen check icon + "All RI data is already up to date"
Updates foundPer-layer action table showing Reason (updated or missing), version info, source, and Refresh / Detach buttons

When updates are found, each row in the action table corresponds to a layer that requires attention:

  • updated: A newer version exists in the database; click Refresh to update.
  • missing: The material no longer exists in the latest database; only Detach is available to remove the database link.

Bulk Operations

The dropdown menu next to the RI Status button provides two bulk operations:

Menu itemEffect
Refresh RI from Database for All LayersUpdate refractive-index data from the database for all linked layers at once
Detach RI Database Link for All LayersRemove database links from all layers at once, keeping the currently loaded data
Detach removes the database link but does not delete the loaded refractive-index data. After detaching, the layer's RI data becomes a standalone file and no longer tracks database versions.

Chart Preview Dialog

Click the Preview button (magnifying-glass icon) on a layer row or surrounding medium to open the refractive-index chart preview dialog.

The dialog contains:

SectionContent
Chart arean/k refractive-index curves for the current material
Description areaEditable material description text
Export buttonsExport TXT, Export CSV
Database info sectionShown only for database-linked materials: Linked to Database tag + Material ID / Version / Ordinary Path / Source
Database action buttonsRefresh From Database, Detach Database Link

The chart area displays n/k refractive-index curves as a function of wavelength, allowing a quick visual check that the dispersion profile matches expectations.

For database-linked materials, the dialog footer shows a Linked to Database tag along with Refresh From Database and Detach Database Link buttons for managing the database synchronization state.

Wavelength Coverage Check

Before running a calculation (Run, Run Sweep, Run Optimizer), the software automatically verifies that the refractive-index data wavelength range of every File-mode layer and surrounding medium covers the configured wavelength sampling range.

If any layer's RI data does not fully cover the requested wavelength sampling range, the run is blocked. The error message identifies the layer name, the data coverage range, and the requested range.

When wavelength coverage is insufficient, there are two corrective actions: change the refractive-index material to one with a wider wavelength range, or reduce the wavelength sampling range in the Optics page.

Structural Validation

The most common structural failures can be reduced to the following cases:

ProblemTypical symptomCorrective action
No active top-level elementValidation fails after all rows are uncheckedKeep at least 1 top-level layer or group enabled
Duplicate namesValidation fails immediately after duplication or reports duplicate namesCheck top-level names first; if a Layer Group is involved, check internal names as well
Zero or negative thicknessA normal layer or an internal group layer cannot pass validationSet thickness to a value greater than 0; use disable instead of 0 for temporary exclusion
Incoherent and birefringence conflictValidation fails after enabling Incoherent and then choosing a birefringent modelKeep only one: either use an incoherent non-birefringent layer, or disable incoherent mode before using birefringence
Absorbing incidence-medium fileValidation fails after switching the incidence medium to file modeInspect the file and ensure the k column remains identically 0

Before leaving this page, the correct structural self-check is:

  1. At least 1 top-level element is enabled.
  2. Top-level names are unique.
  3. Every thickness value is greater than 0.
  4. Each normal layer uses parameters consistent with its current index model.
  5. Both surrounding media satisfy the naming, type, and absorption constraints.
  6. The footer validation status has returned to passed.

Baseline Modeling Procedure

To build a standard “air / single film / substrate” model, use the following sequence:

  1. Keep Incidence Medium as a non-absorbing constant medium.
  2. Edit the default normal layer by setting its name, thickness, and refractive-index model.
  3. If realistic dispersion is required, switch that layer to File mode and load a database material.
  4. Configure the substrate in Transmission Medium; if the substrate is absorbing, define k there.
  5. Check the footer and confirm that the structure passes validation.
  6. Then move to Optics for angle, wavelength, and detector configuration.

For periodic structures, replace step 2 with: create a Layer Group, define one repeated unit in the dialog, and set the repeat count.

After the structure passes validation, continue with the next chapter: Optical Parameters.

Copyright © 2026 Dreapex