Package mbdyn :: Module elements_base :: Class ElementWithNode
[hide private]

Class ElementWithNode

source code

record.RecordBase --+            
                    |            
        record.Record --+        
                        |        
       common.BasicObject --+    
                            |    
                CommonElement --+
                                |
                               ElementWithNode
Known Subclasses:
elements.Body, elts.beam.Beam3, elts.joint.CommonJoint, elts.force.GeneralForce, elts.aerodynamic.Rotor

Every element attached to a node.

Instance Methods [hide private]
 
__init__(self, name) source code
 
attach_to_node(self, node)
Keep the reference of the node
source code
 
set_node_label(self)
Set the node label (or index) for the element once its node has received a label for the MBDyn input file
source code
 
set_relative_from(self, ref)
Set the relative reference frame.
source code

Inherited from CommonElement: do_as_init, set_default, 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)
(Constructor)

source code 
Overrides: CommonElement.__init__

set_relative_from(self, ref)

source code 

Set the relative reference frame. From it, the properties will be entered. Once this method called, the default properties are set on the object, with an update of reference frame. This method is usually called just after the object creation, else there is no relative reference frame written for the input file.

WARNING: If this method is used as last, the object properties are not updated. This is default of the package that needs to be fixed.

Example:
   ref = ReferenceFrame()
   ref.set_position(10., 0., 0.)
   
   node1 = StructuralNode()
   node1.set_relative_from(ref)
   node1.set_position(5., 0., 0.)
   
   node2 = StructuralNode()
   node2.set_position(5., 0., 0.)
   node2.set_relative_from(ref)
Relative to the absolute reference frame, the node 1 will be placed 15m from the origin while the node 2 will be only at 5m.