1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """The constitutive laws available in the MBDyn package.
23 Use only for the beam elements until now.
24 """
25 from mbdyn.common import MANAGER, BasicObject
26 from mbdyn.references import NONE_REF
27
28
30 """The linear elastic generic constitutive law.
31 """
32
33 - def __init__(self, name="linear elastic generic"):
34 BasicObject.__init__(self, name)
35 self.arg_names += ["type", "stiffness_matrix"]
36 MANAGER.add_argument(self, "type", "linear elastic generic")
37 self.written_in_a_block = False
38 self.dimension = None
39 self.ref = NONE_REF
40
42 """Set the name of the law"""
43 self.written_in_a_block = True
44 if self.dimension != None:
45 indice = self.arg_names.index("dimension")
46 else:
47 indice = self.arg_names.index("type")
48 self.arg_names.insert(indice, "key_name")
49 mbdyn_name = "name, %s" % name
50 MANAGER.add_argument(self, "key_name", name, com, mbdyn_name)
51
53 """Set the dimension of the constitutive law"""
54 self.written_in_a_block = True
55 indice = self.arg_names.index("type")
56 self.arg_names.insert(indice, "dimension")
57 MANAGER.add_argument(self, "dimension", value, com)
58
60 """Add the stiffness law matrix"""
61 MANAGER.add_matrix(self, "stiffness_matrix", args, kargs)
62