Package solvcon :: Module case :: Class BaseCase
[hide private]
[frames] | no frames]

Class BaseCase

source code

object --+        
         |        
      dict --+    
             |    
      CaseInfo --+
                 |
                BaseCase
Known Subclasses:

Base class for simulation cases.

init() and run() are the two primary methods responsible for the execution of the simulation case object. Both methods accept a keyword parameter ``level'' which indicates the run level of the run:

Nested Classes [hide private]

Inherited from CaseInfo: __metaclass__

Instance Methods [hide private]
 
_log_start(self, action, msg='', postmsg=' ... ')
Print to user and record start time for certain action.
source code
 
_log_end(self, action, msg='', postmsg=' . ')
Print to user and record end time for certain action.
source code
new empty dictionary

__init__(self, **kw)
Initiailize the basic case.
source code
 
_dynamic_execute(self)
Dynamically execute the codes stored in the input file specified by the case.
source code
 
init(self, level=0)
Initialize solver.
source code
 
run(self, level=0)
Run the simulation case; time marching.
source code
 
cleanup(self, signum=None, frame=None) source code

Inherited from CaseInfo: __getattr__, __setattr__

Inherited from CaseInfo (private): _set_through

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __str__, __subclasshook__

Class Methods [hide private]
callable
register_arrangement(cls, func, casename=None)
Decorate simulation functions.
source code
Class Variables [hide private]
  CSEFN_DEFAULT = 'solvcon.dump.case.obj'
  defdict = {'condition.mtrllist': <type 'list'>, 'dynamic.bakfn...

Inherited from CaseInfo: arrangements

Inherited from dict: __hash__

Instance Variables [hide private]
  runhooks
a special list containing all the hook objects to be run.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_log_start(self, action, msg='', postmsg=' ... ')

source code 

Print to user and record start time for certain action.

Parameters:
  • action (str) - action key.
  • msg (str) - trailing message for the action key.
Returns:
nothing.

_log_end(self, action, msg='', postmsg=' . ')

source code 

Print to user and record end time for certain action.

Parameters:
  • action (str) - action key.
  • msg (str) - supplemental message.
Returns:
nothing

__init__(self, **kw)
(Constructor)

source code 

Initiailize the basic case. Set through keyword parameters.

Parameters:
  • _defdict - customized defdict; internal use only.
Returns:
new empty dictionary

Overrides: object.__init__

_dynamic_execute(self)

source code 

Dynamically execute the codes stored in the input file specified by the case.

Returns:
nothing

init(self, level=0)

source code 

Initialize solver. Nothing inside now.

Parameters:
  • level (int) - run level; higher level does less work.
Returns:
nothing.

run(self, level=0)

source code 

Run the simulation case; time marching.

Parameters:
  • level (int) - run level; higher level does less work.
Returns:
nothing.

register_arrangement(cls, func, casename=None)
Class Method

source code 

Decorate simulation functions. This function asserts required signature which is necessary for a function to be a valid simulation function. Moreover, all the simulation function should be decorated by this decorator.

Returns: callable
simulation function.

Class Variable Details [hide private]

defdict

Value:
{'condition.mtrllist': <type 'list'>,
 'dynamic.bakfn': 'solvcon.input.bak',
 'dynamic.inputfn': 'solvcon.input',
 'dynamic.preserve': False,
 'execution.batch': <class 'solvcon.batch.Batch'>,
 'execution.fpdtype': 'float64',
 'execution.marchret': None,
 'execution.ncore': -1,
...