Package mbdyn :: Module main :: Class Simulation
[hide private]

Class Simulation

source code

record.RecordBase --+            
                    |            
        record.Record --+        
                        |        
       common.BasicObject --+    
                            |    
 preprocessing.SimulationBase --+
                                |
                               Simulation

The main MBDyn simulation. Simulation will gather all the objects and run WraptMBDyn, a MBDyn simulation controlled from Python.

Instance Methods [hide private]
 
__init__(self, name='mbdyn simu', title='Mbdyn used from Python', keep=False, overwrite=False)
'name' is only used for writing the files.
source code
 
set_integrator(self, integrator)
Set the simulation integrator
source code
 
_add_item_to_list(self, list_name, item)
Add a node, element or a reference frame to the corresponding object list.
source code
 
add_reference(self, reference)
Add a reference frame to the simulation
source code
 
add_node(self, node)
Add a node to the simulation
source code
 
add_element(self, elt)
Add an element to the simulation
source code
 
add_object(self, obj)
The user can add its own object to the simulation.
source code
 
append_output(self, node_lines)
Append a MBDyn time step results to the Python objects.
source code
 
_set_info_for_loading(self)
Load the time step and the .mov file before loading the results, used only when scanning the output files
source code
 
load_results(self)
Load the result from the '.mov.
source code
 
set_wrapt_mbdyn(self, wrapt_mbdyn)
Set an instance of the wraptMBDyn, used when the input file is not written by the Python interface
source code
 
_get_mbdyn_instances(self)
The instances provided from the interface get the ones created by MBDyn
source code
 
save_mbdyn(self)
Save the mbdyn status.
source code
 
save(self)
The same method as save_mbdyn.
source code
 
update_elts(self)
Update all the element by calling the update method of each element.
source code
 
update(self)
The same as update_elts.
source code
 
init_simulation(self)
Initialization before running MBDyn.
source code
 
_init_wrapt_mbdyn(self)
Initialize the WraptMBDyn instance.
source code
 
init(self)
Initialize the simulation according to WraptMBDyn.
source code
 
run_with_executable(self, boolean)
Decide if the simulation with the input file written is run with the MBDyn executable of the bindings.
source code
 
solve_by_wrapt_mbdyn(self)
Solve the problem by WraptMBDyn.
source code
 
final_action(self)
Called by WraptMBDyn when it finished the simulation.
source code
 
solve_by_mbdyn_exec(self)
Run the MBDyn executable on the input file written.
source code
 
run_full(self)
Run the complete simulation
source code
 
run(self)
Identic function has 'run_full()'
source code
 
__repr__(self)
Return the representation of the simulation
source code
 
collect_parameters(self)
Collect all the parameters of the Simulation and store them in the para dictionary
source code
 
set_parameters(self, para)
Set the parameters of the simulation from the pickled dictionary para
source code

Inherited from preprocessing.SimulationBase: add_control_data, clean_dir_simu, clean_dir_tmp, create_dir_simu, create_dir_tmp, keep_mbdyn_files, set_node_numerotation_offset, write

Inherited from common.BasicObject: get_lines, get_mbdyn_instance, set_comment, set_label, set_name, set_simulation_ref

Inherited from record.Record: common_init_results, init_results, set_own_parameters, will_save, will_save_nothing, will_save_only

Inherited from record.RecordBase: collect_own_parameters, set_own_para

Inherited from record.RecordBase (private): _collect_own_para

Method Details [hide private]

__init__(self, name='mbdyn simu', title='Mbdyn used from Python', keep=False, overwrite=False)
(Constructor)

source code 
'name' is only used for writing the files.
Overrides: preprocessing.SimulationBase.__init__

_add_item_to_list(self, list_name, item)

source code 
Add a node, element or a reference frame to the corresponding object list. Store also a reference of the simulation to the item object and the representation name is added for the magic function __repr__.

add_object(self, obj)

source code 
The user can add its own object to the simulation. The idea: if the user adds its own object, then he must not add the element and the node to the simulation. His object already contains a list of elements and a list of nodes. By this manner, the controlData can not have duplicated information, that is to say, duplicated node or element. Currently in development and not in use because it may be simpler to invite the user at inheriting from the Simulation (approach run successfully in wind-sim-suite).

append_output(self, node_lines)

source code 
Append a MBDyn time step results to the Python objects. Use when the text files are scanned

load_results(self)

source code 
Load the result from the '.mov. file of MBDyn containing the kinematic degrees of freedom of the nodes

save_mbdyn(self)

source code 
Save the mbdyn status. First the simulation is saved and then all the objects. This method will be called by WraptMBDyn as every time step.

save(self)

source code 
The same method as save_mbdyn. The default is just to save mbdyn but it changes when inheritance occurs
Overrides: record.Record.save

update(self)

source code 
The same as update_elts. The default update for a simulation. Called by WraptMBDyn as every time step.

init_simulation(self)

source code 

Initialization before running MBDyn. The MBDyn instances are tracked from the Python objects.

If an update needs to be done on the elements, they are initialized by 'do_as_init'. The WraptMBDyn update method will call the simulation one.

If the values are saved from Python, the results are initialized. The WraptMBDyn save method will call the simulation one.

_init_wrapt_mbdyn(self)

source code 
Initialize the WraptMBDyn instance. This method will also create a WraptMBDyn in case an input file have been written.

init(self)

source code 
Initialize the simulation according to WraptMBDyn. The Python object get references to the object from the bindings module, interfacing the C++ ones.

run_with_executable(self, boolean)

source code 
Decide if the simulation with the input file written is run with the MBDyn executable of the bindings. Note: does not make sense in case WraptMBDyn comes from outside, no input file has been written in that case.

solve_by_wrapt_mbdyn(self)

source code 
Solve the problem by WraptMBDyn. The most common way to solve a simulation.

final_action(self)

source code 
Called by WraptMBDyn when it finished the simulation. This method allows to interact with WraptMBDyn (by 'run_until'...) without loosing the actions that should be done on the simulation object at the final time

collect_parameters(self)

source code 
Collect all the parameters of the Simulation and store them in the para dictionary
Overrides: record.RecordBase.collect_parameters

set_parameters(self, para)

source code 
Set the parameters of the simulation from the pickled dictionary para
Overrides: record.RecordBase.set_parameters