Expose Debugs to Python API

pull/98/head
Apostolos 2023-01-03 21:54:42 +02:00 committed by Thorsten Liebig
parent 3772497901
commit 638d875906
1 changed files with 14 additions and 1 deletions

View File

@ -447,7 +447,8 @@ cdef class openEMS:
continue continue
grid.AddLine(n, hint[n]) grid.AddLine(n, hint[n])
def Run(self, sim_path, cleanup=False, setup_only=False, debug_pec=False, verbose=None, **kw): def Run(self, sim_path, cleanup=False,setup_only=False, debug_material=False, debug_pec=False,
debug_operator=False, debug_boxes=False, debug_csx=False, verbose=None, **kw):
""" Run(sim_path, cleanup=False, setup_only=False, verbose=None) """ Run(sim_path, cleanup=False, setup_only=False, verbose=None)
Run the openEMS FDTD simulation. Run the openEMS FDTD simulation.
@ -468,9 +469,21 @@ cdef class openEMS:
os.chdir(sim_path) os.chdir(sim_path)
if verbose is not None: if verbose is not None:
self.thisptr.SetVerboseLevel(verbose) self.thisptr.SetVerboseLevel(verbose)
if debug_material:
with nogil:
self.thisptr.DebugMaterial()
if debug_pec: if debug_pec:
with nogil: with nogil:
self.thisptr.DebugPEC() self.thisptr.DebugPEC()
if debug_operator:
with nogil:
self.thisptr.DebugOperator()
if debug_boxes:
with nogil:
self.thisptr.DebugBox()
if debug_csx:
with nogil:
self.thisptr.DebugCSX()
if 'numThreads' in kw: if 'numThreads' in kw:
self.thisptr.SetNumberOfThreads(int(kw['numThreads'])) self.thisptr.SetNumberOfThreads(int(kw['numThreads']))
assert os.getcwd() == sim_path assert os.getcwd() == sim_path