def set_attributes(self): """ Set parameters as attributes. Priority is as follows: first manually set parameters, then manually set parameters in model (if any) and finally default values """ # Ambient temperature (temp) initially set to global # temperature, but may be overriden by the model or the # element line attributes self.temp = glVar.temp # Set overrides first if self.dotModel: ParamSet.set_attributes(self, useDefaults = False) # Get other attributes from model self.dotModel.set_missing_attributes(self) else: ParamSet.set_attributes(self, useDefaults = True)
k = ('Boltzmann constant', 'J K^{-1}', float, 1.3806488e-23), q = ('Elementary charge', 'C', float, 1.602176565e-19), epsilon0 = ('Permittivity of free space', 'F m^{-1}', float, 8.854187817e-12), mu0 = ('Permeability of free space', 'H m^{-1}', float, np.pi*4e-7), c0 = ('Speed of light in free space', 'm s^{-1}', float, 2.99792458e8), T0 = ('Zero degree Celsius temperature', 'K', float, 273.15), epSi = ('Permitivity of silicon', '', float, 104.5e-12), epOx = ('Permitivity of silicon oxide', '', float, 34.5e-12), Np2dB = ('Neper to dB conversion constant', 'dB/Np', float, 8.6858896380650368) ) const = ParamSet(constDict) const.set_attributes() globDict = dict( temp = ('Ambient temperature', 'C', float, 27.), abstol = ('Absolute tolerance for nodal variables', 'nodal unit', float, 1e-7), reltol = ('Relative tolerance for nodal variables', '', float, 1e-4), maxiter = ('Maximum number of Newton iterations', '', int, 20), maxdelta = ('Maximum allowed change in one Newton iteration', 'nodal unit', float, 20.), errfunc = ("Enable additional test for error function in Newton's method", 'bool', bool, False), sparse = ("Use sparse matrices in analyses if possible", 'bool', bool, True), gyr = ('Default gain in internal gyrators', 'S', float, 1e-3) )