kqcircuits.simulations.export.elmer.elmer_export

kqcircuits.simulations.export.elmer.elmer_export.export_elmer_json(simulation, path: pathlib.Path, tool='capacitance', linear_system_method='bicgstab', p_element_order=1, frequency=5, frequency_batch=3, sweep_type='explicit', max_delta_s=0.01, mesh_size=None, boundary_conditions=None, workflow=None, percent_error=0.005, max_error_scale=2, max_outlier_fraction=0.001, maximum_passes=1, minimum_passes=1, integrate_energies=False, is_axisymmetric=False)[source]

Export Elmer simulation into json and gds files.

Parameters
  • simulation – The simulation to be exported.

  • path – Location where to write json.

  • tool (str) – Available: “capacitance”, “wave_equation” and “cross-section” (Default: capacitance)

  • linear_system_method (str) – Available: ‘bicgstab’, ‘mg’ (Default: bicgstab)

  • p_element_order (int) – polynomial order of p-elements (Default: 1)

  • frequency – Units are in GHz. To set up multifrequency analysis, use list of numbers.

  • mesh_size (dict) – Parameters to determine mesh element sizes

  • boundary_conditions (dict) – Parameters to determine boundary conditions

  • workflow (dict) – Parameters for simulation workflow

  • percent_error (float) – Stopping criterion in adaptive meshing.

  • max_error_scale (float) – Maximum element error, relative to percent_error, allowed in individual elements.

  • max_outlier_fraction (float) – Maximum fraction of outliers from the total number of elements

  • maximum_passes (int) – Maximum number of adaptive meshing iterations.

  • minimum_passes (int) – Minimum number of adaptive meshing iterations.

  • integrate_energies – Calculate energy integrals over each object

  • is_axisymmetric (bool) – Simulate with Axi Symmetric coordinates along \(y\Big|_{x=0}\) (Default: False)

Returns

Path to exported json file.

kqcircuits.simulations.export.elmer.elmer_export.export_elmer_script(json_filenames, path: pathlib.Path, workflow=None, file_prefix='simulation', execution_script='scripts/run.py', post_process=None, n_simulations=1)[source]

Create script files for running one or more simulations. Create also a main script to launch all the simulations at once.

Parameters
  • json_filenames – List of paths to json files to be included into the script.

  • path – Location where to write the script file.

  • workflow (dict) – Parameters for simulation workflow

  • file_prefix – Name of the script file to be created.

  • execution_script – The script file to be executed.

  • n_simulations – Total number of simulations

  • post_process – List of PostProcess objects, a single PostProcess object, or None to be executed after simulations

Returns

Path of exported main script file

kqcircuits.simulations.export.elmer.elmer_export.export_elmer(simulations: Sequence[kqcircuits.simulations.simulation.Simulation], path: pathlib.Path, tool='capacitance', script_folder='scripts', linear_system_method='bicgstab', p_element_order=3, frequency=5, frequency_batch=3, sweep_type='explicit', max_delta_s=0.01, file_prefix='simulation', script_file='run.py', mesh_size=None, boundary_conditions=None, workflow=None, percent_error=0.005, max_error_scale=2, max_outlier_fraction=0.001, maximum_passes=1, minimum_passes=1, integrate_energies=False, is_axisymmetric=False, skip_errors=False, post_process=None)[source]

Exports an elmer simulation model to the simulation path.

Parameters
  • simulations (list(Simulation)) – list of all the simulations

  • path (Path) – Location where to output the simulation model

  • tool (str) – Available: “capacitance”, “wave_equation” and “cross-section”

  • script_folder – Path to the Elmer-scripts folder.

  • linear_system_method (str) – Available: ‘bicgstab’, ‘mg’

  • p_element_order (int) – polynomial order of p-elements

  • frequency – Units are in GHz. To set up multifrequency analysis, use list of numbers.

  • file_prefix – File prefix of the script file to be created.

  • script_file – Name of the script file to run.

  • mesh_size (dict) – Parameters to determine mesh element sizes

  • boundary_conditions (dict) – Parameters to determine boundary conditions

  • workflow (dict) – Parameters for simulation workflow

  • percent_error (float) – Stopping criterion in adaptive meshing.

  • max_error_scale (float) – Maximum element error, relative to percent_error, allowed in individual elements.

  • max_outlier_fraction (float) – Maximum fraction of outliers from the total number of elements

  • maximum_passes (int) – Maximum number of adaptive meshing iterations.

  • minimum_passes (int) – Minimum number of adaptive meshing iterations.

  • integrate_energies – Calculate energy integrals over each object

  • is_axisymmetric (bool) – Simulate with Axi Symmetric coordinates along \(y\Big|_{x=0}\) (Default: False)

  • skip_errors (bool) –

    Skip simulations that cause errors. (Default: False)

    Warning

    Use this carefully, some of your simulations might not make sense physically and you might end up wasting time on bad simulations.

  • post_process – List of PostProcess objects, a single PostProcess object, or None to be executed after simulations

Returns

Path to exported script file.

../_images/kqcircuits.simulations.export.elmer.elmer_export.png