|
8 | 8 | import tempfile |
9 | 9 | from shutil import rmtree, copyfile |
10 | 10 | import weakref |
| 11 | +import warnings |
11 | 12 |
|
12 | 13 | import numpy as np |
13 | 14 | import pyvista as pv |
|
25 | 26 | from ansys.mapdl.core.plotting import general_plotter |
26 | 27 | from ansys.mapdl.core.post import PostProcessing |
27 | 28 |
|
| 29 | +_PERMITTED_ERRORS = [ |
| 30 | + r'(\*\*\* ERROR \*\*\*).*(?:[\r\n]+.*)+highly distorted.', |
| 31 | + r'(\*\*\* ERROR \*\*\*).*[\r\n]+.*is turning inside out.', |
| 32 | +] |
| 33 | + |
28 | 34 |
|
29 | 35 | MATPLOTLIB_LOADED = True |
30 | 36 | try: |
@@ -1766,15 +1772,19 @@ def run(self, command, write_to_log=True, **kwargs): |
1766 | 1772 | text += '\n\nIgnore these messages by setting allow_ignore=True' |
1767 | 1773 | raise MapdlInvalidRoutineError(text) |
1768 | 1774 |
|
1769 | | - # flag error |
| 1775 | + # flag errors |
1770 | 1776 | if '*** ERROR ***' in self._response and not self._ignore_errors: |
1771 | | - # remove "is turning inside out" as this allows the |
1772 | | - # solution to continue |
1773 | | - sub = re.sub(r'(\*\*\* ERROR \*\*\*).*[\r\n]+.*is turning inside out.', |
1774 | | - '', self._response) |
1775 | | - if '*** ERROR ***' in sub: |
| 1777 | + # remove permitted errors and allow MAPDL to continue |
| 1778 | + response = self._response |
| 1779 | + for err_str in _PERMITTED_ERRORS: |
| 1780 | + response = re.sub(err_str, '', response) |
| 1781 | + |
| 1782 | + if '*** ERROR ***' in response: |
1776 | 1783 | self._log.error(self._response) |
1777 | 1784 | raise MapdlRuntimeError(self._response) |
| 1785 | + else: |
| 1786 | + warnings.warn('MAPDL returned non-abort errors. Please ' |
| 1787 | + 'check the logs.') |
1778 | 1788 |
|
1779 | 1789 | # special returns for certain geometry commands |
1780 | 1790 | short_cmd = parse_to_short_cmd(command) |
|
0 commit comments