This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
FilterOdb.py
287 lines (253 loc) · 10.1 KB
/
FilterOdb.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
from abaqusConstants import *
from .ButterworthFilter import ButterworthFilter
from .Chebyshev1Filter import Chebyshev1Filter
from .Chebyshev2Filter import Chebyshev2Filter
from .OperatorFilter import OperatorFilter
from ..Odb.OdbBase import OdbBase
class FilterOdb(OdbBase):
"""The Odb object is the in-memory representation of an output database (ODB) file.
Notes
-----
This object can be accessed by:
.. code-block:: python
import odbAccess
session.odbs[name]
"""
def ButterworthFilter(
self,
name: str,
cutoffFrequency: float,
order: int = 2,
operation: SymbolicConstant = NONE,
halt: Boolean = OFF,
limit: float = None,
invariant: SymbolicConstant = NONE,
) -> ButterworthFilter:
"""This method creates a ButterworthFilter object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].ButterworthFilter
session.odbs[name].ButterworthFilter
Parameters
----------
name
A String specifying the repository key. This name ANTIALIASING is reserved for filters
generated internally by the program.
cutoffFrequency
A Float specifying the attenuation point of the filter. Possible values are non-negative
numbers. Order is not available for OperatorFilter.
order
An Int specifying the highest power of the filter transfer function. Possible values are
non-negative numbers less than or equal to 20. Order is not available for
OperatorFilter. The default value is 2.
operation
A SymbolicConstant specifying the filter operator. Possible values are NONE, MIN, MAX,
and ABS. The default value is NONE.
halt
A Boolean specifying whether to stop the analysis if the specified limit is reached. The
default value is OFF.
limit
None or a Float specifying the threshold limit, an upper or lower bound for output
values depending on the operation, or a bound for stopping the analysis when Halt is
used. The default value is None.
invariant
A SymbolicConstant specifying the invariant to which filtering is applied. Possible
values are NONE, FIRST, and SECOND. The default value is NONE.
Returns
-------
A ButterworthFilter object.
Raises
------
InvalidNameError
RangeError
"""
self.filters[name] = butterworthFilter = ButterworthFilter(
name, cutoffFrequency, order, operation, halt, limit, invariant
)
return butterworthFilter
def Chebyshev1Filter(
self,
name: str,
cutoffFrequency: float,
rippleFactor: float = 0,
order: int = 2,
operation: SymbolicConstant = NONE,
halt: Boolean = OFF,
limit: float = None,
invariant: SymbolicConstant = NONE,
) -> Chebyshev1Filter:
"""This method creates a Chebyshev1Filter object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].Chebyshev1Filter
session.odbs[name].Chebyshev1Filter
Parameters
----------
name
A String specifying the repository key. This name ANTIALIASING is reserved for filters
generated internally by the program.
cutoffFrequency
A Float specifying the attenuation point of the filter. Possible values are non-negative
numbers. Order is not available for OperatorFilter.
rippleFactor
A Float specifying the amount of allowable ripple in the filter. Possible values are
non-negative numbers. The default value is 0.225.
order
An Int specifying the highest power of the filter transfer function. Possible values are
non-negative numbers less than or equal to 20. Order is not available for
OperatorFilter. The default value is 2.
operation
A SymbolicConstant specifying the filter operator. Possible values are NONE, MIN, MAX,
and ABS. The default value is NONE.
halt
A Boolean specifying whether to stop the analysis if the specified limit is reached. The
default value is OFF.
limit
None or a Float specifying the threshold limit, an upper or lower bound for output
values depending on the operation, or a bound for stopping the analysis when Halt is
used. The default value is None.
invariant
A SymbolicConstant specifying the invariant to which filtering is applied. Possible
values are NONE, FIRST, and SECOND. The default value is NONE.
Returns
-------
A Chebyshev1Filter object.
Raises
------
InvalidNameError
RangeError
"""
self.filters[name] = chebyshev1Filter = Chebyshev1Filter(
name,
cutoffFrequency,
rippleFactor,
order,
operation,
halt,
limit,
invariant,
)
return chebyshev1Filter
def Chebyshev2Filter(
self,
name: str,
cutoffFrequency: float,
rippleFactor: float = 0,
order: int = 2,
operation: SymbolicConstant = NONE,
halt: Boolean = OFF,
limit: float = None,
invariant: SymbolicConstant = NONE,
) -> Chebyshev2Filter:
"""This method creates a Chebyshev2Filter object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].Chebyshev2Filter
session.odbs[name].Chebyshev2Filter
Parameters
----------
name
A String specifying the repository key. This name ANTIALIASING is reserved for filters
generated internally by the program.
cutoffFrequency
A Float specifying the attenuation point of the filter. Possible values are non-negative
numbers. Order is not available for OperatorFilter.
rippleFactor
A Float specifying the amount of allowable ripple in the filter. Possible values are
non-negative numbers less than 1. The default value is 0.025.
order
An Int specifying the highest power of the filter transfer function. Possible values are
non-negative numbers less than or equal to 20. Order is not available for
OperatorFilter. The default value is 2.
operation
A SymbolicConstant specifying the filter operator. Possible values are NONE, MIN, MAX,
and ABS. The default value is NONE.
halt
A Boolean specifying whether to stop the analysis if the specified limit is reached. The
default value is OFF.
limit
None or a Float specifying the threshold limit, an upper or lower bound for output
values depending on the operation, or a bound for stopping the analysis when Halt is
used. The default value is None.
invariant
A SymbolicConstant specifying the invariant to which filtering is applied. Possible
values are NONE, FIRST, and SECOND. The default value is NONE.
Returns
-------
A Chebyshev2Filter object.
Raises
------
InvalidNameError
RangeError
"""
self.filters[name] = chebyshev2Filter = Chebyshev2Filter(
name,
cutoffFrequency,
rippleFactor,
order,
operation,
halt,
limit,
invariant,
)
return chebyshev2Filter
def OperatorFilter(
self,
name: str,
cutoffFrequency: float,
order: int = 2,
operation: SymbolicConstant = NONE,
halt: Boolean = OFF,
limit: float = None,
invariant: SymbolicConstant = NONE,
) -> OperatorFilter:
"""This method creates an OperatorFilter object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].OperatorFilter
session.odbs[name].OperatorFilter
Parameters
----------
name
A String specifying the repository key. This name ANTIALIASING is reserved for filters
generated internally by the program.
cutoffFrequency
A Float specifying the attenuation point of the filter. Possible values are non-negative
numbers. Order is not available for OperatorFilter.
order
An Int specifying the highest power of the filter transfer function. Possible values are
non-negative numbers less than or equal to 20. Order is not available for
OperatorFilter. The default value is 2.
operation
A SymbolicConstant specifying the filter operator. Possible values are NONE, MIN, MAX,
and ABS. The default value is NONE.
halt
A Boolean specifying whether to stop the analysis if the specified limit is reached. The
default value is OFF.
limit
None or a Float specifying the threshold limit, an upper or lower bound for output
values depending on the operation, or a bound for stopping the analysis when Halt is
used. The default value is None.
invariant
A SymbolicConstant specifying the invariant to which filtering is applied. Possible
values are NONE, FIRST, and SECOND. The default value is NONE.
Returns
-------
An OperatorFilter object.
Raises
------
InvalidNameError
RangeError
"""
self.filters[name] = operatorFilter = OperatorFilter(
name, cutoffFrequency, order, operation, halt, limit, invariant
)
return operatorFilter