Simulation

This section introduces the functions that can be used to control simulation.

Add Solver

addfdtd

FDTD
Description
Adds a FDTD solver into the current simulation project.

Syntax

Code Function
addfdtd; Adds a FDTD solver into the current simulation project.
addfdtd(x_pos, y_pos, z_pos); Adds a FDTD solver into the current simulation project. The x_pos, y_pos, z_pos(unit: m) are the center position of the FDTD simulation region.

See also
addfde, addfdfd

addfde

FDE
Description
Adds a FDE solver into the current simulation project.

Syntax

Code Function
addfde; Adds a FDE solver into the current simulation project.
addfde(x_pos, y_pos, z_pos); Adds a FDE solver into the current simulation project. The x_pos, y_pos, z_pos(unit: m) are the center position of the FDE simulation region.

See also
addfdtd, addfdfd

addfdfd

FDFD
Description
Adds a FDFD solver into the current simulation project.

Syntax

Code Function
addfdfd; Adds a FDFD solver into the current simulation project.
addfdfd(x_pos, y_pos, z_pos); Adds a FDFD solver into the current simulation project. The x_pos, y_pos, z_pos(unit: m) are the center position of the FDFD simulation region.

See also
addfdtd, addfde

addeme

EME
Description

Adds a Eigenmode Expansion (EME) solver into the current simulation project.

Syntax

Code Function
addeme; Adds a EME solver into the current simulation project.
addeme(x_pos, y_pos, z_pos); Adds a EME solver into the current simulation project. The x_pos, y_pos, z_pos(unit: m) are the center position of the EME simulation region.

See also

addfdtd, addfde

addfdcharge

FDCharge

Description

Adds a Finite Difference Charge Transport (FDCharge) solver into the current simulation project.

Syntax

Code Function
addfdcharge; Adds a FDCharge solver into the current simulation project.
addfdcharge(x_pos, y_pos, z_pos); Adds a FDCharge solver into the current simulation project. The x_pos, y_pos, z_pos (unit: m) are the center position of the FDCharge simulation region.

See also

addfdtd, addfde

addrcwa

RCWA
Description
Adds an RCWA solver into the current simulation project.

Syntax

Code Function
addrcwa; Adds an RCWA solver into the current simulation project.
addrcwa(x_pos, y_pos, z_pos); Adds an RCWA solver into the current simulation project. The x_pos, y_pos, z_pos(unit: m) are the center position of the RCWA simulation region.

See also
addfdtd, addfde

addmesh

FDTD · FDFD · FDE · EME · FDCharge · RCWA
Description
Adds a mesh into the current simulation project.

Syntax

Code Function
addmesh; Adds a mesh into the current simulation project.
addmesh(x_pos, y_pos, z_pos); Adds a mesh into the current simulation project. The x_pos, y_pos, z_pos(unit: m) are the center position of the mesh.

See also
addfdtd, addfde, addfdfd

Simulation Control

run

FDTD · FDFD · FDE · EME · FDCharge · RCWA · STACK
Description
Runs the current simulation.

Syntax

Code Function
run; Runs the current simulation.

Example
Suppose in FDTD simulation environment, run the current project and get its simulation status.

run;
getdata('FDTD','simulation status')  #returns 0/1/2/3/4/5, and the meanings are as follows.
# 0: the project has not been run before
# 1: finished all simulation time
# 2: manual stop
# 3: early shutoff
# 4: divergence
# 5: abnormal exit

See also
runjobs, runanalysis

switchtorun

FDTD · FDFD · FDE · EME · FDCharge · RCWA

Description

Executing this command switches the interface from the Design layout to the Run layout.

In the Run layout, all commands that modify model objects (such as set, add, setnamed, delete, and disable) are disabled.

Syntax

Code Function
switchtorun; Switches from the Design layout to the Run layout.

See also
switchtodesign

switchtodesign

FDTD · FDFD · FDE · EME · FDCharge · RCWA · STACK

Description

This command switches the software from the Run layout back to the Design layout.

If the user has enabled the Clear simulation result when switch to design layout option in Preferences, all simulation results will be automatically deleted upon switching.

Syntax

Code Function
switchtodesign; Switches from the Run layout back to the Design layout

See also
switchtorun

solvemode

FDTD · FDFD · FDE
Description
Solves modes using the selected mode source, port, FDE solver or FDFP monitor whose mode expansion option has been enabled.

Syntax

Code Function
solvemode; Solves modes using the selected mode source, port, FDE solver or FDFP monitor whose mode expansion option has been enabled.
solvemode('object_name'); Solves modes using the mode source, port, or FDFP monitor named 'object_name'.
solvemode('parent_name::object_name'); Solves modes using the mode source, port, FDFP monitor named 'object_name' in group, analysis group, port group or solver named parent_name.

Example
Solve modes using mode source named 'Mode Source' in FDTD.

solvemode('FDTD::Mode Source');

See also
run

runsetup

FDTD · FDFD · FDE · EME · FDCharge · RCWA
Description
Runs the setup script in the structure group or analysis group.
This function can force setup script to be executed immediately.
For analysis groups, only FDTD and FDFD are supported.

Syntax

Code Function
runsetup; Runs the setup script in the structure group or analysis group.

See also
runanalysis

runanalysis

FDTD · FDFD
Description
Runs the analysis script in the analysis group.

Syntax

Code Function
runanalysis; Runs the analysis scripts in all analysis groups.
runanalysis('analysis_group'); Runs the analysis script in the analysis group named 'analysis_group' .

Example
Runs the analysis script in the analysis group named 'Analysis_Group_Test_1' in FDTD.

runanalysis('FDTD::Analysis_Group_Test_1');

See also
run

runsweep

FDTD · FDFD · FDE · EME · FDCharge · RCWA
Description
Runs the sweep.

Syntax

Code Function
runsweep; Runs all parameter sweeps sequentially.
runsweep('name'); Runs the sweep named 'name'.

Example
Runs the parameter sweep named 'Sweep_Test' in FDTD.

runsweep('Sweep_Test');

See also
runanalysis

emepropagate

EME

Description

Perform the propagation analysis for an Eigenmode Expansion (EME) solver and compute the S‑parameters for the entire structure. This script should be executed from the EME Analysis Window interface.

Syntax

Code Function
emepropagate; Runs the propagation analysis for the EME solver.

See also

run

emesweep

EME

Description

Once the EME solver enters Analysis mode, this command is used to execute sweep tasks. The following three modes are available:

  • Propagation sweep : Sweeps across the length of a cell group span.
  • Wavelength sweep : Performs a wavelength sweep.
  • Mode convergence sweep : Sweeps the number of modes.
    For specific parameter settings, please refer to the EME analysis window.

Syntax

Code Function
emesweep; , emesweep("propagation sweep"); Run propagation sweep.
emesweep("wavelength sweep"); Run wavelength sweep.
emesweep("mode convergence sweep"); Run mode convergence sweep.

See also

emepropagate

getresourceinfo

FDTD · FDFD · FDE · EME · FDCharge · RCWA · STACK
Description
Gets the basic resource information of CPU and GPU.

Syntax

Code Function
getresourceinfo Lists all the basic information of CPU and GPU.

Example

List all the basic information of CPU and GPU.

getresourceinfo

Result:

val =
CPU:
    CPU id: 0
        name: CPU
        cores: 16
        memory: 31.9278 GB

NVIDIA GPU:
    GPU id: 0
        name: NVIDIA GeForce GTX TITAN X
        graphic memory: 11.9999 GB
        major: 5
        tcc: 0

See also
get

Job Management

clearjobs

FDTD · FDFD · FDE · FDCharge
Description
Clears simulation files in the job manager.

Syntax

Code Function
clearjobs; Clears all simulation files in the job manager.
clearjobs('solver_type'); Clears simulation files of designated solver in the job manager.

Example
Clears simulation files of FDE solver in the job manager.

clearjobs('fde');

See also
addjob

listjobs

FDTD · FDFD · FDE · FDCharge
Description
Lists simulation files in the job manager queue.

Syntax

Code Function
L = listjobs; Lists all simulation files in the job manager queue.
L = listjobs('solver_type'); Lists all simulation files of designated solver in the job manager queue.

Example

L = listjobs('fdtd');

L

Result :

L =
fdtd:                      
F:/fdtd_project_test.mpps

See also
clearjobs, addjob

addjob

FDTD · FDFD · FDE · FDCharge
Description
Adds simulation file to the job manager queue.

Syntax

Code Function
addjob('file_path', 'solver_type'); Adds simulation file specified by 'file_path' to the job manager queue.

Example
Adds simulation file to job manager.

addjob('D:\test_file.mpps', 'FDTD');

See also
runjobs

runjobs

FDTD · FDFD · FDE · FDCharge
Description
Runs simulation files in the current job manager queue.

Syntax

Code Function
runjobs; Runs the jobs of the activated solver in current simulation project. If there is no activated solver, runs the jobs of FDTD solver.
runjobs('solver_type'); Runs simulation files of designated solver in the job manager queue.
runjobs('solver_type', parallel_set) Runs simulation files of designated solver in the job manager queue . If parallel_set is 0, runs jobs in single process mode. If parallel_set is 1, runs jobs using parallel settings specified in the job manager.

See also
addjob