From e5ee7069e087444c7cf35773754768f9332dcb0a Mon Sep 17 00:00:00 2001 From: Diogo Date: Fri, 17 Jan 2025 03:35:28 -0300 Subject: [PATCH] [feature] Add some missing members (#5903) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hailin Wang Co-authored-by: Hailin Wang (cherry picked from commit 0175c7325de91308d47053d7b8ef984d1b921a06) --- src/abaqus/Odb/FieldOutput.py | 6 +- src/abaqus/Session/SessionBase.py | 83 +++++++++++++++++++ src/abaqus/UtilityAndView/SymbolicConstant.py | 1 + src/abaqus/UtilityAndView/abaqusConstants.py | 1 + src/abaqus/__init__.py | 3 +- src/abqpy/__init__.py | 2 + src/jobMessage.py | 43 ++++++++++ 7 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 src/jobMessage.py diff --git a/src/abaqus/Odb/FieldOutput.py b/src/abaqus/Odb/FieldOutput.py index 90949943d2..03f4712a78 100644 --- a/src/abaqus/Odb/FieldOutput.py +++ b/src/abaqus/Odb/FieldOutput.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Sequence, Union, overload +from typing import List, Sequence, Union, overload from typing_extensions import Literal @@ -8,6 +8,7 @@ from ..UtilityAndView.abaqusConstants import OFF, Boolean, SymbolicConstant from ..UtilityAndView.abaqusConstants import abaqusConstants as C +from .FieldBulkData import FieldBulkData from .FieldLocation import FieldLocation from .FieldLocationArray import FieldLocationArray from .FieldValueArray import FieldValueArray @@ -79,6 +80,9 @@ class FieldOutput: #: parameter applies only to tensor field outputs. The default value is OFF. isEngineeringTensor: Boolean = OFF + #: A sequence of FieldBulkData objects. + bulkDataBlocks: List[FieldBulkData] + @overload @abaqus_method_doc def __init__( diff --git a/src/abaqus/Session/SessionBase.py b/src/abaqus/Session/SessionBase.py index fc24cababe..bf101db258 100644 --- a/src/abaqus/Session/SessionBase.py +++ b/src/abaqus/Session/SessionBase.py @@ -295,6 +295,89 @@ class SessionBase: #: A repository of Drawing objects. drawings: dict[str, Drawing] = {} + @abaqus_method_doc + def View( + self, + name: str, + nearPlane: float, + farPlane: float, + width: float, + height: float, + projection: Literal[C.PERSPECTIVE, C.PARALLEL], + cameraPosition: tuple[float, float, float], + cameraUpVector: tuple[float, float, float], + cameraTarget: tuple[float, float, float], + viewOffsetX: float, + viewOffsetY: float, + autoFit: Boolean, + movieMode: Boolean = OFF, + ): + """This method creates a View object. Note:All dimensions and coordinates are specified in the model + coordinate system. Note:This method cannot be used to create a View for a Layer object. + + .. note:: + This function can be accessed by:: + + session.View + + Parameters + ---------- + name + A String specifying the name of the view (also used as the repository key). Possible + values are 'Front', 'Back', 'Top', 'Bottom', 'Left', 'Right', 'Iso', 'User-1', 'User-2', + 'User-3', and 'User-4'. The object member associated with this argument is a + SymbolicConstant. Possible values of the **name** member are:FRONT, BACK, TOP, BOTTOM, + LEFT, RIGHT, ISO, USER1, USER2, USER3, and USER4. + nearPlane + A Float specifying the distance from the camera to the near clipping plane. Possible + values are **nearPlane** > 0.0. + farPlane + A Float specifying the distance from the camera to the far clipping plane when + **farPlaneMode** =SPECIFY. Possible values are **farPlane** > **nearPlane**. + width + A Float specifying the width of the front clipping plane. Possible values are **width** > + 0.0. + height + A Float specifying the height of the front clipping plane. Possible values are **height** + > 0.0. + projection + A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and + PARALLEL. + cameraPosition + A sequence of three Floats specifying the camera position. + cameraUpVector + A sequence of three Floats specifying the camera's up vector (the screen's positive + **Y** axis). The initial value is (0, 0, 0). + cameraTarget + A sequence of three Floats specifying the center of the scene. + viewOffsetX + A Float specifying the amount to pan the model in the screen **X** direction as a fraction + of the viewport width. A positive value pans the model to the right. A negative value + pans the model to the left. The *viewOffsetX* and **viewOffsetY** arguments allow you to pan + the view without changing the position of the camera or the target (*cameraPosition* and + **cameraTarget** arguments to the View method). The resulting change in the view allows + you to pan a perspective display without producing an apparent rotation of the model. + viewOffsetY + A Float specifying the amount to pan the model in the screen **Y** direction as a fraction + of the viewport height. A positive value pans the model upward. A negative value pans + the model downward. + autoFit + A Boolean specifying whether the view is auto-fit when applied. + movieMode + A Boolean specifying whether or not the camera is in movie mode. The default value is + OFF. + + Returns + ------- + View + A View object. + + Raises + ------ + RangeError + """ + ... + @abaqus_method_doc def setValues(self, kernelMemoryLimit: float | None = None): """This method modifies the Session object. diff --git a/src/abaqus/UtilityAndView/SymbolicConstant.py b/src/abaqus/UtilityAndView/SymbolicConstant.py index 013c2ec7b1..10c5e2aa40 100644 --- a/src/abaqus/UtilityAndView/SymbolicConstant.py +++ b/src/abaqus/UtilityAndView/SymbolicConstant.py @@ -1276,6 +1276,7 @@ def __repr__(self) -> str: HARMONIC = "HARMONIC" HEADING = "HEADING" HEALER_TYPE = "HEALER_TYPE" + HEALER_PHASE = "HEALER_PHASE" HEATCAP = "HEATCAP" HEAT_FLUX = "HEAT_FLUX" HEAT_FLUX_AREA = "HEAT_FLUX_AREA" diff --git a/src/abaqus/UtilityAndView/abaqusConstants.py b/src/abaqus/UtilityAndView/abaqusConstants.py index 84d75a4b88..b1b8ab80bb 100644 --- a/src/abaqus/UtilityAndView/abaqusConstants.py +++ b/src/abaqus/UtilityAndView/abaqusConstants.py @@ -1230,6 +1230,7 @@ HARMONIC = abaqusConstants.HARMONIC HEADING = abaqusConstants.HEADING HEALER_TYPE = abaqusConstants.HEALER_TYPE +HEALER_PHASE = abaqusConstants.HEALER_PHASE HEATCAP = abaqusConstants.HEATCAP HEAT_FLUX = abaqusConstants.HEAT_FLUX HEAT_FLUX_AREA = abaqusConstants.HEAT_FLUX_AREA diff --git a/src/abaqus/__init__.py b/src/abaqus/__init__.py index 187e1e5c23..52141aac80 100644 --- a/src/abaqus/__init__.py +++ b/src/abaqus/__init__.py @@ -2,7 +2,7 @@ import auto_all -from abqpy import run # noqa +from abqpy import run, version_info # noqa run(cae=True) auto_all.start_all() @@ -24,6 +24,7 @@ session = Session() mdb = Mdb() +version = version_info[0] backwardCompatibility = BackwardCompatibility() diff --git a/src/abqpy/__init__.py b/src/abqpy/__init__.py index 3ab119799a..3555b06b96 100644 --- a/src/abqpy/__init__.py +++ b/src/abqpy/__init__.py @@ -27,11 +27,13 @@ def _get_version(): __version__ = _get_version() __semver__ = __version__.split("+")[0] +version_info = __semver__.split(".") __all__ = [ "run", "abaqus", "AbqpyCLI", + "version_info", "__version__", "__semver__", ] diff --git a/src/jobMessage.py b/src/jobMessage.py new file mode 100644 index 0000000000..11e5862022 --- /dev/null +++ b/src/jobMessage.py @@ -0,0 +1,43 @@ +import auto_all + +auto_all.start_all() + +from abaqus.UtilityAndView.abaqusConstants import ( # noqa + ABORTED, + ANY_JOB, + ANY_MESSAGE_TYPE, + BATCHPRE_PHASE, + CALCULATOR_PHASE, + CFD_PHASE, + CHECK_SUBMITTED, + COMPLETED, + END_STEP, + ERROR, + EXPLICIT_PHASE, + HEADING, + HEALER_JOB, + HEALER_PHASE, + HEALER_TYPE, + INTERRUPTED, + ITERATION, + JOB_ABORTED, + JOB_COMPLETED, + JOB_INTERRUPTED, + JOB_SUBMITTED, + MONITOR_DATA, + ODB_FILE, + ODB_FRAME, + PACKAGER_PHASE, + SIMULATION_ABORTED, + SIMULATION_COMPLETED, + SIMULATION_INTERRUPTED, + SIMULATION_STARTED, + STANDARD_PHASE, + STARTED, + STATUS, + STEP, + U1, + WARNING, +) + +auto_all.end_all()