/[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 3051 by lgao, Tue Jun 29 00:45:49 2010 UTC revision 3071 by gross, Wed Jul 21 05:37:30 2010 UTC
# Line 67  class SolverOptions(object): Line 67  class SolverOptions(object):
67      :cvar CR: The conjugate residual method      :cvar CR: The conjugate residual method
68      :cvar CGS: The conjugate gradient square method      :cvar CGS: The conjugate gradient square method
69      :cvar BICGSTAB: The stabilized Bi-Conjugate Gradient method      :cvar BICGSTAB: The stabilized Bi-Conjugate Gradient method
70      :cvar TFQMR: Transport Free Quasi Minimal Residual method      :cvar TFQMR: Transpose Free Quasi Minimal Residual method
71      :cvar MINRES: Minimum residual method      :cvar MINRES: Minimum residual method
72      :cvar SSOR: The symmetric over-relaxation method      :cvar SSOR: The symmetric over-relaxation method
73      :cvar ILU0: The incomplete LU factorization preconditioner with no fill-in      :cvar ILU0: The incomplete LU factorization preconditioner with no fill-in
# Line 3100  class LameEquation(LinearPDE): Line 3100  class LameEquation(LinearPDE):
3100       else:       else:
3101          return super(LameEquation, self).getCoefficient(name)          return super(LameEquation, self).getCoefficient(name)
3102    
3103    
3104  def LinearSinglePDE(domain,debug=False):  def LinearSinglePDE(domain,debug=False):
3105     """     """
3106     Defines a single linear PDE.     Defines a single linear PDE.
# Line 3274  class TransportPDE(LinearProblem): Line 3275  class TransportPDE(LinearProblem):
3275                            of solution components is extracted from the                            of solution components is extracted from the
3276                            coefficients.                            coefficients.
3277       :param debug: if True debug information is printed       :param debug: if True debug information is printed
3278       :param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicholson scheme is applied. Note that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. The Crank-Nicholson scheme provides a higher accuracy but requires to limit the time step size to be stable.       :param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicolson scheme is applied. Note that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. The Crank-Nicolson scheme provides a higher accuracy but requires to limit the time step size to be stable.
3279       :type useBackwardEuler: ``bool``       :type useBackwardEuler: ``bool``
3280       """       """
3281       if useBackwardEuler:       if useBackwardEuler:
# Line 3536  class TransportPDE(LinearProblem): Line 3537  class TransportPDE(LinearProblem):
3537            if self.getNumSolutions() == 1:            if self.getNumSolutions() == 1:
3538          if u0.getShape()!=():          if u0.getShape()!=():
3539              raise ValueError,"Illegal shape %s of initial solution."%(u0.getShape(),)              raise ValueError,"Illegal shape %s of initial solution."%(u0.getShape(),)
3540          else:            else:
3541              if u0.getShape()!=(self.getNumSolutions(),):              if u0.getShape()!=(self.getNumSolutions(),):
3542                raise ValueError,"Illegal shape %s of initial solution."%(u0.getShape(),)                raise ValueError,"Illegal shape %s of initial solution."%(u0.getShape(),)
3543        self.setSolution(self.getOperator().solve(u0, self.getRightHandSide(),dt,option_class))        self.setSolution(self.getOperator().solve(u0, self.getRightHandSide(),dt,option_class))
# Line 3636  class TransportPDE(LinearProblem): Line 3637  class TransportPDE(LinearProblem):
3637       """       """
3638       super(TransportPDE,self).setDebugOff()       super(TransportPDE,self).setDebugOff()
3639            
3640    def SingleTransportPDE(domain,useBackwardEuler=False, debug=False):
3641       """
3642       Defines a single transport problem
3643    
3644       :param domain: domain of the PDE
3645       :type domain: `Domain`
3646       :param debug: if True debug information is printed
3647       :param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicolson scheme is applied. Note that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. The Crank-Nicolson scheme provides a higher accuracy but requires to limit the time step size to be stable.
3648       :rtype: `TransportPDE`
3649       """
3650       return TransportPDE(domain,numEquations=1,numSolutions=1, useBackwardEuler=useBackwardEuler, debug=debug)

Legend:
Removed from v.3051  
changed lines
  Added in v.3071

  ViewVC Help
Powered by ViewVC 1.1.26