Package mbdyn :: Package bindings :: Module elements
[hide private]

Source Code for Module mbdyn.bindings.elements

  1  #!/usr/bin/env python 
  2  # -*- coding: utf-8 -*- 
  3  # 
  4  # This file is part of MBDyn sim suite. 
  5  # Copyright (C) 2007 André ESPAZE, as part of a Master thesis supervised by 
  6  # Martin O.L.Hansen (DTU) and Nicolas Chauvat (Logilab) 
  7   
  8  # MBDyn sim suite is free software; you can redistribute it and/or modify 
  9  # it under the terms of the GNU General Public License as published by 
 10  # the Free Software Foundation; either version 2 of the License, or 
 11  # (at your option) any later version. 
 12  # 
 13  # This program is distributed in the hope that it will be useful, 
 14  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
 15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 16  # GNU General Public License for more details. 
 17  # 
 18  # You should have received a copy of the GNU General Public License 
 19  # along with this program; if not, write to the Free Software 
 20  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 21  # 
 22  """The general interface of MBDyn elements. For each element group, 
 23  a general class is defined in that module. However most of 
 24  the elements do not have yet any SWIG interface. In case of  
 25  development, this is the first place to look for   
 26  establishing a first communication with Python. 
 27  This module is then used by L{mbdyn.bindings.groups}, all the classes  
 28  being contained in the C{ELEM_CLASS} dictionary. 
 29  """ 
 30  import mbdyn.bindings.swigModule as swigModule 
 31  from mbdyn.bindings.basic_objects import Element 
 32   
 33   
34 -class Rotor(Element):
35 """General class of the "ROTOR" group""" 36
37 - def __init__(self, protor):
38 Element.__init__(self) 39 self.protor = protor 40 self.rotor = swigModule.convert_to_rotor(protor) 41 self.force = {"x" : [], "y" : [], "z" : []} 42 self.torque = {"x" : [], "y" : [], "z" : []} 43 self.omega = [] 44 self.flist = swigModule.FloatList(3)
45 46
47 -class AutomaticStructural(Element):
48 """The general class for the "AUTOMATICSTRUCTURAL" group""" 49 pass
50
51 -class Gravity(Element):
52 """The general class for the "GRAVITY" group""" 53 pass
54
55 -class Body(Element):
56 """The general class for the "BODY" group""" 57 pass
58
59 -class Joint(Element):
60 """The general class for the "JOINT" group""" 61 pass
62
63 -class Beam(Element):
64 """The general class for the "BEAM" group""" 65 pass
66
67 -class Plate(Element):
68 """The general class for the "PLATE" group""" 69 pass
70
71 -class Force(Element):
72 """The general class of the "FORCE" group 73 """ 74
75 - def __init__(self, c_inst):
76 Element.__init__(self, c_inst)
77
78 - def get_force_type(self):
79 """Return the type of force, a string set on the MBDyn object""" 80 return self.c_inst.get_force_type()
81
82 - def __repr__(self):
83 mess = "Force pointer with label %s in MBDyn" 84 return mess % str(self.label)
85
86 -class ElectricBulk(Element):
87 """The general class for the "ELECTRICBULK" group""" 88 pass
89
90 -class Electric(Element):
91 """The general class for the "ELECTRIC" group""" 92 pass
93
94 -class Hydraulic(Element):
95 """The general class for the "HYDRAULIC" group""" 96 pass
97
98 -class Bulk(Element):
99 """The general class for the "BULK" group""" 100 pass
101
102 -class Loadable(Element):
103 """The general class for the "LOADABLE" group""" 104 pass
105
106 -class Driven(Element):
107 """The general class for the "DRIVEN" group""" 108 pass
109
110 -class External(Element):
111 """The general class for the "EXTERNAL" group""" 112 pass
113
114 -class AirProperties(Element):
115 """The general class for the "AIRPROPERTIES" group""" 116 pass
117
118 -class Aeromodal(Element):
119 """The general class for the "AEROMODAL" group""" 120 pass
121
122 -class Aerodynamic(Element):
123 """The general class for the "AERODYNAMIC" group""" 124 pass
125
126 -class Genel(Element):
127 """The general class for the "GENEL" group""" 128 pass
129
130 -class SocketStreamOutput(Element):
131 """The general class for the "SOCKETSTREAM_OUTPUT" group""" 132 pass
133 134 135 ELEM_CLASS_TABLE = [ 136 ("ROTOR", Rotor), 137 ("AUTOMATICSTRUCTURAL", AutomaticStructural), 138 ("GRAVITY", Gravity), 139 ("BODY", Body), 140 # JOINT is missing because defined in 'joints.py' 141 ("BEAM", Beam), 142 ("PLATE", Plate), 143 # FORCE is missing because defined in 'forces.py' 144 ("ELECTRICBULK", ElectricBulk), 145 ("ELECTRIC", Electric), 146 ("HYDRAULIC", Hydraulic), 147 ("BULK", Bulk), 148 ("LOADABLE", Loadable), 149 ("DRIVEN", Driven), 150 ("EXTERNAL", External), 151 ("AIRPROPERTIES", AirProperties), 152 ("AEROMODAL", Aeromodal), 153 ("AERODYNAMIC", Aerodynamic), 154 ("GENEL", Genel), 155 ("SOCKETSTREAM_OUTPUT", SocketStreamOutput) 156 ] 157 158 ELEM_CLASS = {} 159 160 for group_key, general_class in ELEM_CLASS_TABLE: 161 ELEM_CLASS[group_key] = {"general" : general_class} 162 163 # For avoiding a documentation in Epydoc 164 del group_key 165 del general_class 166