/[escript]/trunk/escript/py_src/linearPDEs.py
ViewVC logotype

Diff of /trunk/escript/py_src/linearPDEs.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2524 by artak, Wed Jul 8 00:39:26 2009 UTC revision 2535 by gross, Thu Jul 16 23:39:58 2009 UTC
# Line 1360  class LinearProblem(object): Line 1360  class LinearProblem(object):
1360       @rtype: L{Domain<escript.Domain>}       @rtype: L{Domain<escript.Domain>}
1361       """       """
1362       return self.__domain       return self.__domain
1363       def getDomainStatus(self):
1364         """
1365         Return the status indicator of the domain
1366         """
1367         return self.getDomain().getStatus()
1368    
1369       def getSystemStatus(self):
1370         """
1371         Return the domain status used to build the current system
1372         """
1373         return self.__system_status
1374       def setSystemStatus(self,status=None):
1375         """
1376         Sets the system status to C{status} if C{status} is not present the
1377         current status of the domain is used.
1378         """
1379         if status == None:
1380             self.__system_status=self.getDomainStatus()
1381         else:
1382             self.__system_status=status
1383    
1384     def getDim(self):     def getDim(self):
1385       """       """
# Line 1873  class LinearProblem(object): Line 1893  class LinearProblem(object):
1893         """         """
1894         Returns True if the solution is still valid.         Returns True if the solution is still valid.
1895         """         """
1896           if not self.getDomainStatus()==self.getSystemStatus(): self.invalidateSolution()
1897         if self.__solution_rtol>self.getSolverOptions().getTolerance() or \         if self.__solution_rtol>self.getSolverOptions().getTolerance() or \
1898            self.__solution_atol>self.getSolverOptions().getAbsoluteTolerance():            self.__solution_atol>self.getSolverOptions().getAbsoluteTolerance():
1899           self.invalidateSolution()             self.invalidateSolution()  
# Line 1896  class LinearProblem(object): Line 1917  class LinearProblem(object):
1917         """         """
1918         Returns True if the operator is still valid.         Returns True if the operator is still valid.
1919         """         """
1920         if self.getRequiredOperatorType()==self.getOperatorType(): self.invalidateOperator()         if not self.getDomainStatus()==self.getSystemStatus(): self.invalidateOperator()
1921           if not self.getRequiredOperatorType()==self.getOperatorType(): self.invalidateOperator()
1922         return self.__is_operator_valid         return self.__is_operator_valid
1923    
1924     def validRightHandSide(self):     def validRightHandSide(self):
# Line 1909  class LinearProblem(object): Line 1931  class LinearProblem(object):
1931         """         """
1932         Indicates the right hand side has to be rebuilt next time it is used.         Indicates the right hand side has to be rebuilt next time it is used.
1933         """         """
1934         if self.isRightHandSideValid(): self.trace("Right hand side has to be rebuilt.")         self.trace("Right hand side has to be rebuilt.")
1935         self.invalidateSolution()         self.invalidateSolution()
1936         self.__is_RHS_valid=False         self.__is_RHS_valid=False
1937    
# Line 1917  class LinearProblem(object): Line 1939  class LinearProblem(object):
1939         """         """
1940         Returns True if the operator is still valid.         Returns True if the operator is still valid.
1941         """         """
1942           if not self.getDomainStatus()==self.getSystemStatus(): self.invalidateRightHandSide()
1943         return self.__is_RHS_valid         return self.__is_RHS_valid
1944    
1945     def invalidateSystem(self):     def invalidateSystem(self):
# Line 1939  class LinearProblem(object): Line 1962  class LinearProblem(object):
1962         """         """
1963         self.trace("New System has been created.")         self.trace("New System has been created.")
1964         self.__operator_type=None         self.__operator_type=None
1965           self.setSystemStatus()
1966         self.__operator=escript.Operator()         self.__operator=escript.Operator()
1967         self.__righthandside=escript.Data()         self.__righthandside=escript.Data()
1968         self.__solution=escript.Data()         self.__solution=escript.Data()
# Line 2584  class LinearPDE(LinearProblem): Line 2608  class LinearPDE(LinearProblem):
2608                   self.insertConstraint(rhs_only=False)                   self.insertConstraint(rhs_only=False)
2609                   self.trace("New operator has been built.")                   self.trace("New operator has been built.")
2610                   self.validOperator()                   self.validOperator()
2611           self.setSystemStatus()
2612           self.trace("System status is %s."%self.getSystemStatus())
2613         return (self.getCurrentOperator(), self.getCurrentRightHandSide())         return (self.getCurrentOperator(), self.getCurrentRightHandSide())
2614    
2615     def insertConstraint(self, rhs_only=False):     def insertConstraint(self, rhs_only=False):
# Line 3520  class TransportPDE(LinearProblem): Line 3546  class TransportPDE(LinearProblem):
3546            self.trace("New system has been built.")            self.trace("New system has been built.")
3547            self.validOperator()            self.validOperator()
3548            self.validRightHandSide()            self.validRightHandSide()
3549           self.setSystemStatus()
3550           self.trace("System status is %s."%self.getSystemStatus())
3551         return (self.getCurrentOperator(), self.getCurrentRightHandSide())         return (self.getCurrentOperator(), self.getCurrentRightHandSide())
3552    
3553     def setDebug(self, flag):     def setDebug(self, flag):

Legend:
Removed from v.2524  
changed lines
  Added in v.2535

  ViewVC Help
Powered by ViewVC 1.1.26