Home | Trees | Indices | Help |
---|
|
The MBDyn service for Python. WraptMBDyn
can run only if
it receives a MBDyn input file. In case the input file is not in the
current directory, the path has to be given by working_dir
.
Like in MBDyn, the output file can be omitted. By defaults the results
file are not written, so the simulation is going faster and this is the
user duty to choose what he wants to save. The mbdyn module offers an
interface for those functionalities. This behavior can be turned off by
write_mbdyn_files.
WraptMBDyn
performs 4 calls that are empty, because they
do not deal with its work, but they are use for an interface. They
are:
The first user of those calls is Simulation but the user could develop what he wants.
The MBDyn object tree is available once the init method has been called. Then the integration can be completely performed by run_full or until a particular time run_until. An demonstration of use for the file 'cantilever1' from the MBDyn tutorial saved in the directory 'input_file':>>> from mbdyn import * >>> wm = WraptMBDyn("cantilever1", "input_file") >>> wm.init() .. >>> wm [elts, nodes] >>> wm.write_mbdyn_files(True) >>> wm.run_until(3.) MBDyn progress: 49% [########################### ] >>> wm.solver.current_time 2.999000072479248 >>> wm.run_full() MBDyn progress: 100% [########################################################] End of simulation at time 6.0 after 6000 steps total iterations: 6075 total Jacobians: 6075 total error: 0.002095883945 CPU time consumed: 6.98 secondsNevertheless run_until is interesting only for an operation not run at each time step, else a reference to update should be supplied.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|
main function of
'mbdyn.cc'. The important solver attributes for the
interface are:
current_time and time_step are updated at
each step. The solver will run the input file parsing and thus fill the
DataManager . The tree for navigating the MBDyn objects is
then created in _get_items. Finally, the customizable do_as_init method is called during that step.
|
DataManager and create a tree of objects. The process is
organised as follow:
|
DataManager the number of
items. If there is at least one, the corresponding group defined in mbdyn.bindings.groups is created.
|
Node and Element from mbdyn.bindings.basic_objects
|
nodes or elts . Those last ones are as well set
on the WraptMBDyn .
|
MBDynParser for getting the ReferenceFrame
references and fill the FramesList
|
WraptMBDyn but is of use in case the user wants to do change
the MBDyn objects at run time.
|
WraptMBDyn , nothing is done in that step but it may be of
use for the class manipulating the service.
|
|
|
|
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Thu Aug 30 11:45:44 2007 | http://epydoc.sourceforge.net |