Package esys :: Package escript :: Module modelframe :: Class Model
[show private | hide private]
[frames | no frames]

Type Model

    object --+        
             |        
LinkableObject --+    
                 |    
      ParameterSet --+
                     |
                    Model

Known Subclasses:
Bathymetry, ConstrainValue, DarcyFlow, LinearCombination, Messenger, OceanRegion, OceanRegionCollector, ODETEST, Probe, Sequencer, Simulation, SteadyIncompressibleFlow, SurfMovie, TemperatureAdvection, TsunamiInDeepWater, TsunamiSource, Visualization

A Model object represents a processess marching over time until a finalizing condition is fullfilled. At each time step an iterative process can be performed and the time step size can be controlled. A Model has the following work flow:
     doInitialization()
     while not finalize():
          dt=getSafeTimeStepSize(dt)
          doStepPreprocessing(dt)
          while not terminateIteration(): doStep(dt)
          doStepPostprocessing(dt)
     doFinalization()
where doInitialization, finalize, getSafeTimeStepSize, doStepPreprocessing, terminateIteration, doStepPostprocessing, doFinalization are methods of the particular instance of a Model. The default implementations of these methods have to be overwritten by the subclass implementing a Model.
Method Summary
  __init__(self, parameters, **kwarg)
Creates a model.
  __str__(self)
  doFinalization(self)
Finalizes the time stepping.
  doInitialization(self)
Initializes the time stepping scheme.
  doStep(self, dt)
Executes an iteration step at a time step.
  doStepPostprocessing(self, dt)
Finalalizes the time step.
  doStepPreprocessing(self, dt)
Sets up a time step of step size dt.
  finalize(self)
Returns False if the time stepping is finalized.
  getSafeTimeStepSize(self, dt)
Returns a time step size which can safely be used.
  terminateIteration(self)
Returns True if iteration on a time step is terminated.
  toDom(self, document, node)
toDom method of Model class
  writeXML(self, ostream)
Writes the object as an XML object into an output stream.
    Inherited from ParameterSet
  __delattr__(self, name)
Removes the attribute name.
  __iter__(self)
Creates an iterator over the parameter and their values.
  __repr__(self)
  declareParameter(self, **parameters)
Declares a new parameter(s) and its (their) initial value.
  declareParameters(self, parameters)
Declares a set of parameters.
  fromDom(cls, doc)
(Class method)
  releaseParameters(self, name)
Removes parameter name from the paramameters.
  showParameters(self)
Returns a descrition of the parameters.
    Inherited from LinkableObject
  __getattr__(self, name)
Returns the value of attribute name.
  __setattr__(self, name, value)
Sets the value for attribute name.
  getAttributeObject(self, name)
Return the object stored for attribute name.
  hasAttribute(self, name)
Returns True if self as attribute name.
  trace(self, msg)
If debugging is on, print the message, otherwise do nothing
    Inherited from object
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle

Class Variable Summary
float UNDEF_DT = 1.0000000000000001e+300                                               
    Inherited from LinkableObject
count number_sequence = <itertools.count object at 0x401ff100>

Instance Method Details

__init__(self, parameters=[], **kwarg)
(Constructor)

Creates a model.

Just calls the parent constructor.
Overrides:
esys.escript.modelframe.ParameterSet.__init__

doFinalization(self)

Finalizes the time stepping.

This function may be overwritten.

doInitialization(self)

Initializes the time stepping scheme.

This function may be overwritten.

doStep(self, dt)

Executes an iteration step at a time step.

dt is the currently used time step size.

This function may be overwritten.

doStepPostprocessing(self, dt)

Finalalizes the time step.

dt is the currently used time step size.

This function may be overwritten.

doStepPreprocessing(self, dt)

Sets up a time step of step size dt.

This function may be overwritten.

finalize(self)

Returns False if the time stepping is finalized.

This function may be overwritten.

getSafeTimeStepSize(self, dt)

Returns a time step size which can safely be used.

dt gives the previously used step size.

This function may be overwritten.

terminateIteration(self)

Returns True if iteration on a time step is terminated.

toDom(self, document, node)

toDom method of Model class
Overrides:
esys.escript.modelframe.ParameterSet.toDom

writeXML(self, ostream=<epydoc.imports._DevNull instance at 0x402244cc>)

Writes the object as an XML object into an output stream.
Overrides:
esys.escript.modelframe.ParameterSet.writeXML (inherited documentation)

Class Variable Details

UNDEF_DT

Type:
float
Value:
1.0000000000000001e+300                                               

Generated by Epydoc 2.1 on Thu Apr 27 11:16:24 2006 http://epydoc.sf.net