Example #1
0
 def __add__(self, other):
     if isinstance(other, TransientTerm):
         return self.__class__(coeff=self.coeff + other.coeff)
     else:
         return CellTerm.__add__(self, other)
Example #2
0
 def __init__(self, coeff=0., var=None):
     if self.__class__ is SourceTerm:
         raise AbstractBaseClassError
     CellTerm.__init__(self, coeff=coeff, var=var)
Example #3
0
 def __init__(self, coeff=0., var=None):
     if self.__class__ is SourceTerm:
         raise AbstractBaseClassError
     CellTerm.__init__(self, coeff=coeff, var=var) 
Example #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)