-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubregion.py
66 lines (54 loc) · 1.97 KB
/
subregion.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
60
61
62
63
64
65
66
from regularregion import RegularRegion
from region import Region
class SubRegion(RegularRegion):
"""
A SubRegion is a:
(1) IRREG r-region number;
(2) RLOW Innter radius of this r subregion;
(3) RHIGH Outer radius of this r subregion;
(4) Field object; and
(5) Material object.
"""
num_params = 5
for001_format = {'line_splits': [3, 1, 1]}
command_params = {
'irreg': {'desc': 'R-Region Number',
'doc': '',
'type': 'Integer',
'req': True,
'pos': 1},
'rlow': {'desc': 'Inner radius of this r subregion',
'doc': '',
'type': 'Real',
'req': True,
'pos': 2},
'rhigh': {'desc': 'Outer radius of this r subregion',
'doc': '',
'type': 'Real',
'req': True,
'pos': 3},
'field': {'desc': 'Field object',
'doc': '',
'type': 'Field',
'req': True,
'pos': 4},
'material': {'desc': 'Material object',
'doc': '',
'type': 'Material',
'req': True,
'pos': 5}
}
def __init__(self, **kwargs):
RegularRegion.__init__(self, kwargs)
def __str__(self):
return 'SubRegion:\n' + 'irreg=' + str(self.irreg) + '\n' + 'rlow=' + str(self.rlow) + '\n' + \
'rhigh=' + str(self.rhigh) + '\n' + 'Field=' + \
str(self.field) + '\n' + \
'Material=' + str(self.material)
def __repr__(self):
return 'SubRegion:\n' + 'irreg=' + str(self.irreg) + '\n' + 'rlow=' + str(self.rlow) + '\n' + \
'rhigh=' + str(self.rhigh) + '\n' + 'Field=' + \
str(self.field) + '\n' + \
'Material=' + str(self.material)
def __setattr__(self, name, value):
Region.__setattr__(self, name, value)