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

feat: Add windows skip marker and windows only test #524

Merged
merged 6 commits into from
Jul 17, 2023
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
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def get_examples():
bracket = prime.examples.download_bracket_fmd()
examples_dict["bracket"] = bracket

mixing_elbow_windows = prime.examples.download_elbow_scdoc()
examples_dict["elbow_lucid_scdoc"] = mixing_elbow_windows

return examples_dict


Expand Down
51 changes: 51 additions & 0 deletions tests/test_elbow_scdoc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import os
import platform
import tempfile

import pytest

from ansys.meshing import prime
from ansys.meshing.prime.graphics import Graphics


@pytest.mark.skipif(platform.system() != 'Windows', reason="Windows specific test.")
def test_elbow_lucid(get_remote_client, get_examples):
"""Tests an use case with the elbow example."""

model = get_remote_client.model
prime_client = prime.launch_prime()
mesh_util = prime.lucid.Mesh(model=model)

mixing_elbow = get_examples["elbow_lucid_scdoc"]
mesh_util.read(file_name=mixing_elbow)
mesh_util.create_zones_from_labels("inlet,outlet")

mesh_util.surface_mesh(min_size=5, max_size=20)

mesh_util.volume_mesh(
volume_fill_type=prime.VolumeFillType.POLY,
prism_surface_expression="* !inlet !outlet",
prism_layers=3,
)

display = Graphics(model=model)
display()

part = model.get_part_by_name("flow_volume")

part_summary_res = part.get_summary(prime.PartSummaryParams(model=model))

search = prime.VolumeSearch(model=model)
params = prime.VolumeQualitySummaryParams(
model=model,
scope=prime.ScopeDefinition(model=model, part_expression="*"),
cell_quality_measures=[prime.CellQualityMeasure.SKEWNESS],
quality_limit=[0.95],
)
results = search.get_volume_quality_summary(params=params)

with tempfile.TemporaryDirectory() as temp_folder:
mesh_file = os.path.join(temp_folder, "mixing_elbow.cas")
mesh_util.write(mesh_file)
assert os.path.exists(mesh_file)
prime_client.exit()
Loading