def _get_plugins(self): plugins = [] for s in self.cfg.sections(): if (m := re.match('soln-plugin-(.+?)(?:-(.+))?$', s)): cfgsect, name, suffix = m.group(0), m.group(1), m.group(2) # Instantiate plugins.append(get_plugin(name, self, cfgsect, suffix))
def _get_plugins(self): plugins = [] for s in self.cfg.sections(): m = re.match('soln-plugin-(.+?)(?:-(.+))?$', s) if m: cfgsect, name, suffix = m.group(0), m.group(1), m.group(2) # Instantiate plugins.append(get_plugin(name, self, cfgsect, suffix)) return plugins
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Current and minimum time steps self._dt = self.cfg.getfloat('solver-time-integrator', 'dt') self.dtmin = 1.0e-12 # Solution filtering frequency self._fnsteps = self.cfg.getint('soln-filter', 'nsteps', '0') # Bank index of solution self._idxcurr = 0 # Solution cache self._curr_soln = None # Accepted and rejected step counters self.nacptsteps = 0 self.nrjctsteps = 0 self.nacptchain = 0 # Stats on the most recent step self.stepinfo = [] # Event handlers for advance_to self.completed_step_handlers = proxylist([]) # Record the starting wall clock time self._wstart = time.time() # Load any plugins specified in the config file for s in self.cfg.sections(): m = re.match('soln-plugin-(.+?)(?:-(.+))?$', s) if m: cfgsect, name, suffix = m.group(0), m.group(1), m.group(2) # Instantiate plugin = get_plugin(name, self, cfgsect, suffix) # Register as an event handler self.completed_step_handlers.append(plugin) # Delete the memory-intensive elements map from the system del self.system.ele_map