Ejemplo n.º 1
0
 def __add__(self, other):
     if isinstance(other, TransientTerm):
         return self.__class__(coeff=self.coeff + other.coeff)
     else:
         return CellTerm.__add__(self, other)
Ejemplo n.º 2
0
 def __init__(self, coeff=0., var=None):
     if self.__class__ is SourceTerm:
         raise AbstractBaseClassError
     CellTerm.__init__(self, coeff=coeff, var=var)
Ejemplo n.º 3
0
 def __init__(self, coeff=0., var=None):
     if self.__class__ is SourceTerm:
         raise AbstractBaseClassError
     CellTerm.__init__(self, coeff=coeff, var=var) 
Ejemplo n.º 4
0
    def __init__(self, coeff = 0.):
        if self.__class__ is SourceTerm:
            raise NotImplementedError, "can't instantiate abstract base class"
	CellTerm.__init__(self, coeff = coeff)