Skip to content

Fix/solution type #615

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

Merged
merged 6 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion _unittest/test_21_Circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pyaedt.generic.TouchstoneParser import read_touchstone

# Setup paths for module imports
from _unittest.conftest import local_path, scratch_path
from _unittest.conftest import local_path, scratch_path, config

try:
import pytest # noqa: F401
Expand Down Expand Up @@ -270,6 +270,9 @@ def test_20_create_AMI_plots(self):
)
== "MyReportQ"
)

@pytest.mark.skipif(config["desktopVersion"] > "2021.2", reason="Skipped on versions higher than 2021.2")
def test_20B_create_AMI_plots(self):
assert (
self.aedtapp.post.create_statistical_eye_plot(
"Dom_Verify",
Expand Down
40 changes: 26 additions & 14 deletions pyaedt/application/Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
"Q3D Extractor": ["Q3D Extractor"],
"HFSS": ["DrivenModal", "DrivenTerminal", "Transient Network", "Eigenmode", "Characteristic Mode", "SBR+"],
"Icepak": [
"SteadyTemperatureAndFlow",
"SteadyTemperatureOnly",
"SteadyFlowOnly",
"SteadyStateTemperatureAndFlow",
"SteadyStateTemperatureOnly",
"SteadyStateFlowOnly",
"TransientTemperatureAndFlow",
"TransientTemperatureOnly",
"TransientFlowOnly",
Expand Down Expand Up @@ -133,47 +133,47 @@
"ElectroDCConduction": "ElectroDCConduction",
"ElectricTransient": "ElectricTransient",
"Matrix": "Matrix",
"SteadyTemperatureAndFlow": [
"SteadyStateTemperatureAndFlow": [
"NAME:SolutionTypeOption",
"SolutionTypeOption:=",
"SteadyState",
"ProblemOption:=",
"SteadyTemperatureAndFlow",
"TemperatureAndFlow",
],
"SteadyTemperatureOnly": [
"SteadyStateTemperatureOnly": [
"NAME:SolutionTypeOption",
"SolutionTypeOption:=",
"SteadyState",
"ProblemOption:=",
"SteadyTemperatureOnly",
"TemperatureOnly",
],
"SteadyFlowOnly": [
"SteadyStateFlowOnly": [
"NAME:SolutionTypeOption",
"SolutionTypeOption:=",
"SteadyState",
"ProblemOption:=",
"SteadyFlowOnly",
"FlowOnly",
],
"TransientTemperatureAndFlow": [
"NAME:SolutionTypeOption",
"SolutionTypeOption:=",
"Transient",
"ProblemOption:=",
"SteadyTemperatureAndFlow",
"TemperatureAndFlow",
],
"TransientTemperatureOnly": [
"NAME:SolutionTypeOption",
"SolutionTypeOption:=",
"Transient",
"ProblemOption:=",
"SteadyTemperatureOnly",
"TemperatureOnly",
],
"TransientFlowOnly": [
"NAME:SolutionTypeOption",
"SolutionTypeOption:=",
"Transient",
"ProblemOption:=",
"SteadyFlowOnly",
"FlowOnly",
],
"NexximLNA": "NexximLNA",
"NexximDC": "NexximDC",
Expand Down Expand Up @@ -573,6 +573,7 @@ def __init__(
self._desktop = main_module.oDesktop
self._desktop_install_dir = main_module.sDesktopinstallDirectory
self._messenger = self._logger._messenger
self._aedt_version = self._desktop.GetVersion()[0:6]

if solution_type:
assert (
Expand All @@ -592,7 +593,6 @@ def __init__(
self.solution_type = self._solution_type
self.project_datasets = self._get_project_datasets()
self.design_datasets = self._get_design_datasets()
self._aedt_version = self._desktop.GetVersion()[0:6]

@aedt_exception_handler
def __delitem__(self, key):
Expand Down Expand Up @@ -861,6 +861,7 @@ def solution_type(self):
@solution_type.setter
@aedt_exception_handler
def solution_type(self, soltype):
self._solution_type = soltype
if soltype:
sol = solutions_settings[soltype]
try:
Expand Down Expand Up @@ -2514,14 +2515,25 @@ def _insert_design(self, design_type, design_name=None, solution_type=None):
), "Solution type {0} is invalid for design type {1}.".format(solution_type, self._design_type)
else:
solution_type = self.default_solution_type
try:
sol = solutions_settings[solution_type]
except:
sol = solution_type
if isinstance(sol, str):
sol = [sol, ""]
elif design_type == "Icepak":
if self._aedt_version > "2021.1":
sol = ["SteadyState TemperatureAndFlow", ""]
else:
sol = ["TemperatureAndFlow", ""]
if design_type == "RMxprtSolution":
new_design = self._oproject.InsertDesign("RMxprt", unique_design_name, "Inner-Rotor Induction Machine", "")
elif design_type == "ModelCreation":
new_design = self._oproject.InsertDesign(
"RMxprt", unique_design_name, "Model Creation Inner-Rotor Induction Machine", ""
)
else:
new_design = self._oproject.InsertDesign(design_type, unique_design_name, solution_type, "")
new_design = self._oproject.InsertDesign(design_type, unique_design_name, sol[0], "")
logging.getLogger().info("Added design '%s' of type %s.", unique_design_name, design_type)
name = new_design.GetName()
if ";" in name:
Expand Down
6 changes: 3 additions & 3 deletions pyaedt/generic/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ class Icepak(object):
TransientTemperatureOnly,
TransientFlowOnly,
) = (
"SteadyTemperatureAndFlow",
"SteadyTemperatureOnly",
"SteadyFlowOnly",
"SteadyStateTemperatureAndFlow",
"SteadyStateTemperatureOnly",
"SteadyStateFlowOnly",
"TransientTemperatureAndFlow",
"TransientTemperatureOnly",
"TransientFlowOnly",
Expand Down
6 changes: 3 additions & 3 deletions pyaedt/modules/PostProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"SBR+": "Modal Solution Data",
"Transient": "Transient",
"EddyCurrent": "EddyCurrent",
"SteadyTemperatureAndFlow": "Monitor",
"SteadyTemperatureOnly": "Monitor",
"SteadyFlowOnly": "Monitor",
"SteadyStateTemperatureAndFlow": "Monitor",
"SteadyStateTemperatureOnly": "Monitor",
"SteadyStateFlowOnly": "Monitor",
"SteadyState": "Monitor",
"NexximLNA": "Standard",
"NexximDC": "Standard",
Expand Down
12 changes: 6 additions & 6 deletions pyaedt/modules/SetupTemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,9 +1613,9 @@ class SetupKeys(object):
"Electrostatic": 8,
"ElectroDCConduction": 9,
"ElectricTransient": 10,
"SteadyTemperatureAndFlow": 11,
"SteadyTemperatureOnly": 12,
"SteadyFlowOnly": 13,
"SteadyStateTemperatureAndFlow": 11,
"SteadyStateTemperatureOnly": 12,
"SteadyStateFlowOnly": 13,
"SteadyState": 11,
"Matrix": 14,
"NexximLNA": 15,
Expand Down Expand Up @@ -1768,9 +1768,9 @@ class SetupKeys(object):
"Electrostatic": "LastAdaptive",
"ElectroDCConduction": "LastAdaptive",
"ElectricTransient": "Transient",
"SteadyTemperatureAndFlow": "SteadyState",
"SteadyTemperatureOnly": "SteadyState",
"SteadyFlowOnly": "SteadyState",
"teadyStateTemperatureAndFlow": "SteadyState",
"SteadyStateTemperatureOnly": "SteadyState",
"SteadyStateFlowOnly": "SteadyState",
"SteadyState": "SteadyState",
"Matrix": "LastAdaptive",
"NexximLNA": None,
Expand Down