Package src :: Package toplevel :: Module PropagatorT :: Class PropagatorFactory
[hide private]
[frames] | no frames]

Class PropagatorFactory

source code

Contains mappings from propagator names to creation functions, their types (object or method) and parameters with default values. Given a name and parameter values, the propagator factory can return either a method handle or an instance of a propagator object.

Instance Methods [hide private]
 
__init__(self) source code
 
query(self, name="None")
Query the factory for information on all available propagation schemes This will display their type (object or method) and parameters and default values.
source code
 
registerObject(self, myModule, name, defaults)
Register a propagator object prototyped in Python
source code
 
registerMethod(self, myModule, name, defaults)
Register a propagator Python method.
source code
 
registerPMObject(self, name, defaults)
Register a SWIG-wrapped propagator object
source code
 
registerModifier(self, name, thetype, theprop)
Register a propagator modifier
source code
string
getType(self, name)
Return the type (object or method) of a propagator
source code
int
findArg(self, name, pars)
Find a parameter name in a parameter tuple.
source code
STS/MTS
applyModifiers(self, obj, name)
Instantiate modifiers for a propagator.
source code
STS, MTS, or Python method handle
create(self, *args)
Accept a Python tuple containing the propagator name, timestep, parameter values and force field.
source code
 
registerAllPM(self)
Register all SWIG-wrapped propagators.
source code
Instance Variables [hide private]
  objects
A list of propagator objects created.
  registry
Maps propagator names to creation functions and parameters/defaults
  modifier_registry
Maps modifier names to method handles
Method Details [hide private]

query(self, name="None")

source code 

Query the factory for information on all available propagation schemes This will display their type (object or method) and parameters and default values. You can also query with a name to get information about a specific propagation scheme

Parameters:
  • name (string) - Propagation scheme name, default is None

registerObject(self, myModule, name, defaults)

source code 

Register a propagator object prototyped in Python

Parameters:
  • myModule (Python Module) - Module in which the class definition is contained
  • name (string) - Name of propagation scheme
  • defaults (tuple) - Mapping from parameter names to default values

registerMethod(self, myModule, name, defaults)

source code 

Register a propagator Python method.

Parameters:
  • myModule (Python Module) - Module in which the method definition is contained
  • name (string) - Name of propagation scheme
  • defaults (tuple) - Mapping from parameter names to default values

registerPMObject(self, name, defaults)

source code 

Register a SWIG-wrapped propagator object

Parameters:
  • name (string) - Name of propagation scheme
  • defaults (tuple) - Mapping from parameter names to default values

registerModifier(self, name, thetype, theprop)

source code 

Register a propagator modifier

Parameters:
  • name (string) - Name of propagation scheme
  • thetype (string) - Type of modifier (preinit, postinit, preforce, ...)
  • theprop (string) - Name of the propagator object that this modifier operates upon.

getType(self, name)

source code 

Return the type (object or method) of a propagator

Parameters:
  • name (string) - Name of propagation scheme
Returns: string
Type of the propagator

findArg(self, name, pars)

source code 

Find a parameter name in a parameter tuple.

Parameters:
  • name (string) - Name of parameter
  • pars (tuple) - Parameter list
Returns: int
Index of the parameter in the list (-1 if not found)

applyModifiers(self, obj, name)

source code 

Instantiate modifiers for a propagator.

Parameters:
  • obj (STS/MTS) - Propagator object
  • name (string) - Propagator name
Returns: STS/MTS
Propagator object with instantiated modifiers.

create(self, *args)

source code 

Accept a Python tuple containing the propagator name, timestep, parameter values and force field. This tuple can thus be various sizes depending on the number of parameters. Create and return a corresponding instantiated propagator object, or method handle.

Parameters:
  • args (tuple) - List of propagator name, dt, parameter values and force field. If the propagation scheme is MTS, this list is followed by the name of the next propagator in the chain and its associated parameters, etc.
Returns: STS, MTS, or Python method handle
The propagator.