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

revision 3431 by jfenwick, Thu Nov 18 00:20:21 2010 UTC revision 3432 by jfenwick, Fri Jan 7 01:32:07 2011 UTC
# Line 31  Some models for flow Line 31  Some models for flow
31
32  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
33
34  from escript import *  import escript
35  import util  import util
36  from flows import StokesProblemCartesian  from flows import StokesProblemCartesian
37  from pdetools import MaxIterReached  from pdetools import MaxIterReached
# Line 333  class Rheology(object): Line 333  class Rheology(object):
333           #           #
334           # state variables:           # state variables:
335           #           #
336           if stress == None: stress=Tensor(0.,Function(self.__domain))           if stress == None: stress=Tensor(0.,escript.Function(self.__domain))
337           if v == None: v=Vector(0.,Solution(self.__domain))           if v == None: v=Vector(0.,escript.Solution(self.__domain))
338           if p == None: p=Vector(0.,ReducedSolution(self.__domain))           if p == None: p=Vector(0.,Reducedescript.Solution(self.__domain))
339           self.setStatus(t, v, p, stress)           self.setStatus(t, v, p, stress)
341
342        def getDomain(self):        def getDomain(self):
343            """            """
# Line 464  class Rheology(object): Line 464  class Rheology(object):
464            :type stress: `Data` of rank 2            :type stress: `Data` of rank 2
465            """            """
466            dom=self.getDomain()            dom=self.getDomain()
467            s=util.interpolate(stress,Function(dom))            s=util.interpolate(stress,escript.Function(dom))
468            self.__stress=util.deviatoric(s)            self.__stress=util.deviatoric(s)
469
470        def getPressure(self):        def getPressure(self):
# Line 482  class Rheology(object): Line 482  class Rheology(object):
482            :param p: new deviatoric stress            :param p: new deviatoric stress
483            :type p: scalar `Data`            :type p: scalar `Data`
484            """            """
485            self.__p=util.interpolate(p,ReducedSolution(self.getDomain()))            self.__p=util.interpolate(p,escript.ReducedSolution(self.getDomain()))
486
487        def getVelocity(self):        def getVelocity(self):
488            """            """
# Line 500  class Rheology(object): Line 500  class Rheology(object):
500            :param v: new current velocity            :param v: new current velocity
501            :type v: vector `Data`            :type v: vector `Data`
502            """            """
503            self.__v=util.interpolate(v,Solution(self.getDomain()))            self.__v=util.interpolate(v,escript.Solution(self.getDomain()))
504        def setStatus(self,t, v, p, stress):        def setStatus(self,t, v, p, stress):
505            """            """
506            Resets the current status given by pressure p and velocity v.            Resets the current status given by pressure p and velocity v.
# Line 531  class Rheology(object): Line 531  class Rheology(object):
531            if D==None:            if D==None:
532                self.__D=self.getDeviatoricStrain(self.getVelocity())                self.__D=self.getDeviatoricStrain(self.getVelocity())
533            else:            else:
534                self.__D=util.deviatoric(util.interpolate(D,Function(self.getDomain())))                self.__D=util.deviatoric(util.interpolate(D,escript.Function(self.getDomain())))
535
536        def getDeviatoricStrain(self, v=None):        def getDeviatoricStrain(self, v=None):
537            """            """
# Line 566  class Rheology(object): Line 566  class Rheology(object):
566            :type gammadot: `Data` of rank 1            :type gammadot: `Data` of rank 1
567            """            """
570            else:            else:
572
# Line 657  class IncompressibleIsotropicFlowCartesi Line 657  class IncompressibleIsotropicFlowCartesi
657           if self.checkVerbose(): print "IncompressibleIsotropicFlowCartesian: eta_eff has been updated."           if self.checkVerbose(): print "IncompressibleIsotropicFlowCartesian: eta_eff has been updated."
658
659           if mu==None:                     if mu==None:
660               stress0=Data()               stress0=escript.Data()
661           else:           else:
662               stress0=-(self.__eta_eff_save/(dt*mu))*s_last               stress0=-(self.__eta_eff_save/(dt*mu))*s_last
663

Legend:
 Removed from v.3431 changed lines Added in v.3432