This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
OutputModel.py
425 lines (393 loc) · 17.4 KB
/
OutputModel.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
import typing
from abaqusConstants import *
from .FieldOutputRequest import FieldOutputRequest
from .HistoryOutputRequest import HistoryOutputRequest
from .IntegratedOutputSection import IntegratedOutputSection
from .TimePoint import TimePoint
from ..Model.ModelBase import ModelBase
from ..Region.Region import Region
class OutputModel(ModelBase):
"""Abaqus creates a Model object named `Model-1` when a session is started.
Notes
-----
This object can be accessed by:
.. code-block:: python
mdb.models[name]
"""
def FieldOutputRequest(
self,
name: str,
createStepName: str,
region: SymbolicConstant = MODEL,
variables: SymbolicConstant = PRESELECT,
frequency: SymbolicConstant = 1,
modes: SymbolicConstant = ALL,
timeInterval: typing.Union[SymbolicConstant, float] = EVERY_TIME_INCREMENT,
numIntervals: int = 20,
timeMarks: Boolean = OFF,
boltLoad: str = "",
sectionPoints: SymbolicConstant = DEFAULT,
interactions: str = None,
rebar: SymbolicConstant = EXCLUDE,
filter: SymbolicConstant = None,
directions: Boolean = ON,
fasteners: str = "",
assembledFastener: str = "",
assembledFastenerSet: str = "",
exteriorOnly: Boolean = OFF,
layupNames: str = "",
layupLocationMethod: str = SPECIFIED,
outputAtPlyTop: Boolean = False,
outputAtPlyMid: Boolean = True,
outputAtPlyBottom: Boolean = False,
position: SymbolicConstant = INTEGRATION_POINTS,
):
"""This method creates a FieldOutputRequest object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].FieldOutputRequest
Parameters
----------
name
A String specifying the repository key.
createStepName
A String specifying the name of the step in which the object is created.
region
The SymbolicConstant MODEL or a Region object specifying the region from which output is
requested. The SymbolicConstant MODEL represents the whole model. The default value is
MODEL.
variables
A sequence of Strings specifying output request variable or component names, or the
SymbolicConstant PRESELECT or ALL. PRESELECT represents all default output variables for
the given step. ALL represents all valid output variables. The default value is
PRESELECT.
frequency
The SymbolicConstant LAST_INCREMENT or an Int specifying the output frequency in
increments. The default value is 1.
modes
The SymbolicConstant ALL or a sequence of Ints specifying a list of eigenmodes for which
output is desired. The default value is ALL.
timeInterval
The SymbolicConstant EVERY_TIME_INCREMENT or a Float specifying the time interval at
which the output states are to be written. The default value is EVERY_TIME_INCREMENT.
numIntervals
An Int specifying the number of intervals during the step at which output database
states are to be written. The default value is 20.
timeMarks
A Boolean specifying when to write results to the output database. OFF indicates that
output is written immediately after the time dictated by the specified number of
intervals. ON indicates that output is written at the exact times dictated by the
specified number of intervals. The default value is OFF.
boltLoad
A String specifying a bolt load from which output is requested.
sectionPoints
The SymbolicConstant DEFAULT or a sequence of Ints specifying the section points for
which output requested. The default is DEFAULT.
interactions
None or a sequence of Strings specifying the interaction names. The default value is
None.The sequence can contain only one String.
rebar
A SymbolicConstant specifying whether output is requested for rebar. Possible values are
EXCLUDE, INCLUDE, and ONLY. The default value is EXCLUDE.
filter
The SymbolicConstant ANTIALIASING or a String specifying the name of an output filter
object. The default value is None.
directions
A Boolean specifying whether to output directions of the local material coordinate
system. The default value is ON.
fasteners
A String specifying the fastener name. The default value is an empty string.
assembledFastener
A String specifying the assembled fastener name. The default value is an empty string.
assembledFastenerSet
A String specifying the set name from the model referenced by the assembled fastener,
*assembledFastener*. The default value is an empty string.
exteriorOnly
A Boolean specifying whether the output domain is restricted to the exterior of the
model. This argument is only valid if *region*=MODEL. The default value is OFF.
layupNames
A List of Composite Layer Names.
layupLocationMethod
A Symbolic constant specifying the method used to indicate the output locations for
composite layups. Possible values are ALL_LOCATIONS, SPECIFIED and TYPED_IN. The default
value is SPECIFIED.
outputAtPlyTop
A Boolean specifying whether to output at the ply top section point. The default value
is False.
outputAtPlyMid
A Boolean specifying whether to output at the ply mid section point. The default value
is True.
outputAtPlyBottom
A Boolean specifying whether to output at the ply bottom section point. The default
value is False.
position
A SymbolicConstant specifying the position on an element where output needs to be
written. Possible values are INTEGRATION_POINTS, AVERAGED_AT_NODES, CENTROIDAL, and
NODES. The default value is INTEGRATION_POINTS.
Returns
-------
A FieldOutputRequest object.
"""
self.fieldOutputRequests[name] = FieldOutputRequest(
name,
createStepName,
region,
variables,
frequency,
modes,
timeInterval,
numIntervals,
timeMarks,
boltLoad,
sectionPoints,
interactions,
rebar,
filter,
directions,
fasteners,
assembledFastener,
assembledFastenerSet,
exteriorOnly,
layupNames,
layupLocationMethod,
outputAtPlyTop,
outputAtPlyMid,
outputAtPlyBottom,
position,
)
return self.fieldOutputRequests[name]
def HistoryOutputRequest(
self,
name: str,
createStepName: str,
region: SymbolicConstant = MODEL,
variables: SymbolicConstant = PRESELECT,
frequency: SymbolicConstant = 1,
modes: SymbolicConstant = ALL,
timeInterval: typing.Union[SymbolicConstant, float] = EVERY_TIME_INCREMENT,
numIntervals: int = 20,
boltLoad: str = "",
sectionPoints: SymbolicConstant = DEFAULT,
stepName: str = "",
interactions: str = None,
contourIntegral: str = None,
numberOfContours: int = 0,
stressInitializationStep: str = None,
contourType: SymbolicConstant = J_INTEGRAL,
kFactorDirection: SymbolicConstant = MTS,
rebar: SymbolicConstant = EXCLUDE,
integratedOutputSection: str = "",
springs: tuple = None,
filter: SymbolicConstant = None,
fasteners: str = "",
assembledFastener: str = "",
assembledFastenerSet: str = "",
sensor: Boolean = OFF,
useGlobal: Boolean = True,
):
"""This method creates a HistoryOutputRequest object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].HistoryOutputRequest
Parameters
----------
name
A String specifying the repository key.
createStepName
A String specifying the name of the step in which the object is created.
region
The SymbolicConstant MODEL or a Region object specifying the region from which output is
requested. The SymbolicConstant MODEL represents the whole model. The default value is
MODEL.If the region is a surface region, the surface must lie within the general contact
surface domain.
variables
A sequence of Strings specifying output request variable or component names, or the
SymbolicConstant PRESELECT or ALL. PRESELECT represents all default output variables for
the given step. ALL represents all valid output variables. The default value is
PRESELECT.
frequency
The SymbolicConstant LAST_INCREMENT or an Int specifying the output frequency in
increments. The default value is 1.
modes
The SymbolicConstant ALL or a sequence of Ints specifying a list of eigenmodes for which
output is desired. The default value is ALL.
timeInterval
The SymbolicConstant EVERY_TIME_INCREMENT or a Float specifying the time interval at
which the output states are to be written. The default value is EVERY_TIME_INCREMENT.
numIntervals
An Int specifying the number of intervals during the step at which output database
states are to be written. The default value is 20.
boltLoad
A String specifying a bolt load from which output is requested. The default value is an
empty string.
sectionPoints
The SymbolicConstant DEFAULT or a sequence of Ints specifying the section points for
which output is requested. The default value is DEFAULT.
stepName
A String specifying the name of the step. The default value is an empty string.
interactions
None or a sequence of Strings specifying the interaction names. The default value is
None.The sequence can contain only one String.
contourIntegral
A String specifying the contour integral name. The default value is None.
numberOfContours
An Int specifying the number of contour integrals to output for the contour integral
object. The default value is 0.
stressInitializationStep
A String specifying the name of the stress initialization step. The default value is
None.
contourType
A SymbolicConstant specifying the type of contour integral. Possible values are
J_INTEGRAL, C_INTEGRAL, T_STRESS, and K_FACTORS. The default value is J_INTEGRAL.
kFactorDirection
A SymbolicConstant specifying the stress intensity factor direction. Possible values are
MTS, MERR, and K110. The *kFactorDirection* argument is valid only if
*contourType*=K_FACTORS. The default value is MTS.
rebar
A SymbolicConstant specifying whether output is requested for rebar. Possible values are
EXCLUDE, INCLUDE, and ONLY. The default value is EXCLUDE.
integratedOutputSection
A String specifying the integrated output section. The default value is an empty string.
springs
A sequence of Strings specifying the springs/dashpots names. The default value is None.
The sequence can contain only one String.
filter
The SymbolicConstant ANTIALIASING or a String specifying the name of an output filter
object. The default value is None.
fasteners
A String specifying the fastener name. The default value is an empty string.
assembledFastener
A String specifying the assembled fastener name. The default value is an empty string.
assembledFastenerSet
A String specifying the set name from the model referenced by the assembled fastener,
*assembledFastener*. The default value is an empty string.
sensor
A Boolean specifying whether to associate the output request with a sensor definition.
The default value is OFF.
useGlobal
A Boolean specifying whether to output vector-valued nodal variables in the global
directions. The default value is True.
Returns
-------
A HistoryOutputRequest object.
"""
self.historyOutputRequests[name] = HistoryOutputRequest(
name,
createStepName,
region,
variables,
frequency,
modes,
timeInterval,
numIntervals,
boltLoad,
sectionPoints,
stepName,
interactions,
contourIntegral,
numberOfContours,
stressInitializationStep,
contourType,
kFactorDirection,
rebar,
integratedOutputSection,
springs,
filter,
fasteners,
assembledFastener,
assembledFastenerSet,
sensor,
useGlobal,
)
return self.historyOutputRequests[name]
def IntegratedOutputSection(
self,
name: str,
surface: Region = Region(),
refPoint: SymbolicConstant = None,
refPointAtCenter: Boolean = OFF,
refPointMotion: SymbolicConstant = INDEPENDENT,
localCsys: str = None,
projectOrientation: Boolean = OFF,
) -> IntegratedOutputSection:
"""This method creates an IntegratedOutputSection object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].IntegratedOutputSection
Parameters
----------
name
A String specifying the repository key.
surface
A Region object specifying the surface over which the output is based.
refPoint
None or a Region object specifying the anchor point about which the integrated moment
over the output region is computed or the SymbolicConstant None representing the global
origin. The default value is None.
refPointAtCenter
A Boolean specifying that the *refPoint* be adjusted so that it coincides with the
center of the output region in the initial configuration. This argument is valid only
when you include the *refPoint* argument. The default value is OFF.
refPointMotion
A SymbolicConstant specifying how to relate the motion of *refPoint* to the average
motion of the output region. A value of INDEPENDENT will allow the *refPoint* to move
independent of the output region. A value of AVERAGE_TRANSLATION will set the
displacement of the *refPoint* equal to the average translation of the output region. A
value of AVERAGE will set the displacement and rotation of the *refPoint* equal to the
average translation of the output region. The default value is INDEPENDENT.This argument
is valid only when you include the *refPoint* argument.
localCsys
None or a DatumCsys object specifying the local coordinate system used to express vector
output. If *localCsys*=None, the degrees of freedom are defined in the global coordinate
system. The default value is None.
projectOrientation
A Boolean specifying that the coordinate system be projected onto the *surface* such
that the 1–axis is normal to the *surface*. Projection onto a planar *surface* is such
that the 1-axis is normal to the surface, and a projection onto a nonplanar *surface* is
such that a least-squares fit surface will be used. The default value is OFF.
Returns
-------
An IntegratedOutputSection object.
"""
self.integratedOutputSections[
name
] = integratedOutputSection = IntegratedOutputSection(
name,
surface,
refPoint,
refPointAtCenter,
refPointMotion,
localCsys,
projectOrientation,
)
return integratedOutputSection
def TimePoint(self, name: str, points: tuple) -> TimePoint:
"""This method creates a TimePoint object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].TimePoint
Parameters
----------
name
A String specifying the repository key.
points
A sequence of sequences of Floats specifying time points at which data are written to
the output database or restart files.
Returns
-------
A TimePoint object.
Raises
------
InvalidNameError
RangeError
"""
self.timePoints[name] = timePoint = TimePoint(name, points)
return timePoint