Changeset 2778 for trunk

Show
Ignore:
Timestamp:
10/23/2008 04:43:14 PM (3 months ago)
Author:
guyer
Message:

Merged log:branches/abstractBaseClass@2774:2775 via svnmerge to source:trunk

........

r2774 | guyer | 2008-10-23 16:00:35 -0400 (Thu, 23 Oct 2008) | 2 lines


raise NotImplementedError for abstract bases

........

r2775 | guyer | 2008-10-23 16:20:53 -0400 (Thu, 23 Oct 2008) | 2 lines


can't test abstract bases

........

Location:
trunk
Files:
20 modified

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svnmerge-integrated changed from /branches/abstractBaseClass:1-2772 to /branches/abstractBaseClass:1-2777
  • trunk/FiPy.egg-info/SOURCES.txt

    r2763 r2778  
    501501utils/includedHTMLWriter.py 
    502502utils/includedLaTeXWriter.py 
    503 utils/epydoc/Makefile 
    504 utils/epydoc/doc/.cvsignore 
    505 utils/epydoc/doc/configfile.html 
    506 utils/epydoc/doc/custom.css 
    507 utils/epydoc/doc/docstrings.html 
    508 utils/epydoc/doc/docutils.css 
    509 utils/epydoc/doc/epydoc-slides.pdf 
    510 utils/epydoc/doc/epydoc-slides.ppt 
    511 utils/epydoc/doc/epydoc.css 
    512 utils/epydoc/doc/epydoc_gui.png 
    513 utils/epydoc/doc/epydoc_guiconfig.png 
    514 utils/epydoc/doc/epytext.html 
    515 utils/epydoc/doc/epytext_example.py 
    516 utils/epydoc/doc/epytextintro.html 
    517 utils/epydoc/doc/faq.html 
    518 utils/epydoc/doc/fields.html 
    519 utils/epydoc/doc/future.html 
    520 utils/epydoc/doc/history.html 
    521 utils/epydoc/doc/home.thumbnail.png 
    522 utils/epydoc/doc/index.html 
    523 utils/epydoc/doc/index.thumbnail.png 
    524 utils/epydoc/doc/inh_example.py 
    525 utils/epydoc/doc/installing.html 
    526 utils/epydoc/doc/license.html 
    527 utils/epydoc/doc/manual-docstring.txt 
    528 utils/epydoc/doc/manual-epytext.txt 
    529 utils/epydoc/doc/manual-fields.txt 
    530 utils/epydoc/doc/manual-install.txt 
    531 utils/epydoc/doc/manual-othermarkup.txt 
    532 utils/epydoc/doc/manual-reference.txt 
    533 utils/epydoc/doc/manual-usage.txt 
    534 utils/epydoc/doc/manual.txt 
    535 utils/epydoc/doc/othermarkup.html 
    536 utils/epydoc/doc/pycon-epydoc.html 
    537 utils/epydoc/doc/pycon-epydoc.pdf 
    538 utils/epydoc/doc/pycon-epydoc.ps 
    539 utils/epydoc/doc/pysrc.thumbnail.png 
    540 utils/epydoc/doc/relatedprojects.html 
    541 utils/epydoc/doc/rst-template.txt 
    542 utils/epydoc/doc/rst-template2.txt 
    543 utils/epydoc/doc/sflogo.png 
    544 utils/epydoc/doc/stylesheet.html 
    545 utils/epydoc/doc/uml.thumbnail.png 
    546 utils/epydoc/doc/using.html 
    547 utils/epydoc/doc/whatsnew.html 
    548 utils/epydoc/doc/doctest/index.html 
    549 utils/epydoc/man/epydoc.1 
    550 utils/epydoc/man/epydocgui.1 
    551 utils/epydoc/src/LICENSE.txt 
    552 utils/epydoc/src/MANIFEST.in 
    553 utils/epydoc/src/Makefile 
    554 utils/epydoc/src/README.txt 
    555 utils/epydoc/src/setup.py 
    556 utils/epydoc/src/epydoc/__init__.py 
    557 utils/epydoc/src/epydoc/apidoc.py 
    558 utils/epydoc/src/epydoc/checker.py 
    559 utils/epydoc/src/epydoc/cli.py 
    560 utils/epydoc/src/epydoc/compat.py 
    561 utils/epydoc/src/epydoc/docbuilder.py 
    562 utils/epydoc/src/epydoc/docintrospecter.py 
    563 utils/epydoc/src/epydoc/docparser.py 
    564 utils/epydoc/src/epydoc/docstringparser.py 
    565 utils/epydoc/src/epydoc/gui.py 
    566 utils/epydoc/src/epydoc/log.py 
    567 utils/epydoc/src/epydoc/util.py 
    568 utils/epydoc/src/epydoc/docwriter/__init__.py 
    569 utils/epydoc/src/epydoc/docwriter/dotgraph.py 
    570 utils/epydoc/src/epydoc/docwriter/html.py 
    571 utils/epydoc/src/epydoc/docwriter/html_colorize.py 
    572 utils/epydoc/src/epydoc/docwriter/html_css.py 
    573 utils/epydoc/src/epydoc/docwriter/html_help.py 
    574 utils/epydoc/src/epydoc/docwriter/latex.py 
    575 utils/epydoc/src/epydoc/docwriter/plaintext.py 
    576 utils/epydoc/src/epydoc/docwriter/xlink.py 
    577 utils/epydoc/src/epydoc/docwriter/latexstyles/epydoc-default.sty 
    578 utils/epydoc/src/epydoc/markup/__init__.py 
    579 utils/epydoc/src/epydoc/markup/doctest.py 
    580 utils/epydoc/src/epydoc/markup/epytext.py 
    581 utils/epydoc/src/epydoc/markup/javadoc.py 
    582 utils/epydoc/src/epydoc/markup/plaintext.py 
    583 utils/epydoc/src/epydoc/markup/pyval_repr.py 
    584 utils/epydoc/src/epydoc/markup/restructuredtext.py 
    585 utils/epydoc/src/epydoc/test/__init__.py 
    586 utils/epydoc/src/epydoc/test/apidoc.doctest 
    587 utils/epydoc/src/epydoc/test/docbuilder.doctest 
    588 utils/epydoc/src/epydoc/test/docintrospecter.doctest 
    589 utils/epydoc/src/epydoc/test/docparser.doctest 
    590 utils/epydoc/src/epydoc/test/encoding.doctest 
    591 utils/epydoc/src/epydoc/test/epytext.doctest 
    592 utils/epydoc/src/epydoc/test/javadoc.doctest 
    593 utils/epydoc/src/epydoc/test/plaintext.doctest 
    594 utils/epydoc/src/epydoc/test/pyval_repr.doctest 
    595 utils/epydoc/src/epydoc/test/restructuredtext.doctest 
    596 utils/epydoc/src/epydoc/test/util.py 
    597 utils/epydoc/src/epydoc/test/zope2.doctest 
    598 utils/epydoc/src/epydoc/test/zope3.doctest 
    599 utils/epydoc/src/scripts/.cvsignore 
    600 utils/epydoc/src/scripts/apirst2html.py 
    601 utils/epydoc/src/scripts/epydoc 
    602 utils/epydoc/src/scripts/epydoc.py 
    603 utils/epydoc/src/scripts/epydoc.pyw 
    604 utils/epydoc/src/scripts/epydocgui 
    605 utils/epydoc/src/tools/mkdispatch.py 
    606 utils/epydoc/src/tools/rst2html.py 
  • trunk/fipy/boundaryConditions/boundaryCondition.py

    r2573 r2778  
    77 #  FILE: "boundaryCondition.py" 
    88 #                                    created: 11/15/03 {9:47:59 PM}  
    9  #                                last update: 6/2/08 {10:41:16 PM}  
     9 #                                last update: 10/23/08 {4:11:11 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5656    def __init__(self,faces,value): 
    5757        """ 
    58  
    59         The `BoundaryCondition` class should not be invoked directly. 
    60          
    6158        :Parameters: 
    6259            - `faces`: A `list` or `tuple` of `Face` objects to which this condition applies. 
     
    6966            >>> from fipy.meshes.grid1D import Grid1D 
    7067            >>> mesh = Grid1D(nx = 2) 
    71             >>> bc = BoundaryCondition(mesh.getInteriorFaces(), 0) 
     68            >>> bc = __BoundaryCondition(mesh.getInteriorFaces(), 0) 
    7269            Traceback (most recent call last): 
    7370                ... 
     
    7572 
    7673        """ 
     74        if self.__class__ is BoundaryCondition: 
     75            raise NotImplementedError, "can't instantiate abstract base class" 
     76         
    7777        self.faces = faces 
    7878        self.value = PhysicalField(value) 
     
    100100        (**L**, **b**) matrices. 
    101101        """  
    102         pass 
     102        raise NotImplementedError 
    103103     
    104104    def _getDerivative(self, order): 
     
    117117        self.boundaryConditionApplied = False 
    118118 
     119class __BoundaryCondition(BoundaryCondition):  
     120    """ 
     121    Dummy subclass for tests 
     122    """ 
     123    pass  
     124 
    119125def _test():  
    120126    import doctest 
  • trunk/fipy/solvers/pysparse/pysparseSolver.py

    r2331 r2778  
    88 #  FILE: "pysparseSolver.py" 
    99 #                                    created: 06/28/07 
    10  #                                last update: 06/28/07 
     10 #                                last update: 10/23/08 {3:04:27 PM} 
    1111 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1212 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5353    .. attention:: This class is abstract. Always create one of its subclasses. 
    5454    """ 
     55    def __init__(self, *args, **kwargs): 
     56        if self.__class__ is PysparseSolver: 
     57            raise NotImplementedError, "can't instantiate abstract base class" 
     58             
     59        Solver.__init__(self, *args, **kwargs) 
    5560 
    5661    def _getMatrixClass(self): 
  • trunk/fipy/solvers/scipy/scipySolver.py

    r2331 r2778  
    88 #  FILE: "scipySolver.py" 
    99 #                                    created: 06/28/07 
    10  #                                last update: 06/29/07 
     10 #                                last update: 10/23/08 {3:05:25 PM} 
    1111 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1212 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5353    .. attention:: This class is abstract. Always create one of its subclasses. 
    5454    """ 
     55    def __init__(self, *args, **kwargs): 
     56        if self.__class__ is ScipySolver: 
     57            raise NotImplementedError, "can't instantiate abstract base class" 
     58             
     59        Solver.__init__(self, *args, **kwargs) 
    5560 
    5661    def _getMatrixClass(self): 
  • trunk/fipy/solvers/solver.py

    r2331 r2778  
    88 #  FILE: "solver.py" 
    99 #                                    created: 11/14/03 {3:47:20 PM}  
    10  #                                last update: 11/16/06 {2:36:00 PM}  
     10 #                                last update: 10/23/08 {3:02:19 PM}  
    1111 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1212 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    111111 
    112112        """ 
     113        if self.__class__ is Solver: 
     114            raise NotImplementedError, "can't instantiate abstract base class" 
     115             
    113116        self.tolerance = tolerance 
    114117        if steps is not None: 
     
    126129         
    127130    def _solve(self, L, x, b): 
    128         pass 
     131        raise NotImplementedError 
    129132         
    130133    _warningList = (ScalarQuantityOutOfRangeWarning, 
     
    152155 
    153156    def _getMatrixClass(self): 
    154         pass 
     157        raise NotImplementedError 
  • trunk/fipy/solvers/trilinos/preconditioners/preconditioner.py

    r2331 r2778  
    88 #  FILE: "preconditioner.py" 
    99 #                                    created: 06/25/07 
    10  #                                last update: 06/25/07 
     10 #                                last update: 10/23/08 {3:07:49 PM} 
    1111 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1212 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5656        Create a `Preconditioner` object. 
    5757        """ 
    58         pass 
     58        if self.__class__ is Preconditioner: 
     59            raise NotImplementedError, "can't instantiate abstract base class" 
    5960         
    6061    def _applyToSolver(self, solver, matrix): 
    61         pass 
     62        raise NotImplementedError 
    6263         
  • trunk/fipy/solvers/trilinos/trilinosAztecOOSolver.py

    r2497 r2778  
    77 #  FILE: "trilinosAztecOOSolver.py" 
    88 #                                    created: 06/25/07  
    9  #                                last update: 06/25/07  
     9 #                                last update: 10/23/08 {3:10:10 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    6565 
    6666        """ 
     67        if self.__class__ is TrilinosAztecOOSolver: 
     68            raise NotImplementedError, "can't instantiate abstract base class" 
     69             
    6770        TrilinosSolver.__init__(self, tolerance=tolerance, 
    6871                                iterations=iterations, steps=steps, precon=None) 
  • trunk/fipy/solvers/trilinos/trilinosSolver.py

    r2334 r2778  
    77 #  FILE: "trilinosSolver.py" 
    88 #                                    created: 06/07/07  
    9  #                                last update: 06/25/07  
     9 #                                last update: 10/23/08 {3:10:07 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    6060 
    6161    """ 
    62      
     62    def __init__(self, *args, **kwargs): 
     63        if self.__class__ is TrilinosSolver: 
     64            raise NotImplementedError, "can't instantiate abstract base class" 
     65             
    6366    def _makeTrilinosMatrix(self, L): 
    6467        """  
     
    132135 
    133136    def _applyTrilinosSolver(self): 
    134         pass 
     137        raise NotImplementedError 
  • trunk/fipy/terms/cellTerm.py

    r2454 r2778  
    77 #  FILE: "cellTerm.py" 
    88 #                                    created: 11/12/03 {11:00:54 AM}  
    9  #                                last update: 3/29/07 {10:40:50 AM}  
     9 #                                last update: 10/23/08 {4:04:47 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5555    """ 
    5656    def __init__(self, coeff=1.): 
     57        if self.__class__ is CellTerm: 
     58            raise NotImplementedError, "can't instantiate abstract base class" 
     59             
    5760        from fipy.variables.variable import Variable 
    5861        if not isinstance(coeff, Variable): 
     
    158161            >>> vcv = CellVariable(mesh=m, rank=1) 
    159162            >>> vfv = FaceVariable(mesh=m, rank=1) 
    160             >>> CellTerm(coeff=cv) 
    161             CellTerm(coeff=CellVariable(value=array([ 0.,  0.]), mesh=UniformGrid1D(dx=1.0, nx=2))) 
    162             >>> CellTerm(coeff=1) 
    163             CellTerm(coeff=1) 
    164             >>> CellTerm(coeff=fv) 
    165             Traceback (most recent call last): 
    166                 ... 
    167             TypeError: The coefficient must be a rank-0 CellVariable or a scalar value. 
    168             >>> CellTerm(coeff=vcv) 
    169             Traceback (most recent call last): 
    170                 ... 
    171             TypeError: The coefficient must be a rank-0 CellVariable or a scalar value. 
    172             >>> CellTerm(coeff=vfv) 
    173             Traceback (most recent call last): 
    174                 ... 
    175             TypeError: The coefficient must be a rank-0 CellVariable or a scalar value. 
    176             >>> CellTerm(coeff=(1,)) 
     163 
     164            >>> __CellTerm(coeff=cv) 
     165            __CellTerm(coeff=CellVariable(value=array([ 0.,  0.]), mesh=UniformGrid1D(dx=1.0, nx=2))) 
     166            >>> __CellTerm(coeff=1) 
     167            __CellTerm(coeff=1) 
     168            >>> __CellTerm(coeff=fv) 
     169            Traceback (most recent call last): 
     170                ... 
     171            TypeError: The coefficient must be a rank-0 CellVariable or a scalar value. 
     172            >>> __CellTerm(coeff=vcv) 
     173            Traceback (most recent call last): 
     174                ... 
     175            TypeError: The coefficient must be a rank-0 CellVariable or a scalar value. 
     176            >>> __CellTerm(coeff=vfv) 
     177            Traceback (most recent call last): 
     178                ... 
     179            TypeError: The coefficient must be a rank-0 CellVariable or a scalar value. 
     180            >>> __CellTerm(coeff=(1,)) 
    177181            Traceback (most recent call last): 
    178182                ... 
     
    182186        pass 
    183187 
     188class __CellTerm(CellTerm): 
     189    """ 
     190    Dummy subclass for tests 
     191    """ 
     192    pass  
     193     
    184194 
    185195def _test():  
  • trunk/fipy/terms/convectionTerm.py

    r2331 r2778  
    77 #  FILE: "convectionTerm.py" 
    88 #                                    created: 11/13/03 {11:39:03 AM}  
    9  #                                last update: 3/29/07 {10:40:48 AM}  
     9 #                                last update: 10/23/08 {4:07:28 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    6969            >>> vcv = CellVariable(mesh=m, rank=1) 
    7070            >>> vfv = FaceVariable(mesh=m, rank=1) 
    71             >>> ConvectionTerm(coeff = cv) 
     71            >>> __ConvectionTerm(coeff = cv) 
    7272            Traceback (most recent call last): 
    7373                ... 
    7474            TypeError: The coefficient must be a vector value. 
    75             >>> ConvectionTerm(coeff = fv) 
     75            >>> __ConvectionTerm(coeff = fv) 
    7676            Traceback (most recent call last): 
    7777                ... 
    7878            TypeError: The coefficient must be a vector value. 
    79             >>> ConvectionTerm(coeff = vcv) 
    80             ConvectionTerm(coeff=_ArithmeticCellToFaceVariable(value=array([[ 0.,  0.,  0.]]), mesh=UniformGrid1D(dx=1.0, nx=2))) 
    81             >>> ConvectionTerm(coeff = vfv) 
    82             ConvectionTerm(coeff=FaceVariable(value=array([[ 0.,  0.,  0.]]), mesh=UniformGrid1D(dx=1.0, nx=2))) 
    83             >>> ConvectionTerm(coeff = (1,)) 
    84             ConvectionTerm(coeff=(1,)) 
     79            >>> __ConvectionTerm(coeff = vcv) 
     80            __ConvectionTerm(coeff=_ArithmeticCellToFaceVariable(value=array([[ 0.,  0.,  0.]]), mesh=UniformGrid1D(dx=1.0, nx=2))) 
     81            >>> __ConvectionTerm(coeff = vfv) 
     82            __ConvectionTerm(coeff=FaceVariable(value=array([[ 0.,  0.,  0.]]), mesh=UniformGrid1D(dx=1.0, nx=2))) 
     83            >>> __ConvectionTerm(coeff = (1,)) 
     84            __ConvectionTerm(coeff=(1,)) 
    8585            >>> from fipy.terms.explicitUpwindConvectionTerm import ExplicitUpwindConvectionTerm 
    8686            >>> ExplicitUpwindConvectionTerm(coeff = (0,)).solve(var = cv) 
     
    9494            >>> vcv2 = CellVariable(mesh=m2, rank=1) 
    9595            >>> vfv2 = FaceVariable(mesh=m2, rank=1) 
    96             >>> ConvectionTerm(coeff=vcv2) 
    97             ConvectionTerm(coeff=_ArithmeticCellToFaceVariable(value=array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.], 
     96            >>> __ConvectionTerm(coeff=vcv2) 
     97            __ConvectionTerm(coeff=_ArithmeticCellToFaceVariable(value=array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.], 
    9898                   [ 0.,  0.,  0.,  0.,  0.,  0.,  0.]]), mesh=UniformGrid2D(dx=1.0, dy=1.0, nx=2, ny=1))) 
    99             >>> ConvectionTerm(coeff=vfv2) 
    100             ConvectionTerm(coeff=FaceVariable(value=array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.], 
     99            >>> __ConvectionTerm(coeff=vfv2) 
     100            __ConvectionTerm(coeff=FaceVariable(value=array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.], 
    101101                   [ 0.,  0.,  0.,  0.,  0.,  0.,  0.]]), mesh=UniformGrid2D(dx=1.0, dy=1.0, nx=2, ny=1))) 
    102102            >>> ExplicitUpwindConvectionTerm(coeff = ((0,),(0,))).solve(var=cv2) 
     
    108108          - `diffusionTerm` : ** deprecated **. The Peclet number is calculated automatically. 
    109109        """ 
     110        if self.__class__ is ConvectionTerm: 
     111            raise NotImplementedError, "can't instantiate abstract base class" 
     112             
    110113        if diffusionTerm is not None: 
    111114            import warnings 
     
    173176            return FaceTerm.__add__(self, other) 
    174177 
     178class __ConvectionTerm(ConvectionTerm):  
     179    """ 
     180    Dummy subclass for tests 
     181    """ 
     182    pass  
     183 
    175184def _test():  
    176185    import doctest 
  • trunk/fipy/terms/equation.py

    r2447 r2778  
    77 #  FILE: "equation.py" 
    88 #                                    created: 11/9/04 {11:51:08 AM}  
    9  #                                last update: 7/25/07 {9:57:05 AM}  
     9 #                                last update: 10/23/08 {4:10:02 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    134134        Add a `Term` to another `Term`, number or variable. 
    135135 
    136            >>> Term(coeff=1.) + 10. + Term(2.) 
    137            10.0 + Term(coeff=3.0) == 0 
    138            >>> Term(coeff=1.) + Term(coeff=2.) + Term(coeff=3.) 
    139            Term(coeff=6.0) 
     136           >>> __Term(coeff=1.) + 10. + __Term(2.) 
     137           10.0 + __Term(coeff=3.0) == 0 
     138           >>> __Term(coeff=1.) + __Term(coeff=2.) + __Term(coeff=3.) 
     139           __Term(coeff=6.0) 
    140140 
    141141        """ 
     
    178178         Negate a `Term`. 
    179179 
    180            >>> -(Term(coeff=1.) - Term(coeff=2.)) 
    181            Term(coeff=1.0) 
     180           >>> -(__Term(coeff=1.) - __Term(coeff=2.)) 
     181           __Term(coeff=1.0) 
    182182 
    183183        """ 
     
    189189                 
    190190        return dup 
     191 
     192class __Term(Term): 
     193    """ 
     194    Dummy subclass for tests 
     195    """ 
     196    pass  
    191197 
    192198def _test():  
  • trunk/fipy/terms/faceTerm.py

    r2571 r2778  
    77 #  FILE: "faceTerm.py" 
    88 #                                    created: 11/17/03 {10:29:10 AM}  
    9  #                                last update: 6/7/08 {11:11:20 PM}  
     9 #                                last update: 10/23/08 {3:13:50 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5555    """ 
    5656    def __init__(self, coeff=1.): 
     57        if self.__class__ is FaceTerm: 
     58            raise NotImplementedError, "can't instantiate abstract base class" 
     59             
    5760        Term.__init__(self, coeff=coeff) 
    5861        self.coeffMatrix = None 
  • trunk/fipy/terms/sourceTerm.py

    r2149 r2778  
    77 #  FILE: "sourceTerm.py" 
    88 #                                    created: 11/28/03 {11:36:25 AM}  
    9  #                                last update: 3/28/07 {10:17:48 AM}  
     9 #                                last update: 10/23/08 {3:14:26 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    5050    """ 
    5151    def __init__(self, coeff = 0.): 
     52        if self.__class__ is SourceTerm: 
     53            raise NotImplementedError, "can't instantiate abstract base class" 
    5254        CellTerm.__init__(self, coeff = coeff)  
    5355         
  • trunk/fipy/terms/term.py

    r2737 r2778  
    77 #  FILE: "term.py" 
    88 #                                    created: 11/12/03 {10:54:37 AM}  
    9  #                                last update: 9/17/08 {9:34:46 AM}  
     9 #                                last update: 10/23/08 {4:05:43 PM}  
    1010 #  Author: Jonathan Guyer <guyer@nist.gov> 
    1111 #  Author: Daniel Wheeler <daniel.wheeler@nist.gov> 
     
    6464 
    6565        """   
     66        if self.__class__ is Term: 
     67            raise NotImplementedError, "can't instantiate abstract base class" 
     68             
    6669        self.coeff = coeff 
    6770        self.geomCoeff = None 
     
    7376         
    7477    def _buildMatrix(self, var, SparseMatrix, boundaryConditions, dt, equation=None):