Skip to content

Commit

Permalink
Fix post Icepak
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Dec 17, 2024
1 parent b7696d2 commit a7f319d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/ansys/aedt/core/application/analysis_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,15 @@ def mesh(self):
Returns
-------
:class:`ansys.aedt.core.modules.mesh.Mesh` or :class:`ansys.aedt.core.modules.mesh_icepak.IcepakMesh`
:class:`ansys.aedt.core.modules.mesh.Mesh`
Mesh object.
"""
if self._mesh is None and self._odesign:
self.logger.reset_timer()

from ansys.aedt.core.modules.mesh import Mesh
from ansys.aedt.core.modules.mesh_icepak import IcepakMesh

self._mesh = IcepakMesh(self) if self.design_type == "Icepak" else Mesh(self)
self._mesh = Mesh(self)

Check warning on line 174 in src/ansys/aedt/core/application/analysis_3d.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_3d.py#L174

Added line #L174 was not covered by tests
self.logger.info_timer("Mesh class has been initialized!")

return self._mesh
Expand Down
38 changes: 35 additions & 3 deletions src/ansys/aedt/core/application/analysis_icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Optional
from typing import Union

from ansys.aedt.core.application.analysis_3d import FieldAnalysis3D
from ansys.aedt.core.application.design import DesignSettingsManipulation
from ansys.aedt.core.generic.configurations import ConfigurationsIcepak
from ansys.aedt.core.modules.boundary.icepak_boundary import BoundaryDictionary
from ansys.aedt.core.visualization.post.monitor_icepak import Monitor


class FieldAnalysisIcepak(FieldAnalysis3D, object):
Expand Down Expand Up @@ -113,9 +115,16 @@ def __init__(
aedt_process_id,
remove_lock=remove_lock,
)
self._monitor = Monitor(self)
self._configurations = ConfigurationsIcepak(self)

self.design_settings.manipulate_inputs = IcepakDesignSettingsManipulation(self)
self._mesh = None
self._post = None
self._monitor = None
self._configurations = ConfigurationsIcepak(self)
if not settings.lazy_load:
self._mesh = self.mesh
self._post = self.post
self._monitor = self.monitor

Check warning on line 127 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L119-L127

Added lines #L119 - L127 were not covered by tests

@property
def post(self):
Expand All @@ -132,6 +141,24 @@ def post(self):
self._post = post_processor(self)
return self._post

Check warning on line 142 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L141-L142

Added lines #L141 - L142 were not covered by tests

@property
def mesh(self):
"""Mesh.
Returns
-------
:class:`ansys.aedt.core.modules.mesh_icepak.IcepakMesh`
Mesh object.
"""
if self._mesh is None and self._odesign:
self.logger.reset_timer()

Check warning on line 154 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L153-L154

Added lines #L153 - L154 were not covered by tests

from ansys.aedt.core.modules.mesh_icepak import IcepakMesh

Check warning on line 156 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L156

Added line #L156 was not covered by tests

self._mesh = IcepakMesh(self)
self.logger.info_timer("Mesh class has been initialized!")
return self._mesh

Check warning on line 160 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L158-L160

Added lines #L158 - L160 were not covered by tests

@property
def monitor(self):
"""Property to handle monitor objects.
Expand All @@ -140,6 +167,11 @@ def monitor(self):
-------
:class:`ansys.aedt.core.modules.monitor_icepak.Monitor`
"""
if self._monitor is None:
from ansys.aedt.core.visualization.post.monitor_icepak import Monitor

Check warning on line 171 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L170-L171

Added lines #L170 - L171 were not covered by tests

self._monitor = Monitor(self)

Check warning on line 173 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L173

Added line #L173 was not covered by tests

self._monitor._delete_removed_monitors() # force update. some operations may delete monitors
return self._monitor

Check warning on line 176 in src/ansys/aedt/core/application/analysis_icepak.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_icepak.py#L175-L176

Added lines #L175 - L176 were not covered by tests

Expand Down

0 comments on commit a7f319d

Please sign in to comment.