def __init__(self, kw): discGen.__init__(self, kw) self.diagnostics._errmessages[E_COMPUTFAIL] = 'Computation of trajectory failed' # user auxiliary function interface self.auxfns = auxfn_container(self) dispatch_list = ['varspecs', 'tdomain', 'ttype', 'tdata', 'tstep', 'inputs', 'ics', 'allvars', 'xtype', 'pars', 'xdomain', 'reuseterms', 'algparams', 'pdomain', 'system', 'fnspecs', 'vfcodeinserts', 'ignorespecial'] # process keys and build func spec self.funcspec = RHSfuncSpec(self._kw_process_dispatch(dispatch_list, kw)) self._kw_process_events(kw) self.checkArgs(kw) tindepdomain = Interval('t_domain', self.indepvartype, self.tdomain, self._abseps) tdepdomain = Interval('t', self.indepvartype, self.tdata, self._abseps) self.indepvariable = Variable(listid, tindepdomain, tdepdomain, 't') self._register(self.indepvariable) for xname in self.funcspec.vars + self.funcspec.auxvars: # Add a temporary dependent variable domain, for validation testing # during integration self.variables[xname] = Variable(indepdomain=tdepdomain, depdomain=Interval(xname, self.xtype[xname], self.xdomain[xname], self._abseps)) self._register(self.variables) self._generate_ixmaps() # Introduce any python-specified code to the local namespace self.addMethods() # all registration completed self.validateSpec()
def __setstate__(self, state): self.__dict__.update(state) self._solver = None if self._funcreg != {}: self.auxfns = auxfn_container(self) self.addMethods()