This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
ShapeTask.py
479 lines (459 loc) · 25.4 KB
/
ShapeTask.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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
from abaqusConstants import *
from .DesignResponse import DesignResponse
from .GeometricRestriction import GeometricRestriction
from .ObjectiveFunction import ObjectiveFunction
from .OptimizationConstraint import OptimizationConstraint
from .OptimizationTask import OptimizationTask
from .StopCondition import StopCondition
class ShapeTask(OptimizationTask):
"""The ShapeTask object defines a shape task.
The ShapeTask object is derived from the OptimizationTask object.
Attributes
----------
designResponses: dict[str, DesignResponse]
A repository of :py:class:`~abaqus.Optimization.DesignResponse.DesignResponse` objects.
objectiveFunctions: dict[str, ObjectiveFunction]
A repository of :py:class:`~abaqus.Optimization.ObjectiveFunction.ObjectiveFunction` objects.
optimizationConstraints: dict[str, OptimizationConstraint]
A repository of :py:class:`~abaqus.Optimization.OptimizationConstraint.OptimizationConstraint` objects.
geometricRestrictions: dict[str, GeometricRestriction]
A repository of :py:class:`~abaqus.Optimization.GeometricRestriction.GeometricRestriction` objects.
stopConditions: dict[str, StopCondition]
A repository of :py:class:`~abaqus.Optimization.StopCondition.StopCondition` objects.
Notes
-----
This object can be accessed by:
.. code-block:: python
import optimization
mdb.models[name].optimizationTasks[name]
"""
# A repository of DesignResponse objects.
designResponses: dict[str, DesignResponse] = dict[str, DesignResponse]()
# A repository of ObjectiveFunction objects.
objectiveFunctions: dict[str, ObjectiveFunction] = dict[str, ObjectiveFunction]()
# A repository of OptimizationConstraint objects.
optimizationConstraints: dict[str, OptimizationConstraint] = dict[
str, OptimizationConstraint
]()
# A repository of GeometricRestriction objects.
geometricRestrictions: dict[str, GeometricRestriction] = dict[
str, GeometricRestriction
]()
# A repository of StopCondition objects.
stopConditions: dict[str, StopCondition] = dict[str, StopCondition]()
def __init__(
self,
name: str,
abaqusSensitivities: Boolean = True,
absoluteStepSizeControl: SymbolicConstant = MINIMUM,
activateDurability: Boolean = ON,
additionalDurabilityFiles: str = "",
algorithm: SymbolicConstant = CONDITION_BASED_OPTIMIZATION,
constrainedLaplacianConvergenceLevel: SymbolicConstant = NORMAL,
curvatureSmoothingEdgeLength: float = 5,
durabilityInputfile: str = "",
durabilitySolver: str = FE_SAFE,
equalityConstraintTolerance: float = None,
featureRecognitionAngle: float = 30,
filterExponent: float = 1,
filterMaxRadius: float = None,
filterRadiusReduction: float = None,
firstCycleDeletedVolumeTechnique: SymbolicConstant = OFF,
freezeBoundaryConditionRegions: Boolean = OFF,
frozenBoundaryConditionRegion: SymbolicConstant = MODEL,
geometricRestrictionEvaluationFrequency: SymbolicConstant = LOW,
growthScaleFactor: float = 1,
haltUponViolation: Boolean = OFF,
layerReferenceRegion: str = None,
meshSmoothingRegionMethod: SymbolicConstant = TASK_REGION_LAYERS,
meshSmoothingStrategy: SymbolicConstant = CONSTRAINED_LAPLACIAN,
midsideInterpolation: SymbolicConstant = POSITIONS,
numFreeNodeLayers: SymbolicConstant = 0,
numSmoothedElementLayers: int = None,
presumeFeasibleBCRegionAtStart: Boolean = ON,
quadMaxAngle: float = 160,
quadMinAngle: float = 20,
quadSkew: float = 30,
quadTaper: float = 0,
region: SymbolicConstant = MODEL,
reportPoorQualityElements: Boolean = OFF,
reportQualityViolation: Boolean = OFF,
shrinkScaleFactor: float = 1,
smoothingRegion: str = None,
targetMeshQuality: SymbolicConstant = LOW,
tetAspectRatio: float = 100,
tetMaxAspect: float = 8,
tetMinAspect: float = 0,
tetSkew: float = 100,
triMaxAngle: float = 140,
triMinAngle: float = 20,
updateShapeBasisVectors: SymbolicConstant = EVERY_CYCLE,
groupOperator: Boolean = OFF,
):
"""This method creates a ShapeTask object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].ShapeTask
Parameters
----------
name
A String specifying the optimization task repository key.
abaqusSensitivities
A Boolean specifying whether to use Abaqus to compute the design responses and their
sensitivities. The default value is True.
absoluteStepSizeControl
A SymbolicConstant specifying whether to control the permitted absolute step size by the
average optimization displacement or minimum optimization displacement. Possible values
are MINIMUM and AVERAGE. The default value is MINIMUM.
activateDurability
A boolean specifying whether or not the durability approach of optimization is turned
on. The default value is ON.
additionalDurabilityFiles
A String specifying the path of additional files pertaining to durability optimization.
Only valid if the *activateDurability* argument is ON.
algorithm
A SymbolicConstant specifying the optimization task algorithm. Possible values are
GENERAL_OPTIMIZATION and CONDITION_BASED_OPTIMIZATION. The default value is
CONDITION_BASED_OPTIMIZATION.
constrainedLaplacianConvergenceLevel
A SymbolicConstant specifying the constrained Laplacian convergence level. Possible
values are NORMAL, CONSERVATIVE, and AGGRESSIVE. The default value is NORMAL.
curvatureSmoothingEdgeLength
A Float specifying the edge length for the movement vector. The default value is 5.0.
durabilityInputfile
A string specifying the path of the input file. Only valid if the *activateDurability*
argument is ON and is a required argument in that case.
durabilitySolver
A String specifying the type of solver for durability optimization. Possible values are:
FE_SAFE, FEMFAT, FALANCS, MSC_FATIGUE, FE_FATIGUE, DESIGN_LIFE, CUSTOM, FEMSITE. The
default value is FE_SAFE. Only valid if the *activateDurability* argument is ON.
equalityConstraintTolerance
A Float specifying the equality constraint tolerance. The default value is 10–3.
featureRecognitionAngle
A Float specifying the mesh smoothing feature recognition angle for edges and corners.
The default value is 30.0.
filterExponent
A Float specifying the weight depending on the radius, used when *filterMaxRadius* is
specified. The default value is 1.0.
filterMaxRadius
None or a Float specifying the maximum influence radius for equivalent stress. The
default value is None.
filterRadiusReduction
None or a Float specifying the reduction of the radius depending on surface bending,
used when *filterMaxRadius* is specified. The default value is None.
firstCycleDeletedVolumeTechnique
A SymbolicConstant specifying the method of specifying volume that can be removed
immediately in the first design cycle. Possible values are OFF, PERCENTAGE, and
ABSOLUTE. The default value is OFF.
freezeBoundaryConditionRegions
A Boolean specifying whether to exclude nodes with boundary conditions from the
optimization. The default value is OFF.
frozenBoundaryConditionRegion
The SymbolicConstant MODEL or a Region object specifying the region in which to freeze
boundary condition regions, or the SymbolicConstant MODEL, used with
*freezeBoundaryConditionRegions*. The default value is MODEL.
geometricRestrictionEvaluationFrequency
A SymbolicConstant specifying the frequency of evaluating geometric restrictions during
mesh smoothing. Possible values are LOW, MEDIUM, and HIGH. The default value is LOW.
growthScaleFactor
A Float specifying the scale factor to apply to optimization displacements for nodes
with growth. The default value is 1.0.
haltUponViolation
A Boolean specifying whether to halt the optimization if quality criteria are not
satisified. The default value is OFF.
layerReferenceRegion
None or a Region object specifying the region specifying the first node layer for mesh
smoothing, used when *meshSmoothingRegionMethod* is TASK_REGION_LAYERS. The default
value is None.
meshSmoothingRegionMethod
A SymbolicConstant specifying the method used to determine the mesh smoothing region.
The REGION value uses the *smoothingRegion*. The NUMBER_OF_LAYERS value uses the
*layerReferenceRegion*. The TASK_REGION_LAYERS value will smooth six layers using the
task region. Possible values are TASK_REGION_LAYERS, REGION, and NUMBER_OF_LAYERS. The
default value is TASK_REGION_LAYERS.
meshSmoothingStrategy
A SymbolicConstant specifying the method smoothing strategy. Possible values are
CONSTRAINED_LAPLACIAN and LOCAL_GRADIENT. The default value is CONSTRAINED_LAPLACIAN.
midsideInterpolation
A SymbolicConstant specifying the approach used when treating midside node positions
during optimization. POSITIONS indicates midside node positions are interpolated
linearly by position. OPTIMIZATION_DISPLACEMENT indicates they are interpolated by
optimization displacement of corner nodes. Possible values are POSITIONS and
OPTIMIZATION_DISPLACEMENT. The default value is POSITIONS.
numFreeNodeLayers
The SymbolicConstant FIX_NONE or an Int specifying the number of node layers adjoining
the task region to remain free during mesh smoothing. A value of 0 indicates that no
layers are free and all layers are fixed. The default value is 0.
numSmoothedElementLayers
None or an Int specifying the number of layers for mesh smoothing when
*meshSmoothingRegionMethod* is NUMBER_OF_LAYERS. The default value is None.
presumeFeasibleBCRegionAtStart
A Boolean specifying whether to ignore automatically frozen boundary condition regions
in the first design cycle. This is used with *freezeBoundaryConditionRegions*. The
default value is ON.
quadMaxAngle
A Float specifying the maximum angle for quad elements during mesh smoothing. The
default value is 160.0.
quadMinAngle
A Float specifying the minimum angle for quad elements during mesh smoothing. The
default value is 20.0.
quadSkew
A Float specifying the skew angle for quad elements during mesh smoothing, used with
*reportQualityViolation*. The default value is 30.0.
quadTaper
A Float specifying the taper for quad elements during mesh smoothing, used with
*reportQualityViolation*. The default value is 0.5.
region
The SymbolicConstant MODEL or a Region object specifying the region to which the
optimization task is applied. The default value is MODEL.
reportPoorQualityElements
A Boolean specifying whether to report poor quality elements during mesh smoothing. The
default value is OFF.
reportQualityViolation
A Boolean specifying whether to report a quality criteria violation during mesh
smoothing. The default value is OFF.
shrinkScaleFactor
A Float specifying the scale factor to apply to optimization displacements for nodes
with shrinkage. The default value is 1.0.
smoothingRegion
None or a Region object specifying the mesh smoothing region, used when
*meshSmoothingRegionMethod* is REGION. The default value is None.
targetMeshQuality
A SymbolicConstant specifying the target mesh quality for mesh smoothing. Possible
values are NONE, LOW, MEDIUM, and HIGH. The default value is LOW.
tetAspectRatio
A Float specifying the tet element aspect ratio during mesh smoothing. The default value
is 100.0.
tetMaxAspect
A Float specifying the maximum tet element aspect ratio during mesh smoothing. The
default value is 8.0.
tetMinAspect
A Float specifying the minimum tet element aspect ratio during mesh smoothing. The
default value is 0.222.
tetSkew
A Float specifying the tet element skew value during mesh smoothing. The default value
is 100.0.
triMaxAngle
A Float specifying the tri element maximum angle during mesh smoothing. The default
value is 140.0.
triMinAngle
A Float specifying the tri element maximum angle during mesh smoothing. The default
value is 20.0.
updateShapeBasisVectors
A SymbolicConstant specifying whether to update shape basis vectors in the first design
cycle or every design cycle. Possible values are EVERY_CYCLE and FIRST_CYCLE. The
default value is EVERY_CYCLE.
groupOperator
A Boolean specifying whether the group in the design response will be evaluated using
the existing algorithm or a new algorithm based on Abaqus sensitivities. The default
value of False means that the existing algorithm will be used.
Returns
-------
A ShapeTask object.
"""
super().__init__()
pass
def setValues(
self,
abaqusSensitivities: Boolean = True,
absoluteStepSizeControl: SymbolicConstant = MINIMUM,
activateDurability: Boolean = ON,
additionalDurabilityFiles: str = "",
algorithm: SymbolicConstant = CONDITION_BASED_OPTIMIZATION,
constrainedLaplacianConvergenceLevel: SymbolicConstant = NORMAL,
curvatureSmoothingEdgeLength: float = 5,
durabilityInputfile: str = "",
durabilitySolver: str = FE_SAFE,
equalityConstraintTolerance: float = None,
featureRecognitionAngle: float = 30,
filterExponent: float = 1,
filterMaxRadius: float = None,
filterRadiusReduction: float = None,
firstCycleDeletedVolumeTechnique: SymbolicConstant = OFF,
freezeBoundaryConditionRegions: Boolean = OFF,
frozenBoundaryConditionRegion: SymbolicConstant = MODEL,
geometricRestrictionEvaluationFrequency: SymbolicConstant = LOW,
growthScaleFactor: float = 1,
haltUponViolation: Boolean = OFF,
layerReferenceRegion: str = None,
meshSmoothingRegionMethod: SymbolicConstant = TASK_REGION_LAYERS,
meshSmoothingStrategy: SymbolicConstant = CONSTRAINED_LAPLACIAN,
midsideInterpolation: SymbolicConstant = POSITIONS,
numFreeNodeLayers: SymbolicConstant = 0,
numSmoothedElementLayers: int = None,
presumeFeasibleBCRegionAtStart: Boolean = ON,
quadMaxAngle: float = 160,
quadMinAngle: float = 20,
quadSkew: float = 30,
quadTaper: float = 0,
region: SymbolicConstant = MODEL,
reportPoorQualityElements: Boolean = OFF,
reportQualityViolation: Boolean = OFF,
shrinkScaleFactor: float = 1,
smoothingRegion: str = None,
targetMeshQuality: SymbolicConstant = LOW,
tetAspectRatio: float = 100,
tetMaxAspect: float = 8,
tetMinAspect: float = 0,
tetSkew: float = 100,
triMaxAngle: float = 140,
triMinAngle: float = 20,
updateShapeBasisVectors: SymbolicConstant = EVERY_CYCLE,
groupOperator: Boolean = OFF,
):
"""This method modifies the ShapeTask object.
Parameters
----------
abaqusSensitivities
A Boolean specifying whether to use Abaqus to compute the design responses and their
sensitivities. The default value is True.
absoluteStepSizeControl
A SymbolicConstant specifying whether to control the permitted absolute step size by the
average optimization displacement or minimum optimization displacement. Possible values
are MINIMUM and AVERAGE. The default value is MINIMUM.
activateDurability
A boolean specifying whether or not the durability approach of optimization is turned
on. The default value is ON.
additionalDurabilityFiles
A String specifying the path of additional files pertaining to durability optimization.
Only valid if the *activateDurability* argument is ON.
algorithm
A SymbolicConstant specifying the optimization task algorithm. Possible values are
GENERAL_OPTIMIZATION and CONDITION_BASED_OPTIMIZATION. The default value is
CONDITION_BASED_OPTIMIZATION.
constrainedLaplacianConvergenceLevel
A SymbolicConstant specifying the constrained Laplacian convergence level. Possible
values are NORMAL, CONSERVATIVE, and AGGRESSIVE. The default value is NORMAL.
curvatureSmoothingEdgeLength
A Float specifying the edge length for the movement vector. The default value is 5.0.
durabilityInputfile
A string specifying the path of the input file. Only valid if the *activateDurability*
argument is ON and is a required argument in that case.
durabilitySolver
A String specifying the type of solver for durability optimization. Possible values are:
FE_SAFE, FEMFAT, FALANCS, MSC_FATIGUE, FE_FATIGUE, DESIGN_LIFE, CUSTOM, FEMSITE. The
default value is FE_SAFE. Only valid if the *activateDurability* argument is ON.
equalityConstraintTolerance
A Float specifying the equality constraint tolerance. The default value is 10–3.
featureRecognitionAngle
A Float specifying the mesh smoothing feature recognition angle for edges and corners.
The default value is 30.0.
filterExponent
A Float specifying the weight depending on the radius, used when *filterMaxRadius* is
specified. The default value is 1.0.
filterMaxRadius
None or a Float specifying the maximum influence radius for equivalent stress. The
default value is None.
filterRadiusReduction
None or a Float specifying the reduction of the radius depending on surface bending,
used when *filterMaxRadius* is specified. The default value is None.
firstCycleDeletedVolumeTechnique
A SymbolicConstant specifying the method of specifying volume that can be removed
immediately in the first design cycle. Possible values are OFF, PERCENTAGE, and
ABSOLUTE. The default value is OFF.
freezeBoundaryConditionRegions
A Boolean specifying whether to exclude nodes with boundary conditions from the
optimization. The default value is OFF.
frozenBoundaryConditionRegion
The SymbolicConstant MODEL or a Region object specifying the region in which to freeze
boundary condition regions, or the SymbolicConstant MODEL, used with
*freezeBoundaryConditionRegions*. The default value is MODEL.
geometricRestrictionEvaluationFrequency
A SymbolicConstant specifying the frequency of evaluating geometric restrictions during
mesh smoothing. Possible values are LOW, MEDIUM, and HIGH. The default value is LOW.
growthScaleFactor
A Float specifying the scale factor to apply to optimization displacements for nodes
with growth. The default value is 1.0.
haltUponViolation
A Boolean specifying whether to halt the optimization if quality criteria are not
satisified. The default value is OFF.
layerReferenceRegion
None or a Region object specifying the region specifying the first node layer for mesh
smoothing, used when *meshSmoothingRegionMethod* is TASK_REGION_LAYERS. The default
value is None.
meshSmoothingRegionMethod
A SymbolicConstant specifying the method used to determine the mesh smoothing region.
The REGION value uses the *smoothingRegion*. The NUMBER_OF_LAYERS value uses the
*layerReferenceRegion*. The TASK_REGION_LAYERS value will smooth six layers using the
task region. Possible values are TASK_REGION_LAYERS, REGION, and NUMBER_OF_LAYERS. The
default value is TASK_REGION_LAYERS.
meshSmoothingStrategy
A SymbolicConstant specifying the method smoothing strategy. Possible values are
CONSTRAINED_LAPLACIAN and LOCAL_GRADIENT. The default value is CONSTRAINED_LAPLACIAN.
midsideInterpolation
A SymbolicConstant specifying the approach used when treating midside node positions
during optimization. POSITIONS indicates midside node positions are interpolated
linearly by position. OPTIMIZATION_DISPLACEMENT indicates they are interpolated by
optimization displacement of corner nodes. Possible values are POSITIONS and
OPTIMIZATION_DISPLACEMENT. The default value is POSITIONS.
numFreeNodeLayers
The SymbolicConstant FIX_NONE or an Int specifying the number of node layers adjoining
the task region to remain free during mesh smoothing. A value of 0 indicates that no
layers are free and all layers are fixed. The default value is 0.
numSmoothedElementLayers
None or an Int specifying the number of layers for mesh smoothing when
*meshSmoothingRegionMethod* is NUMBER_OF_LAYERS. The default value is None.
presumeFeasibleBCRegionAtStart
A Boolean specifying whether to ignore automatically frozen boundary condition regions
in the first design cycle. This is used with *freezeBoundaryConditionRegions*. The
default value is ON.
quadMaxAngle
A Float specifying the maximum angle for quad elements during mesh smoothing. The
default value is 160.0.
quadMinAngle
A Float specifying the minimum angle for quad elements during mesh smoothing. The
default value is 20.0.
quadSkew
A Float specifying the skew angle for quad elements during mesh smoothing, used with
*reportQualityViolation*. The default value is 30.0.
quadTaper
A Float specifying the taper for quad elements during mesh smoothing, used with
*reportQualityViolation*. The default value is 0.5.
region
The SymbolicConstant MODEL or a Region object specifying the region to which the
optimization task is applied. The default value is MODEL.
reportPoorQualityElements
A Boolean specifying whether to report poor quality elements during mesh smoothing. The
default value is OFF.
reportQualityViolation
A Boolean specifying whether to report a quality criteria violation during mesh
smoothing. The default value is OFF.
shrinkScaleFactor
A Float specifying the scale factor to apply to optimization displacements for nodes
with shrinkage. The default value is 1.0.
smoothingRegion
None or a Region object specifying the mesh smoothing region, used when
*meshSmoothingRegionMethod* is REGION. The default value is None.
targetMeshQuality
A SymbolicConstant specifying the target mesh quality for mesh smoothing. Possible
values are NONE, LOW, MEDIUM, and HIGH. The default value is LOW.
tetAspectRatio
A Float specifying the tet element aspect ratio during mesh smoothing. The default value
is 100.0.
tetMaxAspect
A Float specifying the maximum tet element aspect ratio during mesh smoothing. The
default value is 8.0.
tetMinAspect
A Float specifying the minimum tet element aspect ratio during mesh smoothing. The
default value is 0.222.
tetSkew
A Float specifying the tet element skew value during mesh smoothing. The default value
is 100.0.
triMaxAngle
A Float specifying the tri element maximum angle during mesh smoothing. The default
value is 140.0.
triMinAngle
A Float specifying the tri element maximum angle during mesh smoothing. The default
value is 20.0.
updateShapeBasisVectors
A SymbolicConstant specifying whether to update shape basis vectors in the first design
cycle or every design cycle. Possible values are EVERY_CYCLE and FIRST_CYCLE. The
default value is EVERY_CYCLE.
groupOperator
A Boolean specifying whether the group in the design response will be evaluated using
the existing algorithm or a new algorithm based on Abaqus sensitivities. The default
value of False means that the existing algorithm will be used.
"""
pass