Skip to content

Commit e662b7e

Browse files
[feature] Add some missing members (backport #5903) (#5946)
Co-authored-by: Diogo <rossi.diogo@gmail.com>
1 parent 9243c5f commit e662b7e

File tree

7 files changed

+137
-2
lines changed

7 files changed

+137
-2
lines changed

src/abaqus/Odb/FieldOutput.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from __future__ import annotations
22

3-
from typing import Sequence, Union, overload
3+
from typing import List, Sequence, Union, overload
44

55
from typing_extensions import Literal
66

77
from abqpy.decorators import abaqus_class_doc, abaqus_method_doc
88

99
from ..UtilityAndView.abaqusConstants import OFF, Boolean, SymbolicConstant
1010
from ..UtilityAndView.abaqusConstants import abaqusConstants as C
11+
from .FieldBulkData import FieldBulkData
1112
from .FieldLocation import FieldLocation
1213
from .FieldLocationArray import FieldLocationArray
1314
from .FieldValueArray import FieldValueArray
@@ -79,6 +80,9 @@ class FieldOutput:
7980
#: parameter applies only to tensor field outputs. The default value is OFF.
8081
isEngineeringTensor: Boolean = OFF
8182

83+
#: A sequence of FieldBulkData objects.
84+
bulkDataBlocks: List[FieldBulkData]
85+
8286
@overload
8387
@abaqus_method_doc
8488
def __init__(

src/abaqus/Session/SessionBase.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,89 @@ class SessionBase:
295295
#: A repository of Drawing objects.
296296
drawings: dict[str, Drawing] = {}
297297

298+
@abaqus_method_doc
299+
def View(
300+
self,
301+
name: str,
302+
nearPlane: float,
303+
farPlane: float,
304+
width: float,
305+
height: float,
306+
projection: Literal[C.PERSPECTIVE, C.PARALLEL],
307+
cameraPosition: tuple[float, float, float],
308+
cameraUpVector: tuple[float, float, float],
309+
cameraTarget: tuple[float, float, float],
310+
viewOffsetX: float,
311+
viewOffsetY: float,
312+
autoFit: Boolean,
313+
movieMode: Boolean = OFF,
314+
):
315+
"""This method creates a View object. Note:All dimensions and coordinates are specified in the model
316+
coordinate system. Note:This method cannot be used to create a View for a Layer object.
317+
318+
.. note::
319+
This function can be accessed by::
320+
321+
session.View
322+
323+
Parameters
324+
----------
325+
name
326+
A String specifying the name of the view (also used as the repository key). Possible
327+
values are 'Front', 'Back', 'Top', 'Bottom', 'Left', 'Right', 'Iso', 'User-1', 'User-2',
328+
'User-3', and 'User-4'. The object member associated with this argument is a
329+
SymbolicConstant. Possible values of the **name** member are:FRONT, BACK, TOP, BOTTOM,
330+
LEFT, RIGHT, ISO, USER1, USER2, USER3, and USER4.
331+
nearPlane
332+
A Float specifying the distance from the camera to the near clipping plane. Possible
333+
values are **nearPlane** > 0.0.
334+
farPlane
335+
A Float specifying the distance from the camera to the far clipping plane when
336+
**farPlaneMode** =SPECIFY. Possible values are **farPlane** > **nearPlane**.
337+
width
338+
A Float specifying the width of the front clipping plane. Possible values are **width** >
339+
0.0.
340+
height
341+
A Float specifying the height of the front clipping plane. Possible values are **height**
342+
> 0.0.
343+
projection
344+
A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and
345+
PARALLEL.
346+
cameraPosition
347+
A sequence of three Floats specifying the camera position.
348+
cameraUpVector
349+
A sequence of three Floats specifying the camera's up vector (the screen's positive
350+
**Y** axis). The initial value is (0, 0, 0).
351+
cameraTarget
352+
A sequence of three Floats specifying the center of the scene.
353+
viewOffsetX
354+
A Float specifying the amount to pan the model in the screen **X** direction as a fraction
355+
of the viewport width. A positive value pans the model to the right. A negative value
356+
pans the model to the left. The *viewOffsetX* and **viewOffsetY** arguments allow you to pan
357+
the view without changing the position of the camera or the target (*cameraPosition* and
358+
**cameraTarget** arguments to the View method). The resulting change in the view allows
359+
you to pan a perspective display without producing an apparent rotation of the model.
360+
viewOffsetY
361+
A Float specifying the amount to pan the model in the screen **Y** direction as a fraction
362+
of the viewport height. A positive value pans the model upward. A negative value pans
363+
the model downward.
364+
autoFit
365+
A Boolean specifying whether the view is auto-fit when applied.
366+
movieMode
367+
A Boolean specifying whether or not the camera is in movie mode. The default value is
368+
OFF.
369+
370+
Returns
371+
-------
372+
View
373+
A View object.
374+
375+
Raises
376+
------
377+
RangeError
378+
"""
379+
...
380+
298381
@abaqus_method_doc
299382
def setValues(self, kernelMemoryLimit: float | None = None):
300383
"""This method modifies the Session object.

src/abaqus/UtilityAndView/SymbolicConstant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,7 @@ def __repr__(self) -> str:
12761276
HARMONIC = "HARMONIC"
12771277
HEADING = "HEADING"
12781278
HEALER_TYPE = "HEALER_TYPE"
1279+
HEALER_PHASE = "HEALER_PHASE"
12791280
HEATCAP = "HEATCAP"
12801281
HEAT_FLUX = "HEAT_FLUX"
12811282
HEAT_FLUX_AREA = "HEAT_FLUX_AREA"

src/abaqus/UtilityAndView/abaqusConstants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,7 @@
12301230
HARMONIC = abaqusConstants.HARMONIC
12311231
HEADING = abaqusConstants.HEADING
12321232
HEALER_TYPE = abaqusConstants.HEALER_TYPE
1233+
HEALER_PHASE = abaqusConstants.HEALER_PHASE
12331234
HEATCAP = abaqusConstants.HEATCAP
12341235
HEAT_FLUX = abaqusConstants.HEAT_FLUX
12351236
HEAT_FLUX_AREA = abaqusConstants.HEAT_FLUX_AREA

src/abaqus/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import auto_all
44

5-
from abqpy import run # noqa
5+
from abqpy import run, version_info # noqa
66

77
run(cae=True)
88
auto_all.start_all()
@@ -24,6 +24,7 @@
2424

2525
session = Session()
2626
mdb = Mdb()
27+
version = version_info[0]
2728

2829
backwardCompatibility = BackwardCompatibility()
2930

src/abqpy/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ def _get_version():
2727

2828
__version__ = _get_version()
2929
__semver__ = __version__.split("+")[0]
30+
version_info = __semver__.split(".")
3031

3132
__all__ = [
3233
"run",
3334
"abaqus",
3435
"AbqpyCLI",
36+
"version_info",
3537
"__version__",
3638
"__semver__",
3739
]

src/jobMessage.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import auto_all
2+
3+
auto_all.start_all()
4+
5+
from abaqus.UtilityAndView.abaqusConstants import ( # noqa
6+
ABORTED,
7+
ANY_JOB,
8+
ANY_MESSAGE_TYPE,
9+
BATCHPRE_PHASE,
10+
CALCULATOR_PHASE,
11+
CFD_PHASE,
12+
CHECK_SUBMITTED,
13+
COMPLETED,
14+
END_STEP,
15+
ERROR,
16+
EXPLICIT_PHASE,
17+
HEADING,
18+
HEALER_JOB,
19+
HEALER_PHASE,
20+
HEALER_TYPE,
21+
INTERRUPTED,
22+
ITERATION,
23+
JOB_ABORTED,
24+
JOB_COMPLETED,
25+
JOB_INTERRUPTED,
26+
JOB_SUBMITTED,
27+
MONITOR_DATA,
28+
ODB_FILE,
29+
ODB_FRAME,
30+
PACKAGER_PHASE,
31+
SIMULATION_ABORTED,
32+
SIMULATION_COMPLETED,
33+
SIMULATION_INTERRUPTED,
34+
SIMULATION_STARTED,
35+
STANDARD_PHASE,
36+
STARTED,
37+
STATUS,
38+
STEP,
39+
U1,
40+
WARNING,
41+
)
42+
43+
auto_all.end_all()

0 commit comments

Comments
 (0)