-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate and report misconfigured simulation export #91
Comments
I addressed this issue by creating a Unit tests are in |
Thank you for your contribution and for participating in unitaryhack 2024! |
Description
When running a simulation script, we need to define two sets of parameters: one that guides the shape of the geometry, and the other that guides the execution of the third-party simulator, such as Elmer or Ansys. Certain parameter settings of those two parameter sets can't work together. These should be validated and reported before the simulation export work is done.
Use case
When I write a simulation export script in
klayout_package/python/scripts/simulations
I might not notice or I might not know that I have defined simulation and solution parameters in such a way that they can't work together. Instead of spending too much time debugging the problem after the simulation work is done, I'd like the KQC simulation exporter to tell me that the parameters don't make sense and for what reason.Prerequisites
KQCircuits standalone installation required, GUI installation prevents an error which in practice could be circumvented.
Get started
See for example the following block of code from klayout_package/python/scripts/simulations/swissmon_fluxline_sim.py
The
simulations
list here consists of tuples, for which the first object is of class Simulation containing the geometry data, and the other object is a dataclass object containing parameters that need to be fed to the simulator software, Ansys in this case.simulations
list gets fed to the export_ansys function (there is also export_elmer equivalent). This would be a perfect place to perform validations. Before any of the current function code is implemented, there could be a set of manually defined validations to be performed that, if at least one of them fails, the function halts and prints a user-friendly error.These validation checks might be Ansys and Elmer specific, but let's still define a single function for validations that both
export_elmer
andexport_ansys
will call, so that validations can be maintained in one place. The main focus of this exercise is to enable infrastructure so that additional validations could be quite easily added without being too familiar with details of simulation export code.Definition of done
Concrete validation scenarios to start with
Simulation
object has no ports, theSolution
object type cannot be any of the following:AnsysHfssSolution
,AnsysVoltageSolution
,AnsysCurrentSolution
,ElmerVectorHelmholtzSolution
,ElmerCapacitanceSolution
Simulation
object has at least one port of typeEdgePort
, theSolution
object type cannot be any of the following:AnsysEigenmodeSolution
,AnsysVoltageSolution
,AnsysCurrentSolution
Solution
object has a fieldintegrate_magnetic_flux
and it is set to True, theSimulation
object should have at least one entry in layers dict such that it hasthickness == 0.0
andmaterial != 'pec'
. Such layer is called a "non-pec sheet".The text was updated successfully, but these errors were encountered: