Skip to content
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

Fix/solution type #615

Merged
merged 6 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions _unittest/test_08_Primitives3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ def test_28_get_object_faces(self):
assert len(o.edges) == 4
assert len(o.vertices) == 4

@pyaedt_unittest_check_desktop_error
def test_29_get_edges_from_position(self):
self.cache.ignore_error_message_local("Script macro error: Can't find face by name and position.")
o = self.create_rectangle(name="MyRectangle_for_primitives")
Expand Down Expand Up @@ -840,7 +839,6 @@ def test_62_import_space_claim(self):
assert self.aedtapp.modeler.import_spaceclaim_document(os.path.join(self.local_scratch.path, scdoc))
assert len(self.aedtapp.modeler.primitives.objects) == 1

@pyaedt_unittest_check_desktop_error
def test_63_import_step(self):
self.aedtapp.insert_design("StepImport")
assert self.aedtapp.modeler.import_3d_cad(self.step_file)
Expand Down
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
Binary file added doc/source/Resources/ipc2581.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/mechanical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/nde.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/schematic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
2 changes: 1 addition & 1 deletion pyaedt/hfss3dlayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def validate_full_design(self, name=None, outputdir=None, ports=None):
msg = "Desktop Messages:"
validation.writelines(msg + "\n")
val_list.append(msg)
msgs = self._desktop.GetMessages(name, "HFSSDesign1", 0)
msgs = self._desktop.GetMessages(self.project_name, name, 0)
# need to check if design name is always this default name HFSSDesign1
for msg in msgs:
self.logger.info(msg)
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