tidy3dclient.Simulation¶
-
class
tidy3dclient.Simulation(size, center=[0.0, 0.0, 0.0], resolution=None, mesh_step=None, structures=[], sources=[], probes=[], symmetries=[0, 0, 0], pml_layers=[0, 0, 0], run_time=0.0, courant=0.9, verbose=True)¶ Main class for building a simulation model.
-
__init__(size, center=[0.0, 0.0, 0.0], resolution=None, mesh_step=None, structures=[], sources=[], probes=[], symmetries=[0, 0, 0], pml_layers=[0, 0, 0], run_time=0.0, courant=0.9, verbose=True)¶ - Parameters
center (list or np.ndarray, optional) – (micron) 3D vector defining the center of the simulation domain.
size (list or np.ndarray, optional) – (micron) 3D vector defining the size of the simulation domain.
resolution (float or array_like of float, optional) – (1/micron) Number of pixels per micron, or a 3D vector defining the number of pixels per mircon in x, y, and z seprately.
mesh_step (float or array_like of float, optional) – (micron) Step size in all directions, or a 3D vector defining the step size in x, y, and z seprately. If provided,
mesh_stepoverrides theresolutionparameter, otherwisemesh_step = 1/resolution.structures (Structure or a list of Structure objects, optional) – Empty list (default) means vacuum.
sources (Source or a list of Source objects, optional) – Source(s) to be added to the simulation.
probes (Probe or a list of Probe objects, optional) – Probe(s) to be added to the simulation.
symmetries (list of int, optional) – List of three elements defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis, respectively. Each element can be
0(no symmetry),1(even, i.e. ‘PMC’ symmetry) or-1(odd, i.e. ‘PEC’ symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.pml_layers (list of int, optional) – List of three elements defining the number of PML layers on both sides of the simulation domain along x, y, and z. When set to
0(default), periodic boundary conditions are applied.run_time (float, optional) – (second) Total electromagnetic evolution time.
courant (float, optional) – Courant stability factor, must be smaller than 1.
verbose (bool, optional) – Print helpful messages regarding the simulation.
Methods
__init__(size[, center, resolution, …])- param center
(micron) 3D vector defining the center of the simulation domain.
add(objects)Add a list of objects.
export()Return a dictionary with all simulation parameters and objects.
export_json(fjson)Export the simulation to a JSON file.
import_json(fjson)Import a simulation from a JSON file.
load_results(dfile)Load the probe data recorded from a Tidy3D run.
Attributes
fprobesList conaining all FreqProbe objects.
mat_indsList conaining the material index in
materialsof everystructure.materialsList conaining all materials included in the simulation.
sourcesList conaining all Source objects.
structuresList conaining all Structure objects.
tprobesList conaining all TimeProbe objects.
-