Package mbdyn :: Module elements :: Class Body
[hide private]

Class Body

source code

record.RecordBase --+                
                    |                
        record.Record --+            
                        |            
       common.BasicObject --+        
                            |        
  elements_base.CommonElement --+    
                                |    
    elements_base.ElementWithNode --+
                                    |
                                   Body

A MBDyn body with a mass, a center of mass and and an inertia matrix. A body needs to be attached to a node, so the body properties are provided according to the node reference frame. There is usually no need to use the set_relative_from method, but it may be used anyway to set an different center of mass by using a reference frame.

Example of use:
   body = M.body()
   body.attach_to(node)
   body.set_mass(1.)
   body.set_center_of_mass(0.5, 0., 0.)
By default a body has a mass of 1. kg, no offset and an eye inertia matrix.

Instance Methods [hide private]
 
__init__(self, name='body') source code
 
set_default(self)
Set the default definition of a body, those values will stay unless specify by the user
source code
 
set_relative_from(self, ref)
The properties will be set relative to the provided reference frame
source code
 
set_mass(self, value, com=None)
Set the mass of the body
source code
 
set_center_of_mass(self, *args, **kargs)
Set the relative center of mass for the body according to the node reference frame
source code
 
set_inertia_matrix(self, *args, **kargs)
Set the inertia matrix on the body, by default in the node reference frame
source code

Inherited from elements_base.ElementWithNode: attach_to_node, set_node_label

Inherited from elements_base.CommonElement: do_as_init, update

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, save, set_own_parameters, will_save, will_save_nothing, will_save_only

Inherited from record.RecordBase: collect_own_parameters, collect_parameters, set_own_para, set_parameters

Inherited from record.RecordBase (private): _collect_own_para

Method Details [hide private]

__init__(self, name='body')
(Constructor)

source code 
Overrides: elements_base.ElementWithNode.__init__

set_default(self)

source code 
Set the default definition of a body, those values will stay unless specify by the user
Overrides: elements_base.CommonElement.set_default

set_relative_from(self, ref)

source code 
The properties will be set relative to the provided reference frame
Overrides: elements_base.ElementWithNode.set_relative_from