This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
OptimizationTask.py
2069 lines (1837 loc) · 75.5 KB
/
OptimizationTask.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
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from abaqusConstants import *
from .BeadFixedRegion import BeadFixedRegion
from .BeadGrowth import BeadGrowth
from .BeadPenetrationCheck import BeadPenetrationCheck
from .BeadPlanarSymmetry import BeadPlanarSymmetry
from .BeadPointSymmetry import BeadPointSymmetry
from .BeadRotationalSymmetry import BeadRotationalSymmetry
from .DesignDirection import DesignDirection
from .DrillControl import DrillControl
from .FixedRegion import FixedRegion
from .FrozenArea import FrozenArea
from .Growth import Growth
from .ObjectiveFunction import ObjectiveFunction
from .OptimizationConstraint import OptimizationConstraint
from .OptimizationObjectiveArray import OptimizationObjectiveArray
from .OptimizationTaskBase import OptimizationTaskBase
from .PenetrationCheck import PenetrationCheck
from .ShapeDemoldControl import ShapeDemoldControl
from .ShapeMemberSize import ShapeMemberSize
from .ShapePlanarSymmetry import ShapePlanarSymmetry
from .ShapePointSymmetry import ShapePointSymmetry
from .ShapeRotationalSymmetry import ShapeRotationalSymmetry
from .SingleTermDesignResponse import SingleTermDesignResponse
from .SizingClusterAreas import SizingClusterAreas
from .SizingCyclicSymmetry import SizingCyclicSymmetry
from .SizingFrozenArea import SizingFrozenArea
from .SizingMemberSize import SizingMemberSize
from .SizingPlanarSymmetry import SizingPlanarSymmetry
from .SizingPointSymmetry import SizingPointSymmetry
from .SizingRotationalSymmetry import SizingRotationalSymmetry
from .SlideRegionControl import SlideRegionControl
from .StampControl import StampControl
from .StepOptionArray import StepOptionArray
from .TopologyCyclicSymmetry import TopologyCyclicSymmetry
from .TopologyDemoldControl import TopologyDemoldControl
from .TopologyMemberSize import TopologyMemberSize
from .TopologyMillingControl import TopologyMillingControl
from .TopologyOverhangControl import TopologyOverhangControl
from .TopologyPlanarSymmetry import TopologyPlanarSymmetry
from .TopologyPointSymmetry import TopologyPointSymmetry
from .TopologyRotationalSymmetry import TopologyRotationalSymmetry
from .TurnControl import TurnControl
from ..Region.Region import Region
class OptimizationTask(OptimizationTaskBase):
def SingleTermDesignResponse(
self,
name: str,
identifier: str,
csys: int = None,
drivingRegion: str = None,
operation: SymbolicConstant = SUM,
region: SymbolicConstant = MODEL,
shellLayer: SymbolicConstant = MAXIMUM,
stepOperation: SymbolicConstant = SUM,
stepOptions: StepOptionArray = None,
) -> SingleTermDesignResponse:
"""This method creates a SingleTermDesignResponse object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].SingleTermDesignResponse
Parameters
----------
name
A String specifying the design response repository key.
identifier
A String specifying the name of the variable identifier.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
drivingRegion
None or a sequence of Floats specifying the driving region used when *identifier* is an
internal nodal variable. The default value is None.
operation
A SymbolicConstant specifying the operation used on values in the region. Possible
values are MAXIMUM, MINIMUM, and SUM. The default value is SUM.
region
The SymbolicConstant MODEL or a Region object specifying the region of the design
response variable. The default value is MODEL.
shellLayer
A SymbolicConstant specifying the location used for shell layer values. Possible values
are BOTTOM, MAXIMUM, MIDDLE, MINIMUM, and TOP. The default value is MAXIMUM.
stepOperation
A SymbolicConstant specifying the operation used on values across steps and load cases.
Possible values are MAXIMUM, MINIMUM, and SUM. The default value is SUM.
stepOptions
A StepOptionArray object.
Returns
-------
A SingleTermDesignResponse object.
"""
self.designResponses[
name
] = singleTermDesignResponse = SingleTermDesignResponse(
name,
identifier,
csys,
drivingRegion,
operation,
region,
shellLayer,
stepOperation,
stepOptions,
)
return singleTermDesignResponse
def ObjectiveFunction(
self,
name: str,
objectives: OptimizationObjectiveArray,
target: SymbolicConstant = MINIMIZE,
) -> ObjectiveFunction:
"""This method creates an ObjectiveFunction object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].ObjectiveFunction
Parameters
----------
name
A String specifying the objective function repository key.
objectives
An OptimizationObjectiveArray object.
target
A SymbolicConstant specifying the target of the objective function. Possible values are
MINIMIZE, MAXIMIZE, and MINIMIZE_MAXIMUM. The default value is MINIMIZE.
Returns
-------
An ObjectiveFunction object.
Raises
------
InvalidNameError
RangeError
"""
self.objectiveFunctions[name] = objectiveFunction = ObjectiveFunction(
name, objectives, target
)
return objectiveFunction
def OptimizationConstraint(
self,
name: str,
designResponse: str,
restrictionValue: float,
restrictionMethod: SymbolicConstant = ABSOLUTE_EQUAL,
) -> OptimizationConstraint:
"""This method creates an OptimizationConstraint object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].OptimizationConstraint
Parameters
----------
name
A String specifying the optimization constraint repository key.
designResponse
A String specifying the name of the design response to constrain.
restrictionValue
A Float specifying the value to which the design response should be constrained.
restrictionMethod
A SymbolicConstant specifying the method used to constrain the design response. Possible
values are ABSOLUTE_EQUAL, ABSOLUTE_GREATER_THAN_EQUAL, ABSOLUTE_LESS_THAN_EQUAL,
RELATIVE_EQUAL, RELATIVE_GREATER_THAN_EQUAL, and RELATIVE_LESS_THAN_EQUAL. The default
value is ABSOLUTE_EQUAL.
Returns
-------
An OptimizationConstraint object.
Raises
------
InvalidNameError
RangeError
"""
self.optimizationConstraints[
name
] = optimizationConstraint = OptimizationConstraint(
name, designResponse, restrictionValue, restrictionMethod
)
return optimizationConstraint
def BeadFixedRegion(
self,
name: str,
region: Region,
csys: int = None,
u1: Boolean = OFF,
u2: Boolean = OFF,
u3: Boolean = OFF,
) -> BeadFixedRegion:
"""This method creates a BeadFixedRegion object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].BeadFixedRegion
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
u1
A Boolean specifying whether to fix the region in the 1-direction. The default value is
OFF.
u2
A Boolean specifying whether to fix the region in the 2-direction. The default value is
OFF.
u3
A Boolean specifying whether to fix the region in the 3-direction. The default value is
OFF.
Returns
-------
A BeadFixedRegion object.
"""
self.geometricRestrictions[name] = geometricRestriction = BeadFixedRegion(
name, region, csys, u1, u2, u3
)
return geometricRestriction
def BeadGrowth(
self, name: str, region: Region, beadGrowth: float = 0, shrink: float = 0
) -> BeadGrowth:
"""This method creates a BeadGrowth object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].BeadGrowth
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
beadGrowth
A Float specifying the maximum optimization displacement in the growth direction. Either
*beadGrowth* or *shrink* or both must be specified. The default value is 0.0.
shrink
A Float specifying the maximum optimization displacement in the shrink direction. Either
*beadGrowth* or *shrink* or both must be specified The default value is 0.0.
Returns
-------
A BeadGrowth object.
"""
self.geometricRestrictions[name] = geometricRestriction = BeadGrowth(
name, region, beadGrowth, shrink
)
return geometricRestriction
def BeadPenetrationCheck(
self, name: str, beadPenetrationCheckRegion: Region, region: Region
) -> BeadPenetrationCheck:
"""This method creates a BeadPenetrationCheck object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].BeadPenetrationCheck
Parameters
----------
name
A String specifying the geometric restriction repository key.
beadPenetrationCheckRegion
A Region object specifying the penetration check region.
region
A Region object specifying the region to which the geometric restriction is applied.
Returns
-------
A BeadPenetrationCheck object.
"""
self.geometricRestrictions[name] = geometricRestriction = BeadPenetrationCheck(
name, beadPenetrationCheckRegion, region
)
return geometricRestriction
def BeadPlanarSymmetry(
self,
name: str,
region: Region,
axis: SymbolicConstant = AXIS_1,
csys: int = None,
) -> BeadPlanarSymmetry:
"""This method creates a BeadPlanarSymmetry object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].BeadPlanarSymmetry
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
axis
A SymbolicConstant specifying the axis of symmetry. Possible values are AXIS_1, AXIS_2,
and AXIS_3. The default value is AXIS_1.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
Returns
-------
A BeadPlanarSymmetry object.
"""
self.geometricRestrictions[name] = geometricRestriction = BeadPlanarSymmetry(
name, region, axis, csys
)
return geometricRestriction
def BeadPointSymmetry(
self, name: str, region: Region, csys: int = None
) -> BeadPointSymmetry:
"""This method creates a BeadPointSymmetry object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].BeadPointSymmetry
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
csys
None or a DatumCsys object specifying the position of the symmetry point defined as the
origin of a local coordinate system. If *csys*=None, the global coordinate system is
used. When this member is queried, it returns an Int. The default value is None.
Returns
-------
A BeadPointSymmetry object.
"""
self.geometricRestrictions[name] = geometricRestriction = BeadPointSymmetry(
name, region, csys
)
return geometricRestriction
def BeadRotationalSymmetry(
self,
name: str,
angle: float,
region: Region,
axis: SymbolicConstant = AXIS_1,
csys: int = None,
) -> BeadRotationalSymmetry:
"""This method creates a BeadRotationalSymmetry object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].BeadRotationalSymmetry
Parameters
----------
name
A String specifying the geometric restriction repository key.
angle
A Float specifying the repeating segment size, an angle in degrees.
region
A Region object specifying the region to which the geometric restriction is applied.
axis
A SymbolicConstant specifying the axis of symmetry. Possible values are AXIS_1, AXIS_2,
and AXIS_3. The default value is AXIS_1.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
Returns
-------
A BeadRotationalSymmetry object.
"""
self.geometricRestrictions[
name
] = geometricRestriction = BeadRotationalSymmetry(
name, angle, region, axis, csys
)
return geometricRestriction
def DesignDirection(
self,
name: str,
region: Region,
csys: int = None,
mainPoint: str = None,
mainPointDetermination: SymbolicConstant = MAXIMUM,
movementRestriction: SymbolicConstant = VECTOR,
presumeFeasibleRegionAtStart: Boolean = ON,
u1: Boolean = ON,
u2: Boolean = ON,
u3: Boolean = ON,
) -> DesignDirection:
"""This method creates a DesignDirection object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].DesignDirection
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
masterPoint
None or a Region object specifying the master point used when *masterPointDetermination* is
SPECIFY. The default value is None.
masterPointDetermination
A SymbolicConstant specifying the rule for assigning point priority. Possible values are
MAXIMUM, MINIMUM, and SPECIFY. The default value is MAXIMUM.
movementRestriction
A SymbolicConstant specifying whether movement in the region should follow only the
direction of the *masterPoint*, only the magnitude, or both the magnitude of the
*masterPoint* and the directions specified by *u1*, *u2* and *u3*. Possible values are
DIRECTION, MAGNITUDE, and VECTOR. The default value is VECTOR.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
u1
A Boolean specifying whether movement in the region should follow the *masterPoint* in
the 1-direction. This is used when *movementRestriction* is VECTOR. The default value is
ON.
u2
A Boolean specifying whether movement in the region should follow the *masterPoint* in
the 2-direction. This is used when *movementRestriction* is VECTOR. The default value is
ON.
u3
A Boolean specifying whether movement in the region should follow the *masterPoint* in
the 3-direction. This is used when *movementRestriction* is VECTOR. The default value is
ON.
Returns
-------
A DesignDirection object.
"""
self.geometricRestrictions[name] = geometricRestriction = DesignDirection(
name,
region,
csys,
mainPoint,
mainPointDetermination,
movementRestriction,
presumeFeasibleRegionAtStart,
u1,
u2,
u3,
)
return geometricRestriction
def DrillControl(
self,
name: str,
clientDirection: tuple,
region: Region,
csys: int = None,
drawAngle: float = 0,
mainPoint: str = None,
mainPointDetermination: SymbolicConstant = MAXIMUM,
presumeFeasibleRegionAtStart: Boolean = ON,
tolerance1: float = 0,
tolerance2: float = 0,
tolerance3: float = 0,
undercutTolerance: float = 0,
) -> DrillControl:
"""This method creates a DrillControl object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].DrillControl
Parameters
----------
name
A String specifying the geometric restriction repository key.
clientDirection
A VertexArray object of length 2 specifying the direction of the drill axis positioned
at the *csys* origin. Instead of through a ConstrainedSketchVertex, each point may be specified through a
tuple of coordinates.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
drawAngle
A Float specifying the draw angle. The default value is 0.0.
masterPoint
None or a Region object specifying the master point used when *masterPointDetermination* is
SPECIFY. The default value is None.
masterPointDetermination
A SymbolicConstant specifying the rule for assigning point priority. Possible values are
MAXIMUM, MINIMUM, and SPECIFY. The default value is MAXIMUM.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
tolerance1
A Float specifying the geometric tolerance in the 1-direction. The default value is
0.01.
tolerance2
A Float specifying the geometric tolerance in the 2-direction. The default value is
0.01.
tolerance3
A Float specifying the geometric tolerance in the 3-direction. The default value is
0.01.
undercutTolerance
A Float specifying the undercut tolerance. The default value is 0.0.
Returns
-------
A DrillControl object.
"""
self.geometricRestrictions[name] = geometricRestriction = DrillControl(
name,
clientDirection,
region,
csys,
drawAngle,
mainPoint,
mainPointDetermination,
presumeFeasibleRegionAtStart,
tolerance1,
tolerance2,
tolerance3,
undercutTolerance,
)
return geometricRestriction
def FixedRegion(
self,
name: str,
region: Region,
csys: int = None,
presumeFeasibleRegionAtStart: Boolean = ON,
u1: Boolean = OFF,
u2: Boolean = OFF,
u3: Boolean = OFF,
) -> FixedRegion:
"""This method creates a FixedRegion object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].FixedRegion
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
u1
A Boolean specifying whether to fix the region in the 1-direction. The default value is
OFF.
u2
A Boolean specifying whether to fix the region in the 2-direction. The default value is
OFF.
u3
A Boolean specifying whether to fix the region in the 3-direction. The default value is
OFF.
Returns
-------
A FixedRegion object.
"""
self.geometricRestrictions[name] = geometricRestriction = FixedRegion(
name, region, csys, presumeFeasibleRegionAtStart, u1, u2, u3
)
return geometricRestriction
def FrozenArea(self, name: str, region: Region = Region()) -> FrozenArea:
"""This method creates a FrozenArea object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].FrozenArea
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
Returns
-------
A FrozenArea object.
"""
self.geometricRestrictions[name] = geometricRestriction = FrozenArea(
name, region
)
return geometricRestriction
def Growth(
self,
name: str,
region: Region,
growth: float = 0,
presumeFeasibleRegionAtStart: Boolean = ON,
shrink: float = 0,
) -> Growth:
"""This method creates a Growth object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].Growth
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
growth
A Float specifying the maximum optimization displacement in the growth direction. Either
*growth* or *shrink* or both must be specified. The default value is 0.0.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
shrink
A Float specifying the maximum optimization displacement in the shrink direction. Either
*growth* or *shrink* or both must be specified The default value is 0.0.
Returns
-------
A Growth object.
"""
self.geometricRestrictions[name] = geometricRestriction = Growth(
name, region, growth, presumeFeasibleRegionAtStart, shrink
)
return geometricRestriction
def PenetrationCheck(
self,
name: str,
penetrationCheckRegion: Region,
region: Region,
presumeFeasibleRegionAtStart: Boolean = ON,
) -> PenetrationCheck:
"""This method creates a PenetrationCheck object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].PenetrationCheck
Parameters
----------
name
A String specifying the geometric restriction repository key.
penetrationCheckRegion
A Region object specifying the penetration check region.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
Returns
-------
A PenetrationCheck object.
"""
self.geometricRestrictions[name] = geometricRestriction = PenetrationCheck(
name, penetrationCheckRegion, region, presumeFeasibleRegionAtStart
)
return geometricRestriction
def ShapeDemoldControl(
self,
name: str,
pullDirection: tuple,
region: Region,
collisionCheckRegion: SymbolicConstant = DEMOLD_REGION,
csys: int = None,
drawAngle: float = 0,
mainPointDetermination: SymbolicConstant = MAXIMUM,
presumeFeasibleRegionAtStart: Boolean = ON,
tolerance1: float = 0,
tolerance2: float = 0,
tolerance3: float = 0,
undercutTolerance: float = 0,
) -> ShapeDemoldControl:
"""This method creates a ShapeDemoldControl object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].ShapeDemoldControl
Parameters
----------
name
A String specifying the geometric restriction repository key.
pullDirection
A VertexArray object of length 2 specifying the demold pull direction. Instead of
through a ConstrainedSketchVertex, each point might be specified through a tuple of coordinates.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
collisionCheckRegion
The SymbolicConstant DEMOLD_REGION or a Region object specifying the collision check
region. If the value is DEMOLD_REGION, then the value of *region* is used as both the
demold region and the collision check region. The default value is DEMOLD_REGION.
csys
None or a DatumCsys object specifying the local coordinate system of the
*pullDirection*. If *csys*=None, the global coordinate system is used. When this member
is queried, it returns an Int indicating the identifier of the DatumCsys. The default
value is None.
drawAngle
A Float specifying the draw angle. The default value is 0.0.
masterPointDetermination
A SymbolicConstant specifying the rule for assigning point priority. Possible values are
MAXIMUM and MINIMUM. The default value is MAXIMUM.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
tolerance1
A Float specifying the geometric tolerance in the 1-direction. The default value is
0.01.
tolerance2
A Float specifying the geometric tolerance in the 2-direction. The default value is
0.01.
tolerance3
A Float specifying the geometric tolerance in the 3-direction. The default value is
0.01.
undercutTolerance
A Float specifying the undercut tolerance. The default value is 0.0.
Returns
-------
A ShapeDemoldControl object.
"""
self.geometricRestrictions[name] = geometricRestriction = ShapeDemoldControl(
name,
pullDirection,
region,
collisionCheckRegion,
csys,
drawAngle,
mainPointDetermination,
presumeFeasibleRegionAtStart,
tolerance1,
tolerance2,
tolerance3,
undercutTolerance,
)
return geometricRestriction
def ShapeMemberSize(
self,
name: str,
region: Region,
maxThickness: float = 0,
minThickness: float = 0,
sizeRestriction: SymbolicConstant = MINIMUM,
assignNodeGroupRegion: str = OFF,
nodeGroupRegion: str = "",
) -> ShapeMemberSize:
"""This method creates a ShapeMemberSize object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].ShapeMemberSize
Parameters
----------
name
A String specifying the geometric restriction repository key.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
maxThickness
A Float specifying the maximum thickness. The default value is 0.0.
minThickness
A Float specifying the minimum thickness. The default value is 0.0.
sizeRestriction
A SymbolicConstant specifying whether to restrict the minimum or maximum thickness.
Possible values are MAXIMUM and MINIMUM. The default value is MINIMUM.
Returns
-------
A ShapeMemberSize object.
"""
self.geometricRestrictions[name] = geometricRestriction = ShapeMemberSize(
name,
region,
maxThickness,
minThickness,
sizeRestriction,
assignNodeGroupRegion,
nodeGroupRegion,
)
return geometricRestriction
def ShapePlanarSymmetry(
self,
name: str,
clientDirection: tuple,
region: Region,
allowNonSymmetricMesh: Boolean = TRUE,
csys: int = None,
mainPointDetermination: SymbolicConstant = MAXIMUM,
presumeFeasibleRegionAtStart: Boolean = ON,
tolerance1: float = 0,
tolerance2: float = 0,
tolerance3: float = 0,
) -> ShapePlanarSymmetry:
"""This method creates a ShapePlanarSymmetry object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].ShapePlanarSymmetry
Parameters
----------
name
A String specifying the geometric restriction repository key.
clientDirection
A VertexArray object of length 2 specifying the vector positioned at the *csys* origin
that is normal to the symmetry plane. Instead of through a ConstrainedSketchVertex, each point may be
specified through a tuple of coordinates.
region
A Region object specifying the region to which the geometric restriction is applied.
When used with a TopologyTask, there is no default value. When used with a ShapeTask,
the default value is MODEL.
allowNonSymmetricMesh
A Boolean specifying whether to allow a nonsymmetric mesh for this geometric
restriction. The default value is TRUE.
csys
None or a DatumCsys object specifying the local coordinate system. If *csys*=None, the
global coordinate system is used. When this member is queried, it returns an Int. The
default value is None.
mainPointDetermination
A SymbolicConstant specifying the rule for determining the master node. Possible values
are MAXIMUM and MINIMUM. The default value is MAXIMUM.
presumeFeasibleRegionAtStart
A Boolean specifying whether to ignore the geometric restriction in the first design
cycle. The default value is ON.
tolerance1
A Float specifying the geometric tolerance in the 1-direction. The default value is
0.01.
tolerance2
A Float specifying the geometric tolerance in the 2-direction. The default value is
0.01.
tolerance3
A Float specifying the geometric tolerance in the 3-direction. The default value is
0.01.
Returns
-------
A ShapePlanarSymmetry object.
"""
self.geometricRestrictions[name] = geometricRestriction = ShapePlanarSymmetry(
name,
clientDirection,
region,
allowNonSymmetricMesh,
csys,
mainPointDetermination,
presumeFeasibleRegionAtStart,
tolerance1,
tolerance2,
tolerance3,
)
return geometricRestriction
def ShapePointSymmetry(
self,
name: str,
region: Region,
csys: int = None,
mainPointDetermination: SymbolicConstant = MAXIMUM,
presumeFeasibleRegionAtStart: Boolean = ON,
tolerance1: float = 0,
tolerance2: float = 0,
tolerance3: float = 0,
) -> ShapePointSymmetry:
"""This method creates a ShapePointSymmetry object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].optimizationTasks[name].ShapePointSymmetry
Parameters