get_solution_data#
- PostProcessorIcepak.get_solution_data(expressions=None, setup_sweep_name=None, domain=None, variations=None, primary_sweep_variable=None, report_category=None, context=None, subdesign_id=None, polyline_points=1001, math_formula=None)#
Get a simulation result from a solved setup and cast it in a
SolutionDataobject.Data to be retrieved from Electronics Desktop are any simulation results available in that specific simulation context. Most of the argument have some defaults which works for most of the
Standardreport quantities.- Parameters:
- expressions
strorlist,optional One or more formulas to add to the report. Example is value
"dB(S(1,1))"or a list of values. Default isNonewhich returns all traces.- setup_sweep_name
str,optional Name of the setup. The default is
None, in which case thenominal_adaptivesetup is used. Be sure to build a setup string in the form of"SetupName : SetupSweep", whereSetupSweepis the sweep name to use in the export orLastAdaptive.- domain
str,optional Plot Domain. Options are “Sweep” for frequency domain related results and “Time” for transient related data.
- variations
dict,optional Dictionary of all families including the primary sweep. The default is
Nonewhich uses the nominal variations of the setup.- primary_sweep_variable
str,optional Name of the primary sweep. The default is
"None"which, depending on the context, internally assigns the primary sweep to: 1.Freqfor frequency domain results, 2.Timefor transient results, 3.Thetafor radiation patterns, 4.distancefor field plot over a polyline.- report_category
str,optional Category of the Report to be created. If
Nonedefault data Report is used. The Report Category can be one of the types available for creating a report depend on the simulation setup. For example for a Far Field Plot in HFSS the UI shows the report category as “Create Far Fields Report”. The report category is “Far Fields” in this case. Depending on the setup different categories are available. IfNonedefault category is used (the first item in the Results drop down menu in AEDT). To get the list of available categories user can use methodavailable_report_types.- context
str,dict,optional This is the context of the report. The default is
None. It can be: 1. None 2."Differential Pairs"3. Reduce Matrix Name for Q2d/Q3d solution 4. Infinite Sphere name for Far Fields Plot. 5. Dictionary. If dictionary is passed, key is the report property name and value is property value. 6. For Maxwell 2D/3D eddy current solution types, this can be provided as a dictionary, where the key is the matrix name and value the reduced matrix.- subdesign_id
int,optional Subdesign ID for exporting a Touchstone file of this subdesign. This parameter is valid for
Circuitonly. The default value isNone.- polyline_points
int,optional Number of points on which to create the report for plots on polylines. This parameter is valid for
Fieldsplot only.- math_formula
str,optional One of the available AEDT mathematical formulas to apply. For example,
abs, dB.
- expressions
- Returns:
ansys.aedt.core.modules.solutions.SolutionDataSolution Data object.
References
>>> oModule.GetSolutionDataPerVariation
Examples
>>> from ansys.aedt.core import Hfss >>> hfss = Hfss() >>> hfss.post.create_report("dB(S(1,1))") >>> variations = hfss.available_variations.nominal_values >>> variations["Theta"] = ["All"] >>> variations["Phi"] = ["All"] >>> variations["Freq"] = ["30GHz"] >>> data1 = hfss.post.get_solution_data( ... "GainTotal", ... hfss.nominal_adaptive, ... variations=variations, ... primary_sweep_variable="Phi", ... secondary_sweep_variable="Theta", ... context="3D", ... report_category="Far Fields", ...)
>>> data2 =hfss.post.get_solution_data( ... "S(1,1)", ... hfss.nominal_sweep, ... variations=variations, ...) >>> data2.plot() >>> hfss.desktop_class.release_desktop(False, False)
>>> from ansys.aedt.core import Maxwell2d >>> m2d = Maxwell2d() >>> data3 = m2d.post.get_solution_data( ... "InputCurrent(PHA)", ... domain="Time", ... primary_sweep_variable="Time", ... ) >>> data3.plot("InputCurrent(PHA)") >>> m2d.desktop_class.release_desktop(False, False)
>>> from ansys.aedt.core import Circuit >>> circuit = Circuit() >>> context = {"algorithm": "FFT", "max_frequency": "100MHz", "time_stop": "2.5us", "time_start": "0ps"} >>> spectralPlotData = circuit.post.get_solution_data( ... expressions="V(Vprobe1)", domain="Spectral", primary_sweep_variable="Spectrum", context=context ... ) >>> circuit.desktop_class.release_desktop(False, False)
>>> from ansys.aedt.core import Maxwell3d >>> m3d = Maxwell3d(solution_type="EddyCurrent") >>> rectangle1 = m3d.modeler.create_rectangle(0, [0.5, 1.5, 0], [2.5, 5], name="Sheet1") >>> rectangle2 = m3d.modeler.create_rectangle(0, [9, 1.5, 0], [2.5, 5], name="Sheet2") >>> rectangle3 = m3d.modeler.create_rectangle(0, [16.5, 1.5, 0], [2.5, 5], name="Sheet3") >>> m3d.assign_current(rectangle1.faces[0], amplitude=1, name="Cur1") >>> m3d.assign_current(rectangle2.faces[0], amplitude=1, name="Cur2") >>> m3d.assign_current(rectangle3.faces[0], amplitude=1, name="Cur3") >>> L = m3d.assign_matrix(assignment=["Cur1", "Cur2", "Cur3"], matrix_name="Matrix1") >>> out = L.join_series(sources=["Cur1", "Cur2"], matrix_name="ReducedMatrix1") >>> expressions = m3d.post.available_report_quantities( ... report_category="EddyCurrent", display_type="Data Table", context={"Matrix1": "ReducedMatrix1"} ... ) >>> data = m2d.post.get_solution_data(expressions=expressions, context={"Matrix1": "ReducedMatrix1"}) >>> m3d.desktop_class.release_desktop(False, False)