#80: needless rebuilding of variables
-------------------+--------------------------------------------------------
Reporter:  wd15    |       Owner:      
    Type:  defect  |      Status:  new 
Priority:  1       |   Component:  None
 Version:          |    Severity:  Bugs
Keywords:          |  
-------------------+--------------------------------------------------------
 There are places in _buildMatrix where we are recreating variables
 everytime we call _buildMatrix.
 Creating variables is relatively expensive due to the

              - shape calculating using the op,
              - getUnit() (although it shouldn't be)
              - building C strings (for small problems)

 I think we are recreating these variables due to our caching issues. It
 seems that we should be able to
 keep the variable object but just explicitly tell it not to cache. For
 example in diffusionTerm.py we have

     >>> coeff = self._getGeomCoeff(mesh)
     >>> minusCoeff = -coeff

 and then later on we say

     >>> del minusCoeff
     >>> del coeffs

 It seems like for those situations we should be declaring as self.coeff
 the first time through but then saying
 self.coeff.dontCache() after declaration and then there is no need to
 delete. If we are running
 --cache mode on then we probably want to keep self.coeff anyway and not
 delete it.

-- 
Ticket URL: <http://matdl-osi.org:9000/fipy/ticket/80>
FiPy <http://www.ctcms.nist.gov/fipy>
A Finite Volume PDE Solver Using Python

Reply via email to