• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

haiiliin / abqpy / 9778506695

03 Jul 2024 01:10PM UTC coverage: 73.935% (-0.02%) from 73.951%
9778506695

push

github

web-flow
[bugfix] Move circular imports to `TYPE_CHECKING` blocks (backport #5586) (#5649)

[bugfix] Move circular imports to `TYPE_CHECKING` blocks (#5586)

* [bugfix] Move circular imports to TYPE_CHECKING blocks

* Update

(cherry picked from commit d7a30a18b)

Co-authored-by: Hailin Wang <hailin.wang@connect.polyu.hk>

17 of 23 new or added lines in 6 files covered. (73.91%)

7 existing lines in 1 file now uncovered.

24167 of 32687 relevant lines covered (73.93%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.14
/src/abaqus/Connector/ConnectorBehaviorOption.py
1
from __future__ import annotations
1✔
2

3
from typing import TYPE_CHECKING
1✔
4

5
from typing_extensions import Literal
1✔
6

7
from abqpy.decorators import abaqus_class_doc, abaqus_method_doc
1✔
8

9
from ..UtilityAndView.abaqusConstants import (
1✔
10
    COEFFICIENTS,
11
    CONSTANT,
12
    FRACTION,
13
    LINEAR,
14
    OFF,
15
    ON,
16
    PENALTY,
17
    Boolean,
18
)
19
from ..UtilityAndView.abaqusConstants import abaqusConstants as C
1✔
20
from .ConnectorOptions import ConnectorOptions
1✔
21
from .ConnectorPotentialArray import ConnectorPotentialArray
1✔
22
from .TangentialBehavior import TangentialBehavior
1✔
23

24
if TYPE_CHECKING:
1✔
NEW
25
    from .DerivedComponent import DerivedComponent
×
26

27

28
@abaqus_class_doc
1✔
29
class ConnectorBehaviorOption:
1✔
30
    """The ConnectorBehaviorOption object is the abstract base type for other ConnectorBehaviorOption objects.
31
    The ConnectorBehaviorOption object has no explicit constructor. The members of the ConnectorBehaviorOption
32
    object are common to all objects derived from the ConnectorBehaviorOption.
33

34
    .. note::
35
        This object can be accessed by::
36

37
            import section
38
            mdb.models[name].sections[name].behaviorOptions[i]
39
            import odbSection
40
            session.odbs[name].sections[name].behaviorOptions[i]
41
    """
42

43
    #: A ConnectorPotentialArray object.
44
    connectorPotentials: ConnectorPotentialArray = []
1✔
45

46
    #: A DerivedComponent object.
47
    derivedComponent: DerivedComponent
1✔
48

49
    #: A ConnectorPotentialArray object.
50
    evolutionPotentials: ConnectorPotentialArray = []
1✔
51

52
    #: A ConnectorPotentialArray object.
53
    initiationPotentials: ConnectorPotentialArray = []
1✔
54

55
    #: A ConnectorOptions object.
56
    initiationOptions: ConnectorOptions = ConnectorOptions()
1✔
57

58
    #: A ConnectorOptions object.
59
    isotropicOptions: ConnectorOptions = ConnectorOptions()
1✔
60

61
    #: A ConnectorOptions object.
62
    kinematicOptions: ConnectorOptions = ConnectorOptions()
1✔
63

64
    #: A ConnectorOptions object specifying the ConnectorOptions used to define tabular options
65
    #: for this ConnectorBehaviorOption.
66
    options: ConnectorOptions = ConnectorOptions()
1✔
67

68
    #: A TangentialBehavior object
69
    tangentialBehavior: TangentialBehavior = TangentialBehavior()
1✔
70

71
    @abaqus_method_doc
1✔
72
    def TangentialBehavior(
1✔
73
        self,
74
        formulation: Literal[C.PENALTY, C.EXPONENTIAL_DECAY] = PENALTY,
75
        slipRateDependency: Boolean = OFF,
76
        pressureDependency: Boolean = OFF,
77
        temperatureDependency: Boolean = OFF,
78
        dependencies: int = 0,
79
        exponentialDecayDefinition: Literal[C.TEST_DATA, C.COEFFICIENTS] = COEFFICIENTS,
80
        shearStressLimit: float | None = None,
81
        maximumElasticSlip: Literal[C.FRACTION, C.ABSOLUTE_DISTANCE] = FRACTION,
82
        fraction: float | None = None,
83
        absoluteDistance: float | None = None,
84
        table: tuple = (),
85
    ) -> TangentialBehavior:
86
        """This method creates a TangentialBehavior object.
87

88
        .. note::
89
            This function can be accessed by::
90

91
                mdb.models[name].sections[name].behaviorOptions[i].TangentialBehavior
92
                session.odbs[name].sections[name].behaviorOptions[i].TangentialBehavior
93

94
        Parameters
95
        ----------
96
        formulation
97
            A SymbolicConstant specifying the friction coefficient formulation. Possible values are
98
            PENALTY and EXPONENTIAL_DECAY. The default value is PENALTY.
99
        slipRateDependency
100
            A Boolean specifying whether the data depend on slip rate. The default value is OFF.
101
        pressureDependency
102
            A Boolean specifying whether the data depend on contact pressure. The default value is
103
            OFF.
104
        temperatureDependency
105
            A Boolean specifying whether the data depend on temperature. The default value is OFF.
106
        dependencies
107
            An Int specifying the number of field variables for the data. The default value is 0.
108
        exponentialDecayDefinition
109
            A SymbolicConstant specifying the exponential decay definition for the data. Possible
110
            values are COEFFICIENTS and TEST_DATA. The default value is COEFFICIENTS.
111
        shearStressLimit
112
            None or a Float specifying no upper limit or the friction coefficient shear stress
113
            limit. The default value is None.
114
        maximumElasticSlip
115
            A SymbolicConstant specifying the method for modifying the allowable elastic slip.
116
            Possible values are FRACTION and ABSOLUTE_DISTANCE. The default value is FRACTION.This
117
            argument applies only to Abaqus/Standard analyses.
118
        fraction
119
            A Float specifying the ratio of the allowable maximum elastic slip to a characteristic
120
            model dimension. The default value is 10⁻⁴.This argument applies only to Abaqus/Standard
121
            analyses.
122
        absoluteDistance
123
            None or a Float specifying the absolute magnitude of the allowable elastic slip. The
124
            default value is None.This argument applies only to Abaqus/Standard analyses.
125
        table
126
            A sequence of sequences of Floats specifying the tangential properties. Items in the
127
            table data are described below. The default value is an empty sequence.
128

129
        Returns
130
        -------
131
        TangentialBehavior
132
            A TangentialBehavior object.
133
        """
134
        self.tangentialBehavior = tangentialBehavior = TangentialBehavior(
×
135
            formulation,
136
            slipRateDependency,
137
            pressureDependency,
138
            temperatureDependency,
139
            dependencies,
140
            exponentialDecayDefinition,
141
            shearStressLimit,
142
            maximumElasticSlip,
143
            fraction,
144
            absoluteDistance,
145
            table,
146
        )
147
        return tangentialBehavior
×
148

149
    @abaqus_method_doc
1✔
150
    def DerivedComponent(self) -> DerivedComponent:
1✔
151
        """This method creates a DerivedComponent object.
152

153
        .. note::
154
            This function can be accessed by::
155

156
                mdb.models[name].sections[name].behaviorOptions[i].TangentialBehavior
157
                session.odbs[name].sections[name].behaviorOptions[i].TangentialBehavior
158

159
        Returns
160
        -------
161
        DerivedComponent
162
            A DerivedComponent object.
163

164
        Raises
165
        ------
166
        ValueError and TextError
167
        """
NEW
168
        from .DerivedComponent import DerivedComponent
×
169

170
        self.derivedComponent = derivedComponent = DerivedComponent()
×
171
        return derivedComponent
×
172

173
    @abaqus_method_doc
1✔
174
    def ConnectorOptions(
1✔
175
        self,
176
        useBehRegSettings: Boolean = ON,
177
        regularize: Boolean = ON,
178
        defaultTolerance: Boolean = ON,
179
        regularization: float = 0,
180
        defaultRateFactor: Boolean = ON,
181
        rateFactor: float = 0,
182
        interpolation: Literal[C.LOGARITHMIC, C.LINEAR] = LINEAR,
183
        useBehExtSettings: Boolean = ON,
184
        extrapolation: Literal[C.CONSTANT, C.LINEAR] = CONSTANT,
185
    ) -> ConnectorOptions:
186
        """This method creates a connector options object to be used in conjunction with an allowable connector
187
        behavior option, derived component term, or connector section.
188

189
        .. note::
190
            This function can be accessed by::
191

192
                mdb.models[name].sections[name].behaviorOptions[i].TangentialBehavior
193
                session.odbs[name].sections[name].behaviorOptions[i].TangentialBehavior
194

195
        Parameters
196
        ----------
197
        useBehRegSettings
198
            A Boolean specifying whether or not to use the behavior-level settings for
199
            regularization options. This argument is applicable only for an Abaqus/Explicit
200
            analysis. The default value is ON.
201
        regularize
202
            A Boolean specifying whether or not the tabular data will be regularized. This argument
203
            is applicable only for an Abaqus/Explicit analysis and only if **useBehRegSettings** = OFF.
204
            The default value is ON.
205
        defaultTolerance
206
            A Boolean specifying whether or not the analysis default regularization tolerance will
207
            be used. This argument is applicable only for an Abaqus/Explicit analysis and only if
208
            **useBehRegSettings** = OFF and **regularize** = ON. The default value is ON.
209
        regularization
210
            A Float specifying the regularization increment to be used. This argument is applicable
211
            only for an Abaqus/Explicit analysis and only if **useBehRegSettings** = OFF,
212
            **regularize** = ON, and **defaultTolerance** = OFF. The default value is 0.03.
213
        defaultRateFactor
214
            A Boolean specifying whether or not the analysis default rate filter factor will be
215
            used. This argument is applicable only for an Abaqus/Explicit analysis that includes
216
            isotropic hardening with tabular definition or damage initiation with Plastic motion
217
            criteria. The default value is ON.
218
        rateFactor
219
            A Float specifying the rate filter factor to be used. This argument is applicable only
220
            for an Abaqus/Explicit analysis that includes isotropic hardening with tabular
221
            definition or damage initiation with Plastic motion criteria. This argument is also
222
            applicable only if **defaultRateFactor** = OFF. The default value is 0.9.
223
        interpolation
224
            A SymbolicConstant specifying the type of interpolation increment to be used on
225
            rate-dependent tabular data. This argument is applicable only for an Abaqus/Explicit
226
            analysis that includes isotropic hardening with tabular definition or damage initiation
227
            with Plastic motion criteria. Possible values are LINEAR and LOGARITHMIC. The default
228
            value is LINEAR.
229
        useBehExtSettings
230
            A Boolean specifying whether or not to use the behavior-level settings for extrapolation
231
            options. The default value is ON.
232
        extrapolation
233
            A SymbolicConstant specifying the extrapolation technique to be used. This argument is
234
            applicable only if **useBehExtSettings** = OFF. Possible values are CONSTANT and LINEAR. The
235
            default value is CONSTANT.
236

237
        Returns
238
        -------
239
        ConnectorOptions
240
            A ConnectorOptions object.
241

242
        Raises
243
        ------
244
        ValueError and TextError.
245
        """
246
        self.options = connectorOptions = ConnectorOptions(
×
247
            useBehRegSettings,
248
            regularize,
249
            defaultTolerance,
250
            regularization,
251
            defaultRateFactor,
252
            rateFactor,
253
            interpolation,
254
            useBehExtSettings,
255
            extrapolation,
256
        )
257
        return connectorOptions
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc