Functions module

Functions.AddGlobalParameter(Parameters)[source]

Add Global parameters to the working enviroment

Parameters:

Parameters (dict) – Dictionary with the name and value of the parameter. GlobalParam[‘Length’]

Returns:

String with VBA Code

Return type:

str

Functions.BackgroundSet(Parameters)[source]

Set the Simulation background.

Parameters:
  • Parameters (dic) – Dictionary with coordinates for the background. Parameters[“Type Background”] = str, Type of the Background. Defoult is “Normal” Parameters[“Xmin Background”] = int/float Parameters[“Xmin Background”] = int/float Parameters[“Xmin Background”] = int/float Parameters[“Xmin Background”] = int/float Parameters[“Xmin Background”] = int/float Parameters[“Xmin Background”] = int/float

  • Type (str, optional) – Type of background material. Cehck CST for more information. Defaults to Normal.

Returns:

String with VBA Code

Return type:

str

Functions.ChangeSolverType(Type)[source]
Functions.ClearAllPicks()[source]

Clear all pciks

Returns:

String with VBA Code

Return type:

str

Functions.CreateEfieldMonitor(Parameters)[source]

Set Monitor

Parameters:

Parameters (dict) –

Dictionary with Parameters Parameters[“Wavelength”] : Int/float. This will set the wavelength. For this function and only for this function you need to give the exact number. So 1.55 um will be Parameters[“Wavelength”] = 1.55e-6 Parameters[“Monitor Type”] : str with monitor Type. Can be one of :

”Efield”, “Hfield”, “Surfacecurrent”, “Powerflow”, “Current”, “Powerloss”, “Eenergy”, “Elossdens”, “Lossdens”, “Henergy”, “Farfield”, “Fieldsource”, “Spacecharge”, “ParticleCurrentDensity”, “Electrondensity”

Raises:

ValueError – Error massage

Returns:

String with VBA Code

Return type:

str

Functions.Curve(CurveName, Points)[source]
Functions.DeleteGlobalParameter(Parameters)[source]

Delete an Global parameter from the enviroment.

Parameters:

Parameters (dict) – Dictionary with the name and value of the parameter. GlobalParam[‘Length’]

Returns:

String with VBA Code

Return type:

str

Functions.Discrete_Port(Parameters, Obj)[source]
Functions.ExportResults(Path, Name, Result)[source]
Functions.Material(Name, Values)[source]

Add Anisotropic material to Material Libs

Parameters:
  • Name (str) – Name of the Material

  • Values (Dict) – Dictionary with the material Values: Values[“X”] : X Epsilon Value Values[“Y”] : Y Epsilon Value Values[“Z”] : Z Epsilon Value

Returns:

String with the VBA code

Return type:

str

Functions.Material_Au(Name)[source]

Add gold to the Material Library :param Name: Name of the Material :type Name: str

Returns:

String with the VBA code

Return type:

str

Functions.Material_SiO2(Name)[source]

Add silicon dioxide to the Material Library

Parameters:

Name (str) – Name of the Material

Returns:

String with the VBA code

Return type:

str

Functions.Material_Silicon(Name)[source]

Add silicon to the Material Library

Parameters:

Name (str) – Name of the Material

Returns:

String with the VBA code

Return type:

str

Functions.MoveWaveguidePorts(Parameters)[source]
Functions.Optical_WaveguidePorts_MZM(Parameters, Obj)[source]
Functions.Pick(Parameters)[source]

Pick function

Parameters:

Parameters (dict) – Dictionary with Parameters PicParams[“Option”] : Pcik option. For example “Face” PicParams[“Object”] : Name of the object on witch the pick will be executed. PicParams[“Face Number”] = int with the ID of the picked Face for example.

Returns:

String with VBA Code

Return type:

str

Functions.Poligon_2D(WGName, Points)[source]

Create the 2D poligon for tRib waveguide

Parameters:
  • WGName (str) – Name of the poligon

  • Points (dict) – Dictionary with the Points: Points[‘X’] = [] Points[‘Y’] = []

Returns:

String with VBA Code

Return type:

str

Functions.Poligon_3D(WGName, Points)[source]

Create the 2D poligon for tRib waveguide

Parameters:
  • WGName (str) – Name of the poligon

  • Points (dict) – Dictionary with the Points: Points[‘X’] = [] Points[‘Y’] = [] Points[‘Z’] = []

Returns:

String with VBA Code

Return type:

str

Functions.RibWaveguide_ToSolid(SolidName, WaveguideName='Rib_Waveguide', WG_Hight=None, Angle=None, NameFolder=None, Material=None, WGFolderName=None, WGName=None)[source]
This is ToSolid function that will allow the use to create the RibWaveguide.

TODO: Murrge the TOSolid and RibWaveguideToSolid functions later on.

Parameters:
  • SolidName (str) – Solid name

  • WaveguideName (str, optional) – Waveguide Name. Defaults to “Rib_Waveguide”.

  • WG_Hight (int/float, optional) – Hight of the waveguide. Defaults to None.

  • Angle (int/float, optional) – Side angle of the waveguide. Defaults to None.

  • NameFolder (str, optional) – Folder name. Defaults to None.

  • Material (str, optional) – Material for of the Bond wire. For now you need to load the material in your simulation and then use this function. Otherwise the material will not be found. Defaults to None.

  • WGFolderName (str, optional) – Name of the folder where the poligon 3D or 2D is created. Defaults to None.

  • WGName (str, optional) – Name of the Poligon 3D or 2D. Defaults to None.

Raises:

ValueError – Error massage

Returns:

String with VBA Code

Return type:

str

Functions.RotationTranslation(Parameters)[source]
Functions.SetBoundary(Parameters)[source]

Set Boundary box Parameters

Parameters:

Parameters (dict) – Dictionary with Boundary Parameters Parameters[“Xmin Boundary”] = str Parameters[“Xmax Boundary”] = str Parameters[“Ymin Boundary”] = str Parameters[“Ymax Boundary”] = str Parameters[“Zmin Boundary”] = str Parameters[“Zmax Boundary”] = str Parameters[“Xsymmetry Boundary”] = str Parameters[“Ysymmetry Boundary”] = str Parameters[“Zsymmetry Boundary”] = str

Returns:

String with VBA Code

Return type:

str

Functions.SetDiscretePort(Parameters)[source]
Functions.SetElectricalSimulationProperties(Parameters)[source]
Functions.SetElectricalTemplate(Parameters)[source]
Functions.SetFreqSolver(Parameters)[source]

Set Frequency solver Parameters

Parameters:

Parameters (dict) – Dictionary with Parameters Parameters[“Accuracy”] : int from 10,15,20,25,30,35,40. Simulation accuracy. For example 20. Parameters[“Caclculate Modes Only”] : Boolen. True if you want to calculate only the Ports modes. False to calculate the hole structure. Parameters[“Auto Impedance”] : Booled. Set Port Impedance. True if you want to set manually False otherwise. Parameters[“Impedance”] : int/float Port Impedance. Parameters[“Source Port”] : Int. Set the Source Port. For example 1 or 2

Returns:

String with VBA Code

Return type:

str

Functions.SetMesh(Parameters)[source]
Sets the type of the mesh. The user can define the mesh cells per wavelength near and far

from the simulations object.

Parameters:

Parameters (dict) –

Dictionarty with Parameters Parameters[“Mesh Type”] : str Type of the Mesh. You can choose between:

PBA - Hexahedral mesh with Perfect Boundary Approximation HexahedralTLM CFD CFDNew Staircase - Hexahedral mesh with staircase cells Tetrahedral - Tetrahedral mesh Surface - Surface mesh SurfaceMLS - urface multi layer mesh Planar - Planar 2D mesh

Parameters[“Mesh Cells Near Object”] : int Cells per Wavelength near the simulation object Parameters[“Mesh Cells far Object”] : int Cells per Wavelength far from the simulation object

Returns:

String with VBA Code

Return type:

str

Functions.SetOpticalSimulationProperties(Parameters)[source]
Functions.SetSimFreqeuncy(Parameters)[source]

Set Simulation Frequency

Parameters:

Parameters (dict) – Dictionary with Parameters Parameters[“Min Frequency”] : Min Frequency of Simulation Parameters[“Max Frequency”] : Max Frequency of Simulation

Returns:

String with VBA Code

Return type:

str

Functions.SetSimWavelength(Parameters)[source]

Set Simulation SetSimWavelength

Parameters:

Parameters (dict) – Dictionary with Parameters Parameters[“Min Wavelength”] : Min Wavelength Parameters[“Max Wavelength”] : Max Wavelength

Returns:

String with VBA Code

Return type:

str

Functions.SetTimeSolver(Parameters)[source]

Set Time solver Parameters

Parameters:

Parameters (dict) – Dictionary with Parameters Parameters[“Accuracy”] : int from 10,15,20,25,30,35,40. Simulation accuracy. For example 20. Parameters[“Caclculate Modes Only”] : Boolen. True if you want to calculate only the Ports modes. False to calculate the hole structure. Parameters[“Auto Impedance”] : Booled. Set Port Impedance. True if you want to set manually False otherwise. Parameters[“Impedance”] : int/float Port Impedance. Parameters[“Source Port”] : Int. Set the Source Port. For example 1 or 2

Returns:

String with VBA Code

Return type:

str

Functions.SetUnits(DictUnits)[source]

Set the Simulation Global Units

Parameters:

DictUnits (dict) – Dictionary with Units: DictUnits[‘Dimensions’] - Length DictUnits[‘Frequency’] - Frequency DictUnits[‘Time’] - time DictUnits[‘Temperature’] - Temperature Not nessesery. Can be left out DictUnits[‘Voltage’] - Voltage DictUnits[‘Current’] - Current DictUnits[‘Resistance’] - Resistance DictUnits[‘Conductance’] - Conductance DictUnits[‘Capacitance’] - Capacitance DictUnits[‘Inductance’] - Inductance

Returns:

String with VBA Code

Return type:

str

Functions.StartTimeSolver()[source]

Start Time Simulation

Returns:

String with VBA Code

Return type:

str

Functions.ToSolid(SolidName, CurveName='Polygon', NameFolder=None, Material=None)[source]

This function transfer an function or polynom to solid object.

Parameters:
  • SolidName (str) – Name of the solid object

  • CurveName (str, optional) – Name of the curve. Defaults to “Polygon”.

  • NameFolder (str, optional) – Name of the folder. Defaults to Curve name.

  • Material (str, optional) – Material for of the Bond wire. For now you need to load the material in your simulation and then use this function. Otherwise the material will not be found. Defaults to Aluminum.

Returns:

String with VBA Code

Return type:

str

Functions.Translation(Parameters)[source]
Functions.WaveguidePort(Parameters)[source]

Set the Waveguide Port for

Parameters:

Parameters (dict) –

Dictionary with Port Parameters Parameters[“Orientation”] = Str with Port Orientation can be “Positive” or “Negative”. For

this function an 2 ports will be defined so please give an array with two Oriantations like Parameters[“Orientation”] = [“Positive”, “Positive”]

Parameters[“Coordinates”] = Str witch Coordinates type, “Picks” is the best one! Parameters[“Span”] = Array with Array of port span [[Ymin, Ymax],[Zmin, Zmax]] Parameters[“Potential”] = Array with port Potential . For example [1,2] Parameters[“Port Number”] = Array with Port number [1,2] Parameters[“Polarity”] = Port Polarity can be be “Positive” or “Negative”. For

this function an 2 ports will be defined so please give an array with two Polaritys. For example Parameters[“Polarity”] = [“Positive”, “Positive”]

Parameters[“Solid Name”] = Name of the Object on witch the Waveguide port will be created. For example “WG:WG1” Parameters[“Face ID”] = Array with the ID of the two picked faces. For example Parameters[“Face ID”] = [2,4]

Returns:

String with VBA Code

Return type:

str

Functions.WaveguidePortWithPins(Parameters, PicParams)[source]

Set the Waveguide Port for

Parameters:
  • Parameters (dict) –

    Dictionary with Port Parameters Parameters[“Orientation”] = Str with Port Orientation can be “Positive” or “Negative”. For

    this function an 2 ports will be defined so please give an array with two Oriantations like Parameters[“Orientation”] = [“Positive”, “Positive”]

    Parameters[“Coordinates”] = Str witch Coordinates type, “Picks” is the best one! Parameters[“Span”] = Array with Array of port span [[Ymin, Ymax],[Zmin, Zmax]] Parameters[“Potential”] = Array with port Potential . For example [1,2] Parameters[“Port Number”] = Array with Port number [1,2] Parameters[“Polarity”] = Port Polarity can be be “Positive” or “Negative”. For

    this function an 2 ports will be defined so please give an array with two Polaritys. For example Parameters[“Polarity”] = [“Positive”, “Positive”]

    Parameters[“Solid Name”] = Name of the Object on witch the Waveguide port will be created. For example “WG:WG1” Parameters[“Face ID”] = Array with the ID of the two picked faces. For example Parameters[“Face ID”] = [2,4]

  • PicParams (dict) – Dictionary with Pick Faces Parameters PickParams[“Face Number”] = Integer with the number of the picked face of the structure

Returns:

String with VBA Code

Return type:

str

Functions.WaveguidePorts_on_Electrodes_MZM(Parameters, Obj)[source]