ptolemy.domains.ct.kernel.solver
Class FixedStepSolver

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.domains.ct.kernel.ODESolver
          extended by ptolemy.domains.ct.kernel.solver.FixedStepSolver
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Direct Known Subclasses:
BackwardEulerSolver, ForwardEulerSolver

public abstract class FixedStepSolver
extends ODESolver

Abstract base class for fixed step size ODE solvers, which provides no error control. It provides base implementation for some methods that are shared by all fixed-step-size solvers.

Since:
Ptolemy II 0.2
Version:
$Id: FixedStepSolver.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Jie Liu, Haiyang Zheng
See Also:
Serialized Form
Accepted Rating:
Green (hyzheng)
Proposed Rating:
Green (hyzheng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
FixedStepSolver(Workspace workspace)
          Construct a solver in the given workspace with a null string name.
 
Method Summary
protected  void _advanceModelTime()
          Override the method in the base abstract class to advance the model time.
 void fireDynamicActors()
          Fire dynamic actors.
 void fireStateTransitionActors()
          Fire state transition actors.
 int getAmountOfHistoryInformation()
          Return 0 to indicate that no history information is needed by this solver.
 int getIntegratorAuxVariableCount()
          Return 0 to indicate that an integrator under this solver needs no auxiliary variable.
 boolean integratorIsAccurate(CTBaseIntegrator integrator)
          Return true always, since no error control is performed.
 double integratorPredictedStepSize(CTBaseIntegrator integrator)
          Return the current step size of the director.
 
Methods inherited from class ptolemy.domains.ct.kernel.ODESolver
_getRoundCount, _getSchedule, _incrementRoundCount, _isConverged, _makeSolverOf, _resetRoundCount, _setConverged, _voteForConverged, getContainer, integratorFire, resolveStates
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateExistence, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixedStepSolver

public FixedStepSolver(Workspace workspace)
Construct a solver in the given workspace with a null string name. If the workspace argument is null, use the default workspace. The director is added to the list of objects in the workspace. Increment the version number of the workspace.

Parameters:
workspace - Object for synchronization and version tracking
Method Detail

fireDynamicActors

public void fireDynamicActors()
                       throws IllegalActionException
Fire dynamic actors. Advance the model time to the current model time plus the current step size on the first round.

Overrides:
fireDynamicActors in class ODESolver
Throws:
IllegalActionException - If thrown in the super class or the model time can not be set.

fireStateTransitionActors

public void fireStateTransitionActors()
                               throws IllegalActionException
Fire state transition actors. Increment the round count. If the states have converged, reset the round count.

Overrides:
fireStateTransitionActors in class ODESolver
Throws:
IllegalActionException - If thrown in the super class.

getAmountOfHistoryInformation

public int getAmountOfHistoryInformation()
Return 0 to indicate that no history information is needed by this solver.

Specified by:
getAmountOfHistoryInformation in class ODESolver
Returns:
0.

getIntegratorAuxVariableCount

public int getIntegratorAuxVariableCount()
Return 0 to indicate that an integrator under this solver needs no auxiliary variable.

Specified by:
getIntegratorAuxVariableCount in class ODESolver
Returns:
0.

integratorIsAccurate

public final boolean integratorIsAccurate(CTBaseIntegrator integrator)
Return true always, since no error control is performed.

Specified by:
integratorIsAccurate in class ODESolver
Parameters:
integrator - The integrator that wants to do the test.
Returns:
True always.

integratorPredictedStepSize

public final double integratorPredictedStepSize(CTBaseIntegrator integrator)
Return the current step size of the director.

Specified by:
integratorPredictedStepSize in class ODESolver
Parameters:
integrator - The integrator that want to predict the step size.
Returns:
The current step size of the director.
See Also:
CTStepSizeControlActor.predictedStepSize()

_advanceModelTime

protected void _advanceModelTime()
                          throws IllegalActionException
Override the method in the base abstract class to advance the model time. Advance the model time to the current model time plus the current step size on the first round.

Overrides:
_advanceModelTime in class ODESolver
Throws:
IllegalActionException - If thrown in the super class or the model time can not be set.