This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
DiscreteField.py
205 lines (176 loc) · 6.69 KB
/
DiscreteField.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
from abaqusConstants import *
from .DataTableArray import DataTableArray
from .Field import Field
from ..Assembly.PartInstance import PartInstance
from ..Region.Region import Region
class DiscreteField(Field):
"""The DiscreteField object defines a varying field whose values correspond to distinct
points within a domain.
The DiscreteField object is derived from the Field object.
Notes
-----
This object can be accessed by:
.. code-block:: python
import fields
mdb.models[name].discreteFields[name]
"""
def __init__(
self,
name: str,
defaultValues: tuple,
fieldType: SymbolicConstant,
location: SymbolicConstant = NODES,
dataWidth: int = 1,
data: DataTableArray = None,
description: str = "",
orientationType: SymbolicConstant = CARTESIAN,
partLevelOrientation: Boolean = OFF,
):
"""This method creates a DiscreteField object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].DiscreteField
Parameters
----------
name
A String specifying the repository key.
defaultValues
A sequence of Floats specifying a sequence of floats specifying the default values.
fieldType
A SymbolicConstant or an Int specifying the type of data represented by this discrete
field. Possible values are SCALAR, ORIENTATION, and PRESCRIBEDCONDITION_DOF.
location
A SymbolicConstant or an Int specifying the location of the domain data. Possible values
are NODES and ELEMENTS. The default value is NODES.
dataWidth
An Int specifying the width of the supplied data. The default value is 1.
data
A DataTableArray object.
description
A String specifying the description of the field. The default value is an empty string.
orientationType
A SymbolicConstant specifying the type of the system being described by a discrete field
used for an orientation. Possible values are CARTESIAN, CYLINDRICAL, and SPHERICAL. The
default value is CARTESIAN.
partLevelOrientation
A Boolean specifying whether or not the orientations are described in terms of part
level coordinates. The default value is OFF.
Returns
-------
A DiscreteField object.
Raises
------
AbaqusException.
"""
super().__init__()
pass
def DiscreteFieldByVolumeFraction(
self,
name: str,
eulerianInstance: PartInstance,
referenceInstance: PartInstance,
accuracy: str = MEDIUM,
materialLocation: str = INSIDE,
description: str = "",
scaleFactor: str = "",
):
"""This method creates a DiscreteField object that represents the volume fraction of each
element of an Eulerian Instance that is occupied by a reference instance.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].DiscreteField
Parameters
----------
name
A String specifying the repository key.
eulerianInstance
A PartInstance object specifying the elements for which volume fraction values will be
computed.
referenceInstance
A PartInstance object specifying the region that either contains material or is empty of
material.
accuracy
A Symbolic Constant specifying the level of accuracy that will be used in computing
volume fractions. Possible values are LOW, MEDIUM, or HIGH. The default value is MEDIUM.
materialLocation
A Symbolic Constant indicating whether the material is inside or outside the
*referenceInstance*. Possible values are INSIDE or OUTSIDE. The default value is INSIDE.
description
A String specifying the description of the field. The default value is an empty string.
scaleFactor
A float specifying the fraction of the volume that is occupied by the
*referenceInstance.* Valid values are between 0 and 1.
Returns
-------
A DiscreteField object.
Raises
------
AbaqusException.
"""
pass
def DiscreteFieldFromAnalytic(
self,
name: str,
location: SymbolicConstant,
analyticFieldName: str,
region: Region,
):
"""This method creates a DiscreteField object from a AnalyticalField object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].DiscreteField
Parameters
----------
name
A String specifying the repository key.
location
A SymbolicConstant or an Int specifying the location of the domain data. Possible values
are NODES and ELEMENTS. The default value is NODES.
analyticFieldName
A String specifying the name of the AnalyticalField containing the source data.
region
A Region object for the field.
Returns
-------
A DiscreteField object.
Raises
------
AbaqusException.
"""
pass
def setValues(
self,
location: SymbolicConstant = NODES,
dataWidth: int = 1,
data: DataTableArray = None,
description: str = "",
orientationType: SymbolicConstant = CARTESIAN,
partLevelOrientation: Boolean = OFF,
):
"""This method modifies the DiscreteField object.
Parameters
----------
location
A SymbolicConstant or an Int specifying the location of the domain data. Possible values
are NODES and ELEMENTS. The default value is NODES.
dataWidth
An Int specifying the width of the supplied data. The default value is 1.
data
A DataTableArray object.
description
A String specifying the description of the field. The default value is an empty string.
orientationType
A SymbolicConstant specifying the type of the system being described by a discrete field
used for an orientation. Possible values are CARTESIAN, CYLINDRICAL, and SPHERICAL. The
default value is CARTESIAN.
partLevelOrientation
A Boolean specifying whether or not the orientations are described in terms of part
level coordinates. The default value is OFF.
"""
pass