/[escript]/branches/3.4.1/modellib/py_src/input.py
ViewVC logotype

Diff of /branches/3.4.1/modellib/py_src/input.py

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

trunk/esys2/modellib/py_src/input.py revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC trunk/modellib/py_src/input.py revision 720 by gross, Thu Apr 27 10:16:05 2006 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3    __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
4                        http://www.access.edu.au
5                    Primary Business: Queensland, Australia"""
6    __license__="""Licensed under the Open Software License version 3.0
7                 http://www.opensource.org/licenses/osl-3.0.php"""
8    
9  from esys.escript import *  from esys.escript import *
10  from esys.escript.modelframe import Model,ParameterSet  from esys.escript.modelframe import Model,ParameterSet
11  from math import log  from math import log
# Line 6  from math import log Line 13  from math import log
13  class Sequencer(Model):  class Sequencer(Model):
14      """      """
15      Runs through time until t_end is reached.      Runs through time until t_end is reached.
16        @cvar t_end: - model is terminated when t_end is passed  (exposed in writeXML)
17        @type t_end: float
18        @cvar dt_max: - maximum time step size
19        @type dt_max: float
20        @cvar t: - initial time
21        @type t: float
22    
23      """      """
24      def __init__(self,t=0.,t_end=Model.UNDEF_DT,dt_max=Model.UNDEF_DT,debug=False):      def __init__(self,debug=False):
25          """          """
         @param t_end: - model is terminated when t_end is passed    
                    (exposed in writeXML)  
         @type t_end: float  
         @param dt_max: - maximum time step size  
         @type dt_max: float  
         @param t: - initial time  
         @type t: float  
   
26          """          """
27          Model.__init__(self,debug=debug)          super(Sequencer,self).__init__(debug=debug)
28          self.declareParameter(t=t, \          self.declareParameter(t=0.,
29                                t_end=t_end,  \                                t_end=1.,
30                                dt_max=dt_max)                                dt_max=Model.UNDEF_DT)
31    
32      def doInitialization(self):      def doInitialization(self):
33          """          """
# Line 77  class GaussianProfile(ParameterSet): Line 83  class GaussianProfile(ParameterSet):
83          x = self.domain.getX()          x = self.domain.getX()
84          dim = self.domain.getDim()          dim = self.domain.getDim()
85          l = length(x-self.x_c[:dim])          l = length(x-self.x_c[:dim])
86          m = (l-self.r).whereNegative()          m = whereNegative(l-self.r)
87    
88          return (m+(1.-m)*exp(-log(2.)*(l/self.width)**2))*self.A          return (m+(1.-m)*exp(-log(2.)*(l/self.width)**2))*self.A
89    

Legend:
Removed from v.149  
changed lines
  Added in v.720

  ViewVC Help
Powered by ViewVC 1.1.26