@@ -124,6 +124,7 @@ def __init__(self, loglevel='DEBUG', use_vtk=True, log_apdl=False, local=True,
124124 self ._vget_arr_counter = 0
125125 self ._start_parm = start_parm
126126 self ._path = start_parm .get ('run_location' , None )
127+ self ._ignore_errors = False
127128
128129 self ._log = setup_logger (loglevel .upper ())
129130 self ._log .debug ('Logging set to %s' , loglevel )
@@ -1765,9 +1766,15 @@ def run(self, command, write_to_log=True, **kwargs):
17651766 text += '\n \n Ignore these messages by setting allow_ignore=True'
17661767 raise MapdlInvalidRoutineError (text )
17671768
1768- if '*** ERROR ***' in self ._response : # flag error
1769- self ._log .error (self ._response )
1770- raise MapdlRuntimeError (self ._response )
1769+ # flag error
1770+ 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 :
1776+ self ._log .error (self ._response )
1777+ raise MapdlRuntimeError (self ._response )
17711778
17721779 # special returns for certain geometry commands
17731780 short_cmd = parse_to_short_cmd (command )
@@ -1782,6 +1789,20 @@ def run(self, command, write_to_log=True, **kwargs):
17821789
17831790 return self ._response
17841791
1792+ @property
1793+ def ignore_errors (self ):
1794+ """Flag to ignore MAPDL errors.
1795+
1796+ Normally, any string containing "*** ERROR ***" from MAPDL
1797+ will trigger a ``MapdlRuntimeError``. Set this to ``True`` to
1798+ ignore these errors.
1799+ """
1800+ return self ._ignore_errors
1801+
1802+ @ignore_errors .setter
1803+ def ignore_errors (self , value ):
1804+ self ._ignore_errors = bool (value )
1805+
17851806 # @supress_logging
17861807 def load_table (self , name , array , var1 = '' , var2 = '' , var3 = '' ):
17871808 """Load a table from Python to MAPDL
0 commit comments