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

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

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

revision 609 by elspeth, Tue Mar 21 09:46:39 2006 UTC revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC
# Line 7  Currently includes: Line 7  Currently includes:
7      - Projector - to project a discontinuous      - Projector - to project a discontinuous
8      - Locator - to trace values in data objects at a certain location      - Locator - to trace values in data objects at a certain location
9      - TimeIntegrationManager - to handel extraplotion in time      - TimeIntegrationManager - to handel extraplotion in time
10    
11    @var __author__: name of author
12    @var __copyright__: copyrights
13    @var __license__: licence agreement
14    @var __url__: url entry point on documentation
15    @var __version__: version
16    @var __date__: date of the version
17  """  """
18    
19    __author__="Lutz Gross, l.gross@uq.edu.au"
20  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
21                      http://www.access.edu.au                      http://www.access.edu.au
22                  Primary Business: Queensland, Australia"""                  Primary Business: Queensland, Australia"""
23  __licence__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
24               http://www.opensource.org/licences/osl-3.0.php"""               http://www.opensource.org/licenses/osl-3.0.php"""
25    __url__="http://www.iservo.edu.au/esys"
26    __version__="$Revision$"
27    __date__="$Date$"
28    
29    
30  import escript  import escript
31  import linearPDEs  import linearPDEs
# Line 24  class TimeIntegrationManager: Line 36  class TimeIntegrationManager:
36    """    """
37    a simple mechanism to manage time dependend values.    a simple mechanism to manage time dependend values.
38    
39    typical usage is:    typical usage is::
40    
41    dt=0.1 # time increment       dt=0.1 # time increment
42    tm=TimeIntegrationManager(inital_value,p=1)       tm=TimeIntegrationManager(inital_value,p=1)
43    while t<1.       while t<1.
44        v_guess=tm.extrapolate(dt) # extrapolate to t+dt           v_guess=tm.extrapolate(dt) # extrapolate to t+dt
45        v=...           v=...
46        tm.checkin(dt,v)           tm.checkin(dt,v)
47        t+=dt           t+=dt
48    
49    @remark: currently only p=1 is supported.    @note: currently only p=1 is supported.
50    """    """
51    def __init__(self,*inital_values,**kwargs):    def __init__(self,*inital_values,**kwargs):
52       """       """
# Line 180  class NoPDE: Line 192  class NoPDE:
192    
193       The constraint is overwriting any other condition.       The constraint is overwriting any other condition.
194    
195       @remark: This class is similar to the L{LinearPDE} class with A=B=C=X=0 but has the intention       @note: This class is similar to the L{linearPDEs.LinearPDE} class with A=B=C=X=0 but has the intention
196                that all input parameter are given in L{Solution} or L{ReducedSolution}. The whole              that all input parameter are given in L{Solution} or L{ReducedSolution}. The whole
197                thing is a bit strange and I blame Robert.Woodcock@csiro.au for this.              thing is a bit strange and I blame Robert.Woodcock@csiro.au for this.
198       """       """
199       def __init__(self,domain,D=None,Y=None,q=None,r=None):       def __init__(self,domain,D=None,Y=None,q=None,r=None):
200           """           """
# Line 191  class NoPDE: Line 203  class NoPDE:
203           @param domain: domain of the PDE.           @param domain: domain of the PDE.
204           @type domain: L{Domain}           @type domain: L{Domain}
205           @param D: coefficient of the solution.           @param D: coefficient of the solution.
206           @type D: C{float}, C{int}, L{NumArray}, L{Data}           @type D: C{float}, C{int}, L{numarray.NumArray}, L{Data}
207           @param Y: right hand side           @param Y: right hand side
208           @type Y: C{float}, C{int}, L{NumArray}, L{Data}           @type Y: C{float}, C{int}, L{numarray.NumArray}, L{Data}
209           @param q: location of constraints           @param q: location of constraints
210           @type q: C{float}, C{int}, L{NumArray}, L{Data}           @type q: C{float}, C{int}, L{numarray.NumArray}, L{Data}
211           @param r: value of solution at locations of constraints           @param r: value of solution at locations of constraints
212           @type r: C{float}, C{int}, L{NumArray}, L{Data}           @type r: C{float}, C{int}, L{numarray.NumArray}, L{Data}
213           """           """
214           self.__domain=domain           self.__domain=domain
215           self.__D=D           self.__D=D
# Line 225  class NoPDE: Line 237  class NoPDE:
237           assigns values to the parameters.           assigns values to the parameters.
238    
239           @param D: coefficient of the solution.           @param D: coefficient of the solution.
240           @type D: C{float}, C{int}, L{NumArray}, L{Data}           @type D: C{float}, C{int}, L{numarray.NumArray}, L{Data}
241           @param Y: right hand side           @param Y: right hand side
242           @type Y: C{float}, C{int}, L{NumArray}, L{Data}           @type Y: C{float}, C{int}, L{numarray.NumArray}, L{Data}
243           @param q: location of constraints           @param q: location of constraints
244           @type q: C{float}, C{int}, L{NumArray}, L{Data}           @type q: C{float}, C{int}, L{numarray.NumArray}, L{Data}
245           @param r: value of solution at locations of constraints           @param r: value of solution at locations of constraints
246           @type r: C{float}, C{int}, L{NumArray}, L{Data}           @type r: C{float}, C{int}, L{numarray.NumArray}, L{Data}
247           """           """
248           if not D==None:           if not D==None:
249              self.__D=D              self.__D=D
# Line 330  class Locator: Line 342  class Locator:
342          if isinstance(data,escript.Data):          if isinstance(data,escript.Data):
343             if data.getFunctionSpace()==self.getFunctionSpace():             if data.getFunctionSpace()==self.getFunctionSpace():
344               out=data.convertToNumArrayFromDPNo(self.getId()[0],self.getId()[1])               out=data.convertToNumArrayFromDPNo(self.getId()[0],self.getId()[1])
345                 #out=data.convertToNumArrayFromDPNo(self.getId()[0],self.getId()[1],self.getId()[2])
346             else:             else:
347               out=data.interpolate(self.getFunctionSpace()).convertToNumArrayFromDPNo(self.getId()[0],self.getId()[1])               out=data.interpolate(self.getFunctionSpace()).convertToNumArrayFromDPNo(self.getId()[0],self.getId()[1])
348                 #out=data.interpolate(self.getFunctionSpace()).convertToNumArrayFromDPNo(self.getId()[0],self.getId()[1],self.getId()[2])
349             if data.getRank()==0:             if data.getRank()==0:
350                return out[0]                return out[0]
351             else:             else:

Legend:
Removed from v.609  
changed lines
  Added in v.782

  ViewVC Help
Powered by ViewVC 1.1.26