FEMFy.fefd_solver.FEFDSolver
- class FEMFy.fefd_solver.FEFDSolver
Bases:
simulator
Finite Element Frequency Domain
Methods
element_layers
()get_core_simulator
()run
()run_geom
(dev_geo)set_boundaries
([min_x_bc, max_x_bc, ...])Set the boundary condition for the mode solver.
set_sim_settings
(device_geometry[, ...])This method set the higher level simulation settings.
- set_boundaries(min_x_bc: str = 'pmc', max_x_bc: str = 'pmc', min_y_bc: str = 'pmc', max_y_bc: str = 'pmc', params: PML_Params = None) None
Set the boundary condition for the mode solver. Supported boundaries are:
"pmc"
: perfect magnetic conductor, “asy” For anti-symmetric boundary and"sym"
for symmetric boundary. Anti-symmetric is related to an odd symmetry of the H-fields at the boundary. Symmetric is related to an even symmetry of the H-fileds at the boundary.- Parameters:
min_x (dict, optional) – A dict with the choice of for x_min face. Defaults to {“bc”:”pmc”}.
max_x (dict, optional) – A dict with the choice of for x_max face.. Defaults to {“bc”:”pmc”}.
min_y (dict, optional) – A dict with the choice of for y_min face.. Defaults to {“bc”:”pmc”}.
max_y (dict, optional) – A dict with the choice of for y_max face.. Defaults to {“bc”:”pmc”}.
- set_sim_settings(device_geometry: ~pyOptiShared.DeviceGeometry.DeviceGeometry, simulation_type: str = 'nportsparam', wavelength: ~pyOptiShared.Simulator.WavelengthInfo = <pyOptiShared.Simulator.WavelengthInfo object>, mesh: ~pyOptiShared.Simulator.Mesh = None, method: str = 'direct', resolution: int = 200, results_path: str = '', interpolation: str = 'nearest', stability: float = 1.0, polarization: str = 'TE', adjoint_info: ~pyOptiShared.Simulator.AdjointInfo = None) None
This method set the higher level simulation settings. Check GetGlobalUnits() methods for units.
- Parameters:
sim_type (str, optional) – Type of simulation. Defaults to “nportsparam”. PS: Currently supported is nportsparam, only.
sim_time (float, optional) – Simulation time. Defaults to 10_000.
sim_size (float | list[float, float, float], optional) – The dimension of the simulation region. Defaults to [10, 10, 3]. Usualy this is overriden by the DeviceGeometry() object.
space_step (float, optional) – Space step. Uniform for X, Y and Z. Defaults to 0.025 (25nm).
kernel_type (str, optional) – Defines the type of kernel. Either “cuda” or “numpy”. Defaults to “cuda”.
auto_shutoff_flag (bool, optional) – If True will end the simulation using autoshutoff. Defaults to True. Autoshutoff triggers when the total simulation power gets below its maximum by a factor of auto_shutoff_limit.
auto_shutoff_limit (float, optional) – The relative threshold to trigger autoshutoff. Defaults to 1e-4.
export_mat_grid (bool, optional) – If True exports the material grid to the results file. Defaults to False.
round_buffers (bool, optional) – If True it rounds the buffers of the DeviceGeometry() to multiples of the space_step. Defaults to True.
subpixel_level (int, optional) – Dielectric material averaging level. Defaults to 2. PS: It oversamples the geometry by this many folds and then averages out the permittivity profile.
save_path (str, optional) – A path to save the results file (.hdf5 and .snp). Defaults to None. If not provided it will save directly in the current working directory.
results_filename (str, optional) – If None the solver will use information in the Device Geometry, date and time to create a filename.
show_modes (bool, optional) – Displays the modes before running the simulation. Defaults to False.
show_permittivity (bool, optional) – Displays the permittivity profile before running the simulation. Defaults to False.