-
Notifications
You must be signed in to change notification settings - Fork 14
/
set.py
59 lines (45 loc) · 1.4 KB
/
set.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Author(s): Andrew Liew (github.com/andrewliew)
__all__ = [
'Set',
]
class Set(object):
"""Initialises base Set object.
Parameters
----------
name : str
Name of the set.
type : str
'node', 'element', 'surface_node', surface_element'.
selection : list, dict
The integer keys of the nodes, elements or the element numbers and sides.
index : int
Set index number.
Attributes
----------
name : str
Name of the set.
type : str
'node', 'element', 'surface_node', surface_element'.
selection : list, dict
The integer keys of the nodes, elements or the element numbers and sides.
index : int
Set index number.
"""
def __init__(self, name, type, selection, index):
self.__name__ = 'Set'
self.name = name
self.type = type
self.selection = selection
self.index = index
def __str__(self):
print('\n')
print('compas_fea {0} object'.format(self.__name__))
print('-' * (len(self.__name__) + 18))
for attr in ['name', 'type', 'selection', 'index']:
print('{0:<9} : {1}'.format(attr, getattr(self, attr)))
return ''
def __repr__(self):
return '{0}({1})'.format(self.__name__, self.name)