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

Class Model

    object --+        
             |        
LinkableObject --+    
                 |    
      ParameterSet --+
                     |
                    Model
Known Subclasses:

A Model object represents a process marching over time until a finalizing condition is fulfilled. 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 terminateInitialIteration(): doInitializationiStep()
   doInitialPostprocessing()
   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.

Instance Methods [hide private]
 
__init__(self, parameters=[], **kwargs)
Creates a model.
 
__str__(self)
str(x)
 
doFinalization(self)
Finalizes the time stepping.
 
doInitialPostprocessing(self)
Finalises the initialization iteration process.
 
doInitialStep(self)
Performs an iteration step in the initialization phase.
 
doInitialization(self)
Initializes the time stepping scheme.
 
doStep(self, dt)
Executes an iteration step at a time step.
 
doStepPostprocessing(self, dt)
Finalises 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 be safely used.
 
setUp(self)
Sets up the model.
 
terminateInitialIteration(self)
Returns True if iteration at the inital phase is terminated.
 
terminateIteration(self)
Returns True if iteration on a time step is terminated.
 
toDom(self, esysxml, node)
toDom method of Model class.

Inherited from ParameterSet: __delattr__, __iter__, __repr__, checkLinkTargets, declareParameter, declareParameters, releaseParameters, showParameters, writeXML

Inherited from ParameterSet (private): _parametersToDom

Inherited from LinkableObject: __getattr__, __setattr__, getAttributeObject, hasAttribute, trace

Inherited from object: __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__

Class Methods [hide private]

Inherited from ParameterSet: fromDom

Class Variables [hide private]
  UNDEF_DT = 1e+300
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

 

Creates a model.

Just calls the parent constructor.

Overrides: object.__init__

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

doFinalization(self)

 

Finalizes the time stepping.

This function may be overwritten.

doInitialPostprocessing(self)

 

Finalises the initialization iteration process. This method is not called in case of a restart.

This function may be overwritten.

doInitialStep(self)

 

Performs an iteration step in the initialization phase. This method is not called in case of a restart.

This function may be overwritten.

doInitialization(self)

 

Initializes the time stepping scheme. This method is not called in case of a restart.

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)

 

Finalises 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 be safely used.

dt gives the previously used step size.

This function may be overwritten.

setUp(self)

 

Sets up the model.

This function may be overwritten.

toDom(self, esysxml, node)

 

toDom method of Model class.

Overrides: ParameterSet.toDom