/[escript]/trunk/escriptcore/py_src/flows.py
ViewVC logotype

Diff of /trunk/escriptcore/py_src/flows.py

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

revision 4326 by caltinay, Wed Mar 20 02:50:46 2013 UTC revision 4396 by jfenwick, Wed May 8 09:27:10 2013 UTC
# Line 37  from . import escriptcpp Line 37  from . import escriptcpp
37  escore=escriptcpp  escore=escriptcpp
38  #from . import escript  #from . import escript
39  from . import util  from . import util
40  from .linearPDEs import LinearPDE, LinearPDESystem, LinearSinglePDE, SolverOptions  import linearPDEs as lpe
41  from .pdetools import HomogeneousSaddlePointProblem,Projector, ArithmeticTuple, PCG, NegativeNorm, GMRES  import pdetools as pdt
42    
43  class DarcyFlow(object):  class DarcyFlow(object):
44     """     """
# Line 84  class DarcyFlow(object): Line 84  class DarcyFlow(object):
84        self.l=None        self.l=None
85        self.w=None        self.w=None
86            
87        self.__pde_p=LinearSinglePDE(domain)        self.__pde_p=lpe.LinearSinglePDE(domain)
88        self.__pde_p.setSymmetryOn()        self.__pde_p.setSymmetryOn()
89        if self.useReduced: self.__pde_p.setReducedOrderOn()        if self.useReduced: self.__pde_p.setReducedOrderOn()
90    
# Line 96  class DarcyFlow(object): Line 96  class DarcyFlow(object):
96           if util.inf(w)<0.:           if util.inf(w)<0.:
97              raise ValueError("Weighting factor must be non-negative.")              raise ValueError("Weighting factor must be non-negative.")
98           if self.verbose: print("DarcyFlow: global postprocessing of flux is used.")           if self.verbose: print("DarcyFlow: global postprocessing of flux is used.")
99           self.__pde_v=LinearPDESystem(domain)           self.__pde_v=lpe.LinearPDESystem(domain)
100           self.__pde_v.setSymmetryOn()           self.__pde_v.setSymmetryOn()
101           if self.useReduced: self.__pde_v.setReducedOrderOn()           if self.useReduced: self.__pde_v.setReducedOrderOn()
102           self.w=w           self.w=w
# Line 105  class DarcyFlow(object): Line 105  class DarcyFlow(object):
105           #self.l=util.vol(self.domain)**(1./self.domain.getDim()) # length scale           #self.l=util.vol(self.domain)**(1./self.domain.getDim()) # length scale
106    
107        elif self.solver  == self.SMOOTH:        elif self.solver  == self.SMOOTH:
108           self.__pde_v=LinearPDESystem(domain)           self.__pde_v=lpe.LinearPDESystem(domain)
109           self.__pde_v.setSymmetryOn()           self.__pde_v.setSymmetryOn()
110           if self.useReduced: self.__pde_v.setReducedOrderOn()           if self.useReduced: self.__pde_v.setReducedOrderOn()
111           if self.verbose: print("DarcyFlow: flux smoothing is used.")           if self.verbose: print("DarcyFlow: flux smoothing is used.")
# Line 317  class DarcyFlow(object): Line 317  class DarcyFlow(object):
317              u= self.__pde_v.getSolution() * self.perm_scale              u= self.__pde_v.getSolution() * self.perm_scale
318          return u          return u
319                
320  class StokesProblemCartesian(HomogeneousSaddlePointProblem):  class StokesProblemCartesian(pdt.HomogeneousSaddlePointProblem):
321       """       """
322       solves       solves
323    
# Line 349  class StokesProblemCartesian(Homogeneous Line 349  class StokesProblemCartesian(Homogeneous
349           :param domain: domain of the problem.           :param domain: domain of the problem.
350           :type domain: `Domain`           :type domain: `Domain`
351           """           """
352           HomogeneousSaddlePointProblem.__init__(self,**kwargs)           pdt.HomogeneousSaddlePointProblem.__init__(self,**kwargs)
353           self.domain=domain           self.domain=domain
354           self.__pde_v=LinearPDE(domain,numEquations=self.domain.getDim(),numSolutions=self.domain.getDim())           self.__pde_v=lpe.LinearPDE(domain,numEquations=self.domain.getDim(),numSolutions=self.domain.getDim())
355           self.__pde_v.setSymmetryOn()           self.__pde_v.setSymmetryOn()
356            
357           self.__pde_prec=LinearPDE(domain)           self.__pde_prec=lpe.LinearPDE(domain)
358           self.__pde_prec.setReducedOrderOn()           self.__pde_prec.setReducedOrderOn()
359           self.__pde_prec.setSymmetryOn()           self.__pde_prec.setSymmetryOn()
360    
361           self.__pde_proj=LinearPDE(domain)           self.__pde_proj=lpe.LinearPDE(domain)
362           self.__pde_proj.setReducedOrderOn()           self.__pde_proj.setReducedOrderOn()
363           self.__pde_proj.setValue(D=1)           self.__pde_proj.setValue(D=1)
364           self.__pde_proj.setSymmetryOn()           self.__pde_proj.setSymmetryOn()

Legend:
Removed from v.4326  
changed lines
  Added in v.4396

  ViewVC Help
Powered by ViewVC 1.1.26