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 harmonic edge case #167

Merged
merged 1 commit into from
Oct 20, 2022
Merged
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
12 changes: 6 additions & 6 deletions ansys/mapdl/reader/cyclic_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def _add_cyclic_properties(self):
mask_b = np.isclose(self.time_values, np.roll(self.time_values, -1))
self._is_repeated_mode = np.logical_or(mask_a, mask_b)

# should not have repeated modes at harmonic index of 0 or N/2
self._is_repeated_mode[self._resultheader["hindex"] == 0] = False
self._is_repeated_mode[
self._resultheader["hindex"] == self.n_sector // 2
] = False

# edge case for single pair of repeated modes
if self._is_repeated_mode.size == 2 and self._is_repeated_mode.all():
self._repeated_index = np.array([1, 0])
Expand All @@ -118,12 +124,6 @@ def _add_cyclic_properties(self):
self._is_repeated_mode = np.array([False])
return

# should not have repeated modes at harmonic index of 0 or N/2
self._is_repeated_mode[self._resultheader["hindex"] == 0] = False
self._is_repeated_mode[
self._resultheader["hindex"] == self.n_sector // 2
] = False

self._repeated_index = np.empty(self._is_repeated_mode.size, np.int)
self._repeated_index[:] = -1
if np.any(self._is_repeated_mode):
Expand Down